Skip to content

Commit

Permalink
[mt][batch][document translator] Update API based on SDK team feedback (
Browse files Browse the repository at this point in the history
Azure#13618)

* 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
  • Loading branch information
alexhcheng authored and mkarmark committed Jul 20, 2021
1 parent 34245c4 commit 7048670
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 54 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
},
"body": {
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt",
"sourcePath": "https://myblob.blob.core.windows.net/sourceContainer/fr/mydoc.txt",
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
"status": "Running",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@
"endpoint": "{endpoint}",
"Ocp-Apim-Subscription-Key": "{API key}",
"id": "727BF148-F327-47A0-9481-ABAE6362F11E",
"$top": 5,
"$skip": 10
"$top": 2,
"$skip": 0,
"$maxpagesize": 1,
"$orderBy": "CreatedDateTimeUtc asc",
"createdDateTimeUtcStart": "2021-03-23T07:03:38.0136316Z",
"createdDateTimeUtcEnd": "2021-03-25T07:03:38.0136316Z",
"statuses": [
"Succeeded"
],
"ids": [
"273622bd-835c-4946-9798-fd8f19f6bbf2",
"511b6a66-a6f8-4640-83e1-48c325e9fa29"
]
},
"responses": {
"401": {
Expand Down Expand Up @@ -89,16 +100,17 @@
"value": [
{
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt",
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
"sourcePath": "https://myblob.blob.core.windows.net/sourceContainer/fr/mydoc.txt",
"createdDateTimeUtc": "2021-03-23T07:03:39.013631Z",
"lastActionDateTimeUtc": "2021-03-23T07:03:41.012452Z",
"status": "Running",
"to": "fr",
"progress": 0.1,
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2",
"characterCharged": 0
}
],
"@nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?$top=5&$skip=15"
"@nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?$top=1&$skip=1&$maxpagesize=1&$orderBy=CreatedDateTimeUtc%20asc&createdDateTimeUtcStart=2021-03-23T00:03:38.0136316Z&createdDateTimeUtcEnd=2021-03-25T00:03:38.0136316&statuses=Succeeded&ids=273622BD-835C-4946-9798-FD8F19F6BBF2,511B6A66-A6F8-4640-83E1-48C325E9FA29"
}
},
"400": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"200": {
"headers": {
"retry-after": "30",
"ETag": "686897696a7c876b7e"
},
"body": {
Expand All @@ -59,8 +60,7 @@
],
"contentTypes": [
"text/plain"
],
"versions": []
]
},
{
"format": "PortableDocumentFormat",
Expand All @@ -69,8 +69,16 @@
],
"contentTypes": [
"application/pdf"
]
},
{
"format": "OpenXmlWord",
"fileExtensions": [
".docx"
],
"versions": []
"contentTypes": [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
},
{
"format": "OpenXmlPresentation",
Expand All @@ -79,8 +87,7 @@
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
],
"versions": []
]
},
{
"format": "OpenXmlSpreadsheet",
Expand All @@ -89,38 +96,17 @@
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
"versions": []
},
{
"format": "OutlookMailMessage",
"fileExtensions": [
".msg"
],
"contentTypes": [
"application/vnd.ms-outlook"
],
"versions": []
]
},
{
"format": "HtmlFile",
"fileExtensions": [
".html"
".html",
".htm"
],
"contentTypes": [
"text/html"
],
"versions": []
},
{
"format": "OpenXmlWord",
"fileExtensions": [
".docx"
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
],
"versions": []
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"200": {
"headers": {
"retry-after": "30",
"ETag": "686897696a7c876b7e"
},
"body": {
Expand All @@ -60,6 +61,7 @@
"contentTypes": [
"application/xliff+xml"
],
"defaultVersion": "1.2",
"versions": [
"1.0",
"1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA",
"resourceGroupName": "TestResourceGroup",
"endpoint": "{endpoint}",
"Ocp-Apim-Subscription-Key": "{API key}"
"Ocp-Apim-Subscription-Key": "{API key}",
"$top": 1,
"$skip": 0,
"$maxpagesize": 10,
"$orderBy": "CreatedDateTime asc",
"createdDateTimeUtcStart": "2021-03-23T07:03:38.0136316Z",
"createdDateTimeUtcEnd": "2021-03-25T07:03:38.0136316Z",
"statuses": [
"Succeeded"
],
"ids": [
"273622bd-835c-4946-9798-fd8f19f6bbf2"
]
},
"responses": {
"401": {
Expand Down Expand Up @@ -71,9 +83,9 @@
"body": {
"value": [
{
"id": "727bf148-f327-47a0-9481-abae6362f11e",
"createdDateTimeUtc": "2020-03-26T00:00:00Z",
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z",
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2",
"createdDateTimeUtc": "2021-03-23T07:03:30.013631Z",
"lastActionDateTimeUtc": "2021-03-26T01:00:00Z",
"status": "Succeeded",
"summary": {
"total": 10,
Expand All @@ -82,7 +94,7 @@
"inProgress": 0,
"notYetStarted": 0,
"cancelled": 0,
"totalCharacterCharged": 0
"totalCharacterCharged": 1000
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
},
"200": {
"headers": {
"retry-after": "30",
"ETag": "686897696a7c876b7e"
},
"body": {
Expand Down

0 comments on commit 7048670

Please sign in to comment.