From 003936ffed9258ab88b769d2221962a9c7360578 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 24 Apr 2020 13:17:58 -0700 Subject: [PATCH 01/77] Merged from master again --- .../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 + 16 files changed, 2654 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/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 03e9107e3d48b2d6d760551ec7153aa2499d981d Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 27 Apr 2020 15:56:24 -0700 Subject: [PATCH 02/77] 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 a46d5d6dc34b66cbe75e498d27ce1afa561d6719 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 19:52:05 -0700 Subject: [PATCH 03/77] 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 52542975b2593585a2b54be861c5b9da97426dbe Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 20:16:14 -0700 Subject: [PATCH 04/77] 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 f751d1153571196939d8dc67ef2789bdfe626fdf Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:33:38 -0700 Subject: [PATCH 05/77] 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 a377257c553e0e3f844e110c0c6be3832abf7a38 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:40:36 -0700 Subject: [PATCH 06/77] 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 608a9d48aeb9e78a071be5c2c16365bf0503f7fd Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:48:23 -0700 Subject: [PATCH 07/77] 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 08e7ef0fcc6c771fd4a9e6735638efaa2964a8ee Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 07:59:15 -0700 Subject: [PATCH 08/77] 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 ef1f2b2f779543d99d8f3e5276d1e5c90216249c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:08:31 -0700 Subject: [PATCH 09/77] 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 a416e02608f53cc2d69d3f50a4f3b3b209d5757d Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:51:51 -0700 Subject: [PATCH 10/77] 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 7f938562998a77b4778e132a362c00f179eceb20 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:44:27 -0700 Subject: [PATCH 11/77] 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 ca82cbe350c013b0292a55f63fbbdd452b46dd0e Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:56:29 -0700 Subject: [PATCH 12/77] 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 bf751b83a4c95254157d781841512d7a2e54c728 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 13:01:37 -0700 Subject: [PATCH 13/77] 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 e0d21e0d2aa43a93eb1942f6b5d6591858d409c3 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:25:12 -0700 Subject: [PATCH 14/77] 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 15 files changed, 191 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 From 583c3dbb4221f5b4608c88c612946f9e80310e05 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:47:30 -0700 Subject: [PATCH 15/77] change path to v1.0_preview.1 --- .../preview/v1.0/TranslatorBatch.json | 1282 ----------------- .../preview/v1.0/examples/batch.json | 120 -- .../preview/v1.0/examples/cancel.json | 104 -- .../preview/v1.0/examples/document.json | 104 -- .../preview/v1.0/examples/documents.json | 125 -- .../preview/v1.0/examples/format.json | 82 -- .../preview/v1.0/examples/glossary.json | 83 -- .../preview/v1.0/examples/operation.json | 107 -- .../preview/v1.0/examples/operations.json | 110 -- .../preview/v1.0/examples/storage.json | 63 - 10 files changed, 2180 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json deleted file mode 100644 index 4736d8339ee2..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json +++ /dev/null @@ -1,1282 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Batch Document Translation Client", - "version": "v1.0-preview.1" - }, - "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": "Translation_SubmitBatchRequest", - "consumes": [ - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "request details", - "schema": { - "$ref": "#/definitions/BatchSubmissionRequest" - } - } - ], - "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 batch 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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetOperations", - "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/BatchStatusResponse" - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get status for batch operations": { - "$ref": "./examples/operations.json" - } - } - } - }, - "/v1.0-preview.1/batches/{id}/documents/{documentId}": { - "get": { - "tags": [ - "Translation" - ], - "summary": "Returns the status of the specific document", - "description": "Returns the status of the translation of the document.", - "operationId": "Translation_GetDocumentStatus", - "produces": [ - "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 - uuid. The document id", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Document Status": { - "$ref": "./examples/document.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": "Translation_GetOperationStatus", - "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/BatchStatusDetail" - }, - "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\": \"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", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Batch 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": "Translation_CancelOperation", - "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/BatchStatusDetail" - } - }, - "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}" - }, - "x-ms-error-response": true - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Cancel a batch 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": "Translation_GetOperationDocumentsStatus", - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Documents Status for the operation batch 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": "Translation_GetDocumentFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetGlossaryFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetDocumentStorageSource", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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" - } - } - } - }, - "BatchSubmissionRequest": { - "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 - } - } - }, - "BatchStatusDetail": { - "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" - } - } - }, - "BatchStatusResponse": { - "description": "Document Status Response", - "type": "object", - "properties": { - "value": { - "description": "The summary status of individual operation", - "type": "array", - "items": { - "$ref": "#/definitions/BatchStatusDetail" - } - }, - "@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" - } - } - }, - "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", - "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" - }, - "error": { - "$ref": "#/definitions/ErrorV2" - }, - "progress": { - "format": "float", - "description": "Progress of the translation if available", - "maximum": 1, - "minimum": 0, - "type": "number", - "example": 0.5 - }, - "id": { - "format": "uuid", - "description": "Document Id", - "type": "string", - "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" - } - } - }, - "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" - } - } - } - }, - "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": [] - } - ], - "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, - "type": "string", - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - ] - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json deleted file mode 100644 index f4c0fe1c1c19..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "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/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json deleted file mode 100644 index 582b7c86043b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json deleted file mode 100644 index 0ba43466b7de..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json deleted file mode 100644 index cdb8df766ea7..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "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" - } - }, - "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/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json deleted file mode 100644 index 66452ed6c1a9..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json deleted file mode 100644 index 6c8fd7d5af2b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json deleted file mode 100644 index 88adf548729e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json deleted file mode 100644 index 0bef1580c01f..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json deleted file mode 100644 index 309b22d92b7e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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" - ] - } - } - } -} From 3f5a45998781904afd85c7b423d52ee9d3c9a5be Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 25 Aug 2020 09:48:08 -0700 Subject: [PATCH 16/77] add input type parameter for folder vs file --- .../preview/v1.0-preview.1/TranslatorBatch.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 abdf5f8a1425..a335724dfb36 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 @@ -824,7 +824,7 @@ "type": "object", "properties": { "sourceUrl": { - "description": "Location of the folder / container with your documents", + "description": "Location of the folder / container or single file with your documents", "type": "string", "example": "https://myblob.blob.core.windows.net/Container/" }, @@ -900,6 +900,14 @@ } } }, + "StorageInputType": { + "description": "Storage type of the input documents source string", + "enum": [ + "Folder", + "File" + ], + "type": "string" + }, "BatchRequest": { "description": "Definition for the input batch translation request", "required": [ @@ -917,6 +925,9 @@ "items": { "$ref": "#/definitions/TargetInput" } + }, + "storageType": { + "$ref": "#/definitions/StorageInputType" } } }, From 855ee7be36dea52f41e90561830c9e712e34b02a Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 24 Apr 2020 13:17:58 -0700 Subject: [PATCH 17/77] Merged from master again --- .../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 + 16 files changed, 2654 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/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 f79507f4b36b915c777b32a4a36c299c15cbd2c1 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 27 Apr 2020 15:56:24 -0700 Subject: [PATCH 18/77] 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 2d55fa4e3fb141cdcfdb76b82d6e7680b0f955cc Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 19:52:05 -0700 Subject: [PATCH 19/77] 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 615d6df285d495575a674d9e6a94e8e6a72608e4 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 20:16:14 -0700 Subject: [PATCH 20/77] 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 b57403ffe17cfbf6d938f92ba1717c40983c5cd6 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:33:38 -0700 Subject: [PATCH 21/77] 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 11967577bec4785da814d4b93062dffd56851313 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:40:36 -0700 Subject: [PATCH 22/77] 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 095f47e03da395063a0f376b404e077694622b2c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:48:23 -0700 Subject: [PATCH 23/77] 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 80f5423a5154eaa0778c33c2bca85e2427e05bcd Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 07:59:15 -0700 Subject: [PATCH 24/77] 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 0163acd51c6c9d0a5fed844b577aec409c01fdfd Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:08:31 -0700 Subject: [PATCH 25/77] 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 96cb962dc38117de8e1ea50c1a99b3a8ff53f19a Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:51:51 -0700 Subject: [PATCH 26/77] 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 f191e92ffa06e1274e6a957d73d763c85a505725 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:44:27 -0700 Subject: [PATCH 27/77] 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 b0ce5eee155cfe7d11710d720965e034ea651daf Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:56:29 -0700 Subject: [PATCH 28/77] 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 89c3d1437d507bd5c8fc3c23a8175f2da3cdb67e Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 13:01:37 -0700 Subject: [PATCH 29/77] 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 5d0eae0f0e1955a237560d41e9044adb5b88d336 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:25:12 -0700 Subject: [PATCH 30/77] 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 15 files changed, 191 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 From 4d301ece23d4f05803627e30ca24f028bb9304e0 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:47:30 -0700 Subject: [PATCH 31/77] change path to v1.0_preview.1 --- .../preview/v1.0/TranslatorBatch.json | 1282 ----------------- .../preview/v1.0/examples/batch.json | 120 -- .../preview/v1.0/examples/cancel.json | 104 -- .../preview/v1.0/examples/document.json | 104 -- .../preview/v1.0/examples/documents.json | 125 -- .../preview/v1.0/examples/format.json | 82 -- .../preview/v1.0/examples/glossary.json | 83 -- .../preview/v1.0/examples/operation.json | 107 -- .../preview/v1.0/examples/operations.json | 110 -- .../preview/v1.0/examples/storage.json | 63 - 10 files changed, 2180 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json deleted file mode 100644 index 4736d8339ee2..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json +++ /dev/null @@ -1,1282 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Batch Document Translation Client", - "version": "v1.0-preview.1" - }, - "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": "Translation_SubmitBatchRequest", - "consumes": [ - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "request details", - "schema": { - "$ref": "#/definitions/BatchSubmissionRequest" - } - } - ], - "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 batch 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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetOperations", - "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/BatchStatusResponse" - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get status for batch operations": { - "$ref": "./examples/operations.json" - } - } - } - }, - "/v1.0-preview.1/batches/{id}/documents/{documentId}": { - "get": { - "tags": [ - "Translation" - ], - "summary": "Returns the status of the specific document", - "description": "Returns the status of the translation of the document.", - "operationId": "Translation_GetDocumentStatus", - "produces": [ - "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 - uuid. The document id", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Document Status": { - "$ref": "./examples/document.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": "Translation_GetOperationStatus", - "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/BatchStatusDetail" - }, - "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\": \"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", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Batch 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": "Translation_CancelOperation", - "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/BatchStatusDetail" - } - }, - "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}" - }, - "x-ms-error-response": true - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Cancel a batch 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": "Translation_GetOperationDocumentsStatus", - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Documents Status for the operation batch 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": "Translation_GetDocumentFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetGlossaryFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetDocumentStorageSource", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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" - } - } - } - }, - "BatchSubmissionRequest": { - "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 - } - } - }, - "BatchStatusDetail": { - "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" - } - } - }, - "BatchStatusResponse": { - "description": "Document Status Response", - "type": "object", - "properties": { - "value": { - "description": "The summary status of individual operation", - "type": "array", - "items": { - "$ref": "#/definitions/BatchStatusDetail" - } - }, - "@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" - } - } - }, - "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", - "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" - }, - "error": { - "$ref": "#/definitions/ErrorV2" - }, - "progress": { - "format": "float", - "description": "Progress of the translation if available", - "maximum": 1, - "minimum": 0, - "type": "number", - "example": 0.5 - }, - "id": { - "format": "uuid", - "description": "Document Id", - "type": "string", - "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" - } - } - }, - "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" - } - } - } - }, - "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": [] - } - ], - "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, - "type": "string", - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - ] - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json deleted file mode 100644 index f4c0fe1c1c19..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "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/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json deleted file mode 100644 index 582b7c86043b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json deleted file mode 100644 index 0ba43466b7de..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json deleted file mode 100644 index cdb8df766ea7..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "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" - } - }, - "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/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json deleted file mode 100644 index 66452ed6c1a9..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json deleted file mode 100644 index 6c8fd7d5af2b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json deleted file mode 100644 index 88adf548729e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json deleted file mode 100644 index 0bef1580c01f..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json deleted file mode 100644 index 309b22d92b7e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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" - ] - } - } - } -} From 039be5c848f210fca994c3004e94a769eb9925e9 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:15:38 -0800 Subject: [PATCH 32/77] Update title of swagger page --- .../v1.0-preview.1/TranslatorBatch.json | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 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 36fc967f6fb5..869f84b7662e 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 @@ -8,7 +8,7 @@ "/batches": { "post": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Submit a document translation request to the Document Translation service", "description": "Use this API to submit a bulk (batch) translation request to the Document Translation service.\r\nEach request can contain multiple documents and must contain a source and destination container for each document.\r\n \r\nThe prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.\r\n \r\nGlossaries / Translation memory can be included in the request and are applied by the service when the document is translated.\r\n \r\nIf the glossary is invalid or unreachable during translation, an error is indicated in the document status.\r\nIf a file with the same name already exists at the destination, it will be overwritten. The targetUrl for each target language must be unique.", @@ -68,7 +68,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -101,7 +101,7 @@ }, "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns a list of batch requests submitted and the status for each request", "description": "Returns a list of batch requests submitted and the status for each request.\r\nThis list only contains batch requests submitted by the user (based on the subscription). The status for each request is sorted by id.\r\n \r\nIf the number of requests exceeds our paging limit, server-side paging is used. Paginated responses indicate a partial result and include a continuation token in the response.\r\nThe absence of a continuation token means that no additional pages are available.\r\n \r\n$top and $skip query parameters can be used to specify a number of results to return and an offset for the collection.\r\n \r\nThe server honors 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\n \r\nWhen both $top and $skip are included, 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.\r\nThis reduces the risk of the client making assumptions about the data returned.", @@ -176,7 +176,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -211,7 +211,7 @@ "/batches/{id}/documents/{documentId}": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns the status for a specific document", "description": "Returns the translation status for a specific document based on the request Id and document Id.", @@ -282,7 +282,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -317,7 +317,7 @@ "/batches/{id}": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns the status for a document translation request", "description": "Returns the status for a document translation request.\r\nThe status includes the overall request status, as well as the status for documents that are being translated as part of that request.", @@ -380,7 +380,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -413,7 +413,7 @@ }, "delete": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Cancel a currently processing or queued operation", "description": "Cancel a currently processing or queued operation.\r\nCancel 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.", @@ -464,7 +464,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -499,7 +499,7 @@ "/batches/{id}/documents": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns the status for all documents in a batch document translation request", "description": "Returns the status for all documents in a batch document translation request.\r\n \r\nThe documents included in the response are sorted by document Id in descending order. If the number of documents in the response exceeds our paging limit, server-side paging is used.\r\nPaginated responses indicate a partial result and include a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\n$top and $skip query parameters can be used to specify a number of results to return and an offset for the collection.\r\nThe server honors 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\n \r\nWhen both $top and $skip are included, 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.\r\nThis reduces the risk of the client making assumptions about the data returned.", @@ -592,7 +592,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -627,7 +627,7 @@ "/documents/formats": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns a list of supported document formats", "description": "The list of supported document formats supported by the Document Translation service.\r\nThe list includes the common file extension, as well as the content-type if using the upload API.", @@ -648,7 +648,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -683,7 +683,7 @@ "/glossaries/formats": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns the list of supported glossary formats", "description": "The list of supported glossary formats supported by the Document Translation service.\r\nThe list includes the common file extension used.", @@ -704,7 +704,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -739,7 +739,7 @@ "/storagesources": { "get": { "tags": [ - "Translation" + "Document Translation" ], "summary": "Returns a list of supported storage sources", "description": "Returns a list of storage sources/options supported by the Document Translation service.", @@ -760,7 +760,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -849,7 +849,7 @@ "type": "object", "properties": { "glossaryUrl": { - "description": "Location of the glossary. \r\nWe will use the file extension to extract the formatting 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", + "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" }, From 19723f03b266af1a38a4f724c9d9f532afbbeb08 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:21:40 -0800 Subject: [PATCH 33/77] update ' --- .../v1.0-preview.1/TranslatorBatch.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 869f84b7662e..9450b39e84ca 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 @@ -68,7 +68,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -176,7 +176,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -282,7 +282,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's 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 }, @@ -380,7 +380,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -464,7 +464,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -592,7 +592,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's 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 }, @@ -648,7 +648,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -704,7 +704,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -760,7 +760,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, From f4c5ef27d90847573a7b6277fe1bb1e8b6faf94c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:24:22 -0800 Subject: [PATCH 34/77] updating formating to formatting --- .../TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9450b39e84ca..2df2d76e0c60 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 @@ -849,7 +849,7 @@ "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", + "description": "Location of the glossary. \r\nWe will use the file extension to extract the formatting 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" }, From 2198fa4bb99eece84df031c4b4f0432ecbe72230 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 24 Apr 2020 13:17:58 -0700 Subject: [PATCH 35/77] Merged from master again --- .../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 + 16 files changed, 2654 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/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 b931af6a9d1e5f2bc8ed4d9391b99dfc255f9053 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 27 Apr 2020 15:56:24 -0700 Subject: [PATCH 36/77] 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 8f5253bff7c3befec38cff856b073e0108b89e8e Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 19:52:05 -0700 Subject: [PATCH 37/77] 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 0f7bca3771754f9b2ed4277b89f75e4007cdbd9b Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 20:16:14 -0700 Subject: [PATCH 38/77] 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 7a66430daad768db98c28155a7ab97902ff814f7 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:33:38 -0700 Subject: [PATCH 39/77] 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 e76d4e657d43da101dfb614fda9534e74200f340 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:40:36 -0700 Subject: [PATCH 40/77] 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 9604e7f05e7e76fecdddd35512df4bc0ce0890a3 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:48:23 -0700 Subject: [PATCH 41/77] 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 68e24e9e795c29d29a321b73233f73a3339bef85 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 07:59:15 -0700 Subject: [PATCH 42/77] 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 2a1f38053d55f85066df3b77f361db8657dcd9bf Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:08:31 -0700 Subject: [PATCH 43/77] 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 76f13b799db6207b93d35cbf3c84e1d4e4ddcae6 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:51:51 -0700 Subject: [PATCH 44/77] 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 cc5afd51de553f04fb8eaa15ea77ebb126b25ece Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:44:27 -0700 Subject: [PATCH 45/77] 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 19ccbbbc509f7baad532e3a9f824f8dded9db132 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:56:29 -0700 Subject: [PATCH 46/77] 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 b6144d8124855b6d86f08602ffa65a02837ac977 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 13:01:37 -0700 Subject: [PATCH 47/77] 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 97d67f7366ea41d33c08dce8b66aefbff7d39fd1 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:25:12 -0700 Subject: [PATCH 48/77] 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 15 files changed, 191 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 From 998e952bcf1fd74d15f218a4966c55de8f57e6ad Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:47:30 -0700 Subject: [PATCH 49/77] change path to v1.0_preview.1 --- .../preview/v1.0/TranslatorBatch.json | 1282 ----------------- .../preview/v1.0/examples/batch.json | 120 -- .../preview/v1.0/examples/cancel.json | 104 -- .../preview/v1.0/examples/document.json | 104 -- .../preview/v1.0/examples/documents.json | 125 -- .../preview/v1.0/examples/format.json | 82 -- .../preview/v1.0/examples/glossary.json | 83 -- .../preview/v1.0/examples/operation.json | 107 -- .../preview/v1.0/examples/operations.json | 110 -- .../preview/v1.0/examples/storage.json | 63 - 10 files changed, 2180 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json deleted file mode 100644 index 4736d8339ee2..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json +++ /dev/null @@ -1,1282 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Batch Document Translation Client", - "version": "v1.0-preview.1" - }, - "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": "Translation_SubmitBatchRequest", - "consumes": [ - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "request details", - "schema": { - "$ref": "#/definitions/BatchSubmissionRequest" - } - } - ], - "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 batch 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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetOperations", - "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/BatchStatusResponse" - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get status for batch operations": { - "$ref": "./examples/operations.json" - } - } - } - }, - "/v1.0-preview.1/batches/{id}/documents/{documentId}": { - "get": { - "tags": [ - "Translation" - ], - "summary": "Returns the status of the specific document", - "description": "Returns the status of the translation of the document.", - "operationId": "Translation_GetDocumentStatus", - "produces": [ - "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 - uuid. The document id", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Document Status": { - "$ref": "./examples/document.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": "Translation_GetOperationStatus", - "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/BatchStatusDetail" - }, - "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\": \"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", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Batch 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": "Translation_CancelOperation", - "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/BatchStatusDetail" - } - }, - "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}" - }, - "x-ms-error-response": true - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Cancel a batch 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": "Translation_GetOperationDocumentsStatus", - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Documents Status for the operation batch 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": "Translation_GetDocumentFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetGlossaryFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetDocumentStorageSource", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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" - } - } - } - }, - "BatchSubmissionRequest": { - "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 - } - } - }, - "BatchStatusDetail": { - "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" - } - } - }, - "BatchStatusResponse": { - "description": "Document Status Response", - "type": "object", - "properties": { - "value": { - "description": "The summary status of individual operation", - "type": "array", - "items": { - "$ref": "#/definitions/BatchStatusDetail" - } - }, - "@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" - } - } - }, - "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", - "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" - }, - "error": { - "$ref": "#/definitions/ErrorV2" - }, - "progress": { - "format": "float", - "description": "Progress of the translation if available", - "maximum": 1, - "minimum": 0, - "type": "number", - "example": 0.5 - }, - "id": { - "format": "uuid", - "description": "Document Id", - "type": "string", - "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" - } - } - }, - "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" - } - } - } - }, - "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": [] - } - ], - "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, - "type": "string", - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - ] - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json deleted file mode 100644 index f4c0fe1c1c19..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "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/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json deleted file mode 100644 index 582b7c86043b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json deleted file mode 100644 index 0ba43466b7de..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json deleted file mode 100644 index cdb8df766ea7..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "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" - } - }, - "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/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json deleted file mode 100644 index 66452ed6c1a9..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json deleted file mode 100644 index 6c8fd7d5af2b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json deleted file mode 100644 index 88adf548729e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json deleted file mode 100644 index 0bef1580c01f..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json deleted file mode 100644 index 309b22d92b7e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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" - ] - } - } - } -} From 14901e9e4da6471e7656dc08896d8f6b5ddffe29 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:15:38 -0800 Subject: [PATCH 50/77] Update title of swagger page --- .../v1.0-preview.1/TranslatorBatch.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 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 2df2d76e0c60..869f84b7662e 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 @@ -68,7 +68,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -176,7 +176,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -282,7 +282,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -380,7 +380,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -464,7 +464,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -592,7 +592,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -648,7 +648,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -704,7 +704,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -760,7 +760,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -849,7 +849,7 @@ "type": "object", "properties": { "glossaryUrl": { - "description": "Location of the glossary. \r\nWe will use the file extension to extract the formatting 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", + "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" }, From 3539e2e1c345856b7e528d944f151c81a9d41b26 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 24 Apr 2020 13:17:58 -0700 Subject: [PATCH 51/77] Merged from master again --- .../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 + 16 files changed, 2654 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/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 2acb3c0f42369c4c8d8837a640a922e289718f9b Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 27 Apr 2020 15:56:24 -0700 Subject: [PATCH 52/77] 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 bac7dce87e749a11b23c59d9e81a6861066b12be Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 19:52:05 -0700 Subject: [PATCH 53/77] 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 eb38aec830e6ecdd334231ff966b2ee1d4742d72 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 28 Apr 2020 20:16:14 -0700 Subject: [PATCH 54/77] 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 94039b33941931bb24a4b1b7a83688023125cef0 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:33:38 -0700 Subject: [PATCH 55/77] 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 6b8e8c5218c0ded3babd84f936bc77cf34395041 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:40:36 -0700 Subject: [PATCH 56/77] 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 426ea8223f7ba371fe6cfea7ac46487aca402e81 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 29 Apr 2020 19:48:23 -0700 Subject: [PATCH 57/77] 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 1960b3b72edc53124d86b88bea44529cbde2a485 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 07:59:15 -0700 Subject: [PATCH 58/77] 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 1e5bb7fa246e5daf01ea95ece4463107f974a318 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:08:31 -0700 Subject: [PATCH 59/77] 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 65e2ae4c3f9892654d50a0ed03de0fb992da659a Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 30 Apr 2020 08:51:51 -0700 Subject: [PATCH 60/77] 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 15ef4423e7828ca808bb46bbae8b6cc3d067ed7a Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:44:27 -0700 Subject: [PATCH 61/77] 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 38d2b86fdcbe7972d6fc7e0cd3b0bf87cc15df72 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 10:56:29 -0700 Subject: [PATCH 62/77] 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 43a2548d94f0885423a295d6df8545f4d1587009 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Tue, 5 May 2020 13:01:37 -0700 Subject: [PATCH 63/77] 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 422d29bceae11f1ae4eb685da36557a259c498cc Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:25:12 -0700 Subject: [PATCH 64/77] 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 15 files changed, 191 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 From 4eadb4db4b0da015a375e1fcbadf127a13555f86 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Wed, 20 May 2020 13:47:30 -0700 Subject: [PATCH 65/77] change path to v1.0_preview.1 --- .../preview/v1.0/TranslatorBatch.json | 1282 ----------------- .../preview/v1.0/examples/batch.json | 120 -- .../preview/v1.0/examples/cancel.json | 104 -- .../preview/v1.0/examples/document.json | 104 -- .../preview/v1.0/examples/documents.json | 125 -- .../preview/v1.0/examples/format.json | 82 -- .../preview/v1.0/examples/glossary.json | 83 -- .../preview/v1.0/examples/operation.json | 107 -- .../preview/v1.0/examples/operations.json | 110 -- .../preview/v1.0/examples/storage.json | 63 - 10 files changed, 2180 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json delete mode 100644 specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json deleted file mode 100644 index 4736d8339ee2..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/TranslatorBatch.json +++ /dev/null @@ -1,1282 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Batch Document Translation Client", - "version": "v1.0-preview.1" - }, - "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": "Translation_SubmitBatchRequest", - "consumes": [ - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "request details", - "schema": { - "$ref": "#/definitions/BatchSubmissionRequest" - } - } - ], - "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 batch 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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetOperations", - "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/BatchStatusResponse" - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get status for batch operations": { - "$ref": "./examples/operations.json" - } - } - } - }, - "/v1.0-preview.1/batches/{id}/documents/{documentId}": { - "get": { - "tags": [ - "Translation" - ], - "summary": "Returns the status of the specific document", - "description": "Returns the status of the translation of the document.", - "operationId": "Translation_GetDocumentStatus", - "produces": [ - "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 - uuid. The document id", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Document Status": { - "$ref": "./examples/document.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": "Translation_GetOperationStatus", - "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/BatchStatusDetail" - }, - "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\": \"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", - "schema": { - "$ref": "#/definitions/ErrorResponseV2" - }, - "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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Batch 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": "Translation_CancelOperation", - "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/BatchStatusDetail" - } - }, - "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}" - }, - "x-ms-error-response": true - }, - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Cancel a batch 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": "Translation_GetOperationDocumentsStatus", - "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\": \"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", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "x-ms-examples": { - "Get Documents Status for the operation batch 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": "Translation_GetDocumentFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetGlossaryFormats", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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": "Translation_GetDocumentStorageSource", - "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}" - }, - "x-ms-error-response": true - }, - "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}" - }, - "x-ms-error-response": true - }, - "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-error-response": true - } - }, - "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" - } - } - } - }, - "BatchSubmissionRequest": { - "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 - } - } - }, - "BatchStatusDetail": { - "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" - } - } - }, - "BatchStatusResponse": { - "description": "Document Status Response", - "type": "object", - "properties": { - "value": { - "description": "The summary status of individual operation", - "type": "array", - "items": { - "$ref": "#/definitions/BatchStatusDetail" - } - }, - "@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" - } - } - }, - "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", - "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" - }, - "error": { - "$ref": "#/definitions/ErrorV2" - }, - "progress": { - "format": "float", - "description": "Progress of the translation if available", - "maximum": 1, - "minimum": 0, - "type": "number", - "example": 0.5 - }, - "id": { - "format": "uuid", - "description": "Document Id", - "type": "string", - "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" - } - } - }, - "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" - } - } - } - }, - "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": [] - } - ], - "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, - "type": "string", - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - ] - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json deleted file mode 100644 index f4c0fe1c1c19..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/batch.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "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/preview/v1.0/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json deleted file mode 100644 index 582b7c86043b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/cancel.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json deleted file mode 100644 index 0ba43466b7de..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/document.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json deleted file mode 100644 index cdb8df766ea7..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/documents.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "parameters": { - "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 - }, - "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", - "progress": 0.1, - "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" - } - }, - "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/preview/v1.0/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json deleted file mode 100644 index 66452ed6c1a9..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/format.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json deleted file mode 100644 index 6c8fd7d5af2b..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/glossary.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json deleted file mode 100644 index 88adf548729e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operation.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "parameters": { - "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": { - "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/preview/v1.0/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json deleted file mode 100644 index 0bef1580c01f..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/operations.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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/preview/v1.0/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json deleted file mode 100644 index 309b22d92b7e..000000000000 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0/examples/storage.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "api-version": "v1.0-preview.1", - "subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", - "resourceGroupName": "TestResourceGroup", - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}" - }, - "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" - ] - } - } - } -} From 8d9a47f16b101a37ef03dddaf6487afcc0eb5f80 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:21:40 -0800 Subject: [PATCH 66/77] update ' --- .../v1.0-preview.1/TranslatorBatch.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 869f84b7662e..9450b39e84ca 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 @@ -68,7 +68,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -176,7 +176,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -282,7 +282,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's 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 }, @@ -380,7 +380,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -464,7 +464,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -592,7 +592,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's 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 }, @@ -648,7 +648,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -704,7 +704,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, @@ -760,7 +760,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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 }, From 18c4092c909723f888aa3cb99e01c555af462d2f Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 28 Jan 2021 16:24:22 -0800 Subject: [PATCH 67/77] updating formating to formatting --- .../TranslatorText/preview/v1.0-preview.1/TranslatorBatch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9450b39e84ca..2df2d76e0c60 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 @@ -849,7 +849,7 @@ "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", + "description": "Location of the glossary. \r\nWe will use the file extension to extract the formatting 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" }, From 62d890aca38f50abb307671dd54b144980c67904 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 11 Feb 2021 13:53:21 -0800 Subject: [PATCH 68/77] update swagger changes --- .../v1.0-preview.1/TranslatorBatch.json | 182 ++++++++++-------- .../v1.0-preview.1/examples/cancel.json | 3 +- .../v1.0-preview.1/examples/document.json | 3 +- .../v1.0-preview.1/examples/documents.json | 3 +- .../v1.0-preview.1/examples/operation.json | 3 +- .../v1.0-preview.1/examples/operations.json | 3 +- 6 files changed, 108 insertions(+), 89 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 2df2d76e0c60..0970c0116053 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 @@ -12,7 +12,7 @@ ], "summary": "Submit a document translation request to the Document Translation service", "description": "Use this API to submit a bulk (batch) translation request to the Document Translation service.\r\nEach request can contain multiple documents and must contain a source and destination container for each document.\r\n \r\nThe prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.\r\n \r\nGlossaries / Translation memory can be included in the request and are applied by the service when the document is translated.\r\n \r\nIf the glossary is invalid or unreachable during translation, an error is indicated in the document status.\r\nIf a file with the same name already exists at the destination, it will be overwritten. The targetUrl for each target language must be unique.", - "operationId": "Translation_SubmitBatchRequest", + "operationId": "DocumentTranslation_SubmitBatchRequest", "consumes": [ "application/json", "text/json", @@ -68,7 +68,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -105,7 +105,7 @@ ], "summary": "Returns a list of batch requests submitted and the status for each request", "description": "Returns a list of batch requests submitted and the status for each request.\r\nThis list only contains batch requests submitted by the user (based on the subscription). The status for each request is sorted by id.\r\n \r\nIf the number of requests exceeds our paging limit, server-side paging is used. Paginated responses indicate a partial result and include a continuation token in the response.\r\nThe absence of a continuation token means that no additional pages are available.\r\n \r\n$top and $skip query parameters can be used to specify a number of results to return and an offset for the collection.\r\n \r\nThe server honors 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\n \r\nWhen both $top and $skip are included, 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.\r\nThis reduces the risk of the client making assumptions about the data returned.", - "operationId": "Translation_GetOperations", + "operationId": "DocumentTranslation_GetOperations", "produces": [ "application/json" ], @@ -176,7 +176,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -215,7 +215,7 @@ ], "summary": "Returns the status for a specific document", "description": "Returns the translation status for a specific document based on the request Id and document Id.", - "operationId": "Translation_GetDocumentStatus", + "operationId": "DocumentTranslation_GetDocumentStatus", "produces": [ "application/json" ], @@ -282,7 +282,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -321,7 +321,7 @@ ], "summary": "Returns the status for a document translation request", "description": "Returns the status for a document translation request.\r\nThe status includes the overall request status, as well as the status for documents that are being translated as part of that request.", - "operationId": "Translation_GetOperationStatus", + "operationId": "DocumentTranslation_GetOperationStatus", "produces": [ "application/json" ], @@ -380,7 +380,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -417,7 +417,7 @@ ], "summary": "Cancel a currently processing or queued operation", "description": "Cancel a currently processing or queued operation.\r\nCancel 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": "Translation_CancelOperation", + "operationId": "DocumentTranslation_CancelOperation", "produces": [ "application/json" ], @@ -464,7 +464,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -503,7 +503,7 @@ ], "summary": "Returns the status for all documents in a batch document translation request", "description": "Returns the status for all documents in a batch document translation request.\r\n \r\nThe documents included in the response are sorted by document Id in descending order. If the number of documents in the response exceeds our paging limit, server-side paging is used.\r\nPaginated responses indicate a partial result and include a continuation token in the response. The absence of a continuation token means that no additional pages are available.\r\n \r\n$top and $skip query parameters can be used to specify a number of results to return and an offset for the collection.\r\nThe server honors 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\n \r\nWhen both $top and $skip are included, 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.\r\nThis reduces the risk of the client making assumptions about the data returned.", - "operationId": "Translation_GetOperationDocumentsStatus", + "operationId": "DocumentTranslation_GetOperationDocumentsStatus", "produces": [ "application/json" ], @@ -592,7 +592,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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\": \"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 }, @@ -631,7 +631,7 @@ ], "summary": "Returns a list of supported document formats", "description": "The list of supported document formats supported by the Document Translation service.\r\nThe list includes the common file extension, as well as the content-type if using the upload API.", - "operationId": "Translation_GetDocumentFormats", + "operationId": "DocumentTranslation_GetDocumentFormats", "produces": [ "application/json" ], @@ -648,7 +648,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -687,7 +687,7 @@ ], "summary": "Returns the list of supported glossary formats", "description": "The list of supported glossary formats supported by the Document Translation service.\r\nThe list includes the common file extension used.", - "operationId": "Translation_GetGlossaryFormats", + "operationId": "DocumentTranslation_GetGlossaryFormats", "produces": [ "application/json" ], @@ -704,7 +704,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -743,7 +743,7 @@ ], "summary": "Returns a list of supported storage sources", "description": "Returns a list of storage sources/options supported by the Document Translation service.", - "operationId": "Translation_GetDocumentStorageSource", + "operationId": "DocumentTranslation_GetDocumentStorageSource", "produces": [ "application/json" ], @@ -760,7 +760,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User's 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}" + "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 }, @@ -958,10 +958,76 @@ "Succeeded", "Failed", "Cancelled", - "Cancelling" + "Cancelling", + "ValidationFailed" ], "type": "string" }, + "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" + } + } + }, "StatusSummary": { "type": "object", "properties": { @@ -1000,6 +1066,11 @@ "description": "Number of cancelled", "type": "integer", "example": 0 + }, + "totalCharacterCharged": { + "format": "int64", + "description": "Total characters charged by the API", + "type": "integer" } } }, @@ -1034,6 +1105,9 @@ "status": { "$ref": "#/definitions/Status" }, + "error": { + "$ref": "#/definitions/ErrorV2" + }, "summary": { "$ref": "#/definitions/StatusSummary" } @@ -1057,71 +1131,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" - } - } - }, "DocumentStatusDetail": { "required": [ "createdDateTimeUtc", @@ -1177,6 +1186,11 @@ "description": "Document Id", "type": "string", "example": "1c7399a7-6913-4f20-bb43-e2fe2ba1a67d" + }, + "characterCharged": { + "format": "int64", + "description": "Character charged by the API", + "type": "integer" } } }, diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json index 582b7c86043b..edce3654ded4 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json @@ -96,7 +96,8 @@ "success": 9, "inProgress": 0, "notYetStarted": 0, - "cancelled": 0 + "cancelled": 0, + "totalCharacterCharged": 0 } } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json index 0ba43466b7de..f02565361708 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json @@ -97,7 +97,8 @@ "detectedLanguage": "en", "to": "fr", "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" + "id": "273622bd-835c-4946-9798-fd8f19f6bbf2", + "characterCharged": 0 } } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json index cdb8df766ea7..2e13670f1358 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json @@ -100,7 +100,8 @@ "detectedLanguage": "en", "to": "fr", "progress": 0.1, - "id": "273622bd-835c-4946-9798-fd8f19f6bbf2" + "id": "273622bd-835c-4946-9798-fd8f19f6bbf2", + "characterCharged": 0 } ], "@nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0.preview.1/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?$top=5&$skip=15" diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json index 88adf548729e..d8b26ee24424 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json @@ -99,7 +99,8 @@ "success": 9, "inProgress": 0, "notYetStarted": 0, - "cancelled": 0 + "cancelled": 0, + "totalCharacterCharged": 0 } } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json index 0bef1580c01f..643a28f38f17 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json @@ -85,7 +85,8 @@ "success": 9, "inProgress": 0, "notYetStarted": 0, - "cancelled": 0 + "cancelled": 0, + "totalCharacterCharged": 0 } } ] From 8587acdc8e066e9d7e8a6b0c516cbb58e57636c4 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 11 Feb 2021 13:57:46 -0800 Subject: [PATCH 69/77] fix ' --- .../v1.0-preview.1/TranslatorBatch.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 0970c0116053..bde36b508e5b 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 @@ -68,7 +68,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -176,7 +176,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -282,7 +282,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' 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 }, @@ -380,7 +380,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -464,7 +464,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -592,7 +592,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' 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 }, @@ -648,7 +648,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -704,7 +704,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, @@ -760,7 +760,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\": \"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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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 }, From 818fae7b070949223365a371f139bb54b13a1863 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Thu, 18 Feb 2021 10:36:02 -0800 Subject: [PATCH 70/77] added x-ms-enum --- .../v1.0-preview.1/TranslatorBatch.json | 62 ++++++++++++++++--- 1 file changed, 53 insertions(+), 9 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 bde36b508e5b..91ff01aca2d4 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 @@ -68,7 +68,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -176,7 +176,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -282,7 +282,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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\": \"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 }, @@ -380,7 +380,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -464,7 +464,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -592,7 +592,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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\": \"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 }, @@ -648,7 +648,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -704,7 +704,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -760,7 +760,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "examples": { - "application/json": "{\r\n \"error\": {\r\n \"code\": \"RequestRateTooHigh\",\r\n \"message\": \"User' 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}" + "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 }, @@ -1306,5 +1306,49 @@ "x-ms-skip-url-encoding": true } ] + }, + "x-ms-enum": { + "name": "ErrorCodeV2", + "modelAsString": true, + "values": [ + { + "value": "InvalidRequest" + }, + { + "value": "InvalidArgument" + }, + { + "value": "InternalServerError" + }, + { + "value": "ServiceUnavailable" + }, + { + "value": "ResourceNotFound" + }, + { + "value": "Unauthorized" + }, + { + "value": "RequestRateTooHigh" + } + ], + "name": "StorageInputType", + "modelAsString": true, + "values": [ + { + "value": "Folder" + }, + { + "value": "File" + } + ], + "name": "StorageSource", + "modelAsString": true, + "values": [ + { + "value": "AzureBlob" + } + ] } } From 34c4298df4ceb552ad571da2af7b89b0f9a7630d Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 19 Feb 2021 10:09:51 -0800 Subject: [PATCH 71/77] fix x-ms-enum, added a few more xmsextensions, remove go generation for preview --- .../v1.0-preview.1/TranslatorBatch.json | 155 +++++++++++------- .../data-plane/TranslatorText/readme.go.md | 10 -- 2 files changed, 100 insertions(+), 65 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 91ff01aca2d4..d68411424419 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 @@ -97,6 +97,10 @@ "Batch Submit": { "$ref": "./examples/batch.json" } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" } }, "get": { @@ -205,6 +209,9 @@ "Get status for batch operations": { "$ref": "./examples/operations.json" } + }, + "x-ms-pageable": { + "nextLinkName": "@nextLink" } } }, @@ -621,6 +628,9 @@ "Get Documents Status for the operation batch id": { "$ref": "./examples/documents.json" } + }, + "x-ms-pageable": { + "nextLinkName": "@nextLink" } } }, @@ -814,7 +824,16 @@ "enum": [ "AzureBlob" ], - "type": "string" + "type": "string", + "x-ms-enum": { + "name": "StorageSource", + "modelAsString": false, + "values": [ + { + "value": "AzureBlob" + } + ] + } }, "SourceInput": { "description": "Source of the input documents", @@ -909,7 +928,19 @@ "Folder", "File" ], - "type": "string" + "type": "string", + "x-ms-enum": { + "name": "StorageInputType", + "modelAsString": false, + "values": [ + { + "value": "Folder" + }, + { + "value": "File" + } + ] + } }, "BatchRequest": { "description": "Definition for the input batch translation request", @@ -961,7 +992,34 @@ "Cancelling", "ValidationFailed" ], - "type": "string" + "type": "string", + "x-ms-enum": { + "name": "Status", + "modelAsString": false, + "values": [ + { + "value": "NotStarted" + }, + { + "value": "Running" + }, + { + "value": "Succeeded" + }, + { + "value": "Failed" + }, + { + "value": "Cancelled" + }, + { + "value": "Cancelling" + }, + { + "value": "ValidationFailed" + } + ] + } }, "ErrorCodeV2": { "description": "Enums containing high level error codes.", @@ -974,27 +1032,56 @@ "Unauthorized", "RequestRateTooHigh" ], - "type": "string" + "type": "string", + "x-ms-enum": { + "name": "ErrorCodeV2", + "modelAsString": false, + "values": [ + { + "value": "InvalidRequest" + }, + { + "value": "InvalidArgument" + }, + { + "value": "InternalServerError" + }, + { + "value": "ServiceUnavailable" + }, + { + "value": "ResourceNotFound" + }, + { + "value": "Unauthorized" + }, + { + "value": "RequestRateTooHigh" + } + ] + } }, "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).", + "required": [ + "error", + "message" + ], "type": "object", "properties": { "code": { "format": "int32", - "description": "Gets detailed error code.", + "description": "Gets detailed error code.\r\nNot displayed to the user", "type": "integer", "readOnly": true }, "error": { "description": "Gets detailed error string.", - "type": "string", - "readOnly": true + "type": "string" }, "message": { "description": "Gets high level error message.", - "type": "string", - "readOnly": true + "type": "string" }, "target": { "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", @@ -1008,6 +1095,9 @@ }, "ErrorV2": { "description": "This contains an outer error with error code, message, details, target and an inner error with more descriptive details.", + "required": [ + "message" + ], "type": "object", "properties": { "code": { @@ -1015,8 +1105,7 @@ }, "message": { "description": "Gets high level error message.", - "type": "string", - "readOnly": true + "type": "string" }, "target": { "description": "Gets the source of the error. \r\nFor example it would be \"documents\" or \"document id\" in case of invalid document.", @@ -1306,49 +1395,5 @@ "x-ms-skip-url-encoding": true } ] - }, - "x-ms-enum": { - "name": "ErrorCodeV2", - "modelAsString": true, - "values": [ - { - "value": "InvalidRequest" - }, - { - "value": "InvalidArgument" - }, - { - "value": "InternalServerError" - }, - { - "value": "ServiceUnavailable" - }, - { - "value": "ResourceNotFound" - }, - { - "value": "Unauthorized" - }, - { - "value": "RequestRateTooHigh" - } - ], - "name": "StorageInputType", - "modelAsString": true, - "values": [ - { - "value": "Folder" - }, - { - "value": "File" - } - ], - "name": "StorageSource", - "modelAsString": true, - "values": [ - { - "value": "AzureBlob" - } - ] } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/readme.go.md b/specification/cognitiveservices/data-plane/TranslatorText/readme.go.md index b8ac4832c584..22c2a7d8b8de 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/readme.go.md +++ b/specification/cognitiveservices/data-plane/TranslatorText/readme.go.md @@ -14,16 +14,6 @@ go: ``` yaml $(go) && $(multiapi) batch: - tag: release_3_0 - - tag: release_1_0_preview.1 -``` - -### Tag: release_1_0_preview.1 and go - -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) == 'release_1_0_preview.1' && $(go) -output-folder: $(go-sdk-folder)/services/preview/cognitiveservices/v1.0_preview.1/$(namespace) ``` ### Tag: release_3_0 and go From fd2ba1add384ac6331a464f602e1638579ccaaff Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 19 Feb 2021 10:26:33 -0800 Subject: [PATCH 72/77] fix examples and error code --- .../v1.0-preview.1/TranslatorBatch.json | 119 ++++++++++-------- .../v1.0-preview.1/examples/batch.json | 20 +-- .../v1.0-preview.1/examples/cancel.json | 20 +-- .../v1.0-preview.1/examples/document.json | 21 ++-- .../v1.0-preview.1/examples/documents.json | 25 ++-- .../v1.0-preview.1/examples/format.json | 12 +- .../v1.0-preview.1/examples/glossary.json | 12 +- .../v1.0-preview.1/examples/operation.json | 20 +-- .../v1.0-preview.1/examples/operations.json | 20 +-- .../v1.0-preview.1/examples/storage.json | 12 +- 10 files changed, 149 insertions(+), 132 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 d68411424419..897ba3d784f1 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 @@ -48,7 +48,7 @@ "$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}" + "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 \"internalCode\": 400120,\r\n \"code\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -58,7 +58,7 @@ "$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}" + "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 \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -68,7 +68,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -78,7 +78,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -88,7 +88,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -160,7 +160,7 @@ "$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}" + "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 \"internalCode\": 400120,\r\n \"code\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -170,7 +170,7 @@ "$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}" + "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 \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -180,7 +180,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -190,7 +190,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -200,7 +200,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -269,7 +269,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -279,7 +279,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 404000,\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -289,7 +289,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -299,7 +299,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -309,7 +309,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -367,7 +367,7 @@ "$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}" + "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 \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -377,7 +377,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 404000,\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -387,7 +387,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -397,7 +397,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -407,7 +407,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -451,7 +451,7 @@ "$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}" + "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 \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -461,7 +461,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 404000,\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -471,7 +471,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -481,7 +481,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -491,7 +491,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -569,7 +569,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 400120,\r\n \"code\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -579,7 +579,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 401000,\r\n \"code\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -589,7 +589,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"id not found\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 404000,\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -599,7 +599,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -609,7 +609,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -619,7 +619,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\": \"document\",\r\n \"innerError\": {\r\n \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -658,7 +658,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -668,7 +668,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -678,7 +678,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -714,7 +714,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -724,7 +724,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -734,7 +734,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -770,7 +770,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\": \"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}" + "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 \"internalCode\": 429000,\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -780,7 +780,7 @@ "$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}" + "application/json": "{\r\n \"error\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Internal Server Error\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -790,7 +790,7 @@ "$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}" + "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 \"internalCode\": 503000,\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -1064,19 +1064,19 @@ "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).", "required": [ - "error", + "code", "message" ], "type": "object", "properties": { - "code": { + "internalCode": { "format": "int32", - "description": "Gets detailed error code.\r\nNot displayed to the user", + "description": "Gets detailed Internal error code.", "type": "integer", "readOnly": true }, - "error": { - "description": "Gets detailed error string.", + "code": { + "description": "Gets code error string.", "type": "string" }, "message": { @@ -1118,6 +1118,15 @@ } }, "StatusSummary": { + "required": [ + "cancelled", + "failed", + "inProgress", + "notYetStarted", + "success", + "total", + "totalCharacterCharged" + ], "type": "object", "properties": { "total": { @@ -1169,6 +1178,7 @@ "createdDateTimeUtc", "id", "lastActionDateTimeUtc", + "status", "summary" ], "type": "object", @@ -1204,6 +1214,9 @@ }, "BatchStatusResponse": { "description": "Document Status Response", + "required": [ + "value" + ], "type": "object", "properties": { "value": { @@ -1223,8 +1236,10 @@ "DocumentStatusDetail": { "required": [ "createdDateTimeUtc", + "id", "lastActionDateTimeUtc", "path", + "progress", "status", "to" ], @@ -1250,11 +1265,6 @@ "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" @@ -1285,6 +1295,9 @@ }, "DocumentStatusResponse": { "description": "Document Status Response", + "required": [ + "value" + ], "type": "object", "properties": { "value": { @@ -1334,6 +1347,9 @@ }, "FileFormatListResult": { "description": "Base type for List return in our api", + "required": [ + "value" + ], "type": "object", "properties": { "value": { @@ -1347,6 +1363,9 @@ }, "StorageSourceListResult": { "description": "Base type for List return in our api", + "required": [ + "value" + ], "type": "object", "properties": { "value": { diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json index 5a7fbc6e93b1..f515627ac191 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json @@ -50,8 +50,8 @@ "code": "Unauthorized", "message": "User is not authorized", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -64,8 +64,8 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -78,8 +78,8 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -92,8 +92,8 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -111,8 +111,8 @@ "code": "InvalidRequest", "message": "Some argument is incorrect", "innerError": { - "code": 400120, - "error": "SASTokenInvalid", + "internalCode": 400120, + "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json index edce3654ded4..21e246ac2e6e 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json @@ -16,8 +16,8 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -31,8 +31,8 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -46,8 +46,8 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -61,8 +61,8 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -76,8 +76,8 @@ "message": "id not found", "target": "Operation", "innerError": { - "code": 404000, - "error": "ResourceNotFound", + "internalCode": 404000, + "code": "ResourceNotFound", "message": "Resource requested is not found" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json index f02565361708..fbd08f6b2277 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json @@ -17,8 +17,8 @@ "message": "User is not authorized", "target": "Document", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -32,8 +32,8 @@ "message": "User's request rate is too high", "target": "Document", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -47,8 +47,8 @@ "message": "Internal Server Error", "target": "Document", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -62,8 +62,8 @@ "message": "Service is temporary unavailable", "target": "Document", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -77,8 +77,8 @@ "message": "id not found", "target": "Document", "innerError": { - "code": 404000, - "error": "ResourceNotFound", + "internalCode": 404000, + "code": "ResourceNotFound", "message": "Resource requested is not found" } } @@ -94,7 +94,6 @@ "createdDateTimeUtc": "2020-03-26T00:00:00Z", "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", "status": "Running", - "detectedLanguage": "en", "to": "fr", "progress": 0.1, "id": "273622bd-835c-4946-9798-fd8f19f6bbf2", diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json index 2e13670f1358..83bfbe58f184 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json @@ -18,8 +18,8 @@ "message": "User is not authorized", "target": "Document", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -33,8 +33,8 @@ "message": "User's request rate is too high", "target": "Document", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -48,8 +48,8 @@ "message": "Internal Server Error", "target": "Document", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -63,8 +63,8 @@ "message": "Service is temporary unavailable", "target": "Document", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -78,8 +78,8 @@ "message": "id not found", "target": "Document", "innerError": { - "code": 404000, - "error": "ResourceNotFound", + "internalCode": 404000, + "code": "ResourceNotFound", "message": "Resource requested is not found" } } @@ -97,7 +97,6 @@ "createdDateTimeUtc": "2020-03-26T00:00:00Z", "lastActionDateTimeUtc": "2020-03-26T01:00:00Z", "status": "Running", - "detectedLanguage": "en", "to": "fr", "progress": 0.1, "id": "273622bd-835c-4946-9798-fd8f19f6bbf2", @@ -115,8 +114,8 @@ "message": "Some argument is incorrect", "target": "Document", "innerError": { - "code": 400120, - "error": "SASTokenInvalid", + "internalCode": 400120, + "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json index 4189e8a56c31..a7e83b967d30 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json @@ -14,8 +14,8 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -28,8 +28,8 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -42,8 +42,8 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json index 4652c8c64b99..49acffe35690 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json @@ -14,8 +14,8 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -28,8 +28,8 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -42,8 +42,8 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json index d8b26ee24424..a352e7151565 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json @@ -16,8 +16,8 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -31,8 +31,8 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -46,8 +46,8 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -61,8 +61,8 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -76,8 +76,8 @@ "message": "id not found", "target": "Operation", "innerError": { - "code": 404000, - "error": "ResourceNotFound", + "internalCode": 404000, + "code": "ResourceNotFound", "message": "Resource requested is not found" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json index 643a28f38f17..46478c6e585b 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json @@ -15,8 +15,8 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "code": 401000, - "error": "Unauthorized", + "internalCode": 401000, + "code": "Unauthorized", "message": "Operation is not authorized" } } @@ -30,8 +30,8 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -45,8 +45,8 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -60,8 +60,8 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } @@ -100,8 +100,8 @@ "message": "Some argument is incorrect", "target": "Operation", "innerError": { - "code": 400120, - "error": "SASTokenInvalid", + "internalCode": 400120, + "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json index 309b22d92b7e..cd873cfee1ae 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json @@ -14,8 +14,8 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "code": 429000, - "error": "RateTooHigh", + "internalCode": 429000, + "code": "RateTooHigh", "message": "Request rate is too high" } } @@ -28,8 +28,8 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "code": 500000, - "error": "Internal Server Error", + "internalCode": 500000, + "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } } @@ -42,8 +42,8 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "code": 503000, - "error": "ServiceTemporaryUnavailable", + "internalCode": 503000, + "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } } From d8336663747eb3f7c8007554b4726a515d154310 Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 19 Feb 2021 10:31:22 -0800 Subject: [PATCH 73/77] add jsonignore to internalcode --- .../v1.0-preview.1/TranslatorBatch.json | 86 +++++++++---------- .../v1.0-preview.1/examples/batch.json | 5 -- .../v1.0-preview.1/examples/cancel.json | 5 -- .../v1.0-preview.1/examples/document.json | 5 -- .../v1.0-preview.1/examples/documents.json | 6 -- .../v1.0-preview.1/examples/format.json | 3 - .../v1.0-preview.1/examples/glossary.json | 3 - .../v1.0-preview.1/examples/operation.json | 5 -- .../v1.0-preview.1/examples/operations.json | 5 -- .../v1.0-preview.1/examples/storage.json | 3 - 10 files changed, 40 insertions(+), 86 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 897ba3d784f1..82b08c35a585 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 @@ -48,7 +48,7 @@ "$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 \"internalCode\": 400120,\r\n \"code\": \"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\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -58,7 +58,7 @@ "$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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -68,7 +68,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\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -78,7 +78,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -88,7 +88,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -160,7 +160,7 @@ "$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 \"internalCode\": 400120,\r\n \"code\": \"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\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -170,7 +170,7 @@ "$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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -180,7 +180,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\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -190,7 +190,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -200,7 +200,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -269,7 +269,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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -279,7 +279,7 @@ "$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 \"internalCode\": 404000,\r\n \"code\": \"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\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -289,7 +289,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 \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -299,7 +299,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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -309,7 +309,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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -367,7 +367,7 @@ "$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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -377,7 +377,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "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 \"internalCode\": 404000,\r\n \"code\": \"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\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -387,7 +387,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\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -397,7 +397,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -407,7 +407,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -451,7 +451,7 @@ "$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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -461,7 +461,7 @@ "$ref": "#/definitions/ErrorResponseV2" }, "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 \"internalCode\": 404000,\r\n \"code\": \"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\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -471,7 +471,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\": \"batch\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -481,7 +481,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -491,7 +491,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -569,7 +569,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 \"internalCode\": 400120,\r\n \"code\": \"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\": \"SASTokenInvalid\",\r\n \"message\": \"SAS token for storage is invalid\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -579,7 +579,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 \"internalCode\": 401000,\r\n \"code\": \"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\": \"Unauthorized\",\r\n \"message\": \"Operation is not authorized\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -589,7 +589,7 @@ "$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 \"internalCode\": 404000,\r\n \"code\": \"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\": \"ResourceNotFound\",\r\n \"message\": \"Resource requested is not found\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -599,7 +599,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 \"internalCode\": 429000,\r\n \"code\": \"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\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -609,7 +609,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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -619,7 +619,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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -658,7 +658,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\": \"format\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -668,7 +668,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -678,7 +678,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -714,7 +714,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\": \"format\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -724,7 +724,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -734,7 +734,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -770,7 +770,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\": \"source\",\r\n \"innerError\": {\r\n \"internalCode\": 429000,\r\n \"code\": \"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\": \"source\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -780,7 +780,7 @@ "$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 \"internalCode\": 500000,\r\n \"code\": \"InternalServerError\",\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\": \"source\",\r\n \"innerError\": {\r\n \"code\": \"InternalServerError\",\r\n \"message\": \"Unexpected internal server error has occurred\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -790,7 +790,7 @@ "$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 \"internalCode\": 503000,\r\n \"code\": \"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\": \"source\",\r\n \"innerError\": {\r\n \"code\": \"ServiceTemporaryUnavailable\",\r\n \"message\": \"Service is currently unavailable. Please try again later\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true } @@ -1069,12 +1069,6 @@ ], "type": "object", "properties": { - "internalCode": { - "format": "int32", - "description": "Gets detailed Internal error code.", - "type": "integer", - "readOnly": true - }, "code": { "description": "Gets code error string.", "type": "string" diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json index f515627ac191..7108552c493f 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/batch.json @@ -50,7 +50,6 @@ "code": "Unauthorized", "message": "User is not authorized", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -64,7 +63,6 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -78,7 +76,6 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -92,7 +89,6 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -111,7 +107,6 @@ "code": "InvalidRequest", "message": "Some argument is incorrect", "innerError": { - "internalCode": 400120, "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json index 21e246ac2e6e..0861cf840b0c 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/cancel.json @@ -16,7 +16,6 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -31,7 +30,6 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -46,7 +44,6 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -61,7 +58,6 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -76,7 +72,6 @@ "message": "id not found", "target": "Operation", "innerError": { - "internalCode": 404000, "code": "ResourceNotFound", "message": "Resource requested is not found" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json index fbd08f6b2277..f5f45731270f 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/document.json @@ -17,7 +17,6 @@ "message": "User is not authorized", "target": "Document", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -32,7 +31,6 @@ "message": "User's request rate is too high", "target": "Document", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -47,7 +45,6 @@ "message": "Internal Server Error", "target": "Document", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -62,7 +59,6 @@ "message": "Service is temporary unavailable", "target": "Document", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -77,7 +73,6 @@ "message": "id not found", "target": "Document", "innerError": { - "internalCode": 404000, "code": "ResourceNotFound", "message": "Resource requested is not found" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json index 83bfbe58f184..c92c6b7ecd02 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/documents.json @@ -18,7 +18,6 @@ "message": "User is not authorized", "target": "Document", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -33,7 +32,6 @@ "message": "User's request rate is too high", "target": "Document", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -48,7 +46,6 @@ "message": "Internal Server Error", "target": "Document", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -63,7 +60,6 @@ "message": "Service is temporary unavailable", "target": "Document", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -78,7 +74,6 @@ "message": "id not found", "target": "Document", "innerError": { - "internalCode": 404000, "code": "ResourceNotFound", "message": "Resource requested is not found" } @@ -114,7 +109,6 @@ "message": "Some argument is incorrect", "target": "Document", "innerError": { - "internalCode": 400120, "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json index a7e83b967d30..fe48785fe1ae 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/format.json @@ -14,7 +14,6 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -28,7 +27,6 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -42,7 +40,6 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json index 49acffe35690..ec73e440dbb8 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/glossary.json @@ -14,7 +14,6 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -28,7 +27,6 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -42,7 +40,6 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json index a352e7151565..8b00ce81f329 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operation.json @@ -16,7 +16,6 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -31,7 +30,6 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -46,7 +44,6 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -61,7 +58,6 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -76,7 +72,6 @@ "message": "id not found", "target": "Operation", "innerError": { - "internalCode": 404000, "code": "ResourceNotFound", "message": "Resource requested is not found" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json index 46478c6e585b..be97db209ed7 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/operations.json @@ -15,7 +15,6 @@ "message": "User is not authorized", "target": "Operation", "innerError": { - "internalCode": 401000, "code": "Unauthorized", "message": "Operation is not authorized" } @@ -30,7 +29,6 @@ "message": "User's request rate is too high", "target": "Operation", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -45,7 +43,6 @@ "message": "Internal Server Error", "target": "Operation", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -60,7 +57,6 @@ "message": "Service is temporary unavailable", "target": "Operation", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } @@ -100,7 +96,6 @@ "message": "Some argument is incorrect", "target": "Operation", "innerError": { - "internalCode": 400120, "code": "SASTokenInvalid", "message": "SAS token for storage is invalid" } diff --git a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json index cd873cfee1ae..3a3064ae73c1 100644 --- a/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json +++ b/specification/cognitiveservices/data-plane/TranslatorText/preview/v1.0-preview.1/examples/storage.json @@ -14,7 +14,6 @@ "code": "RequestRateTooHigh", "message": "User's request rate is too high", "innerError": { - "internalCode": 429000, "code": "RateTooHigh", "message": "Request rate is too high" } @@ -28,7 +27,6 @@ "code": "InternalServerError", "message": "Internal Server Error", "innerError": { - "internalCode": 500000, "code": "InternalServerError", "message": "Unexpected internal server error has occurred" } @@ -42,7 +40,6 @@ "code": "ServiceUnavailable", "message": "Service is temporary unavailable", "innerError": { - "internalCode": 503000, "code": "ServiceTemporaryUnavailable", "message": "Service is currently unavailable. Please try again later" } From d98e987c895723970807e2c1ffae82e33554f1bc Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 19 Feb 2021 11:06:56 -0800 Subject: [PATCH 74/77] fix quotes --- .../v1.0-preview.1/TranslatorBatch.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 82b08c35a585..cc7fd37399d2 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 @@ -68,7 +68,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\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -180,7 +180,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\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -289,7 +289,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\": \"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's request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -387,7 +387,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\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -471,7 +471,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\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"batch\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -599,7 +599,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\": \"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's request rate is too high\",\r\n \"target\": \"document\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -658,7 +658,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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -714,7 +714,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\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"format\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, @@ -770,7 +770,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\": \"source\",\r\n \"innerError\": {\r\n \"code\": \"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's request rate is too high\",\r\n \"target\": \"source\",\r\n \"innerError\": {\r\n \"code\": \"RateTooHigh\",\r\n \"message\": \"Request rate is too high\"\r\n }\r\n }\r\n}" }, "x-ms-error-response": true }, From 644d9f16bd4a1623a04f395a32c890649520633d Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Fri, 19 Feb 2021 11:10:44 -0800 Subject: [PATCH 75/77] modelasstring = true --- .../preview/v1.0-preview.1/TranslatorBatch.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 cc7fd37399d2..754fc38b80a1 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 @@ -827,7 +827,7 @@ "type": "string", "x-ms-enum": { "name": "StorageSource", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "AzureBlob" @@ -931,7 +931,7 @@ "type": "string", "x-ms-enum": { "name": "StorageInputType", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "Folder" @@ -995,7 +995,7 @@ "type": "string", "x-ms-enum": { "name": "Status", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "NotStarted" @@ -1035,7 +1035,7 @@ "type": "string", "x-ms-enum": { "name": "ErrorCodeV2", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "InvalidRequest" From 3b0e44206b8fa4d96246fc7bd45ac3bda0c2a78c Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 22 Feb 2021 08:50:54 -0800 Subject: [PATCH 76/77] update x-ms-enum name --- .../preview/v1.0-preview.1/TranslatorBatch.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 754fc38b80a1..21e59f34668c 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 @@ -826,7 +826,7 @@ ], "type": "string", "x-ms-enum": { - "name": "StorageSource", + "name": "StorageSourceEnum", "modelAsString": true, "values": [ { @@ -930,7 +930,7 @@ ], "type": "string", "x-ms-enum": { - "name": "StorageInputType", + "name": "StorageInputTypeEnum", "modelAsString": true, "values": [ { @@ -994,7 +994,7 @@ ], "type": "string", "x-ms-enum": { - "name": "Status", + "name": "StatusEnum", "modelAsString": true, "values": [ { @@ -1034,7 +1034,7 @@ ], "type": "string", "x-ms-enum": { - "name": "ErrorCodeV2", + "name": "ErrorCodeV2Enum", "modelAsString": true, "values": [ { From d2004283d021019747281afc573607f600f454cd Mon Sep 17 00:00:00 2001 From: Alex Cheng Date: Mon, 22 Feb 2021 08:59:39 -0800 Subject: [PATCH 77/77] Revert "update x-ms-enum name" This reverts commit 3b0e44206b8fa4d96246fc7bd45ac3bda0c2a78c. --- .../preview/v1.0-preview.1/TranslatorBatch.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 21e59f34668c..754fc38b80a1 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 @@ -826,7 +826,7 @@ ], "type": "string", "x-ms-enum": { - "name": "StorageSourceEnum", + "name": "StorageSource", "modelAsString": true, "values": [ { @@ -930,7 +930,7 @@ ], "type": "string", "x-ms-enum": { - "name": "StorageInputTypeEnum", + "name": "StorageInputType", "modelAsString": true, "values": [ { @@ -994,7 +994,7 @@ ], "type": "string", "x-ms-enum": { - "name": "StatusEnum", + "name": "Status", "modelAsString": true, "values": [ { @@ -1034,7 +1034,7 @@ ], "type": "string", "x-ms-enum": { - "name": "ErrorCodeV2Enum", + "name": "ErrorCodeV2", "modelAsString": true, "values": [ {