From fb639d1b4970f9ebb7fa912036cee6011177c454 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 24 Apr 2020 13:17:58 -0700 Subject: [PATCH 01/18] Merged from master again --- custom-words.txt | 6 + .../Batch/preview/v1.0/TranslatorBatch.json | 1469 +++++++++++++++++ .../Batch/preview/v1.0/examples/batch.json | 118 ++ .../Batch/preview/v1.0/examples/cancel.json | 102 ++ .../Batch/preview/v1.0/examples/document.json | 103 ++ .../preview/v1.0/examples/documents.json | 124 ++ .../Batch/preview/v1.0/examples/format.json | 80 + .../Batch/preview/v1.0/examples/glossary.json | 81 + .../preview/v1.0/examples/operation.json | 105 ++ .../preview/v1.0/examples/operations.json | 108 ++ .../Batch/preview/v1.0/examples/post.json | 112 ++ .../Batch/preview/v1.0/examples/storage.json | 61 + .../TranslatorText/Batch/readme.go.md | 20 + .../data-plane/TranslatorText/Batch/readme.md | 118 ++ .../TranslatorText/Batch/readme.nodejs.md | 14 + .../TranslatorText/Batch/readme.ruby.md | 27 + .../TranslatorText/Batch/readme.typescript.md | 12 + 17 files changed, 2660 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md diff --git a/custom-words.txt b/custom-words.txt index 038e31c530b9..c5413b1e677f 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -187,6 +187,7 @@ BCDR BCWG beider Bfor +bfqt bigint Bigram bigrams @@ -1005,6 +1006,7 @@ octokit Odata odatatype ODBC +officedocument OLTP onboarded Onboarding @@ -1021,6 +1023,7 @@ openapi opencode opencontainers openid +openxmlformats operationalinsights Operationalization operationresults @@ -1290,6 +1293,7 @@ runcounts runid runsource runtimes +rwdlacup rwxrw Saas salesforcetables @@ -1429,6 +1433,7 @@ storageaccount storageaccounts storagedatalake storageimportexport +storagesources storagesync storagetarget storageuri @@ -1711,6 +1716,7 @@ Widevine windowsazuremediaservices windowsesu wlmengg +wordprocessingml workbooktemplates Workernode workloadmonitor diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json new file mode 100644 index 000000000000..f4a6ca943306 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -0,0 +1,1469 @@ +{ + "swagger": "2.0", + "info": { + "title": "Batch Text Translation API", + "version": "v1.0-preview.1" + }, + "host": "westus2.cognitiveservices.azure.com", + "basePath": "/translator/text/batch", + "schemes": [ + "https" + ], + "paths": { + "/v1.0-preview.1/batches": { + "post": { + "tags": [ + "Translation" + ], + "summary": "Submit a batch document translation request to the translation service", + "description": "Submit a batch request to the document translation service.\r\n \r\nEach request can consists of multiple inputs.\r\nEach input will contains both a source and destination container for source and target language pair.\r\n \r\nThe prefix and suffix filter (if supplied) will be used to filter the folders.\r\nThe prefix will be applied to the subpath after the container name\r\n \r\nGlossaries / Translation memory can be supplied and will be applied when the document is being translated.\r\nIf the glossary is invalid or unreachable during translation time. An error will be indicated in the document status.\r\n \r\nIf the file with the same name already exists in the destination, it will be overwritten.\r\nTargetUrl for each target language needs to be unique.", + "operationId": "Batch Documents Submit", + "consumes": [ + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "request details", + "schema": { + "$ref": "#/definitions/JobSubmissionBatchRequest" + } + } + ], + "responses": { + "202": { + "description": "Successful request and the batch request is created by the service. The header Operation-Location will indicate a status url with the operation id.", + "headers": { + "Operation-Location": { + "description": "Location of the operation", + "type": "string", + "format": "" + } + } + }, + "400": { + "description": "Invalid request. Check input parameters", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Batch Submit": { + "$ref": "./examples/batch.json" + } + } + }, + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the list of operations submitted and their summary status", + "description": "Returns the list of status of the translation batch operation.\r\nThe list will consist only of the batch request submitted by the user (based on their subscription)\r\n \r\nThe operation status are sorted by the operation Id\r\n \r\nIf the number of operations exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", + "operationId": "Get status of operation list", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "$top", + "description": "Take the $top entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + { + "in": "query", + "name": "$skip", + "description": "Skip the $skip entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 0, + "maximum": 2147483647, + "minimum": 0 + } + ], + "responses": { + "200": { + "description": "Successful request and returns the status of the all the operations", + "schema": { + "$ref": "#/definitions/OperationStatusResponse" + }, + "headers": { + "Retry-After": { + "description": "Indicates how long to wait before making a new request.", + "type": "integer", + "format": "int32" + }, + "ETag": { + "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", + "type": "string", + "format": "" + } + } + }, + "400": { + "description": "Invalid request. Check input parameters", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get status for operation list": { + "$ref": "./examples/operations.json" + } + } + } + }, + "/v1.0-preview.1/batches/upload": { + "post": { + "tags": [ + "Translation" + ], + "summary": "Submit a binary document in the POST body to the translation service.", + "description": "Use content-type header to denote the file format type\r\n \r\nExample:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/pdf for .pdf files", + "operationId": "Single Document Upload", + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "in": "query", + "name": "SourceLanguage", + "description": "The language code of the original document\r\nIf none is specified, we will perform auto detect on the document", + "type": "string" + }, + { + "in": "query", + "name": "Category", + "description": "Category for the translation system (Optional)", + "type": "string" + }, + { + "in": "query", + "name": "TargetLanguage", + "description": "The language code for the documents to translate to", + "required": true, + "type": "string" + } + ], + "responses": { + "201": { + "description": "Successful request and it is created by the service. The operation details are returned", + "schema": { + "$ref": "#/definitions/DocumentSubmissionResponse" + }, + "headers": { + "Location": { + "description": "Location of the document status", + "type": "string", + "format": "" + }, + "Operation-Location": { + "description": "Location of the operation", + "type": "string", + "format": "" + } + } + }, + "400": { + "description": "Invalid request. Check input parameters", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Document Submit": { + "$ref": "./examples/post.json" + } + } + } + }, + "/v1.0-preview.1/documents/{documentId}": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the status of the specific document", + "description": "Returns the status of the translation of the document.", + "operationId": "Get Document Status", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "documentId", + "description": "Format - int64. The document id", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "200": { + "description": "Successful request and it is accepted by the service. The operation details are returned", + "schema": { + "$ref": "#/definitions/DocumentStatusDetail" + }, + "headers": { + "Retry-After": { + "description": "Indicates how long to wait before making a new request.", + "type": "integer", + "format": "int32" + }, + "ETag": { + "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", + "type": "string", + "format": "" + } + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "404": { + "description": "Resource is not found", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Document Status": { + "$ref": "./examples/document.json" + } + } + } + }, + "/v1.0-preview.1/documents": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the status of the documents of a translation batch operation", + "description": "Returns the status of the list of documents translation operation status in the subscription\r\n \r\nThe documents are sorted by the document Id\r\n \r\nIf the number of documents exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", + "operationId": "Get Detailed Document Status", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "$top", + "description": "Take the $top entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + { + "in": "query", + "name": "$skip", + "description": "Skip the $skip entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 0, + "maximum": 2147483647, + "minimum": 0 + } + ], + "responses": { + "200": { + "description": "Successful request and returns the status of the documents", + "schema": { + "$ref": "#/definitions/DocumentStatusResponse" + }, + "headers": { + "Retry-After": { + "description": "Indicates how long to wait before making a new request.", + "type": "integer", + "format": "int32" + }, + "ETag": { + "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", + "type": "string", + "format": "" + } + } + }, + "400": { + "description": "Invalid request. Check input parameters", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "404": { + "description": "Resource is not found", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Documents Status": { + "$ref": "./examples/documents.json" + } + } + } + }, + "/v1.0-preview.1/batches/{id}": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the status of the batch translation operation", + "description": "Returns the status of the translation batch operation.\r\nThe status will include the overall job status as well as a summary of the current progress of all the documents being translated.", + "operationId": "Get Operation Status", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Format - uuid. The operation id", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Successful request and returns the status of the batch translation operation", + "schema": { + "$ref": "#/definitions/OperationStatusSummary" + }, + "headers": { + "Retry-After": { + "description": "Indicates how long to wait before making a new request.", + "type": "integer", + "format": "int32" + }, + "ETag": { + "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", + "type": "string", + "format": "" + } + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "404": { + "description": "Resource is not found", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Operation Status": { + "$ref": "./examples/operation.json" + } + } + }, + "delete": { + "tags": [ + "Translation" + ], + "summary": "Cancel a currently processing or queued operation.", + "description": "Cancel a currently processing or queued operation.\r\nAn operation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned.\r\nAll documents that have completed translation will not be cancelled and will be charged.\r\nAll pending documents will be cancelled if possible.", + "operationId": "cancel batch operation", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Format - uuid. The operation-id", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Cancel request has been submitted", + "schema": { + "$ref": "#/definitions/OperationStatusSummary" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "404": { + "description": "Resource is not found", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Cancel an operation example": { + "$ref": "./examples/cancel.json" + } + } + } + }, + "/v1.0-preview.1/batches/{id}/documents": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the status of the documents of a translation batch operation", + "description": "Returns the status of the list of documents translation operation by a given operation id.\r\n \r\nThe documents are sorted by the document Id\r\n \r\nIf the number of documents exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", + "operationId": "Get Detailed Document Status for a given operation id", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Format - uuid. The operation id", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "in": "query", + "name": "$top", + "description": "Take the $top entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 50, + "maximum": 100, + "minimum": 1 + }, + { + "in": "query", + "name": "$skip", + "description": "Skip the $skip entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", + "type": "integer", + "format": "int32", + "default": 0, + "maximum": 2147483647, + "minimum": 0 + } + ], + "responses": { + "200": { + "description": "Successful request and returns the status of the documents", + "schema": { + "$ref": "#/definitions/DocumentStatusResponse" + }, + "headers": { + "Retry-After": { + "description": "Indicates how long to wait before making a new request.", + "type": "integer", + "format": "int32" + }, + "ETag": { + "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", + "type": "string", + "format": "" + } + } + }, + "400": { + "description": "Invalid request. Check input parameters", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + } + }, + "401": { + "description": "Unauthorized. Please check your credentials", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + } + }, + "404": { + "description": "Resource is not found", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Documents Status for the operation id": { + "$ref": "./examples/documents.json" + } + } + } + }, + "/v1.0-preview.1/documents/formats": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the list of supported document formats", + "description": "The list of supported document formats supported by our service.\r\nThe list will include the common file extension used and supported as well as the content-type if using the upload API.", + "operationId": "Get Document Formats", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Returns the list of supported document file formats", + "schema": { + "$ref": "#/definitions/FileFormatListResult" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Document Formats": { + "$ref": "./examples/format.json" + } + } + } + }, + "/v1.0-preview.1/glossaries/formats": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the list of supported document formats", + "description": "The list of supported glossary formats supported by our service.\r\nThe list will include the common file extension used.", + "operationId": "Get Glossary Formats", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Returns the list of supported glossary file formats", + "schema": { + "$ref": "#/definitions/FileFormatListResult" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Glossary Formats": { + "$ref": "./examples/glossary.json" + } + } + } + }, + "/v1.0-preview.1/storagesources": { + "get": { + "tags": [ + "Translation" + ], + "summary": "Returns the list of supported storage sources", + "description": "The list of storage sources supported by our service.", + "operationId": "Get storage sources that we currently support", + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful request and returns the list of storage sources", + "schema": { + "$ref": "#/definitions/StorageSourceListResult" + } + }, + "429": { + "description": "Too many requests", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + } + }, + "503": { + "description": "Server temporary unavailable", + "schema": { + "$ref": "#/definitions/ErrorResponseV2" + }, + "examples": { + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + } + } + }, + "x-ms-examples": { + "Get Document Storage Sources": { + "$ref": "./examples/storage.json" + } + } + } + } + }, + "definitions": { + "DocumentFilter": { + "type": "object", + "properties": { + "prefix": { + "description": "A case-sensitive prefix string to filter documents in the source path for translation. \r\nFor example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for translation.", + "type": "string", + "example": "FolderA" + }, + "suffix": { + "description": "A case-sensitive suffix string to filter documents in the source path for translation. \r\nThis is most often use for file extensions", + "type": "string", + "example": ".txt" + } + } + }, + "StorageSource": { + "description": "Storage Source", + "enum": [ + "AzureBlob" + ], + "type": "string" + }, + "SourceInput": { + "description": "Source of the input documents", + "required": [ + "sourceUrl" + ], + "type": "object", + "properties": { + "sourceUrl": { + "description": "Location of the folder / container with your documents", + "type": "string", + "example": "https://myblob.blob.core.windows.net/Container/" + }, + "filter": { + "$ref": "#/definitions/DocumentFilter" + }, + "language": { + "description": "Language code\r\nIf none is specified, we will perform auto detect on the document", + "type": "string", + "example": "en" + }, + "storageSource": { + "$ref": "#/definitions/StorageSource" + } + } + }, + "Glossary": { + "description": "Glossary / translation memory for the request", + "required": [ + "glossaryUrl" + ], + "type": "object", + "properties": { + "glossaryUrl": { + "description": "Location of the glossary. \r\nWe will use the file extension to extract the formating if the format parameter is not supplied.\r\n\r\nIf the translation language pair is not present in the glossary, it will not be applied", + "type": "string", + "example": "https://myblob.blob.core.windows.net/Container/myglossary.tsv" + }, + "format": { + "description": "Format", + "type": "string", + "example": "XLIFF" + }, + "version": { + "description": "Version", + "type": "string", + "example": "2.0" + } + } + }, + "TargetInput": { + "description": "Destination for the finished translated documents", + "required": [ + "language", + "targetUrl" + ], + "type": "object", + "properties": { + "targetUrl": { + "description": "Location of the folder / container with your documents", + "type": "string", + "example": "https://myblob.blob.core.windows.net/TargetUrl/" + }, + "category": { + "description": "Category / custom system for translation request", + "type": "string", + "example": "general" + }, + "language": { + "description": "Target Language", + "type": "string", + "example": "fr" + }, + "glossaries": { + "description": "List of Glossary", + "type": "array", + "items": { + "$ref": "#/definitions/Glossary" + } + }, + "storageSource": { + "$ref": "#/definitions/StorageSource" + } + } + }, + "BatchRequest": { + "description": "Definition for the input batch translation request", + "required": [ + "source", + "targets" + ], + "type": "object", + "properties": { + "source": { + "$ref": "#/definitions/SourceInput" + }, + "targets": { + "description": "Location of the destination for the output", + "type": "array", + "items": { + "$ref": "#/definitions/TargetInput" + } + } + } + }, + "JobSubmissionBatchRequest": { + "description": "Job submission batch request", + "required": [ + "inputs" + ], + "type": "object", + "properties": { + "inputs": { + "description": "The input list of documents or folders containing documents", + "type": "array", + "items": { + "$ref": "#/definitions/BatchRequest" + } + } + } + }, + "Status": { + "description": "List of possible statuses for job or document", + "enum": [ + "NotStarted", + "Running", + "Succeeded", + "Failed", + "Cancelled", + "Cancelling" + ], + "type": "string" + }, + "StatusSummary": { + "type": "object", + "properties": { + "total": { + "format": "int32", + "description": "Total count", + "type": "integer", + "example": 1 + }, + "failed": { + "format": "int32", + "description": "Failed count", + "type": "integer", + "example": 0 + }, + "success": { + "format": "int32", + "description": "Number of Success", + "type": "integer", + "example": 1 + }, + "inProgress": { + "format": "int32", + "description": "Number of in progress", + "type": "integer", + "example": 0 + }, + "notYetStarted": { + "format": "int32", + "description": "Count of not yet started", + "type": "integer", + "example": 0 + }, + "cancelled": { + "format": "int32", + "description": "Number of cancelled", + "type": "integer", + "example": 0 + } + } + }, + "OperationStatusSummary": { + "description": "Job status response", + "required": [ + "createdDateTimeUtc", + "id", + "lastActionDateTimeUtc", + "summary" + ], + "type": "object", + "properties": { + "id": { + "format": "uuid", + "description": "Id of the operation.", + "type": "string", + "example": "36724748-f7a0-4db7-b7fd-f041ddc75033" + }, + "createdDateTimeUtc": { + "format": "date-time", + "description": "Operation created date time", + "type": "string", + "example": "2020-01-20T11:40:07.7010000-08:00" + }, + "lastActionDateTimeUtc": { + "format": "date-time", + "description": "Date time in which the operation's status has been updated", + "type": "string", + "example": "2020-01-20T11:41:07.7010000-08:00" + }, + "status": { + "$ref": "#/definitions/Status" + }, + "summary": { + "$ref": "#/definitions/StatusSummary" + } + } + }, + "OperationStatusResponse": { + "description": "Document Status Response", + "type": "object", + "properties": { + "value": { + "description": "The summary status of individual operation", + "type": "array", + "items": { + "$ref": "#/definitions/OperationStatusSummary" + } + }, + "@nextLink": { + "description": "Url for the next page. Null if no more pages available", + "type": "string", + "example": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operations?$top=5&$skip=15" + } + } + }, + "DocumentSubmissionResponse": { + "description": "The response for a document submission", + "type": "object", + "properties": { + "job": { + "$ref": "#/definitions/OperationStatusSummary" + }, + "documentDownloadUrl": { + "description": "Document download link", + "type": "string" + }, + "documentExpirationDateTimeUtc": { + "format": "date-time", + "description": "Datetime in Utc when the document will no longer be available", + "type": "string" + } + } + }, + "DocumentStatusDetail": { + "required": [ + "createdDateTimeUtc", + "lastActionDateTimeUtc", + "path", + "status", + "to" + ], + "type": "object", + "properties": { + "path": { + "description": "Location of the document or folder", + "type": "string", + "example": "https://myblob.blob.core.windows.net/mycontainer/fr/mydoc.txt" + }, + "createdDateTimeUtc": { + "format": "date-time", + "description": "Operation created date time", + "type": "string", + "example": "2020-01-20T11:40:07.7010000-08:00" + }, + "lastActionDateTimeUtc": { + "format": "date-time", + "description": "Date time in which the operation's status has been updated", + "type": "string", + "example": "2020-01-20T11:41:07.7010000-08:00" + }, + "status": { + "$ref": "#/definitions/Status" + }, + "detectedLanguage": { + "description": "Detected language of the original document (to be implemented)", + "type": "string", + "example": "en" + }, + "to": { + "description": "To language", + "type": "string" + }, + "errorMessage": { + "description": "Error message if any", + "type": "string", + "example": "document is malformed" + }, + "errorCode": { + "format": "int32", + "description": "Error code if any", + "type": "integer", + "example": 400052 + }, + "progress": { + "format": "float", + "description": "Progress of the translation if available", + "maximum": 1, + "minimum": 0, + "type": "number", + "example": 0.5 + }, + "id": { + "format": "int64", + "description": "Document Id", + "type": "integer" + } + } + }, + "DocumentStatusResponse": { + "description": "Document Status Response", + "type": "object", + "properties": { + "value": { + "description": "The detail status of individual documents", + "type": "array", + "items": { + "$ref": "#/definitions/DocumentStatusDetail" + } + }, + "@nextLink": { + "description": "Url for the next page. Null if no more pages available", + "type": "string", + "example": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operations/727BF148-F327-47A0-9481-ABAE6362F11E/documents?$top=5&$skip=15" + } + } + }, + "FileFormat": { + "type": "object", + "properties": { + "format": { + "description": "Name of the format", + "type": "string", + "example": "PlainText" + }, + "fileExtensions": { + "description": "Supported file extension for this format", + "type": "array", + "items": { + "type": "string" + } + }, + "contentTypes": { + "description": "Supported Content-Types for this format", + "type": "array", + "items": { + "type": "string" + } + }, + "versions": { + "description": "Supported Version", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "FileFormatListResult": { + "description": "Base type for List return in our api", + "type": "object", + "properties": { + "value": { + "description": "list of objects", + "type": "array", + "items": { + "$ref": "#/definitions/FileFormat" + } + } + } + }, + "StorageSourceListResult": { + "description": "Base type for List return in our api", + "type": "object", + "properties": { + "value": { + "description": "list of objects", + "type": "array", + "items": { + "$ref": "#/definitions/StorageSource" + } + } + } + }, + "ErrorCodeV2": { + "description": "Enums containing high level error codes.", + "enum": [ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable", + "ResourceNotFound", + "Unauthorized", + "RequestRateTooHigh" + ], + "type": "string" + }, + "InnerErrorV2": { + "description": "New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.\r\nThis contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "Gets detailed error code.", + "type": "integer", + "readOnly": true + }, + "error": { + "description": "Gets detailed error string.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Gets high level error message.", + "type": "string", + "readOnly": true + }, + "target": { + "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", + "type": "string", + "readOnly": true + }, + "innerError": { + "$ref": "#/definitions/InnerErrorV2" + } + } + }, + "ErrorV2": { + "description": "This contains an outer error with error code, message, details, target and an inner error with more descriptive details.", + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/ErrorCodeV2" + }, + "message": { + "description": "Gets high level error message.", + "type": "string", + "readOnly": true + }, + "target": { + "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", + "type": "string", + "readOnly": true + }, + "innerError": { + "$ref": "#/definitions/InnerErrorV2" + } + } + }, + "ErrorResponseV2": { + "description": "Contains unified error information used for HTTP responses across any Cognitive Service. Instances\r\ncan be created either through Microsoft.CloudAI.Containers.HttpStatusExceptionV2 or by returning it directly from\r\na controller.", + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/ErrorV2" + } + } + } + }, + "securityDefinitions": { + "subscription_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header", + "description": "Provide your cognitive services subscription key here." + } + }, + "security": [ + { + "subscription_key": [] + } + ] +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json new file mode 100644 index 000000000000..e63bfd4bd4af --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json @@ -0,0 +1,118 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "batchRequest": { + "inputs": [ + { + "source": { + "sourceUrl": "https://myblob.blob.core.windows.net/sourceContainer", + "filter": { + "prefix": "pre", + "suffix": ".txt" + }, + "language": "en", + "storageSource": "AzureBlob" + }, + "targets": [ + { + "targetUrl": "https://myblob.blob.core.windows.net/destinationContainer1", + "category": "general", + "language": "fr", + "glossaries": [ + { + "glossaryUrl": "https://myblob.blob.core.windows.net/myglossary/en_fr_glossary.xlf" + } + ], + "storageSource": "AzureBlob" + }, + { + "targetUrl": "https://myblob.blob.core.windows.net/destinationContainer2", + "category": "general", + "language": "es", + "storageSource": "AzureBlob" + } + ] + } + ] + } + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "202": { + "headers": { + "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55" + } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Some argument is incorrect", + "innerError": { + "code": 400120, + "error": "SASTokenInvalid", + "message": "SAS token for storage is invalid" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json new file mode 100644 index 000000000000..e3631a31abef --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json @@ -0,0 +1,102 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "id": "727BF148-F327-47A0-9481-ABAE6362F11E" + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "Operation", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "Operation", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "Operation", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "Operation", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "ResourceNotFound", + "message": "id not found", + "target": "Operation", + "innerError": { + "code": 404000, + "error": "ResourceNotFound", + "message": "Resource requested is not found" + } + } + } + }, + "200": { + "headers": {}, + "body": { + "id": "727bf148-f327-47a0-9481-abae6362f11e", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "Succeeded", + "summary": { + "total": 10, + "failed": 1, + "success": 9, + "inProgress": 0, + "notYetStarted": 0, + "cancelled": 0 + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json new file mode 100644 index 000000000000..0f7932faf592 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json @@ -0,0 +1,103 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "id": "727BF148-F327-47A0-9481-ABAE6362F11E", + "documentId": 199800 + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "Document", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "Document", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "Document", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "Document", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "ResourceNotFound", + "message": "id not found", + "target": "Document", + "innerError": { + "code": 404000, + "error": "ResourceNotFound", + "message": "Resource requested is not found" + } + } + } + }, + "200": { + "headers": { + "retry-after": "30", + "ETag": "686897696a7c876b7e" + }, + "body": { + "path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "Running", + "detectedLanguage": "en", + "to": "fr", + "errorCode": 0, + "progress": 0.1, + "id": 123532 + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json new file mode 100644 index 000000000000..4cf2cf7e5a97 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json @@ -0,0 +1,124 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "id": "727BF148-F327-47A0-9481-ABAE6362F11E", + "$top": 5, + "$skip": 10 + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "Document", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "Document", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "Document", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "Document", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "ResourceNotFound", + "message": "id not found", + "target": "Document", + "innerError": { + "code": 404000, + "error": "ResourceNotFound", + "message": "Resource requested is not found" + } + } + } + }, + "200": { + "headers": { + "retry-after": "30", + "ETag": "686897696a7c876b7e" + }, + "body": { + "value": [ + { + "path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "Running", + "detectedLanguage": "en", + "to": "fr", + "errorCode": 0, + "progress": 0.1, + "id": 123532 + } + ], + "@nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?$top=5&$skip=15" + } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Some argument is incorrect", + "target": "Document", + "innerError": { + "code": 400120, + "error": "SASTokenInvalid", + "message": "SAS token for storage is invalid" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json new file mode 100644 index 000000000000..e89018779748 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json @@ -0,0 +1,80 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup" + }, + "responses": { + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "200": { + "headers": { + "ETag": "686897696a7c876b7e" + }, + "body": { + "value": [ + { + "format": "PlainText", + "fileExtensions": [ + ".txt" + ], + "contentTypes": [ + "text/plain" + ], + "versions": [] + }, + { + "format": "OpenXmlWord", + "fileExtensions": [ + ".docx" + ], + "contentTypes": [ + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + ], + "versions": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json new file mode 100644 index 000000000000..2672567144e8 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json @@ -0,0 +1,81 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup" + }, + "responses": { + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "200": { + "headers": { + "ETag": "686897696a7c876b7e" + }, + "body": { + "value": [ + { + "format": "XLIFF", + "fileExtensions": [ + ".xlf" + ], + "contentTypes": [ + "application/xliff+xml" + ], + "versions": [ + "1.2", + "2.0" + ] + }, + { + "format": "TMX", + "fileExtensions": [ + ".tmx" + ], + "contentTypes": [], + "versions": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json new file mode 100644 index 000000000000..249fd05f2703 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "id": "727BF148-F327-47A0-9481-ABAE6362F11E" + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "Operation", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "Operation", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "Operation", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "Operation", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "404": { + "headers": {}, + "body": { + "error": { + "code": "ResourceNotFound", + "message": "id not found", + "target": "Operation", + "innerError": { + "code": 404000, + "error": "ResourceNotFound", + "message": "Resource requested is not found" + } + } + } + }, + "200": { + "headers": { + "retry-after": "30", + "ETag": "686897696a7c876b7e" + }, + "body": { + "id": "727bf148-f327-47a0-9481-abae6362f11e", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "Succeeded", + "summary": { + "total": 10, + "failed": 1, + "success": 9, + "inProgress": 0, + "notYetStarted": 0, + "cancelled": 0 + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json new file mode 100644 index 000000000000..63edae21cf88 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json @@ -0,0 +1,108 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup" + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "Operation", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "Operation", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "Operation", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "Operation", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "200": { + "headers": { + "retry-after": "30", + "ETag": "686897696a7c876b7e" + }, + "body": { + "value": [ + { + "id": "727bf148-f327-47a0-9481-abae6362f11e", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "Succeeded", + "summary": { + "total": 10, + "failed": 1, + "success": 9, + "inProgress": 0, + "notYetStarted": 0, + "cancelled": 0 + } + } + ] + } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Some argument is incorrect", + "target": "Operation", + "innerError": { + "code": 400120, + "error": "SASTokenInvalid", + "message": "SAS token for storage is invalid" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json new file mode 100644 index 000000000000..4c13c8264468 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json @@ -0,0 +1,112 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup", + "TargetLanguage": "fr", + "Category": "general", + "SourceLanguage": "es", + "body": "ZG9jdW1lbnQgYmluYXJ5IGJvZHk=" + }, + "responses": { + "401": { + "headers": {}, + "body": { + "error": { + "code": "Unauthorized", + "message": "User is not authorized", + "target": "document", + "innerError": { + "code": 401000, + "error": "Unauthorized", + "message": "Operation is not authorized" + } + } + } + }, + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "target": "document", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "target": "document", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "target": "document", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "201": { + "headers": { + "location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/documents/12345", + "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55" + }, + "body": { + "job": { + "id": "727bf148-f327-47a0-9481-abae6362f11e", + "createdDateTimeUtc": "2020-03-26T00:00:00Z", + "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", + "status": "NotStarted", + "summary": { + "total": 1, + "failed": 0, + "success": 0, + "inProgress": 0, + "notYetStarted": 1, + "cancelled": 0 + } + }, + "documentDownloadUrl": "https://myblob.blob.core.windows.net/container/file.txt?[SasToken]", + "documentExpirationDateTimeUtc": "2020-03-27T00:00:00Z" + } + }, + "400": { + "headers": {}, + "body": { + "error": { + "code": "InvalidRequest", + "message": "Some argument is incorrect", + "target": "document", + "innerError": { + "code": 400125, + "error": "InvalidTargetLanguage", + "message": "Target Language is invalid or not supported" + } + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json new file mode 100644 index 000000000000..215c22b81f59 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "v1.0-preview.1", + "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", + "resourceGroupName": "TestResourceGroup" + }, + "responses": { + "429": { + "headers": {}, + "body": { + "error": { + "code": "RequestRateTooHigh", + "message": "User's request rate is too high", + "innerError": { + "code": 429000, + "error": "RateTooHigh", + "message": "Request rate is too high" + } + } + } + }, + "500": { + "headers": {}, + "body": { + "error": { + "code": "InternalServerError", + "message": "Internal Server Error", + "innerError": { + "code": 500000, + "error": "Internal Server Error", + "message": "Unexpected internal server error has occurred" + } + } + } + }, + "503": { + "headers": {}, + "body": { + "error": { + "code": "ServiceUnavailable", + "message": "Service is temporary unavailable", + "innerError": { + "code": 503000, + "error": "ServiceTemporaryUnavailable", + "message": "Service is currently unavailable. Please try again later" + } + } + } + }, + "200": { + "headers": { + "ETag": "686897696a7c876b7e" + }, + "body": { + "value": [ + "AzureBlob" + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md new file mode 100644 index 000000000000..c804a0e4a28a --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md @@ -0,0 +1,20 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +``` yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: translation.batch + clear-output-folder: true +``` + + +### Tag: release_1_0_review and go + +These settings apply only when `--tag=release_1_0_preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'release_1_0_preview' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0.preview/$(namespace) +``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md new file mode 100644 index 000000000000..542cd1f8ef08 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md @@ -0,0 +1,118 @@ +# Cognitive Services Translation Batch SDK + +The Cognitive Service SDK has support for the Translation Batch Cognitive Service. +While this repository contains the [Autorest](https://aka.ms/autorest) generated SDK, the easiest way to consume the SDK is by installing the NuGet package for it. + +Note that the Cognitive Services Translation Batch SDK is simply a wrapper on top of the Translation Batch Cognitive service. As such, it will generate calls to the Azure service. + + +## Prerequisites +You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with **Translation Batch API**. + +## Installing the NuGet SDK Package +1. Create a new Console solution in Visual Studio. +2. Right click on the solution and click **Manage NuGet Packages for Solution** +3. Mark the **Include Prerelease** checkbox. +4. Select the **Browse** tab, and Search for **Microsoft.Azure.CognitiveServices.Translation.Batch** +5. Select the NuGet package and install it. + +## Releases + +> see https://aka.ms/autorest + +The current preview release is `release_1_0_preview`. + +``` yaml +tag: release_1_0_preview +add-credentials: true +``` + +### Release 1.0-Preview + +These settings apply only when `--tag=release_1_0_preview` is specified on the command line. + +``` yaml $(tag) == 'release_1_0_preview' +input-file: preview/v1.0/TranslatorBatch.json +log-file: logs/log.txt +``` + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js + - repo: azure-sdk-for-node + - repo: azure-sdk-for-ruby + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_cognitiveservices_translationbatch'] +``` + +## CSharp Settings + +These settings apply only when `--csharp` is specified on the command line. + +``` yaml $(csharp) +csharp: + sync-methods: None + license-header: MICROSOFT_MIT_NO_VERSION + azure-arm: false + namespace: Microsoft.Azure.CognitiveServices.Translation.Batch + output-folder: $(csharp-sdks-folder)/CognitiveServices/Translation.Batch/src/Generated + clear-output-folder: true +```` + +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + license-header: MICROSOFT_MIT_NO_VERSION + add-credentials: true + payload-flattening-threshold: 2 + namespace: azure.cognitiveservices.translation.batch + package-name: azure-cognitiveservices-translation.batch + clear-output-folder: true +``` + +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch/azure/cognitiveservices/translation/batch +``` + +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch +``` + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +java: + azure-arm: true + namespace: com.microsoft.azure.cognitiveservices.translation.batch + license-header: MICROSOFT_MIT_NO_CODEGEN + payload-flattening-threshold: 1 + output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/translation/batch + with-optional-parameters: true + with-single-async-method: true +``` + diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md new file mode 100644 index 000000000000..a85d3df66e43 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md @@ -0,0 +1,14 @@ +## Node.js + +These settings apply only when `--nodejs` is specified on the command line. +Please also specify `--node-sdks-folder=`. + +``` yaml $(nodejs) +nodejs: + package-name: azure-cognitiveservices-translation-batch + output-folder: $(node-sdks-folder)/lib/services/cognitiveServices/translation/batch + azure-arm: false + generate-license-txt: true + generate-package-json: true + generate-readme-md: false +``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md new file mode 100644 index 000000000000..2fc5fb8e89ac --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md @@ -0,0 +1,27 @@ +## Ruby + +These settings apply only when `--ruby` is specified on the command line. + +``` yaml +package-name: azure_cognitiveservices_translation_batch +package-version: "0.0.1" +azure-arm: true +``` + +### Ruby multi-api + +``` yaml $(ruby) && $(multiapi) +batch: + - tag: release_1_0_preview +``` + +### Tag: release_1_0_preview and ruby + +These settings apply only when `--tag=release_1_0_preview --ruby` is specified on the command line. +Please also specify `--ruby-sdks-folder=`. + +``` yaml $(tag) == 'release_1_0_preview' && $(ruby) +namespace: "Azure::CognitiveServices::Translation::Batch::V1_0" +output-folder: $(ruby-sdks-folder)/data/azure_cognitiveservices_translation_batch/lib +title: "TranslationBatchClient" +``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md new file mode 100644 index 000000000000..21d62d40c7f4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md @@ -0,0 +1,12 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +``` yaml $(typescript) +typescript: + package-name: "@azure/cognitiveservices-translation-batch" + output-folder: "$(typescript-sdks-folder)/sdk/cognitiveservices/cognitiveservices-translation-batch" + azure-arm: false + generate-metadata: true +``` From 923e20185de7cc6f8dff7eddf37cc9a8eadd93fa Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 27 Apr 2020 15:56:24 -0700 Subject: [PATCH 02/18] updated swagger based on API review feedback --- .../Batch/preview/v1.0/TranslatorBatch.json | 304 ++++++------------ .../Batch/preview/v1.0/examples/document.json | 3 +- .../preview/v1.0/examples/documents.json | 3 +- .../Batch/preview/v1.0/examples/post.json | 18 +- 4 files changed, 98 insertions(+), 230 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index f4a6ca943306..8653f3f8b42e 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -1,11 +1,11 @@ { "swagger": "2.0", "info": { - "title": "Batch Text Translation API", + "title": "Batch Document Translation API", "version": "v1.0-preview.1" }, "host": "westus2.cognitiveservices.azure.com", - "basePath": "/translator/text/batch", + "basePath": "/translator/text/document", "schemes": [ "https" ], @@ -32,7 +32,7 @@ "name": "body", "description": "request details", "schema": { - "$ref": "#/definitions/JobSubmissionBatchRequest" + "$ref": "#/definitions/BatchSubmissionRequest" } } ], @@ -135,7 +135,7 @@ "200": { "description": "Successful request and returns the status of the all the operations", "schema": { - "$ref": "#/definitions/OperationStatusResponse" + "$ref": "#/definitions/BatchStatusResponse" }, "headers": { "Retry-After": { @@ -203,13 +203,13 @@ } } }, - "/v1.0-preview.1/batches/upload": { + "/v1.0-preview.1/batches/single/binary": { "post": { "tags": [ "Translation" ], "summary": "Submit a binary document in the POST body to the translation service.", - "description": "Use content-type header to denote the file format type\r\n \r\nExample:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/pdf for .pdf files", + "description": "Use content-type header to denote the file format type\r\n \r\nExample:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", "operationId": "Single Document Upload", "produces": [ "text/plain", @@ -309,7 +309,7 @@ } } }, - "/v1.0-preview.1/documents/{documentId}": { + "/v1.0-preview.1/batches/{id}/documents/{documentId}": { "get": { "tags": [ "Translation" @@ -321,13 +321,21 @@ "application/json" ], "parameters": [ + { + "in": "path", + "name": "id", + "description": "Format - uuid. The batch id", + "required": true, + "type": "string", + "format": "uuid" + }, { "in": "path", "name": "documentId", - "description": "Format - int64. The document id", + "description": "Format - uuid. The document id", "required": true, - "type": "integer", - "format": "int64" + "type": "string", + "format": "uuid" } ], "responses": { @@ -402,120 +410,6 @@ } } }, - "/v1.0-preview.1/documents": { - "get": { - "tags": [ - "Translation" - ], - "summary": "Returns the status of the documents of a translation batch operation", - "description": "Returns the status of the list of documents translation operation status in the subscription\r\n \r\nThe documents are sorted by the document Id\r\n \r\nIf the number of documents exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", - "operationId": "Get Detailed Document Status", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "query", - "name": "$top", - "description": "Take the $top entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", - "type": "integer", - "format": "int32", - "default": 50, - "maximum": 100, - "minimum": 1 - }, - { - "in": "query", - "name": "$skip", - "description": "Skip the $skip entries in the collection\r\nWhen both $top and $skip are supplied, $skip is applied first", - "type": "integer", - "format": "int32", - "default": 0, - "maximum": 2147483647, - "minimum": 0 - } - ], - "responses": { - "200": { - "description": "Successful request and returns the status of the documents", - "schema": { - "$ref": "#/definitions/DocumentStatusResponse" - }, - "headers": { - "Retry-After": { - "description": "Indicates how long to wait before making a new request.", - "type": "integer", - "format": "int32" - }, - "ETag": { - "description": "The ETag response-header field provides the current value of the entity tag for the requested variant. Used with If-Match, If-None-Match and If-Range to implement optimistic concurrency control.", - "type": "string", - "format": "" - } - } - }, - "400": { - "description": "Invalid request. Check input parameters", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" - } - }, - "401": { - "description": "Unauthorized. Please check your credentials", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } - }, - "404": { - "description": "Resource is not found", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" - } - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } - }, - "503": { - "description": "Server temporary unavailable", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } - } - }, - "x-ms-examples": { - "Get Documents Status": { - "$ref": "./examples/documents.json" - } - } - } - }, "/v1.0-preview.1/batches/{id}": { "get": { "tags": [ @@ -541,7 +435,7 @@ "200": { "description": "Successful request and returns the status of the batch translation operation", "schema": { - "$ref": "#/definitions/OperationStatusSummary" + "$ref": "#/definitions/BatchStatusDetail" }, "headers": { "Retry-After": { @@ -632,7 +526,7 @@ "200": { "description": "Cancel request has been submitted", "schema": { - "$ref": "#/definitions/OperationStatusSummary" + "$ref": "#/definitions/BatchStatusDetail" } }, "401": { @@ -1097,7 +991,7 @@ } } }, - "JobSubmissionBatchRequest": { + "BatchSubmissionRequest": { "description": "Job submission batch request", "required": [ "inputs" @@ -1166,7 +1060,7 @@ } } }, - "OperationStatusSummary": { + "BatchStatusDetail": { "description": "Job status response", "required": [ "createdDateTimeUtc", @@ -1202,7 +1096,7 @@ } } }, - "OperationStatusResponse": { + "BatchStatusResponse": { "description": "Document Status Response", "type": "object", "properties": { @@ -1210,7 +1104,7 @@ "description": "The summary status of individual operation", "type": "array", "items": { - "$ref": "#/definitions/OperationStatusSummary" + "$ref": "#/definitions/BatchStatusDetail" } }, "@nextLink": { @@ -1224,9 +1118,6 @@ "description": "The response for a document submission", "type": "object", "properties": { - "job": { - "$ref": "#/definitions/OperationStatusSummary" - }, "documentDownloadUrl": { "description": "Document download link", "type": "string" @@ -1238,6 +1129,71 @@ } } }, + "ErrorCodeV2": { + "description": "Enums containing high level error codes.", + "enum": [ + "InvalidRequest", + "InvalidArgument", + "InternalServerError", + "ServiceUnavailable", + "ResourceNotFound", + "Unauthorized", + "RequestRateTooHigh" + ], + "type": "string" + }, + "InnerErrorV2": { + "description": "New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.\r\nThis contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).", + "type": "object", + "properties": { + "code": { + "format": "int32", + "description": "Gets detailed error code.", + "type": "integer", + "readOnly": true + }, + "error": { + "description": "Gets detailed error string.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Gets high level error message.", + "type": "string", + "readOnly": true + }, + "target": { + "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", + "type": "string", + "readOnly": true + }, + "innerError": { + "$ref": "#/definitions/InnerErrorV2" + } + } + }, + "ErrorV2": { + "description": "This contains an outer error with error code, message, details, target and an inner error with more descriptive details.", + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/ErrorCodeV2" + }, + "message": { + "description": "Gets high level error message.", + "type": "string", + "readOnly": true + }, + "target": { + "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", + "type": "string", + "readOnly": true + }, + "innerError": { + "$ref": "#/definitions/InnerErrorV2" + } + } + }, "DocumentStatusDetail": { "required": [ "createdDateTimeUtc", @@ -1277,16 +1233,8 @@ "description": "To language", "type": "string" }, - "errorMessage": { - "description": "Error message if any", - "type": "string", - "example": "document is malformed" - }, - "errorCode": { - "format": "int32", - "description": "Error code if any", - "type": "integer", - "example": 400052 + "error": { + "$ref": "#/definitions/ErrorV2" }, "progress": { "format": "float", @@ -1297,9 +1245,10 @@ "example": 0.5 }, "id": { - "format": "int64", + "format": "uuid", "description": "Document Id", - "type": "integer" + "type": "string", + "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" } } }, @@ -1378,71 +1327,6 @@ } } }, - "ErrorCodeV2": { - "description": "Enums containing high level error codes.", - "enum": [ - "InvalidRequest", - "InvalidArgument", - "InternalServerError", - "ServiceUnavailable", - "ResourceNotFound", - "Unauthorized", - "RequestRateTooHigh" - ], - "type": "string" - }, - "InnerErrorV2": { - "description": "New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.\r\nThis contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).", - "type": "object", - "properties": { - "code": { - "format": "int32", - "description": "Gets detailed error code.", - "type": "integer", - "readOnly": true - }, - "error": { - "description": "Gets detailed error string.", - "type": "string", - "readOnly": true - }, - "message": { - "description": "Gets high level error message.", - "type": "string", - "readOnly": true - }, - "target": { - "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", - "type": "string", - "readOnly": true - }, - "innerError": { - "$ref": "#/definitions/InnerErrorV2" - } - } - }, - "ErrorV2": { - "description": "This contains an outer error with error code, message, details, target and an inner error with more descriptive details.", - "type": "object", - "properties": { - "code": { - "$ref": "#/definitions/ErrorCodeV2" - }, - "message": { - "description": "Gets high level error message.", - "type": "string", - "readOnly": true - }, - "target": { - "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", - "type": "string", - "readOnly": true - }, - "innerError": { - "$ref": "#/definitions/InnerErrorV2" - } - } - }, "ErrorResponseV2": { "description": "Contains unified error information used for HTTP responses across any Cognitive Service. Instances\r\ncan be created either through Microsoft.CloudAI.Containers.HttpStatusExceptionV2 or by returning it directly from\r\na controller.", "type": "object", diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json index 0f7932faf592..f118e3570dda 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json @@ -94,9 +94,8 @@ "status": "Running", "detectedLanguage": "en", "to": "fr", - "errorCode": 0, "progress": 0.1, - "id": 123532 + "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" } } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json index 4cf2cf7e5a97..b4e733738b33 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json @@ -97,9 +97,8 @@ "status": "Running", "detectedLanguage": "en", "to": "fr", - "errorCode": 0, "progress": 0.1, - "id": 123532 + "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" } ], "@nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?$top=5&$skip=15" diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json index 4c13c8264468..efd79a8220b6 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json @@ -71,24 +71,10 @@ }, "201": { "headers": { - "location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/documents/12345", - "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55" + "location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55/documents/974e819b-8592-43bd-8efc-da51eb5f9ee3", + "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55" }, "body": { - "job": { - "id": "727bf148-f327-47a0-9481-abae6362f11e", - "createdDateTimeUtc": "2020-03-26T00:00:00Z", - "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", - "status": "NotStarted", - "summary": { - "total": 1, - "failed": 0, - "success": 0, - "inProgress": 0, - "notYetStarted": 1, - "cancelled": 0 - } - }, "documentDownloadUrl": "https://myblob.blob.core.windows.net/container/file.txt?[SasToken]", "documentExpirationDateTimeUtc": "2020-03-27T00:00:00Z" } From 8167171ca94901d45f9634ba2c60f6f949b099ed Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 19:52:05 -0700 Subject: [PATCH 03/18] updated post --- .../Batch/preview/v1.0/TranslatorBatch.json | 128 +++++++++--------- .../Batch/preview/v1.0/examples/post.json | 16 +-- 2 files changed, 71 insertions(+), 73 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index 8653f3f8b42e..b1b37b193a50 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -41,7 +41,7 @@ "description": "Successful request and the batch request is created by the service. The header Operation-Location will indicate a status url with the operation id.", "headers": { "Operation-Location": { - "description": "Location of the operation", + "description": "Location of batch the operation", "type": "string", "format": "" } @@ -53,7 +53,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" } }, "401": { @@ -62,7 +62,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "429": { @@ -71,7 +71,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -80,7 +80,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -89,7 +89,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, @@ -156,7 +156,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" } }, "401": { @@ -165,7 +165,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "429": { @@ -174,7 +174,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -183,7 +183,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -192,29 +192,30 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, "x-ms-examples": { - "Get status for operation list": { + "Get status for batch operations": { "$ref": "./examples/operations.json" } } } }, - "/v1.0-preview.1/batches/single/binary": { + "/v1.0-preview.1/batches/hosted": { "post": { "tags": [ "Translation" ], - "summary": "Submit a binary document in the POST body to the translation service.", - "description": "Use content-type header to denote the file format type\r\n \r\nExample:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", + "summary": "Submit documents as a multipart/form-data POST message to the Microsoft hosted batch translation service.", + "description": "Content-Type: multipart/form-data; boundary=------------------------f09ba952eaa5d6f4\r\n \r\nContent-Type of each individual part or the filename will be used to determine the file type\r\n \r\nExample request:\r\ncurl -v -F document=@hi.txt;type=text/plain;filename=hello.txt -F document=@pl.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document;filename=mydoc.docx\r\n \r\nExample content types:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", "operationId": "Single Document Upload", + "consumes": [ + "multipart/form-data" + ], "produces": [ - "text/plain", - "application/json", - "text/json" + "application/json" ], "parameters": [ { @@ -235,24 +236,36 @@ "description": "The language code for the documents to translate to", "required": true, "type": "string" + }, + { + "in": "formData", + "name": "document", + "description": "Documents to be uploaded to the Microsoft Hosted Batch Translation Services", + "type": "array", + "items": { + "format": "binary", + "type": "string" + } } ], "responses": { - "201": { - "description": "Successful request and it is created by the service. The operation details are returned", - "schema": { - "$ref": "#/definitions/DocumentSubmissionResponse" - }, + "202": { + "description": "Successful request and documents uploaded to the service", "headers": { "Location": { - "description": "Location of the document status", + "description": "Location to the Azure Blob Container containing the translated documents", "type": "string", "format": "" }, "Operation-Location": { - "description": "Location of the operation", + "description": "Location of the batch operation", "type": "string", "format": "" + }, + "Expires": { + "description": "Expiration of the Azure Blob Container", + "type": "string", + "format": "date-time" } } }, @@ -262,7 +275,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" } }, "401": { @@ -271,7 +284,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "429": { @@ -280,7 +293,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -289,7 +302,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -298,12 +311,12 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, "x-ms-examples": { - "Document Submit": { + "Batch Hosted Submit": { "$ref": "./examples/post.json" } } @@ -456,7 +469,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "404": { @@ -465,7 +478,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" } }, "429": { @@ -474,7 +487,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -483,7 +496,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -492,12 +505,12 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, "x-ms-examples": { - "Get Operation Status": { + "Get Batch Operation Status": { "$ref": "./examples/operation.json" } } @@ -535,7 +548,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "404": { @@ -544,7 +557,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" } }, "429": { @@ -553,7 +566,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -562,7 +575,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -571,12 +584,12 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, "x-ms-examples": { - "Cancel an operation example": { + "Cancel a batch operation example": { "$ref": "./examples/cancel.json" } } @@ -648,7 +661,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" } }, "401": { @@ -657,7 +670,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" } }, "404": { @@ -666,7 +679,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" } }, "429": { @@ -675,7 +688,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" } }, "500": { @@ -684,7 +697,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" } }, "503": { @@ -693,12 +706,12 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"operation\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" } } }, "x-ms-examples": { - "Get Documents Status for the operation id": { + "Get Documents Status for the operation batch id": { "$ref": "./examples/documents.json" } } @@ -1114,21 +1127,6 @@ } } }, - "DocumentSubmissionResponse": { - "description": "The response for a document submission", - "type": "object", - "properties": { - "documentDownloadUrl": { - "description": "Document download link", - "type": "string" - }, - "documentExpirationDateTimeUtc": { - "format": "date-time", - "description": "Datetime in Utc when the document will no longer be available", - "type": "string" - } - } - }, "ErrorCodeV2": { "description": "Enums containing high level error codes.", "enum": [ diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json index efd79a8220b6..ec94f893d5ad 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json @@ -3,10 +3,13 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "Content-Type": "multipart/form-data; boundary=------------------------f09ba952eaa5d6f", "TargetLanguage": "fr", "Category": "general", "SourceLanguage": "es", - "body": "ZG9jdW1lbnQgYmluYXJ5IGJvZHk=" + "document": [ + "--------------------------f64487c993479cd6\nContent-Disposition: form-data; name=\"document\"; filename=\"hello.docx\"\nContent-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document\nSystem.Byte[]" + ] }, "responses": { "401": { @@ -69,14 +72,11 @@ } } }, - "201": { + "202": { "headers": { - "location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55/documents/974e819b-8592-43bd-8efc-da51eb5f9ee3", - "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55" - }, - "body": { - "documentDownloadUrl": "https://myblob.blob.core.windows.net/container/file.txt?[SasToken]", - "documentExpirationDateTimeUtc": "2020-03-27T00:00:00Z" + "location": "https://myblob.blob.core.windows.net/container?[SasToken]", + "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55", + "Expires": "2020-03-27T00:00:00Z" } }, "400": { From d7e619ae75a0cfc3e1d5055735e4d3bd2d44078c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 20:16:14 -0700 Subject: [PATCH 04/18] fix spelling --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index b1b37b193a50..92cade68c44e 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -209,7 +209,7 @@ "Translation" ], "summary": "Submit documents as a multipart/form-data POST message to the Microsoft hosted batch translation service.", - "description": "Content-Type: multipart/form-data; boundary=------------------------f09ba952eaa5d6f4\r\n \r\nContent-Type of each individual part or the filename will be used to determine the file type\r\n \r\nExample request:\r\ncurl -v -F document=@hi.txt;type=text/plain;filename=hello.txt -F document=@pl.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document;filename=mydoc.docx\r\n \r\nExample content types:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", + "description": "Content-Type: multipart/form-data; boundary=------------------------f09ba952eaa5d6f4\r\n \r\nContent-Type of each individual part or the filename will be used to determine the file type\r\n \r\nExample request:\r\ncurl -v -F document=@hi.txt;type=text/plain;filename=hello.txt -F document=@test.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document;filename=hello.docx\r\n \r\nExample content types:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", "operationId": "Single Document Upload", "consumes": [ "multipart/form-data" From 0092e4200ec799e0b68fa9e835f46dfd7a09513d Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:33:38 -0700 Subject: [PATCH 05/18] added x-ms-pageable, x-ms-error-response, x-ms-long-running --- .../Batch/preview/v1.0/TranslatorBatch.json | 247 +++++++----------- .../Batch/preview/v1.0/examples/post.json | 98 ------- 2 files changed, 89 insertions(+), 256 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index 92cade68c44e..8462b155acab 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -54,7 +54,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "401": { "description": "Unauthorized. Please check your credentials", @@ -63,7 +64,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -72,7 +74,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -81,7 +84,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -90,13 +94,18 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { "Batch Submit": { "$ref": "./examples/batch.json" } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "Operation-Location" } }, "get": { @@ -157,7 +166,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "401": { "description": "Unauthorized. Please check your credentials", @@ -166,7 +176,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -175,7 +186,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -184,7 +196,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -193,132 +206,17 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { "Get status for batch operations": { "$ref": "./examples/operations.json" } - } - } - }, - "/v1.0-preview.1/batches/hosted": { - "post": { - "tags": [ - "Translation" - ], - "summary": "Submit documents as a multipart/form-data POST message to the Microsoft hosted batch translation service.", - "description": "Content-Type: multipart/form-data; boundary=------------------------f09ba952eaa5d6f4\r\n \r\nContent-Type of each individual part or the filename will be used to determine the file type\r\n \r\nExample request:\r\ncurl -v -F document=@hi.txt;type=text/plain;filename=hello.txt -F document=@test.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document;filename=hello.docx\r\n \r\nExample content types:\r\ntext/plain for .txt files\r\napplication/vnd.openxmlformats-officedocument.wordprocessingml.document for .docx files\r\napplication/xliff+xml\" for .xlf files", - "operationId": "Single Document Upload", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "query", - "name": "SourceLanguage", - "description": "The language code of the original document\r\nIf none is specified, we will perform auto detect on the document", - "type": "string" - }, - { - "in": "query", - "name": "Category", - "description": "Category for the translation system (Optional)", - "type": "string" - }, - { - "in": "query", - "name": "TargetLanguage", - "description": "The language code for the documents to translate to", - "required": true, - "type": "string" - }, - { - "in": "formData", - "name": "document", - "description": "Documents to be uploaded to the Microsoft Hosted Batch Translation Services", - "type": "array", - "items": { - "format": "binary", - "type": "string" - } - } - ], - "responses": { - "202": { - "description": "Successful request and documents uploaded to the service", - "headers": { - "Location": { - "description": "Location to the Azure Blob Container containing the translated documents", - "type": "string", - "format": "" - }, - "Operation-Location": { - "description": "Location of the batch operation", - "type": "string", - "format": "" - }, - "Expires": { - "description": "Expiration of the Azure Blob Container", - "type": "string", - "format": "date-time" - } - } - }, - "400": { - "description": "Invalid request. Check input parameters", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" - } - }, - "401": { - "description": "Unauthorized. Please check your credentials", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } - }, - "500": { - "description": "Internal Server Error", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } - }, - "503": { - "description": "Server temporary unavailable", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } - } }, - "x-ms-examples": { - "Batch Hosted Submit": { - "$ref": "./examples/post.json" - } + "x-ms-pageable": { + "nextLinkName": "@nextLink" } } }, @@ -377,7 +275,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "404": { "description": "Resource is not found", @@ -386,7 +285,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -395,7 +295,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -404,7 +305,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -413,7 +315,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -470,7 +373,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "404": { "description": "Resource is not found", @@ -479,7 +383,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -488,7 +393,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -497,7 +403,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -506,7 +413,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -549,7 +457,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "404": { "description": "Resource is not found", @@ -558,7 +467,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -567,7 +477,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -576,7 +487,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -585,7 +497,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -662,7 +575,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InvalidRequest\",\r\n \"message\": \"Some argument is incorrect\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 400120,\r\n \"error\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "401": { "description": "Unauthorized. Please check your credentials", @@ -671,7 +585,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"User is not authorized\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 401000,\r\n \"error\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "404": { "description": "Resource is not found", @@ -680,7 +595,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 404000,\r\n \"error\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "429": { "description": "Too many requests", @@ -689,7 +605,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -698,7 +615,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -707,13 +625,17 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { "Get Documents Status for the operation batch id": { "$ref": "./examples/documents.json" } + }, + "x-ms-pageable": { + "nextLinkName": "@nextLink" } } }, @@ -742,7 +664,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -751,7 +674,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -760,7 +684,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -795,7 +720,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -804,7 +730,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -813,7 +740,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { @@ -848,7 +776,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User\\u0027s request rate is too high\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 429000,\r\n \"error\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "500": { "description": "Internal Server Error", @@ -857,7 +786,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 500000,\r\n \"error\": \"Internal Server Error\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true }, "503": { "description": "Server temporary unavailable", @@ -866,7 +796,8 @@ }, "examples": { "application/json": "{\r\n \"error\": {\r\n \"code\": \"ServiceUnavailable\",\r\n \"message\": \"Service is temporary unavailable\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": 503000,\r\n \"error\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" - } + }, + "x-ms-error-response": true } }, "x-ms-examples": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json deleted file mode 100644 index ec94f893d5ad..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/post.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "Content-Type": "multipart/form-data; boundary=------------------------f09ba952eaa5d6f", - "TargetLanguage": "fr", - "Category": "general", - "SourceLanguage": "es", - "document": [ - "--------------------------f64487c993479cd6\nContent-Disposition: form-data; name=\"document\"; filename=\"hello.docx\"\nContent-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document\nSystem.Byte[]" - ] - }, - "responses": { - "401": { - "headers": {}, - "body": { - "error": { - "code": "Unauthorized", - "message": "User is not authorized", - "target": "document", - "innerError": { - "code": 401000, - "error": "Unauthorized", - "message": "Operation is not authorized" - } - } - } - }, - "429": { - "headers": {}, - "body": { - "error": { - "code": "RequestRateTooHigh", - "message": "User's request rate is too high", - "target": "document", - "innerError": { - "code": 429000, - "error": "RateTooHigh", - "message": "Request rate is too high" - } - } - } - }, - "500": { - "headers": {}, - "body": { - "error": { - "code": "InternalServerError", - "message": "Internal Server Error", - "target": "document", - "innerError": { - "code": 500000, - "error": "Internal Server Error", - "message": "Unexpected internal server error has occurred" - } - } - } - }, - "503": { - "headers": {}, - "body": { - "error": { - "code": "ServiceUnavailable", - "message": "Service is temporary unavailable", - "target": "document", - "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", - "message": "Service is currently unavailable. Please try again later" - } - } - } - }, - "202": { - "headers": { - "location": "https://myblob.blob.core.windows.net/container?[SasToken]", - "Operation-Location": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0fa2822f-4c2a-4317-9c20-658c801e0e55", - "Expires": "2020-03-27T00:00:00Z" - } - }, - "400": { - "headers": {}, - "body": { - "error": { - "code": "InvalidRequest", - "message": "Some argument is incorrect", - "target": "document", - "innerError": { - "code": 400125, - "error": "InvalidTargetLanguage", - "message": "Target Language is invalid or not supported" - } - } - } - } - } -} From 9b151db35fc574a95271e8ef61aaf8e6ebd32a77 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:40:36 -0700 Subject: [PATCH 06/18] fix enum --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index 8462b155acab..581f96dcc726 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -105,7 +105,7 @@ }, "x-ms-long-running-operation": true, "x-ms-long-running-operation-options": { - "final-state-via": "Operation-Location" + "final-state-via": "location" } }, "get": { From 570fe6269680b18185b87b4c9686cb0f9ce06ab9 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:48:23 -0700 Subject: [PATCH 07/18] remove long running operation --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index 581f96dcc726..cc823be009e9 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -102,10 +102,6 @@ "Batch Submit": { "$ref": "./examples/batch.json" } - }, - "x-ms-long-running-operation": true, - "x-ms-long-running-operation-options": { - "final-state-via": "location" } }, "get": { From 025b8758f3b4fbeaa4c623645bdc600895c6e86b Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 07:59:15 -0700 Subject: [PATCH 08/18] bug in sdk go generation --- .../TranslatorText/Batch/readme.go.md | 20 ------------------- .../data-plane/TranslatorText/Batch/readme.md | 5 ----- 2 files changed, 25 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md deleted file mode 100644 index c804a0e4a28a..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md +++ /dev/null @@ -1,20 +0,0 @@ -## Go - -These settings apply only when `--go` is specified on the command line. - -``` yaml $(go) -go: - license-header: MICROSOFT_APACHE_NO_VERSION - namespace: translation.batch - clear-output-folder: true -``` - - -### Tag: release_1_0_review and go - -These settings apply only when `--tag=release_1_0_preview --go` is specified on the command line. -Please also specify `--go-sdk-folder=`. - -``` yaml $(tag) == 'release_1_0_preview' && $(go) -output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0.preview/$(namespace) -``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md index 542cd1f8ef08..130bad930867 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md @@ -45,7 +45,6 @@ This is not used by Autorest itself. swagger-to-sdk: - repo: azure-sdk-for-python - repo: azure-sdk-for-java - - repo: azure-sdk-for-go - repo: azure-sdk-for-js - repo: azure-sdk-for-node - repo: azure-sdk-for-ruby @@ -96,10 +95,6 @@ python: output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch ``` -## Go - -See configuration in [readme.go.md](./readme.go.md) - ## Java These settings apply only when `--java` is specified on the command line. From 025df672db6e5b6e602da0d768a539e1bc04a845 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:08:31 -0700 Subject: [PATCH 09/18] Revert "bug in sdk go generation" This reverts commit 025b8758f3b4fbeaa4c623645bdc600895c6e86b. --- .../TranslatorText/Batch/readme.go.md | 20 +++++++++++++++++++ .../data-plane/TranslatorText/Batch/readme.md | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md new file mode 100644 index 000000000000..c804a0e4a28a --- /dev/null +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md @@ -0,0 +1,20 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +``` yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: translation.batch + clear-output-folder: true +``` + + +### Tag: release_1_0_review and go + +These settings apply only when `--tag=release_1_0_preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'release_1_0_preview' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0.preview/$(namespace) +``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md index 130bad930867..542cd1f8ef08 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md @@ -45,6 +45,7 @@ This is not used by Autorest itself. swagger-to-sdk: - repo: azure-sdk-for-python - repo: azure-sdk-for-java + - repo: azure-sdk-for-go - repo: azure-sdk-for-js - repo: azure-sdk-for-node - repo: azure-sdk-for-ruby @@ -95,6 +96,10 @@ python: output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch ``` +## Go + +See configuration in [readme.go.md](./readme.go.md) + ## Java These settings apply only when `--java` is specified on the command line. From 654bb2caed21e3ef80bc1dbb58dac73c041d61f5 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:51:51 -0700 Subject: [PATCH 10/18] remove x-ms-pageable --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index cc823be009e9..755f1d6503b6 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -210,9 +210,6 @@ "Get status for batch operations": { "$ref": "./examples/operations.json" } - }, - "x-ms-pageable": { - "nextLinkName": "@nextLink" } } }, @@ -629,9 +626,6 @@ "Get Documents Status for the operation batch id": { "$ref": "./examples/documents.json" } - }, - "x-ms-pageable": { - "nextLinkName": "@nextLink" } } }, From 894932fea03122262a2ce29d42fe644f3af95780 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:44:27 -0700 Subject: [PATCH 11/18] addressed changes --- .../Batch/preview/v1.0/TranslatorBatch.json | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index 755f1d6503b6..e40ec7b267ca 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -1,14 +1,9 @@ { "swagger": "2.0", "info": { - "title": "Batch Document Translation API", + "title": "Batch Document Translation Client", "version": "v1.0-preview.1" }, - "host": "westus2.cognitiveservices.azure.com", - "basePath": "/translator/text/document", - "schemes": [ - "https" - ], "paths": { "/v1.0-preview.1/batches": { "post": { @@ -17,7 +12,7 @@ ], "summary": "Submit a batch document translation request to the translation service", "description": "Submit a batch request to the document translation service.\r\n \r\nEach request can consists of multiple inputs.\r\nEach input will contains both a source and destination container for source and target language pair.\r\n \r\nThe prefix and suffix filter (if supplied) will be used to filter the folders.\r\nThe prefix will be applied to the subpath after the container name\r\n \r\nGlossaries / Translation memory can be supplied and will be applied when the document is being translated.\r\nIf the glossary is invalid or unreachable during translation time. An error will be indicated in the document status.\r\n \r\nIf the file with the same name already exists in the destination, it will be overwritten.\r\nTargetUrl for each target language needs to be unique.", - "operationId": "Batch Documents Submit", + "operationId": "Translation_SubmitBatchRequest", "consumes": [ "application/json", "text/json", @@ -110,7 +105,7 @@ ], "summary": "Returns the list of operations submitted and their summary status", "description": "Returns the list of status of the translation batch operation.\r\nThe list will consist only of the batch request submitted by the user (based on their subscription)\r\n \r\nThe operation status are sorted by the operation Id\r\n \r\nIf the number of operations exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", - "operationId": "Get status of operation list", + "operationId": "Translation_GetOperations", "produces": [ "application/json" ], @@ -220,7 +215,7 @@ ], "summary": "Returns the status of the specific document", "description": "Returns the status of the translation of the document.", - "operationId": "Get Document Status", + "operationId": "Translation_GetDocumentStatus", "produces": [ "application/json" ], @@ -326,7 +321,7 @@ ], "summary": "Returns the status of the batch translation operation", "description": "Returns the status of the translation batch operation.\r\nThe status will include the overall job status as well as a summary of the current progress of all the documents being translated.", - "operationId": "Get Operation Status", + "operationId": "Translation_GetOperationStatus", "produces": [ "application/json" ], @@ -422,7 +417,7 @@ ], "summary": "Cancel a currently processing or queued operation.", "description": "Cancel a currently processing or queued operation.\r\nAn operation will not be cancelled if it is already completed or failed or cancelling. A bad request will be returned.\r\nAll documents that have completed translation will not be cancelled and will be charged.\r\nAll pending documents will be cancelled if possible.", - "operationId": "cancel batch operation", + "operationId": "Translation_CancelOperation", "produces": [ "application/json" ], @@ -508,7 +503,7 @@ ], "summary": "Returns the status of the documents of a translation batch operation", "description": "Returns the status of the list of documents translation operation by a given operation id.\r\n \r\nThe documents are sorted by the document Id\r\n \r\nIf the number of documents exceed our paging limit, server side paging will be used.\r\nPaginated responses will indicate a partial result by including a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\nClients MAY use $top and $skip query parameters to specify a number of results to return and an offset into the collection.\r\nThe server will honor the values specified by the client; however, clients MUST be prepared to handle responses that contain a different page size or contain a continuation token.\r\nWhen both $top and $skip are given by a client, the server SHOULD first apply $skip and then $top on the collection.\r\nNote: If the server can't honor $top and/or $skip, the server MUST return an error to the client informing about it instead of just ignoring the query options. This will avoid the risk of the client making assumptions about the data returned.", - "operationId": "Get Detailed Document Status for a given operation id", + "operationId": "Translation_GetOperationDocumentsStatus", "produces": [ "application/json" ], @@ -636,7 +631,7 @@ ], "summary": "Returns the list of supported document formats", "description": "The list of supported document formats supported by our service.\r\nThe list will include the common file extension used and supported as well as the content-type if using the upload API.", - "operationId": "Get Document Formats", + "operationId": "Translation_GetDocumentFormats", "produces": [ "application/json" ], @@ -692,7 +687,7 @@ ], "summary": "Returns the list of supported document formats", "description": "The list of supported glossary formats supported by our service.\r\nThe list will include the common file extension used.", - "operationId": "Get Glossary Formats", + "operationId": "Translation_GetGlossaryFormats", "produces": [ "application/json" ], @@ -748,7 +743,7 @@ ], "summary": "Returns the list of supported storage sources", "description": "The list of storage sources supported by our service.", - "operationId": "Get storage sources that we currently support", + "operationId": "Translation_GetDocumentStorageSource", "produces": [ "application/json" ], @@ -1268,5 +1263,19 @@ { "subscription_key": [] } - ] + ], + "x-ms-parameterized-host": { + "HostTemplate": "{Endpoint}/translator/text/document/v1.0-preview.1", + "UseSchemePrefix": false, + "Parameters": [ + { + "in": "path", + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "required": true, + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + ] + } } From 443c5baafeb831bdb939d70e93923459f952e6c1 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:56:29 -0700 Subject: [PATCH 12/18] fix casing for x-ms-parameterized-host --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index e40ec7b267ca..eabab4de07a9 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -1265,9 +1265,9 @@ } ], "x-ms-parameterized-host": { - "HostTemplate": "{Endpoint}/translator/text/document/v1.0-preview.1", - "UseSchemePrefix": false, - "Parameters": [ + "hostTemplate": "{Endpoint}/translator/text/document/v1.0-preview.1", + "useSchemePrefix": false, + "parameters": [ { "in": "path", "name": "Endpoint", From d5207a5315d4d66665ebdf651de77f6fffc4cafb Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 13:01:37 -0700 Subject: [PATCH 13/18] fix endpoint in examples --- .../TranslatorText/Batch/preview/v1.0/TranslatorBatch.json | 5 +++-- .../TranslatorText/Batch/preview/v1.0/examples/batch.json | 2 ++ .../TranslatorText/Batch/preview/v1.0/examples/cancel.json | 2 ++ .../TranslatorText/Batch/preview/v1.0/examples/document.json | 2 ++ .../Batch/preview/v1.0/examples/documents.json | 2 ++ .../TranslatorText/Batch/preview/v1.0/examples/format.json | 4 +++- .../TranslatorText/Batch/preview/v1.0/examples/glossary.json | 4 +++- .../Batch/preview/v1.0/examples/operation.json | 2 ++ .../Batch/preview/v1.0/examples/operations.json | 4 +++- .../TranslatorText/Batch/preview/v1.0/examples/storage.json | 4 +++- 10 files changed, 25 insertions(+), 6 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json index eabab4de07a9..4736d8339ee2 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json @@ -1265,14 +1265,15 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{Endpoint}/translator/text/document/v1.0-preview.1", + "hostTemplate": "{endpoint}/translator/text/document/v1.0-preview.1", "useSchemePrefix": false, "parameters": [ { "in": "path", - "name": "Endpoint", + "name": "endpoint", "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", "required": true, + "type": "string", "x-ms-parameter-location": "client", "x-ms-skip-url-encoding": true } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json index e63bfd4bd4af..f4c0fe1c1c19 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json @@ -3,6 +3,8 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", "batchRequest": { "inputs": [ { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json index e3631a31abef..582b7c86043b 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json @@ -3,6 +3,8 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", "id": "727BF148-F327-47A0-9481-ABAE6362F11E" }, "responses": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json index f118e3570dda..0ba43466b7de 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json @@ -3,6 +3,8 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", "id": "727BF148-F327-47A0-9481-ABAE6362F11E", "documentId": 199800 }, diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json index b4e733738b33..cdb8df766ea7 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json @@ -3,6 +3,8 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", "id": "727BF148-F327-47A0-9481-ABAE6362F11E", "$top": 5, "$skip": 10 diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json index e89018779748..66452ed6c1a9 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json @@ -2,7 +2,9 @@ "parameters": { "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup" + "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" }, "responses": { "429": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json index 2672567144e8..6c8fd7d5af2b 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json @@ -2,7 +2,9 @@ "parameters": { "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup" + "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" }, "responses": { "429": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json index 249fd05f2703..88adf548729e 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json @@ -3,6 +3,8 @@ "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", "id": "727BF148-F327-47A0-9481-ABAE6362F11E" }, "responses": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json index 63edae21cf88..0bef1580c01f 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json @@ -2,7 +2,9 @@ "parameters": { "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup" + "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" }, "responses": { "401": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json index 215c22b81f59..309b22d92b7e 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json @@ -2,7 +2,9 @@ "parameters": { "api-version": "v1.0-preview.1", "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup" + "resourceGroupName": "TestResourceGroup", + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}" }, "responses": { "429": { From af3037add7e51205bce0bd650ca0a8283bf68b0c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:25:12 -0700 Subject: [PATCH 14/18] move everything in the same SDK readme file --- .../TranslatorText/Batch/readme.go.md | 20 --- .../data-plane/TranslatorText/Batch/readme.md | 118 ------------------ .../TranslatorText/Batch/readme.nodejs.md | 14 --- .../TranslatorText/Batch/readme.ruby.md | 27 ---- .../TranslatorText/Batch/readme.typescript.md | 12 -- .../preview/v1.0/TranslatorBatch.json | 0 .../preview/v1.0/examples/batch.json | 0 .../preview/v1.0/examples/cancel.json | 0 .../preview/v1.0/examples/document.json | 0 .../preview/v1.0/examples/documents.json | 0 .../preview/v1.0/examples/format.json | 0 .../preview/v1.0/examples/glossary.json | 0 .../preview/v1.0/examples/operation.json | 0 .../preview/v1.0/examples/operations.json | 0 .../preview/v1.0/examples/storage.json | 0 .../data-plane/TranslatorText/readme.md | 44 ++++++- 16 files changed, 42 insertions(+), 193 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/TranslatorBatch.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/batch.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/cancel.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/document.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/documents.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/format.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/glossary.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/operation.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/operations.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/{Batch => }/preview/v1.0/examples/storage.json (100%) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md deleted file mode 100644 index c804a0e4a28a..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.go.md +++ /dev/null @@ -1,20 +0,0 @@ -## Go - -These settings apply only when `--go` is specified on the command line. - -``` yaml $(go) -go: - license-header: MICROSOFT_APACHE_NO_VERSION - namespace: translation.batch - clear-output-folder: true -``` - - -### Tag: release_1_0_review and go - -These settings apply only when `--tag=release_1_0_preview --go` is specified on the command line. -Please also specify `--go-sdk-folder=`. - -``` yaml $(tag) == 'release_1_0_preview' && $(go) -output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0.preview/$(namespace) -``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md deleted file mode 100644 index 542cd1f8ef08..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.md +++ /dev/null @@ -1,118 +0,0 @@ -# Cognitive Services Translation Batch SDK - -The Cognitive Service SDK has support for the Translation Batch Cognitive Service. -While this repository contains the [Autorest](https://aka.ms/autorest) generated SDK, the easiest way to consume the SDK is by installing the NuGet package for it. - -Note that the Cognitive Services Translation Batch SDK is simply a wrapper on top of the Translation Batch Cognitive service. As such, it will generate calls to the Azure service. - - -## Prerequisites -You must have a [Cognitive Services API account](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) with **Translation Batch API**. - -## Installing the NuGet SDK Package -1. Create a new Console solution in Visual Studio. -2. Right click on the solution and click **Manage NuGet Packages for Solution** -3. Mark the **Include Prerelease** checkbox. -4. Select the **Browse** tab, and Search for **Microsoft.Azure.CognitiveServices.Translation.Batch** -5. Select the NuGet package and install it. - -## Releases - -> see https://aka.ms/autorest - -The current preview release is `release_1_0_preview`. - -``` yaml -tag: release_1_0_preview -add-credentials: true -``` - -### Release 1.0-Preview - -These settings apply only when `--tag=release_1_0_preview` is specified on the command line. - -``` yaml $(tag) == 'release_1_0_preview' -input-file: preview/v1.0/TranslatorBatch.json -log-file: logs/log.txt -``` - -## Swagger to SDK - -This section describes what SDK should be generated by the automatic system. -This is not used by Autorest itself. - -``` yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-python - - repo: azure-sdk-for-java - - repo: azure-sdk-for-go - - repo: azure-sdk-for-js - - repo: azure-sdk-for-node - - repo: azure-sdk-for-ruby - after_scripts: - - bundle install && rake arm:regen_all_profiles['azure_cognitiveservices_translationbatch'] -``` - -## CSharp Settings - -These settings apply only when `--csharp` is specified on the command line. - -``` yaml $(csharp) -csharp: - sync-methods: None - license-header: MICROSOFT_MIT_NO_VERSION - azure-arm: false - namespace: Microsoft.Azure.CognitiveServices.Translation.Batch - output-folder: $(csharp-sdks-folder)/CognitiveServices/Translation.Batch/src/Generated - clear-output-folder: true -```` - -## Python - -These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. -Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. - -``` yaml $(python) -python-mode: create -python: - license-header: MICROSOFT_MIT_NO_VERSION - add-credentials: true - payload-flattening-threshold: 2 - namespace: azure.cognitiveservices.translation.batch - package-name: azure-cognitiveservices-translation.batch - clear-output-folder: true -``` - -``` yaml $(python) && $(python-mode) == 'update' -python: - no-namespace-folders: true - output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch/azure/cognitiveservices/translation/batch -``` - -``` yaml $(python) && $(python-mode) == 'create' -python: - basic-setup-py: true - output-folder: $(python-sdks-folder)/cognitiveservices/azure-cognitiveservices-translation-batch -``` - -## Go - -See configuration in [readme.go.md](./readme.go.md) - -## Java - -These settings apply only when `--java` is specified on the command line. -Please also specify `--azure-libraries-for-java-folder=`. - -``` yaml $(java) -java: - azure-arm: true - namespace: com.microsoft.azure.cognitiveservices.translation.batch - license-header: MICROSOFT_MIT_NO_CODEGEN - payload-flattening-threshold: 1 - output-folder: $(azure-libraries-for-java-folder)/cognitiveservices/data-plane/translation/batch - with-optional-parameters: true - with-single-async-method: true -``` - diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md deleted file mode 100644 index a85d3df66e43..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.nodejs.md +++ /dev/null @@ -1,14 +0,0 @@ -## Node.js - -These settings apply only when `--nodejs` is specified on the command line. -Please also specify `--node-sdks-folder=`. - -``` yaml $(nodejs) -nodejs: - package-name: azure-cognitiveservices-translation-batch - output-folder: $(node-sdks-folder)/lib/services/cognitiveServices/translation/batch - azure-arm: false - generate-license-txt: true - generate-package-json: true - generate-readme-md: false -``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md deleted file mode 100644 index 2fc5fb8e89ac..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.ruby.md +++ /dev/null @@ -1,27 +0,0 @@ -## Ruby - -These settings apply only when `--ruby` is specified on the command line. - -``` yaml -package-name: azure_cognitiveservices_translation_batch -package-version: "0.0.1" -azure-arm: true -``` - -### Ruby multi-api - -``` yaml $(ruby) && $(multiapi) -batch: - - tag: release_1_0_preview -``` - -### Tag: release_1_0_preview and ruby - -These settings apply only when `--tag=release_1_0_preview --ruby` is specified on the command line. -Please also specify `--ruby-sdks-folder=`. - -``` yaml $(tag) == 'release_1_0_preview' && $(ruby) -namespace: "Azure::CognitiveServices::Translation::Batch::V1_0" -output-folder: $(ruby-sdks-folder)/data/azure_cognitiveservices_translation_batch/lib -title: "TranslationBatchClient" -``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md b/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md deleted file mode 100644 index 21d62d40c7f4..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/Batch/readme.typescript.md +++ /dev/null @@ -1,12 +0,0 @@ -## TypeScript - -These settings apply only when `--typescript` is specified on the command line. -Please also specify `--typescript-sdks-folder=`. - -``` yaml $(typescript) -typescript: - package-name: "@azure/cognitiveservices-translation-batch" - output-folder: "$(typescript-sdks-folder)/sdk/cognitiveservices/cognitiveservices-translation-batch" - azure-arm: false - generate-metadata: true -``` diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/TranslatorBatch.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/batch.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/cancel.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/document.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/documents.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/format.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/glossary.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operation.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/operations.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/Batch/preview/v1.0/examples/storage.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/readme.md index 4e0143fa3acc..8c16a8931dbd 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/readme.md @@ -6,6 +6,8 @@ Configuration for generating Translator Text SDK. The current release is `release_3_0`. +The current document batch preview release is `preview_1_0` + ``` yaml tag: release_3_0 @@ -13,8 +15,21 @@ add-credentials: true openapi-type: data-plane ``` +``` yaml + +tag: preview_1_0 +add-credentials: true +openapi-type: data-plane +``` + # Releases +### Preview 1.0 +This setting is for batch document translator and only applied when `--tag=preview_1_0` is specified on the command line. +``` yaml $(tag) == 'preview_1_0' +input-file: preview/v1.0/TranslatorBatch.json +``` + ### Release 3.0 These settings apply only when `--tag=release_3_0` is specified on the command line. @@ -90,6 +105,15 @@ go: ``` yaml $(go) && $(multiapi) batch: - tag: release_3_0 + - tag: preview_1_0 +``` +### Tag: preview_1_0 and go + +These settings apply only when `--tag=preview_1_0 --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'preview_1_0' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/$(namespace) ``` ### Tag: release_3_0 and go @@ -120,8 +144,7 @@ java: ``` yaml $(nodejs) nodejs: - package-name: azure-cognitiveservices-newssearch - package-version: 3.0.0 + package-name: azure-cognitiveservices-translatortext output-folder: $(node-sdks-folder)/lib/services/translatorText azure-arm: false generate-license-txt: true @@ -129,6 +152,22 @@ nodejs: generate-readme-md: false ``` +### Tag: preview_1_0 and nodejs + +These settings apply only when `--tag=preview_1_0 --nodejs` is specified on the command line. + +``` yaml $(tag) == 'preview_1_0' && $(nodejs) + package-version: 1.0.0 +``` + +### Tag: release_3_0 and go + +These settings apply only when `--tag=release_3_0 --nodejs` is specified on the command line. + +``` yaml $(tag) == 'release_3_0' && $(nodejs) + package-version: 3.0.0 +``` + ## Multi-API/Profile support for AutoRest v3 generators AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. @@ -142,6 +181,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/v3.0/TranslatorText.json + - $(this-folder)/preview/v1.0/TranslatorBatch.json ``` From 29f82e0794a44ee980ca0cb6546b3a8918aa793b Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:47:30 -0700 Subject: [PATCH 15/18] change path to v1.0_preview.1 --- .../TranslatorBatch.json | 0 .../examples/batch.json | 0 .../examples/cancel.json | 0 .../examples/document.json | 0 .../examples/documents.json | 0 .../examples/format.json | 0 .../examples/glossary.json | 0 .../examples/operation.json | 0 .../examples/operations.json | 0 .../examples/storage.json | 0 .../data-plane/TranslatorText/readme.md | 28 +++++++++---------- 11 files changed, 14 insertions(+), 14 deletions(-) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/TranslatorBatch.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/batch.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/cancel.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/document.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/documents.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/format.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/glossary.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/operation.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/operations.json (100%) rename specification/cognitiveservices/data-plane/TranslatorText/preview/{v1.0 => v1.0-preview.1}/examples/storage.json (100%) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json similarity index 100% rename from specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json rename to specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/readme.md index 8c16a8931dbd..29381e287536 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/readme.md @@ -6,7 +6,7 @@ Configuration for generating Translator Text SDK. The current release is `release_3_0`. -The current document batch preview release is `preview_1_0` +The current document batch preview release is `release_1_0_preview.1'` ``` yaml @@ -17,7 +17,7 @@ openapi-type: data-plane ``` yaml -tag: preview_1_0 +tag: release_1_0_preview.1 add-credentials: true openapi-type: data-plane ``` @@ -25,8 +25,8 @@ openapi-type: data-plane # Releases ### Preview 1.0 -This setting is for batch document translator and only applied when `--tag=preview_1_0` is specified on the command line. -``` yaml $(tag) == 'preview_1_0' +This setting is for batch document translator and only applied when `--tag=release_1_0_preview.1` is specified on the command line. +``` yaml $(tag) == 'release_1_0_preview.1' input-file: preview/v1.0/TranslatorBatch.json ``` @@ -105,15 +105,15 @@ go: ``` yaml $(go) && $(multiapi) batch: - tag: release_3_0 - - tag: preview_1_0 + - tag: release_1_0_preview.1 ``` -### Tag: preview_1_0 and go +### Tag: release_1_0_preview.1 and go -These settings apply only when `--tag=preview_1_0 --go` is specified on the command line. +These settings apply only when `--tag=release_1_0_preview.1 --go` is specified on the command line. Please also specify `--go-sdk-folder=`. -``` yaml $(tag) == 'preview_1_0' && $(go) -output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/$(namespace) +``` yaml $(tag) == 'release_1_0_preview.1' && $(go) +output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0_preview.1/$(namespace) ``` ### Tag: release_3_0 and go @@ -152,12 +152,12 @@ nodejs: generate-readme-md: false ``` -### Tag: preview_1_0 and nodejs +### Tag: release_1_0_preview.1 and nodejs -These settings apply only when `--tag=preview_1_0 --nodejs` is specified on the command line. +These settings apply only when `--tag=release_1_0_preview.1 --nodejs` is specified on the command line. -``` yaml $(tag) == 'preview_1_0' && $(nodejs) - package-version: 1.0.0 +``` yaml $(tag) == 'release_1_0_preview.1' && $(nodejs) + package-version: 1.0.1 ``` ### Tag: release_3_0 and go @@ -181,7 +181,7 @@ require: $(this-folder)/../../../../profiles/readme.md # all the input files across all versions input-file: - $(this-folder)/stable/v3.0/TranslatorText.json - - $(this-folder)/preview/v1.0/TranslatorBatch.json + - $(this-folder)/preview/v1.0-preview.1/TranslatorBatch.json ``` From af0de27512d0c963f9700f4cf928f8058b4b4c9a Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:56:51 -0700 Subject: [PATCH 16/18] fix path --- .../cognitiveservices/data-plane/TranslatorText/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/readme.md index 29381e287536..45677271f008 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/readme.md @@ -27,7 +27,7 @@ openapi-type: data-plane ### Preview 1.0 This setting is for batch document translator and only applied when `--tag=release_1_0_preview.1` is specified on the command line. ``` yaml $(tag) == 'release_1_0_preview.1' -input-file: preview/v1.0/TranslatorBatch.json +input-file: preview/v1.0-preview.1/TranslatorBatch.json ``` ### Release 3.0 From e6b44d74397cfe1418b9cdbad57796508b81e720 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 14:09:01 -0700 Subject: [PATCH 17/18] dummy change to restart merge for a 502 server error on sdk generation --- .../cognitiveservices/data-plane/TranslatorText/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/readme.md b/specification/cognitiveservices/data-plane/TranslatorText/readme.md index 45677271f008..f6b28b8d49fe 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/readme.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/readme.md @@ -6,7 +6,7 @@ Configuration for generating Translator Text SDK. The current release is `release_3_0`. -The current document batch preview release is `release_1_0_preview.1'` +The current document batch preview release is `release_1_0_preview.1'`. ``` yaml From 77830f2d5ca44b79a98b484948e784d70efa20df Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 21 May 2020 12:52:53 -0700 Subject: [PATCH 18/18] fix batch json --- .../preview/v1.0-preview.1/TranslatorBatch.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json index 4736d8339ee2..abdf5f8a1425 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json @@ -5,7 +5,7 @@ "version": "v1.0-preview.1" }, "paths": { - "/v1.0-preview.1/batches": { + "/batches": { "post": { "tags": [ "Translation" @@ -208,7 +208,7 @@ } } }, - "/v1.0-preview.1/batches/{id}/documents/{documentId}": { + "/batches/{id}/documents/{documentId}": { "get": { "tags": [ "Translation" @@ -314,7 +314,7 @@ } } }, - "/v1.0-preview.1/batches/{id}": { + "/batches/{id}": { "get": { "tags": [ "Translation" @@ -496,7 +496,7 @@ } } }, - "/v1.0-preview.1/batches/{id}/documents": { + "/batches/{id}/documents": { "get": { "tags": [ "Translation" @@ -624,7 +624,7 @@ } } }, - "/v1.0-preview.1/documents/formats": { + "/documents/formats": { "get": { "tags": [ "Translation" @@ -680,7 +680,7 @@ } } }, - "/v1.0-preview.1/glossaries/formats": { + "/glossaries/formats": { "get": { "tags": [ "Translation" @@ -736,7 +736,7 @@ } } }, - "/v1.0-preview.1/storagesources": { + "/storagesources": { "get": { "tags": [ "Translation" @@ -1265,7 +1265,7 @@ } ], "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}/translator/text/document/v1.0-preview.1", + "hostTemplate": "{endpoint}/translator/text/batch/v1.0-preview.1", "useSchemePrefix": false, "parameters": [ {