-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
openapi.json
1466 lines (1466 loc) · 53.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"swagger": "2.0",
"info": {
"title": "Azure.AI.DocumentTranslation",
"version": "2024-05-01",
"description": "Document translation service",
"x-typespec-generated": [
{
"emitter": "@azure-tools/typespec-autorest"
}
]
},
"schemes": [
"https"
],
"x-ms-parameterized-host": {
"hostTemplate": "{endpoint}/translator",
"useSchemePrefix": false,
"parameters": [
{
"name": "endpoint",
"in": "path",
"description": "Supported document Translation endpoint, 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/batches": {
"get": {
"operationId": "DocumentTranslationOperations_GetTranslationsStatus",
"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\nrequest.\nThis list only contains batch requests submitted by the user (based on\nthe resource).\n \nIf the number of requests exceeds our paging limit,\nserver-side paging is used. Paginated responses indicate a partial result and\ninclude a continuation token in the response.\nThe absence of a continuation\ntoken means that no additional pages are available.\n \ntop, skip\nand maxpagesize query parameters can be used to specify a number of results to\nreturn and an offset for the collection.\n \ntop indicates the total\nnumber of records the user wants to be returned across all pages.\nskip\nindicates the number of records to skip from the list of batches based on the\nsorting method specified. By default, we sort by descending start\ntime.\nmaxpagesize is the maximum items returned in a page. If more items are\nrequested via top (or top is not specified and there are more items to be\nreturned), @nextLink will contain the link to the next page.\n \n\norderby query parameter can be used to sort the returned list (ex\n\"orderby=createdDateTimeUtc asc\" or \"orderby=createdDateTimeUtc\ndesc\").\nThe default sorting is descending by createdDateTimeUtc.\nSome query\nparameters can be used to filter the returned list (ex:\n\"status=Succeeded,Cancelled\") will only return succeeded and cancelled\noperations.\ncreatedDateTimeUtcStart and createdDateTimeUtcEnd can be used\ncombined or separately to specify a range of datetime to filter the returned\nlist by.\nThe supported filtering query parameters are (status, ids,\ncreatedDateTimeUtcStart, createdDateTimeUtcEnd).\n \nThe server honors\nthe values specified by the client. However, clients must be prepared to handle\nresponses that contain a different page size or contain a continuation token.\n \n \nWhen both top and skip are included, the server should first apply\nskip and then top on the collection.\nNote: If the server can't honor top\nand/or skip, the server must return an error to the client informing about it\ninstead of just ignoring the query options.\nThis reduces the risk of the client\nmaking assumptions about the data returned.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "top",
"in": "query",
"description": "top indicates the total number of records the user wants to be returned across\nall pages.\n \nClients MAY use top and skip query parameters to\nspecify a number of results to return and an offset into the collection.\nWhen\nboth top and skip are given by a client, the server SHOULD first apply skip\nand then top on the collection.\n \nNote: If the server can't honor\ntop and/or skip, the server MUST return an error to the client informing\nabout it instead of just ignoring the query options.",
"required": false,
"type": "integer",
"format": "int32",
"maximum": 2147483647
},
{
"name": "skip",
"in": "query",
"description": "skip indicates the number of records to skip from the list of records held by\nthe server based on the sorting method specified. By default, we sort by\ndescending start time.\n \nClients MAY use top and skip query\nparameters to specify a number of results to return and an offset into the\ncollection.\nWhen both top and skip are given by a client, the server SHOULD\nfirst apply skip and then top on the collection.\n \nNote: If the\nserver can't honor top and/or skip, the server MUST return an error to the\nclient informing about it instead of just ignoring the query options.",
"required": false,
"type": "integer",
"format": "int32",
"maximum": 2147483647
},
{
"name": "maxpagesize",
"in": "query",
"description": "maxpagesize is the maximum items returned in a page. If more items are\nrequested via top (or top is not specified and there are more items to be\nreturned), @nextLink will contain the link to the next page.\n \n\nClients MAY request server-driven paging with a specific page size by\nspecifying a maxpagesize preference. The server SHOULD honor this preference\nif the specified page size is smaller than the server's default page size.",
"required": false,
"type": "integer",
"format": "int32",
"default": 50,
"minimum": 1,
"maximum": 100
},
{
"name": "ids",
"in": "query",
"description": "Ids to use in filtering",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"collectionFormat": "csv"
},
{
"name": "statuses",
"in": "query",
"description": "Statuses to use in filtering",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
},
{
"name": "createdDateTimeUtcStart",
"in": "query",
"description": "the start datetime to get items after",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "createdDateTimeUtcEnd",
"in": "query",
"description": "the end datetime to get items before",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "orderby",
"in": "query",
"description": "the sorting query for the collection (ex: 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc')",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/TranslationsStatus"
}
},
"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": {
"Returns a list of batch requests submitted and the status for each request": {
"$ref": "./examples/operations.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
},
"post": {
"operationId": "DocumentTranslationOperations_StartTranslation",
"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\nTranslation service.\nEach request can contain multiple documents and must\ncontain a source and destination container for each document.\n \nThe\nprefix and suffix filter (if supplied) are used to filter folders. The prefix\nis applied to the subpath after the container name.\n \nGlossaries /\nTranslation memory can be included in the request and are applied by the\nservice when the document is translated.\n \nIf the glossary is\ninvalid or unreachable during translation, an error is indicated in the\ndocument status.\nIf a file with the same name already exists at the\ndestination, it will be overwritten. The targetUrl for each target language\nmust be unique.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"$ref": "#/parameters/StartTranslationBody"
}
],
"responses": {
"202": {
"description": "The request has been accepted for processing, but processing has not yet completed.",
"headers": {
"Operation-Location": {
"type": "string",
"description": "Link to the translation operation status"
}
}
},
"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": {
"Submit a document translation request to the Document Translation service": {
"$ref": "./examples/batch.json"
}
},
"x-ms-long-running-operation": true
}
},
"/document/batches/{id}": {
"get": {
"operationId": "DocumentTranslationOperations_GetTranslationStatus",
"summary": "Returns the status for a document translation request",
"description": "Returns the status for a document translation request.\nThe status includes the\noverall request status, as well as the status for documents that are being\ntranslated as part of that request.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "id",
"in": "path",
"description": "Format - uuid. The operation id",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/TranslationStatus"
}
},
"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": {
"Returns the status for a batch document translation request": {
"$ref": "./examples/operation.json"
}
}
},
"delete": {
"operationId": "DocumentTranslationOperations_CancelTranslation",
"summary": "Cancel a currently processing or queued translation",
"description": "Cancel a currently processing or queued translation.\nA translation will not be\ncancelled if it is already completed or failed or cancelling. A bad request\nwill be returned.\nAll documents that have completed translation will not be\ncancelled and will be charged.\nAll pending documents will be cancelled if\npossible.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "id",
"in": "path",
"description": "Format - uuid. The operation-id",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/TranslationStatus"
}
},
"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": {
"Cancel a currently processing or queued translation": {
"$ref": "./examples/cancel.json"
}
}
}
},
"/document/batches/{id}/documents": {
"get": {
"operationId": "DocumentTranslationOperations_GetDocumentsStatus",
"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.\n \n \nIf the number of documents in the response exceeds our paging limit,\nserver-side paging is used.\nPaginated responses indicate a partial result and\ninclude a continuation token in the response. The absence of a continuation\ntoken means that no additional pages are available.\n \ntop, skip\nand maxpagesize query parameters can be used to specify a number of results to\nreturn and an offset for the collection.\n \ntop indicates the total\nnumber of records the user wants to be returned across all pages.\nskip\nindicates the number of records to skip from the list of document status held\nby the server based on the sorting method specified. By default, we sort by\ndescending start time.\nmaxpagesize is the maximum items returned in a page. \nIf more items are requested via top (or top is not specified and there are\nmore items to be returned), @nextLink will contain the link to the next page.\n \n \norderby query parameter can be used to sort the returned list (ex\n\"orderby=createdDateTimeUtc asc\" or \"orderby=createdDateTimeUtc\ndesc\").\nThe default sorting is descending by createdDateTimeUtc.\nSome query\nparameters can be used to filter the returned list (ex:\n\"status=Succeeded,Cancelled\") will only return succeeded and cancelled\ndocuments.\ncreatedDateTimeUtcStart and createdDateTimeUtcEnd can be used\ncombined or separately to specify a range of datetime to filter the returned\nlist by.\nThe supported filtering query parameters are (status, ids,\ncreatedDateTimeUtcStart, createdDateTimeUtcEnd).\n \nWhen both top\nand skip are included, the server should first apply skip and then top on\nthe collection.\nNote: If the server can't honor top and/or skip, the server\nmust return an error to the client informing about it instead of just ignoring\nthe query options.\nThis reduces the risk of the client making assumptions about\nthe data returned.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "id",
"in": "path",
"description": "Format - uuid. The operation id",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "top",
"in": "query",
"description": "top indicates the total number of records the user wants to be returned across\nall pages.\n \nClients MAY use top and skip query parameters to\nspecify a number of results to return and an offset into the collection.\nWhen\nboth top and skip are given by a client, the server SHOULD first apply skip\nand then top on the collection.\n \nNote: If the server can't honor\ntop and/or skip, the server MUST return an error to the client informing\nabout it instead of just ignoring the query options.",
"required": false,
"type": "integer",
"format": "int32",
"maximum": 2147483647
},
{
"name": "skip",
"in": "query",
"description": "skip indicates the number of records to skip from the list of records held by\nthe server based on the sorting method specified. By default, we sort by\ndescending start time.\n \nClients MAY use top and skip query\nparameters to specify a number of results to return and an offset into the\ncollection.\nWhen both top and skip are given by a client, the server SHOULD\nfirst apply skip and then top on the collection.\n \nNote: If the\nserver can't honor top and/or skip, the server MUST return an error to the\nclient informing about it instead of just ignoring the query options.",
"required": false,
"type": "integer",
"format": "int32",
"maximum": 2147483647
},
{
"name": "maxpagesize",
"in": "query",
"description": "maxpagesize is the maximum items returned in a page. If more items are\nrequested via top (or top is not specified and there are more items to be\nreturned), @nextLink will contain the link to the next page.\n \n\nClients MAY request server-driven paging with a specific page size by\nspecifying a maxpagesize preference. The server SHOULD honor this preference\nif the specified page size is smaller than the server's default page size.",
"required": false,
"type": "integer",
"format": "int32",
"default": 50,
"minimum": 1,
"maximum": 100
},
{
"name": "ids",
"in": "query",
"description": "Ids to use in filtering",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "uuid"
},
"collectionFormat": "csv"
},
{
"name": "statuses",
"in": "query",
"description": "Statuses to use in filtering",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
},
{
"name": "createdDateTimeUtcStart",
"in": "query",
"description": "the start datetime to get items after",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "createdDateTimeUtcEnd",
"in": "query",
"description": "the end datetime to get items before",
"required": false,
"type": "string",
"format": "date-time"
},
{
"name": "orderby",
"in": "query",
"description": "the sorting query for the collection (ex: 'CreatedDateTimeUtc asc','CreatedDateTimeUtc desc')",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/DocumentsStatus"
}
},
"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": {
"Returns the status for all documents in a batch document translation request": {
"$ref": "./examples/documents.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/document/batches/{id}/documents/{documentId}": {
"get": {
"operationId": "DocumentTranslationOperations_GetDocumentStatus",
"summary": "Returns the status for a specific document",
"description": "Returns the translation status for a specific document based on the request Id\nand document Id.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "id",
"in": "path",
"description": "Format - uuid. The batch id",
"required": true,
"type": "string",
"format": "uuid"
},
{
"name": "documentId",
"in": "path",
"description": "Format - uuid. The document id",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/DocumentStatus"
}
},
"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": {
"Returns the status of a single document in a batch translation request": {
"$ref": "./examples/document.json"
}
}
}
},
"/document/formats": {
"get": {
"operationId": "DocumentTranslationOperations_GetSupportedFormats",
"summary": "Returns a list of supported document formats",
"description": "The list of supported formats supported by the Document Translation\nservice.\nThe list includes the common file extension, as well as the\ncontent-type if using the upload API.",
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"name": "type",
"in": "query",
"description": "the type of format like document or glossary ",
"required": false,
"type": "string",
"enum": [
"document",
"glossary"
],
"x-ms-enum": {
"name": "FileFormatType",
"modelAsString": true,
"values": [
{
"name": "Document",
"value": "document",
"description": "Document type file format"
},
{
"name": "Glossary",
"value": "glossary",
"description": "Glossary type file format"
}
]
}
}
],
"responses": {
"200": {
"description": "The request has succeeded.",
"schema": {
"$ref": "#/definitions/SupportedFileFormats"
}
},
"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": {
"Returns a list of supported document formats": {
"$ref": "./examples/format.json"
}
}
}
},
"/document:translate": {
"post": {
"operationId": "DocumentTranslationOperations_DocumentTranslate",
"summary": "Submit a single document translation request to the Document Translation service",
"description": "Use this API to submit a single translation request to the Document Translation Service.",
"produces": [
"application/octet-stream",
"application/json"
],
"consumes": [
"multipart/form-data"
],
"parameters": [
{
"$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter"
},
{
"$ref": "#/parameters/DocumentTranslateBody.sourceLanguage"
},
{
"$ref": "#/parameters/DocumentTranslateBody.targetLanguage"
},
{
"$ref": "#/parameters/DocumentTranslateBody.category"
},
{
"$ref": "#/parameters/DocumentTranslateBody.allowFallback"
},
{
"$ref": "#/parameters/Azure.Core.ClientRequestIdHeader"
},
{
"name": "document",
"in": "formData",
"description": "Document to be translated in the form",
"required": true,
"type": "file"
},
{
"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"
}
}
],
"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": {
"Translate a single document": {
"$ref": "./examples/DocumentTranslate_MaximumSet_Gen.json"
}
}
}
}
},
"definitions": {
"AdditionalOutputFileFormat": {
"type": "string",
"description": "List of possible additional output formats",
"enum": [
"None",
"OpenXmlWord"
],
"x-ms-enum": {
"name": "AdditionalOutputFileFormat",
"modelAsString": true,
"values": [
{
"name": "None",
"value": "None",
"description": "No additional format"
},
{
"name": "OpenXmlWord",
"value": "OpenXmlWord",
"description": "OpenXmlWord format"
}
]
}
},
"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."
}
}
},
"Azure.Core.uuid": {
"type": "string",
"format": "uuid",
"description": "Universally Unique Identifier"
},
"BatchRequest": {
"type": "object",
"description": "Definition for the input batch translation request",
"properties": {
"source": {
"$ref": "#/definitions/SourceInput",
"description": "Source of the input documents"
},
"targets": {
"type": "array",
"description": "Location of the destination for the output",
"items": {
"$ref": "#/definitions/TargetInput"
},
"x-ms-identifiers": []
},
"storageType": {
"$ref": "#/definitions/StorageInputType",
"description": "Storage type of the input documents source string"
}
},
"required": [
"source",
"targets"
]
},
"DocumentFilter": {
"type": "object",
"description": "Document filter",
"properties": {
"prefix": {
"type": "string",
"description": "A case-sensitive prefix string to filter documents in the source path for\ntranslation. \nFor example, when using a Azure storage blob Uri, use the prefix\nto restrict sub folders for translation."
},
"suffix": {
"type": "string",
"description": "A case-sensitive suffix string to filter documents in the source path for\ntranslation. \nThis is most often use for file extensions"
}
}
},
"DocumentStatus": {
"type": "object",
"description": "Document Status Response",
"properties": {
"path": {
"type": "string",
"description": "Location of the document or folder"
},
"sourcePath": {
"type": "string",
"description": "Location of the source document"
},
"createdDateTimeUtc": {
"type": "string",
"format": "date-time",
"description": "Operation created date time"
},
"lastActionDateTimeUtc": {
"type": "string",
"format": "date-time",
"description": "Date time in which the operation's status has been updated"
},
"status": {
"$ref": "#/definitions/Status",
"description": "List of possible statuses for job or document"
},
"to": {
"type": "string",
"description": "To language"
},
"error": {
"$ref": "#/definitions/TranslationError",
"description": "This contains an outer error with error code, message, details, target and an\ninner error with more descriptive details."
},
"progress": {
"type": "number",
"format": "float",
"description": "Progress of the translation if available",
"maximum": 1
},
"id": {
"$ref": "#/definitions/Azure.Core.uuid",
"description": "Document Id"
},
"characterCharged": {
"type": "integer",
"format": "int32",
"description": "Character charged by the API"
}
},
"required": [
"sourcePath",
"createdDateTimeUtc",
"lastActionDateTimeUtc",
"status",
"to",
"progress",
"id"
]
},
"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"
]
},
"DocumentsStatus": {
"type": "object",
"description": "Documents Status Response",
"properties": {
"value": {
"type": "array",
"description": "The detail status of individual documents",
"items": {
"$ref": "#/definitions/DocumentStatus"
}
},
"nextLink": {
"type": "string",
"description": "Url for the next page. Null if no more pages available"
}
},
"required": [
"value"
]
},
"FileFormat": {
"type": "object",
"description": "File Format",
"properties": {
"format": {
"type": "string",
"description": "Name of the format"
},
"fileExtensions": {
"type": "array",
"description": "Supported file extension for this format",
"items": {
"type": "string"
}
},
"contentTypes": {
"type": "array",
"description": "Supported Content-Types for this format",
"items": {
"type": "string"
}
},
"defaultVersion": {
"type": "string",
"description": "Default version if none is specified"
},
"versions": {
"type": "array",
"description": "Supported Version",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"description": "Supported Type for this format"
}
},
"required": [
"format",
"fileExtensions",
"contentTypes"
]
},
"FileFormatType": {
"type": "string",
"description": "Format types",
"enum": [
"document",
"glossary"
],
"x-ms-enum": {
"name": "FileFormatType",
"modelAsString": true,
"values": [
{
"name": "Document",
"value": "document",
"description": "Document type file format"
},
{
"name": "Glossary",
"value": "glossary",
"description": "Glossary type file format"
}
]
}
},
"Glossary": {
"type": "object",
"description": "Glossary / translation memory for the request",
"properties": {
"glossaryUrl": {
"type": "string",
"description": "Location of the glossary. \nWe will use the file extension to extract the\nformatting if the format parameter is not supplied.\n\nIf the translation\nlanguage pair is not present in the glossary, it will not be applied"
},
"format": {
"type": "string",
"description": "Format"
},
"version": {
"type": "string",
"description": "Optional Version. If not specified, default is used."
},
"storageSource": {
"$ref": "#/definitions/StorageSource",
"description": "Storage Source"
}
},
"required": [
"glossaryUrl",
"format"
]
},
"InnerTranslationError": {
"type": "object",
"description": "New Inner Error format which conforms to Cognitive Services API Guidelines\nwhich is available at\nhttps://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow.\nThis\ncontains required properties ErrorCode, message and optional properties target,\ndetails(key value pair), inner error(this can be nested).",
"properties": {
"code": {
"type": "string",
"description": "Gets code error string."
},
"message": {
"type": "string",
"description": "Gets high level error message."
},
"target": {
"type": "string",
"description": "Gets the source of the error. \nFor example it would be \"documents\" or\n\"document id\" in case of invalid document.",
"readOnly": true
},