Skip to content

Commit 71aa473

Browse files
authored
new Batch Document Translation API Preview 1.0 (#9218)
* Merged from master again * updated swagger based on API review feedback * updated post * fix spelling * added x-ms-pageable, x-ms-error-response, x-ms-long-running * fix enum * remove long running operation * bug in sdk go generation * Revert "bug in sdk go generation" This reverts commit 025b875. * remove x-ms-pageable * addressed changes * fix casing for x-ms-parameterized-host * fix endpoint in examples * move everything in the same SDK readme file * change path to v1.0_preview.1 * fix path * dummy change to restart merge for a 502 server error on sdk generation * fix batch json
1 parent 5703951 commit 71aa473

File tree

12 files changed

+2228
-2
lines changed

12 files changed

+2228
-2
lines changed

custom-words.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ BCDR
191191
BCWG
192192
beider
193193
Bfor
194+
bfqt
194195
bigint
195196
Bigram
196197
bigrams
@@ -1026,6 +1027,7 @@ octokit
10261027
Odata
10271028
odatatype
10281029
ODBC
1030+
officedocument
10291031
OLTP
10301032
onboarded
10311033
Onboarding
@@ -1042,6 +1044,7 @@ openapi
10421044
opencode
10431045
opencontainers
10441046
openid
1047+
openxmlformats
10451048
operationalinsights
10461049
Operationalization
10471050
operationresults
@@ -1320,6 +1323,7 @@ runcounts
13201323
runid
13211324
runsource
13221325
runtimes
1326+
rwdlacup
13231327
rwxrw
13241328
Saas
13251329
salesforcetables
@@ -1459,6 +1463,7 @@ storageaccount
14591463
storageaccounts
14601464
storagedatalake
14611465
storageimportexport
1466+
storagesources
14621467
storagesync
14631468
storagetarget
14641469
storageuri
@@ -1744,6 +1749,7 @@ Widevine
17441749
windowsazuremediaservices
17451750
windowsesu
17461751
wlmengg
1752+
wordprocessingml
17471753
workbooktemplates
17481754
Workernode
17491755
workloadmonitor

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

Lines changed: 1282 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0-preview.1",
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+
}
29+
],
30+
"storageSource": "AzureBlob"
31+
},
32+
{
33+
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer2",
34+
"category": "general",
35+
"language": "es",
36+
"storageSource": "AzureBlob"
37+
}
38+
]
39+
}
40+
]
41+
}
42+
},
43+
"responses": {
44+
"401": {
45+
"headers": {},
46+
"body": {
47+
"error": {
48+
"code": "Unauthorized",
49+
"message": "User is not authorized",
50+
"innerError": {
51+
"code": 401000,
52+
"error": "Unauthorized",
53+
"message": "Operation is not authorized"
54+
}
55+
}
56+
}
57+
},
58+
"429": {
59+
"headers": {},
60+
"body": {
61+
"error": {
62+
"code": "RequestRateTooHigh",
63+
"message": "User's request rate is too high",
64+
"innerError": {
65+
"code": 429000,
66+
"error": "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": 500000,
80+
"error": "Internal Server Error",
81+
"message": "Unexpected internal server error has occurred"
82+
}
83+
}
84+
}
85+
},
86+
"503": {
87+
"headers": {},
88+
"body": {
89+
"error": {
90+
"code": "ServiceUnavailable",
91+
"message": "Service is temporary unavailable",
92+
"innerError": {
93+
"code": 503000,
94+
"error": "ServiceTemporaryUnavailable",
95+
"message": "Service is currently unavailable. Please try again later"
96+
}
97+
}
98+
}
99+
},
100+
"202": {
101+
"headers": {
102+
"Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55"
103+
}
104+
},
105+
"400": {
106+
"headers": {},
107+
"body": {
108+
"error": {
109+
"code": "InvalidRequest",
110+
"message": "Some argument is incorrect",
111+
"innerError": {
112+
"code": 400120,
113+
"error": "SASTokenInvalid",
114+
"message": "SAS token for storage is invalid"
115+
}
116+
}
117+
}
118+
}
119+
}
120+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0-preview.1",
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": 401000,
20+
"error": "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": "Operation",
33+
"innerError": {
34+
"code": 429000,
35+
"error": "RateTooHigh",
36+
"message": "Request rate is too high"
37+
}
38+
}
39+
}
40+
},
41+
"500": {
42+
"headers": {},
43+
"body": {
44+
"error": {
45+
"code": "InternalServerError",
46+
"message": "Internal Server Error",
47+
"target": "Operation",
48+
"innerError": {
49+
"code": 500000,
50+
"error": "Internal Server Error",
51+
"message": "Unexpected internal server error has occurred"
52+
}
53+
}
54+
}
55+
},
56+
"503": {
57+
"headers": {},
58+
"body": {
59+
"error": {
60+
"code": "ServiceUnavailable",
61+
"message": "Service is temporary unavailable",
62+
"target": "Operation",
63+
"innerError": {
64+
"code": 503000,
65+
"error": "ServiceTemporaryUnavailable",
66+
"message": "Service is currently unavailable. Please try again later"
67+
}
68+
}
69+
}
70+
},
71+
"404": {
72+
"headers": {},
73+
"body": {
74+
"error": {
75+
"code": "ResourceNotFound",
76+
"message": "id not found",
77+
"target": "Operation",
78+
"innerError": {
79+
"code": 404000,
80+
"error": "ResourceNotFound",
81+
"message": "Resource requested is not found"
82+
}
83+
}
84+
}
85+
},
86+
"200": {
87+
"headers": {},
88+
"body": {
89+
"id": "727bf148-f327-47a0-9481-abae6362f11e",
90+
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
91+
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
92+
"status": "Succeeded",
93+
"summary": {
94+
"total": 10,
95+
"failed": 1,
96+
"success": 9,
97+
"inProgress": 0,
98+
"notYetStarted": 0,
99+
"cancelled": 0
100+
}
101+
}
102+
}
103+
}
104+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.0-preview.1",
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": 401000,
21+
"error": "Unauthorized",
22+
"message": "Operation is not authorized"
23+
}
24+
}
25+
}
26+
},
27+
"429": {
28+
"headers": {},
29+
"body": {
30+
"error": {
31+
"code": "RequestRateTooHigh",
32+
"message": "User's request rate is too high",
33+
"target": "Document",
34+
"innerError": {
35+
"code": 429000,
36+
"error": "RateTooHigh",
37+
"message": "Request rate is too high"
38+
}
39+
}
40+
}
41+
},
42+
"500": {
43+
"headers": {},
44+
"body": {
45+
"error": {
46+
"code": "InternalServerError",
47+
"message": "Internal Server Error",
48+
"target": "Document",
49+
"innerError": {
50+
"code": 500000,
51+
"error": "Internal Server Error",
52+
"message": "Unexpected internal server error has occurred"
53+
}
54+
}
55+
}
56+
},
57+
"503": {
58+
"headers": {},
59+
"body": {
60+
"error": {
61+
"code": "ServiceUnavailable",
62+
"message": "Service is temporary unavailable",
63+
"target": "Document",
64+
"innerError": {
65+
"code": 503000,
66+
"error": "ServiceTemporaryUnavailable",
67+
"message": "Service is currently unavailable. Please try again later"
68+
}
69+
}
70+
}
71+
},
72+
"404": {
73+
"headers": {},
74+
"body": {
75+
"error": {
76+
"code": "ResourceNotFound",
77+
"message": "id not found",
78+
"target": "Document",
79+
"innerError": {
80+
"code": 404000,
81+
"error": "ResourceNotFound",
82+
"message": "Resource requested is not found"
83+
}
84+
}
85+
}
86+
},
87+
"200": {
88+
"headers": {
89+
"retry-after": "30",
90+
"ETag": "686897696a7c876b7e"
91+
},
92+
"body": {
93+
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt",
94+
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
95+
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
96+
"status": "Running",
97+
"detectedLanguage": "en",
98+
"to": "fr",
99+
"progress": 0.1,
100+
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2"
101+
}
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)