-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
Copy pathopenapi.json
328 lines (328 loc) · 10.2 KB
/
openapi.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
{
"swagger": "2.0",
"info": {
"title": "Azure.AI.DocumentTranslation",
"version": "2023-11-01-preview",
"x-typespec-generated": [
{
"emitter": "@azure-tools/typespec-autorest"
}
]
},
"schemes": [
"https"
],
"x-ms-parameterized-host": {
"hostTemplate": "{Endpoint}",
"useSchemePrefix": false,
"parameters": [
{
"name": "Endpoint",
"in": "path",
"description": "Supported document Translation endpoints (protocol and hostname, for example: https://{TranslatorResourceName}.cognitiveservices.azure.com/translator).",
"required": true,
"type": "string",
"format": "uri",
"x-ms-skip-url-encoding": true
}
]
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"security": [
{
"ApiKeyAuth": []
},
{
"OAuth2Auth": [
"https://cognitiveservices.azure.com/.default"
]
}
],
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"OAuth2Auth": {
"type": "oauth2",
"flow": "accessCode",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"https://cognitiveservices.azure.com/.default": ""
},
"tokenUrl": "https://login.microsoftonline.com/common/oauth2/token"
}
},
"tags": [],
"paths": {
"/document:translate": {
"post": {
"operationId": "DocumentTranslate",
"description": "API to translate a document.",
"produces": [
"application/octet-stream",
"application/json"
],
"consumes": [
"multipart/form-data"
],
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"$ref": "#/parameters/DocumentTranslateContent.sourceLanguage"
},
{
"$ref": "#/parameters/DocumentTranslateContent.targetLanguage"
},
{
"$ref": "#/parameters/DocumentTranslateContent.category"
},
{
"$ref": "#/parameters/DocumentTranslateContent.allowFallback"
},
{
"$ref": "#/parameters/Azure.Core.ClientRequestIdHeader"
},
{
"$ref": "#/parameters/DocumentTranslateContent.document"
},
{
"$ref": "#/parameters/DocumentTranslateContent.glossary"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"type": "file"
},
"headers": {
"x-ms-client-request-id": {
"type": "string",
"format": "uuid",
"description": "An opaque, globally-unique, client-generated string identifier for the request."
}
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse"
},
"headers": {
"x-ms-error-code": {
"type": "string",
"description": "String error code indicating what went wrong."
}
}
}
},
"x-ms-examples": {
"Document Translate": {
"$ref": "./examples/DocumentTranslate_MaximumSet_Gen.json"
}
}
}
}
},
"definitions": {
"Azure.Core.Foundations.Error": {
"type": "object",
"description": "The error object.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"message": {
"type": "string",
"description": "A human-readable representation of the error."
},
"target": {
"type": "string",
"description": "The target of the error."
},
"details": {
"type": "array",
"description": "An array of details about specific errors that led to this reported error.",
"items": {
"$ref": "#/definitions/Azure.Core.Foundations.Error"
},
"x-ms-identifiers": []
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "An object containing more specific information than the current object about the error."
}
},
"required": [
"code",
"message"
]
},
"Azure.Core.Foundations.ErrorResponse": {
"type": "object",
"description": "A response containing error details.",
"properties": {
"error": {
"$ref": "#/definitions/Azure.Core.Foundations.Error",
"description": "The error object."
}
},
"required": [
"error"
]
},
"Azure.Core.Foundations.InnerError": {
"type": "object",
"description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.",
"properties": {
"code": {
"type": "string",
"description": "One of a server-defined set of error codes."
},
"innererror": {
"$ref": "#/definitions/Azure.Core.Foundations.InnerError",
"description": "Inner error."
}
}
},
"DocumentTranslateContent": {
"type": "object",
"description": "Document Translate Request / Content.",
"properties": {
"document": {
"type": "string",
"format": "byte",
"description": "Document to be translated in the form"
},
"glossary": {
"type": "array",
"description": "Glossary / translation memory will be used during translation in the form.",
"items": {
"type": "string",
"format": "byte"
}
}
},
"required": [
"document"
]
},
"DocumentTranslateResult": {
"type": "object",
"description": "Document Translate Result / Response.",
"properties": {
"document": {
"type": "string",
"format": "byte",
"description": "Request response, response is a translated document."
}
},
"required": [
"document"
]
},
"Versions": {
"type": "string",
"description": "The Azure.AI.DocumentTranslation versions.",
"enum": [
"2023-11-01-preview"
],
"x-ms-enum": {
"name": "Versions",
"modelAsString": true,
"values": [
{
"name": "2023-11-01-preview",
"value": "2023-11-01-preview",
"description": "The 2023-11-01-preview version of the Azure.AI.DocumentTranslation."
}
]
}
}
},
"parameters": {
"Azure.Core.ClientRequestIdHeader": {
"name": "x-ms-client-request-id",
"in": "header",
"description": "An opaque, globally-unique, client-generated string identifier for the request.",
"required": false,
"type": "string",
"format": "uuid",
"x-ms-parameter-location": "method",
"x-ms-client-name": "clientRequestId"
},
"Azure.Core.Foundations.ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "The API version to use for this operation.",
"required": true,
"type": "string",
"minLength": 1,
"x-ms-parameter-location": "method",
"x-ms-client-name": "apiVersion"
},
"DocumentTranslateContent.allowFallback": {
"name": "allowFallback",
"in": "query",
"description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. \n Possible values are: true (default) or false.",
"required": false,
"type": "boolean",
"x-ms-parameter-location": "method"
},
"DocumentTranslateContent.category": {
"name": "category",
"in": "query",
"description": "A string specifying the category (domain) of the translation. This parameter is used to get translations \n from a customized system built with Custom Translator. Add the Category ID from your Custom Translator \n project details to this parameter to use your deployed customized system. Default value is: general.",
"required": false,
"type": "string",
"default": "general",
"x-ms-parameter-location": "method"
},
"DocumentTranslateContent.document": {
"name": "document",
"in": "formData",
"description": "Document to be translated in the form",
"required": true,
"type": "file",
"x-ms-parameter-location": "method"
},
"DocumentTranslateContent.glossary": {
"name": "glossary",
"in": "formData",
"description": "Glossary / translation memory will be used during translation in the form.",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "binary"
},
"x-ms-parameter-location": "method"
},
"DocumentTranslateContent.sourceLanguage": {
"name": "sourceLanguage",
"in": "query",
"description": "Specifies source language of the input document.\nIf this parameter isn't specified, automatic language detection is applied to determine the source language.\nFor example if the source document is written in English, then use sourceLanguage=en",
"required": false,
"type": "string",
"x-ms-parameter-location": "method"
},
"DocumentTranslateContent.targetLanguage": {
"name": "targetLanguage",
"in": "query",
"description": "Specifies the language of the output document.\nThe target language must be one of the supported languages included in the translation scope.\nFor example if you want to translate the document in German language, then use targetLanguage=de",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
}
}