Skip to content

Commit f1a180a

Browse files
authored
[mt][translator][document][batch] Update to release version v1.0 (#13707)
* update API based on SDK team feedback * update based on feedback * manually add ref * try to fix swagger * update swagger based on feedback * update swagger based on feedback. add retry-after * fix status type and datetime example * update examples, added required parameters * make nextlink an urlencoded string * add etag in swagger for these responses * re-add x-ms-enums and schema for status * add new stable/v1.0 for batch translator * Update version of swagger file and examples * update example with correct api version * fix version in README
1 parent 1f4fb02 commit f1a180a

File tree

11 files changed

+2510
-0
lines changed

11 files changed

+2510
-0
lines changed

specification/cognitiveservices/data-plane/TranslatorText/readme.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ tag: release_1_0_preview.1
2121
add-credentials: true
2222
openapi-type: data-plane
2323
```
24+
``` yaml
2425

26+
tag: release_1_0
27+
add-credentials: true
28+
openapi-type: data-plane
29+
```
2530
# Releases
2631
2732
### Preview 1.0
@@ -30,6 +35,12 @@ This setting is for batch document translator and only applied when `--tag=relea
3035
input-file: preview/v1.0-preview.1/TranslatorBatch.json
3136
```
3237

38+
### 1.0 Batch API
39+
This setting is for batch document translator and only applied when `--tag=release_1_0` is specified on the command line.
40+
``` yaml $(tag) == 'release_1_0'
41+
input-file: stable/v1.0/TranslatorBatch.json
42+
```
43+
3344
### Release 3.0
3445
These settings apply only when `--tag=release_3_0` is specified on the command line.
3546

@@ -106,6 +117,14 @@ These settings apply only when `--tag=release_1_0_preview.1 --nodejs` is specifi
106117
package-version: 1.0.1
107118
```
108119

120+
### Tag: release_1_0 and nodejs
121+
122+
These settings apply only when `--tag=release_1_0 --nodejs` is specified on the command line.
123+
124+
``` yaml $(tag) == 'release_1_0' && $(nodejs)
125+
package-version: 1.0
126+
```
127+
109128
### Tag: release_3_0 and go
110129

111130
These settings apply only when `--tag=release_3_0 --nodejs` is specified on the command line.

specification/cognitiveservices/data-plane/TranslatorText/stable/v1.0/TranslatorBatch.json

Lines changed: 1557 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0",
4+
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA",
5+
"resourceGroupName": "TestResourceGroup",
6+
"endpoint": "{endpoint}",
7+
"Ocp-Apim-Subscription-Key": "{API key}",
8+
"batchRequest": {
9+
"inputs": [
10+
{
11+
"source": {
12+
"sourceUrl": "https://myblob.blob.core.windows.net/sourceContainer",
13+
"filter": {
14+
"prefix": "pre",
15+
"suffix": ".txt"
16+
},
17+
"language": "en",
18+
"storageSource": "AzureBlob"
19+
},
20+
"targets": [
21+
{
22+
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer1",
23+
"category": "general",
24+
"language": "fr",
25+
"glossaries": [
26+
{
27+
"glossaryUrl": "https://myblob.blob.core.windows.net/myglossary/en_fr_glossary.xlf",
28+
"storageSource": "AzureBlob"
29+
}
30+
],
31+
"storageSource": "AzureBlob"
32+
},
33+
{
34+
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer2",
35+
"category": "general",
36+
"language": "es",
37+
"storageSource": "AzureBlob"
38+
}
39+
],
40+
"storageType": "Folder"
41+
}
42+
]
43+
}
44+
},
45+
"responses": {
46+
"401": {
47+
"headers": {},
48+
"body": {
49+
"error": {
50+
"code": "Unauthorized",
51+
"message": "User is not authorized",
52+
"innerError": {
53+
"code": "Unauthorized",
54+
"message": "Operation is not authorized"
55+
}
56+
}
57+
}
58+
},
59+
"429": {
60+
"headers": {},
61+
"body": {
62+
"error": {
63+
"code": "RequestRateTooHigh",
64+
"message": "User's request rate is too high",
65+
"innerError": {
66+
"code": "RateTooHigh",
67+
"message": "Request rate is too high"
68+
}
69+
}
70+
}
71+
},
72+
"500": {
73+
"headers": {},
74+
"body": {
75+
"error": {
76+
"code": "InternalServerError",
77+
"message": "Internal Server Error",
78+
"innerError": {
79+
"code": "InternalServerError",
80+
"message": "Unexpected internal server error has occurred"
81+
}
82+
}
83+
}
84+
},
85+
"503": {
86+
"headers": {},
87+
"body": {
88+
"error": {
89+
"code": "ServiceUnavailable",
90+
"message": "Service is temporary unavailable",
91+
"innerError": {
92+
"code": "ServiceTemporaryUnavailable",
93+
"message": "Service is currently unavailable. Please try again later"
94+
}
95+
}
96+
}
97+
},
98+
"202": {
99+
"headers": {
100+
"Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55"
101+
}
102+
},
103+
"400": {
104+
"headers": {},
105+
"body": {
106+
"error": {
107+
"code": "InvalidRequest",
108+
"message": "Some argument is incorrect",
109+
"innerError": {
110+
"code": "SASTokenInvalid",
111+
"message": "SAS token for storage is invalid"
112+
}
113+
}
114+
}
115+
}
116+
}
117+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0",
4+
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA",
5+
"resourceGroupName": "TestResourceGroup",
6+
"endpoint": "{endpoint}",
7+
"Ocp-Apim-Subscription-Key": "{API key}",
8+
"id": "727BF148-F327-47A0-9481-ABAE6362F11E"
9+
},
10+
"responses": {
11+
"401": {
12+
"headers": {},
13+
"body": {
14+
"error": {
15+
"code": "Unauthorized",
16+
"message": "User is not authorized",
17+
"target": "Operation",
18+
"innerError": {
19+
"code": "Unauthorized",
20+
"message": "Operation is not authorized"
21+
}
22+
}
23+
}
24+
},
25+
"429": {
26+
"headers": {},
27+
"body": {
28+
"error": {
29+
"code": "RequestRateTooHigh",
30+
"message": "User's request rate is too high",
31+
"target": "Operation",
32+
"innerError": {
33+
"code": "RateTooHigh",
34+
"message": "Request rate is too high"
35+
}
36+
}
37+
}
38+
},
39+
"500": {
40+
"headers": {},
41+
"body": {
42+
"error": {
43+
"code": "InternalServerError",
44+
"message": "Internal Server Error",
45+
"target": "Operation",
46+
"innerError": {
47+
"code": "InternalServerError",
48+
"message": "Unexpected internal server error has occurred"
49+
}
50+
}
51+
}
52+
},
53+
"503": {
54+
"headers": {},
55+
"body": {
56+
"error": {
57+
"code": "ServiceUnavailable",
58+
"message": "Service is temporary unavailable",
59+
"target": "Operation",
60+
"innerError": {
61+
"code": "ServiceTemporaryUnavailable",
62+
"message": "Service is currently unavailable. Please try again later"
63+
}
64+
}
65+
}
66+
},
67+
"404": {
68+
"headers": {},
69+
"body": {
70+
"error": {
71+
"code": "ResourceNotFound",
72+
"message": "id not found",
73+
"target": "Operation",
74+
"innerError": {
75+
"code": "ResourceNotFound",
76+
"message": "Resource requested is not found"
77+
}
78+
}
79+
}
80+
},
81+
"200": {
82+
"headers": {},
83+
"body": {
84+
"id": "727bf148-f327-47a0-9481-abae6362f11e",
85+
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
86+
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
87+
"status": "Succeeded",
88+
"summary": {
89+
"total": 10,
90+
"failed": 1,
91+
"success": 9,
92+
"inProgress": 0,
93+
"notYetStarted": 0,
94+
"cancelled": 0,
95+
"totalCharacterCharged": 0
96+
}
97+
}
98+
}
99+
}
100+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0",
4+
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA",
5+
"resourceGroupName": "TestResourceGroup",
6+
"endpoint": "{endpoint}",
7+
"Ocp-Apim-Subscription-Key": "{API key}",
8+
"id": "727BF148-F327-47A0-9481-ABAE6362F11E",
9+
"documentId": 199800
10+
},
11+
"responses": {
12+
"401": {
13+
"headers": {},
14+
"body": {
15+
"error": {
16+
"code": "Unauthorized",
17+
"message": "User is not authorized",
18+
"target": "Document",
19+
"innerError": {
20+
"code": "Unauthorized",
21+
"message": "Operation is not authorized"
22+
}
23+
}
24+
}
25+
},
26+
"429": {
27+
"headers": {},
28+
"body": {
29+
"error": {
30+
"code": "RequestRateTooHigh",
31+
"message": "User's request rate is too high",
32+
"target": "Document",
33+
"innerError": {
34+
"code": "RateTooHigh",
35+
"message": "Request rate is too high"
36+
}
37+
}
38+
}
39+
},
40+
"500": {
41+
"headers": {},
42+
"body": {
43+
"error": {
44+
"code": "InternalServerError",
45+
"message": "Internal Server Error",
46+
"target": "Document",
47+
"innerError": {
48+
"code": "InternalServerError",
49+
"message": "Unexpected internal server error has occurred"
50+
}
51+
}
52+
}
53+
},
54+
"503": {
55+
"headers": {},
56+
"body": {
57+
"error": {
58+
"code": "ServiceUnavailable",
59+
"message": "Service is temporary unavailable",
60+
"target": "Document",
61+
"innerError": {
62+
"code": "ServiceTemporaryUnavailable",
63+
"message": "Service is currently unavailable. Please try again later"
64+
}
65+
}
66+
}
67+
},
68+
"404": {
69+
"headers": {},
70+
"body": {
71+
"error": {
72+
"code": "ResourceNotFound",
73+
"message": "id not found",
74+
"target": "Document",
75+
"innerError": {
76+
"code": "ResourceNotFound",
77+
"message": "Resource requested is not found"
78+
}
79+
}
80+
}
81+
},
82+
"200": {
83+
"headers": {
84+
"retry-after": "30",
85+
"ETag": "686897696a7c876b7e"
86+
},
87+
"body": {
88+
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt",
89+
"sourcePath": "https://myblob.blob.core.windows.net/sourceContainer/fr/mydoc.txt",
90+
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
91+
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
92+
"status": "Running",
93+
"to": "fr",
94+
"progress": 0.1,
95+
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2",
96+
"characterCharged": 0
97+
}
98+
}
99+
}
100+
}

0 commit comments

Comments
 (0)