Skip to content

Commit 1f1d5b0

Browse files
FadyEssam2Fady Essam
andauthored
Add TranslatorBatch API v1.1 (#16705)
* add API v1.1 * Match v1.0 swagger * Remove unneeded changes * Address PR failures * Update readme * Update @failedDocumentStatusLink name * Fix swagger examples * Fixing swagger examples * Fix swagger * Address board review comments * move options to target level * remove the @ from failedDocumentStatusLink * switch the pdf output options to enum * Remove failedDocmentsStatusLink field from response * Update TranslatorText Readme file * Add collectionFormat Co-authored-by: Fady Essam <faanis@micrososft.com>
1 parent 02fce64 commit 1f1d5b0

File tree

11 files changed

+2444
-8
lines changed

11 files changed

+2444
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Configuration for generating Translator Text SDK.
66

77
The current release is `release_3_0`.
88

9-
The current document batch preview release is `release_1_0_preview.1'`.
9+
The current document batch release is `release_1_1'`.
1010

1111
``` yaml
1212

@@ -17,13 +17,7 @@ openapi-type: data-plane
1717
1818
``` yaml
1919

20-
tag: release_1_0_preview.1
21-
add-credentials: true
22-
openapi-type: data-plane
23-
```
24-
``` yaml
25-
26-
tag: release_1_0
20+
tag: release_1_1
2721
add-credentials: true
2822
openapi-type: data-plane
2923
```
@@ -41,6 +35,12 @@ This setting is for batch document translator and only applied when `--tag=relea
4135
input-file: stable/v1.0/TranslatorBatch.json
4236
```
4337

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

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

Lines changed: 1556 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"parameters": {
3+
"api-version": "v1.1",
4+
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA",
5+
"resourceGroupName": "TestResourceGroup",
6+
"endpoint": "{endpoint}",
7+
"Ocp-Apim-Subscription-Key": "{API key}",
8+
"body": {
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+
"format": "XLIFF",
29+
"storageSource": "AzureBlob"
30+
}
31+
],
32+
"options": {
33+
"pdfOutputAdditionalFormat": "None"
34+
},
35+
"storageSource": "AzureBlob"
36+
},
37+
{
38+
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer2",
39+
"category": "general",
40+
"language": "es",
41+
"options": {
42+
"pdfOutputAdditionalFormat": "None"
43+
},
44+
"storageSource": "AzureBlob"
45+
}
46+
],
47+
"storageType": "Folder"
48+
}
49+
]
50+
}
51+
},
52+
"responses": {
53+
"202": {
54+
"headers": {
55+
"Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55"
56+
}
57+
}
58+
}
59+
}
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.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": "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.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": "273622BD-835C-4946-9798-FD8F19F6BBF2"
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)