@azure-rest/ai-translation-document 1.0.0-alpha.20250620.1 → 1.0.0-alpha.20250718.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for DocumentTranslationClient.",
6
- "version": "1.0.0-alpha.20250620.1",
6
+ "version": "1.0.0-alpha.20250718.1",
7
7
  "keywords": [
8
8
  "node",
9
9
  "azure",
@@ -1,631 +1,631 @@
1
- ## API Report File for "@azure-rest/ai-translation-document"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import type { AbortSignalLike } from '@azure/abort-controller';
8
- import type { CancelOnProgress } from '@azure/core-lro';
9
- import type { Client } from '@azure-rest/core-client';
10
- import type { ClientOptions } from '@azure-rest/core-client';
11
- import type { CreateHttpPollerOptions } from '@azure/core-lro';
12
- import type { ErrorResponse } from '@azure-rest/core-client';
13
- import type { HttpResponse } from '@azure-rest/core-client';
14
- import type { KeyCredential } from '@azure/core-auth';
15
- import type { OperationState } from '@azure/core-lro';
16
- import type { PagedAsyncIterableIterator } from '@azure/core-paging';
17
- import type { PathUncheckedResponse } from '@azure-rest/core-client';
18
- import type { RawHttpHeaders } from '@azure/core-rest-pipeline';
19
- import type { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
20
- import type { RequestParameters } from '@azure-rest/core-client';
21
- import type { StreamableMethod } from '@azure-rest/core-client';
22
- import type { TokenCredential } from '@azure/core-auth';
23
-
24
- // @public
25
- export interface BatchRequest {
26
- source: SourceInput;
27
- storageType?: StorageInputType;
28
- targets: Array<TargetInput>;
29
- }
30
-
31
- // @public
32
- export interface CancelTranslation200Response extends HttpResponse {
33
- // (undocumented)
34
- body: TranslationStatusOutput;
35
- // (undocumented)
36
- status: "200";
37
- }
38
-
39
- // @public (undocumented)
40
- export interface CancelTranslationDefaultHeaders {
41
- "x-ms-error-code"?: string;
42
- }
43
-
44
- // @public (undocumented)
45
- export interface CancelTranslationDefaultResponse extends HttpResponse {
46
- // (undocumented)
47
- body: ErrorResponse;
48
- // (undocumented)
49
- headers: RawHttpHeaders & CancelTranslationDefaultHeaders;
50
- // (undocumented)
51
- status: string;
52
- }
53
-
54
- // @public (undocumented)
55
- export type CancelTranslationParameters = RequestParameters;
56
-
57
- // @public
58
- function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: DocumentTranslationClientOptions): DocumentTranslationClient;
59
- export default createClient;
60
-
61
- // @public
62
- export interface DocumentFilter {
63
- prefix?: string;
64
- suffix?: string;
65
- }
66
-
67
- // @public
68
- export interface DocumentsStatusOutput {
69
- nextLink?: string;
70
- value: Array<DocumentStatusOutput>;
71
- }
72
-
73
- // @public
74
- export interface DocumentStatusOutput {
75
- characterCharged?: number;
76
- createdDateTimeUtc: string;
77
- error?: TranslationErrorOutput;
78
- id: string;
79
- lastActionDateTimeUtc: string;
80
- path?: string;
81
- progress: number;
82
- sourcePath: string;
83
- status: StatusOutput;
84
- to: string;
85
- }
86
-
87
- // @public (undocumented)
88
- export interface DocumentTranslate {
89
- post(options: DocumentTranslateParameters): StreamableMethod<DocumentTranslate200Response | DocumentTranslateDefaultResponse>;
90
- }
91
-
92
- // @public (undocumented)
93
- export interface DocumentTranslate200Headers {
94
- "content-type": "application/octet-stream";
95
- "x-ms-client-request-id"?: string;
96
- }
97
-
98
- // @public
99
- export interface DocumentTranslate200Response extends HttpResponse {
100
- body: Uint8Array;
101
- // (undocumented)
102
- headers: RawHttpHeaders & DocumentTranslate200Headers;
103
- // (undocumented)
104
- status: "200";
105
- }
106
-
107
- // @public (undocumented)
108
- export interface DocumentTranslateBodyParam {
109
- body: DocumentTranslateContent;
110
- }
111
-
112
- // @public
113
- export type DocumentTranslateContent = FormData | Array<DocumentTranslateContentDocumentPartDescriptor | DocumentTranslateContentGlossaryPartDescriptor>;
114
-
115
- // @public (undocumented)
116
- export interface DocumentTranslateContentDocumentPartDescriptor {
117
- // (undocumented)
118
- body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream | File;
119
- // (undocumented)
120
- contentType?: string;
121
- // (undocumented)
122
- filename?: string;
123
- // (undocumented)
124
- name: "document";
125
- }
126
-
127
- // @public (undocumented)
128
- export interface DocumentTranslateContentGlossaryPartDescriptor {
129
- // (undocumented)
130
- body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream | File;
131
- // (undocumented)
132
- contentType?: string;
133
- // (undocumented)
134
- filename?: string;
135
- // (undocumented)
136
- name: "glossary";
137
- }
138
-
139
- // @public (undocumented)
140
- export interface DocumentTranslateDefaultHeaders {
141
- "x-ms-error-code"?: string;
142
- }
143
-
144
- // @public (undocumented)
145
- export interface DocumentTranslateDefaultResponse extends HttpResponse {
146
- // (undocumented)
147
- body: ErrorResponse;
148
- // (undocumented)
149
- headers: RawHttpHeaders & DocumentTranslateDefaultHeaders;
150
- // (undocumented)
151
- status: string;
152
- }
153
-
154
- // @public (undocumented)
155
- export interface DocumentTranslateHeaderParam {
156
- // (undocumented)
157
- headers?: RawHttpHeadersInput & DocumentTranslateHeaders;
158
- }
159
-
160
- // @public (undocumented)
161
- export interface DocumentTranslateHeaders {
162
- "x-ms-client-request-id"?: string;
163
- }
164
-
165
- // @public (undocumented)
166
- export interface DocumentTranslateMediaTypesParam {
167
- contentType: "multipart/form-data";
168
- }
169
-
170
- // @public (undocumented)
171
- export type DocumentTranslateParameters = DocumentTranslateQueryParam & DocumentTranslateHeaderParam & DocumentTranslateMediaTypesParam & DocumentTranslateBodyParam & RequestParameters;
172
-
173
- // @public (undocumented)
174
- export interface DocumentTranslateQueryParam {
175
- // (undocumented)
176
- queryParameters: DocumentTranslateQueryParamProperties;
177
- }
178
-
179
- // @public (undocumented)
180
- export interface DocumentTranslateQueryParamProperties {
181
- allowFallback?: boolean;
182
- category?: string;
183
- sourceLanguage?: string;
184
- targetLanguage: string;
185
- }
186
-
187
- // @public (undocumented)
188
- export type DocumentTranslationClient = Client & {
189
- path: Routes;
190
- };
191
-
192
- // @public
193
- export interface DocumentTranslationClientOptions extends ClientOptions {
194
- apiVersion?: string;
195
- }
196
-
197
- // @public
198
- export interface FileFormatOutput {
199
- contentTypes: string[];
200
- defaultVersion?: string;
201
- fileExtensions: string[];
202
- format: string;
203
- type?: string;
204
- versions?: string[];
205
- }
206
-
207
- // @public
208
- export type FileFormatType = string;
209
-
210
- // @public
211
- export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
212
-
213
- // @public (undocumented)
214
- export interface GetDocumentsStatus {
215
- get(options?: GetDocumentsStatusParameters): StreamableMethod<GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse>;
216
- }
217
-
218
- // @public
219
- export interface GetDocumentsStatus200Response extends HttpResponse {
220
- // (undocumented)
221
- body: DocumentsStatusOutput;
222
- // (undocumented)
223
- status: "200";
224
- }
225
-
226
- // @public (undocumented)
227
- export interface GetDocumentsStatusDefaultHeaders {
228
- "x-ms-error-code"?: string;
229
- }
230
-
231
- // @public (undocumented)
232
- export interface GetDocumentsStatusDefaultResponse extends HttpResponse {
233
- // (undocumented)
234
- body: ErrorResponse;
235
- // (undocumented)
236
- headers: RawHttpHeaders & GetDocumentsStatusDefaultHeaders;
237
- // (undocumented)
238
- status: string;
239
- }
240
-
241
- // @public (undocumented)
242
- export type GetDocumentsStatusParameters = GetDocumentsStatusQueryParam & RequestParameters;
243
-
244
- // @public (undocumented)
245
- export interface GetDocumentsStatusQueryParam {
246
- // (undocumented)
247
- queryParameters?: GetDocumentsStatusQueryParamProperties;
248
- }
249
-
250
- // @public (undocumented)
251
- export interface GetDocumentsStatusQueryParamProperties {
252
- createdDateTimeUtcEnd?: Date | string;
253
- createdDateTimeUtcStart?: Date | string;
254
- ids?: string[];
255
- maxpagesize?: number;
256
- orderby?: string[];
257
- skip?: number;
258
- statuses?: string[];
259
- top?: number;
260
- }
261
-
262
- // @public (undocumented)
263
- export interface GetDocumentStatus {
264
- get(options?: GetDocumentStatusParameters): StreamableMethod<GetDocumentStatus200Response | GetDocumentStatusDefaultResponse>;
265
- }
266
-
267
- // @public
268
- export interface GetDocumentStatus200Response extends HttpResponse {
269
- // (undocumented)
270
- body: DocumentStatusOutput;
271
- // (undocumented)
272
- status: "200";
273
- }
274
-
275
- // @public (undocumented)
276
- export interface GetDocumentStatusDefaultHeaders {
277
- "x-ms-error-code"?: string;
278
- }
279
-
280
- // @public (undocumented)
281
- export interface GetDocumentStatusDefaultResponse extends HttpResponse {
282
- // (undocumented)
283
- body: ErrorResponse;
284
- // (undocumented)
285
- headers: RawHttpHeaders & GetDocumentStatusDefaultHeaders;
286
- // (undocumented)
287
- status: string;
288
- }
289
-
290
- // @public (undocumented)
291
- export type GetDocumentStatusParameters = RequestParameters;
292
-
293
- // @public
294
- export function getLongRunningPoller<TResult extends StartTranslationLogicalResponse | StartTranslationDefaultResponse>(client: Client, initialResponse: StartTranslation202Response | StartTranslationDefaultResponse, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
295
-
296
- // @public
297
- export type GetPage<TPage> = (pageLink: string, maxPageSize?: number) => Promise<{
298
- page: TPage;
299
- nextPageLink?: string;
300
- }>;
301
-
302
- // @public (undocumented)
303
- export interface GetSupportedFormats {
304
- get(options?: GetSupportedFormatsParameters): StreamableMethod<GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse>;
305
- }
306
-
307
- // @public
308
- export interface GetSupportedFormats200Response extends HttpResponse {
309
- // (undocumented)
310
- body: SupportedFileFormatsOutput;
311
- // (undocumented)
312
- status: "200";
313
- }
314
-
315
- // @public (undocumented)
316
- export interface GetSupportedFormatsDefaultHeaders {
317
- "x-ms-error-code"?: string;
318
- }
319
-
320
- // @public (undocumented)
321
- export interface GetSupportedFormatsDefaultResponse extends HttpResponse {
322
- // (undocumented)
323
- body: ErrorResponse;
324
- // (undocumented)
325
- headers: RawHttpHeaders & GetSupportedFormatsDefaultHeaders;
326
- // (undocumented)
327
- status: string;
328
- }
329
-
330
- // @public (undocumented)
331
- export type GetSupportedFormatsParameters = GetSupportedFormatsQueryParam & RequestParameters;
332
-
333
- // @public (undocumented)
334
- export interface GetSupportedFormatsQueryParam {
335
- // (undocumented)
336
- queryParameters?: GetSupportedFormatsQueryParamProperties;
337
- }
338
-
339
- // @public (undocumented)
340
- export interface GetSupportedFormatsQueryParamProperties {
341
- type?: FileFormatType;
342
- }
343
-
344
- // @public
345
- export interface GetTranslationsStatus200Response extends HttpResponse {
346
- // (undocumented)
347
- body: TranslationsStatusOutput;
348
- // (undocumented)
349
- status: "200";
350
- }
351
-
352
- // @public (undocumented)
353
- export interface GetTranslationsStatusDefaultHeaders {
354
- "x-ms-error-code"?: string;
355
- }
356
-
357
- // @public (undocumented)
358
- export interface GetTranslationsStatusDefaultResponse extends HttpResponse {
359
- // (undocumented)
360
- body: ErrorResponse;
361
- // (undocumented)
362
- headers: RawHttpHeaders & GetTranslationsStatusDefaultHeaders;
363
- // (undocumented)
364
- status: string;
365
- }
366
-
367
- // @public (undocumented)
368
- export type GetTranslationsStatusParameters = GetTranslationsStatusQueryParam & RequestParameters;
369
-
370
- // @public (undocumented)
371
- export interface GetTranslationsStatusQueryParam {
372
- // (undocumented)
373
- queryParameters?: GetTranslationsStatusQueryParamProperties;
374
- }
375
-
376
- // @public (undocumented)
377
- export interface GetTranslationsStatusQueryParamProperties {
378
- createdDateTimeUtcEnd?: Date | string;
379
- createdDateTimeUtcStart?: Date | string;
380
- ids?: string[];
381
- maxpagesize?: number;
382
- orderby?: string[];
383
- skip?: number;
384
- statuses?: string[];
385
- top?: number;
386
- }
387
-
388
- // @public (undocumented)
389
- export interface GetTranslationStatus {
390
- delete(options?: CancelTranslationParameters): StreamableMethod<CancelTranslation200Response | CancelTranslationDefaultResponse>;
391
- get(options?: GetTranslationStatusParameters): StreamableMethod<GetTranslationStatus200Response | GetTranslationStatusDefaultResponse>;
392
- }
393
-
394
- // @public
395
- export interface GetTranslationStatus200Response extends HttpResponse {
396
- // (undocumented)
397
- body: TranslationStatusOutput;
398
- // (undocumented)
399
- status: "200";
400
- }
401
-
402
- // @public (undocumented)
403
- export interface GetTranslationStatusDefaultHeaders {
404
- "x-ms-error-code"?: string;
405
- }
406
-
407
- // @public (undocumented)
408
- export interface GetTranslationStatusDefaultResponse extends HttpResponse {
409
- // (undocumented)
410
- body: ErrorResponse;
411
- // (undocumented)
412
- headers: RawHttpHeaders & GetTranslationStatusDefaultHeaders;
413
- // (undocumented)
414
- status: string;
415
- }
416
-
417
- // @public (undocumented)
418
- export type GetTranslationStatusParameters = RequestParameters;
419
-
420
- // @public
421
- export interface Glossary {
422
- format: string;
423
- glossaryUrl: string;
424
- storageSource?: StorageSource;
425
- version?: string;
426
- }
427
-
428
- // @public
429
- export interface InnerTranslationErrorOutput {
430
- code: string;
431
- innerError?: InnerTranslationErrorOutput;
432
- message: string;
433
- readonly target?: string;
434
- }
435
-
436
- // @public (undocumented)
437
- export function isUnexpected(response: DocumentTranslate200Response | DocumentTranslateDefaultResponse): response is DocumentTranslateDefaultResponse;
438
-
439
- // @public (undocumented)
440
- export function isUnexpected(response: StartTranslation202Response | StartTranslationLogicalResponse | StartTranslationDefaultResponse): response is StartTranslationDefaultResponse;
441
-
442
- // @public (undocumented)
443
- export function isUnexpected(response: GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse): response is GetTranslationsStatusDefaultResponse;
444
-
445
- // @public (undocumented)
446
- export function isUnexpected(response: GetDocumentStatus200Response | GetDocumentStatusDefaultResponse): response is GetDocumentStatusDefaultResponse;
447
-
448
- // @public (undocumented)
449
- export function isUnexpected(response: GetTranslationStatus200Response | GetTranslationStatusDefaultResponse): response is GetTranslationStatusDefaultResponse;
450
-
451
- // @public (undocumented)
452
- export function isUnexpected(response: CancelTranslation200Response | CancelTranslationDefaultResponse): response is CancelTranslationDefaultResponse;
453
-
454
- // @public (undocumented)
455
- export function isUnexpected(response: GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse): response is GetDocumentsStatusDefaultResponse;
456
-
457
- // @public (undocumented)
458
- export function isUnexpected(response: GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse): response is GetSupportedFormatsDefaultResponse;
459
-
460
- // @public
461
- export function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
462
-
463
- // @public
464
- export type PaginateReturn<TResult> = TResult extends {
465
- body: {
466
- value?: infer TPage;
467
- };
468
- } ? GetArrayType<TPage> : Array<unknown>;
469
-
470
- // @public
471
- export interface PagingOptions<TResponse> {
472
- customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
473
- }
474
-
475
- // @public (undocumented)
476
- export interface Routes {
477
- (path: "/document:translate"): DocumentTranslate;
478
- (path: "/document/batches"): StartTranslation;
479
- (path: "/document/batches/{id}/documents/{documentId}", id: string, documentId: string): GetDocumentStatus;
480
- (path: "/document/batches/{id}", id: string): GetTranslationStatus;
481
- (path: "/document/batches/{id}/documents", id: string): GetDocumentsStatus;
482
- (path: "/document/formats"): GetSupportedFormats;
483
- }
484
-
485
- // @public
486
- export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
487
- getOperationState(): TState;
488
- getResult(): TResult | undefined;
489
- isDone(): boolean;
490
- // @deprecated
491
- isStopped(): boolean;
492
- onProgress(callback: (state: TState) => void): CancelOnProgress;
493
- poll(options?: {
494
- abortSignal?: AbortSignalLike;
495
- }): Promise<TState>;
496
- pollUntilDone(pollOptions?: {
497
- abortSignal?: AbortSignalLike;
498
- }): Promise<TResult>;
499
- serialize(): Promise<string>;
500
- // @deprecated
501
- stopPolling(): void;
502
- submitted(): Promise<void>;
503
- // @deprecated
504
- toString(): string;
505
- }
506
-
507
- // @public
508
- export interface SourceInput {
509
- filter?: DocumentFilter;
510
- language?: string;
511
- sourceUrl: string;
512
- storageSource?: StorageSource;
513
- }
514
-
515
- // @public (undocumented)
516
- export interface StartTranslation {
517
- get(options?: GetTranslationsStatusParameters): StreamableMethod<GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse>;
518
- post(options: StartTranslationParameters): StreamableMethod<StartTranslation202Response | StartTranslationDefaultResponse>;
519
- }
520
-
521
- // @public (undocumented)
522
- export interface StartTranslation202Headers {
523
- "operation-location": string;
524
- }
525
-
526
- // @public
527
- export interface StartTranslation202Response extends HttpResponse {
528
- // (undocumented)
529
- headers: RawHttpHeaders & StartTranslation202Headers;
530
- // (undocumented)
531
- status: "202";
532
- }
533
-
534
- // @public (undocumented)
535
- export interface StartTranslationBodyParam {
536
- body: StartTranslationDetails;
537
- }
538
-
539
- // @public (undocumented)
540
- export interface StartTranslationDefaultHeaders {
541
- "x-ms-error-code"?: string;
542
- }
543
-
544
- // @public (undocumented)
545
- export interface StartTranslationDefaultResponse extends HttpResponse {
546
- // (undocumented)
547
- body: ErrorResponse;
548
- // (undocumented)
549
- headers: RawHttpHeaders & StartTranslationDefaultHeaders;
550
- // (undocumented)
551
- status: string;
552
- }
553
-
554
- // @public
555
- export interface StartTranslationDetails {
556
- inputs: Array<BatchRequest>;
557
- }
558
-
559
- // @public
560
- export interface StartTranslationLogicalResponse extends HttpResponse {
561
- // (undocumented)
562
- status: "200";
563
- }
564
-
565
- // @public (undocumented)
566
- export type StartTranslationParameters = StartTranslationBodyParam & RequestParameters;
567
-
568
- // @public
569
- export type StatusOutput = string;
570
-
571
- // @public
572
- export interface StatusSummaryOutput {
573
- cancelled: number;
574
- failed: number;
575
- inProgress: number;
576
- notYetStarted: number;
577
- success: number;
578
- total: number;
579
- totalCharacterCharged: number;
580
- }
581
-
582
- // @public
583
- export type StorageInputType = string;
584
-
585
- // @public
586
- export type StorageSource = string;
587
-
588
- // @public
589
- export interface SupportedFileFormatsOutput {
590
- value: Array<FileFormatOutput>;
591
- }
592
-
593
- // @public
594
- export interface TargetInput {
595
- category?: string;
596
- glossaries?: Array<Glossary>;
597
- language: string;
598
- storageSource?: StorageSource;
599
- targetUrl: string;
600
- }
601
-
602
- // @public
603
- export type TranslationErrorCodeOutput = string;
604
-
605
- // @public
606
- export interface TranslationErrorOutput {
607
- code: TranslationErrorCodeOutput;
608
- innerError?: InnerTranslationErrorOutput;
609
- message: string;
610
- readonly target?: string;
611
- }
612
-
613
- // @public
614
- export interface TranslationsStatusOutput {
615
- nextLink?: string;
616
- value: Array<TranslationStatusOutput>;
617
- }
618
-
619
- // @public
620
- export interface TranslationStatusOutput {
621
- createdDateTimeUtc: string;
622
- error?: TranslationErrorOutput;
623
- id: string;
624
- lastActionDateTimeUtc: string;
625
- status: StatusOutput;
626
- summary: StatusSummaryOutput;
627
- }
628
-
629
- // (No @packageDocumentation comment for this package)
630
-
631
- ```
1
+ ## API Report File for "@azure-rest/ai-translation-document"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { AbortSignalLike } from '@azure/abort-controller';
8
+ import type { CancelOnProgress } from '@azure/core-lro';
9
+ import type { Client } from '@azure-rest/core-client';
10
+ import type { ClientOptions } from '@azure-rest/core-client';
11
+ import type { CreateHttpPollerOptions } from '@azure/core-lro';
12
+ import type { ErrorResponse } from '@azure-rest/core-client';
13
+ import type { HttpResponse } from '@azure-rest/core-client';
14
+ import type { KeyCredential } from '@azure/core-auth';
15
+ import type { OperationState } from '@azure/core-lro';
16
+ import type { PagedAsyncIterableIterator } from '@azure/core-paging';
17
+ import type { PathUncheckedResponse } from '@azure-rest/core-client';
18
+ import type { RawHttpHeaders } from '@azure/core-rest-pipeline';
19
+ import type { RawHttpHeadersInput } from '@azure/core-rest-pipeline';
20
+ import type { RequestParameters } from '@azure-rest/core-client';
21
+ import type { StreamableMethod } from '@azure-rest/core-client';
22
+ import type { TokenCredential } from '@azure/core-auth';
23
+
24
+ // @public
25
+ export interface BatchRequest {
26
+ source: SourceInput;
27
+ storageType?: StorageInputType;
28
+ targets: Array<TargetInput>;
29
+ }
30
+
31
+ // @public
32
+ export interface CancelTranslation200Response extends HttpResponse {
33
+ // (undocumented)
34
+ body: TranslationStatusOutput;
35
+ // (undocumented)
36
+ status: "200";
37
+ }
38
+
39
+ // @public (undocumented)
40
+ export interface CancelTranslationDefaultHeaders {
41
+ "x-ms-error-code"?: string;
42
+ }
43
+
44
+ // @public (undocumented)
45
+ export interface CancelTranslationDefaultResponse extends HttpResponse {
46
+ // (undocumented)
47
+ body: ErrorResponse;
48
+ // (undocumented)
49
+ headers: RawHttpHeaders & CancelTranslationDefaultHeaders;
50
+ // (undocumented)
51
+ status: string;
52
+ }
53
+
54
+ // @public (undocumented)
55
+ export type CancelTranslationParameters = RequestParameters;
56
+
57
+ // @public
58
+ function createClient(endpointParam: string, credentials: TokenCredential | KeyCredential, { apiVersion, ...options }?: DocumentTranslationClientOptions): DocumentTranslationClient;
59
+ export default createClient;
60
+
61
+ // @public
62
+ export interface DocumentFilter {
63
+ prefix?: string;
64
+ suffix?: string;
65
+ }
66
+
67
+ // @public
68
+ export interface DocumentsStatusOutput {
69
+ nextLink?: string;
70
+ value: Array<DocumentStatusOutput>;
71
+ }
72
+
73
+ // @public
74
+ export interface DocumentStatusOutput {
75
+ characterCharged?: number;
76
+ createdDateTimeUtc: string;
77
+ error?: TranslationErrorOutput;
78
+ id: string;
79
+ lastActionDateTimeUtc: string;
80
+ path?: string;
81
+ progress: number;
82
+ sourcePath: string;
83
+ status: StatusOutput;
84
+ to: string;
85
+ }
86
+
87
+ // @public (undocumented)
88
+ export interface DocumentTranslate {
89
+ post(options: DocumentTranslateParameters): StreamableMethod<DocumentTranslate200Response | DocumentTranslateDefaultResponse>;
90
+ }
91
+
92
+ // @public (undocumented)
93
+ export interface DocumentTranslate200Headers {
94
+ "content-type": "application/octet-stream";
95
+ "x-ms-client-request-id"?: string;
96
+ }
97
+
98
+ // @public
99
+ export interface DocumentTranslate200Response extends HttpResponse {
100
+ body: Uint8Array;
101
+ // (undocumented)
102
+ headers: RawHttpHeaders & DocumentTranslate200Headers;
103
+ // (undocumented)
104
+ status: "200";
105
+ }
106
+
107
+ // @public (undocumented)
108
+ export interface DocumentTranslateBodyParam {
109
+ body: DocumentTranslateContent;
110
+ }
111
+
112
+ // @public
113
+ export type DocumentTranslateContent = FormData | Array<DocumentTranslateContentDocumentPartDescriptor | DocumentTranslateContentGlossaryPartDescriptor>;
114
+
115
+ // @public (undocumented)
116
+ export interface DocumentTranslateContentDocumentPartDescriptor {
117
+ // (undocumented)
118
+ body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream | File;
119
+ // (undocumented)
120
+ contentType?: string;
121
+ // (undocumented)
122
+ filename?: string;
123
+ // (undocumented)
124
+ name: "document";
125
+ }
126
+
127
+ // @public (undocumented)
128
+ export interface DocumentTranslateContentGlossaryPartDescriptor {
129
+ // (undocumented)
130
+ body: string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream | File;
131
+ // (undocumented)
132
+ contentType?: string;
133
+ // (undocumented)
134
+ filename?: string;
135
+ // (undocumented)
136
+ name: "glossary";
137
+ }
138
+
139
+ // @public (undocumented)
140
+ export interface DocumentTranslateDefaultHeaders {
141
+ "x-ms-error-code"?: string;
142
+ }
143
+
144
+ // @public (undocumented)
145
+ export interface DocumentTranslateDefaultResponse extends HttpResponse {
146
+ // (undocumented)
147
+ body: ErrorResponse;
148
+ // (undocumented)
149
+ headers: RawHttpHeaders & DocumentTranslateDefaultHeaders;
150
+ // (undocumented)
151
+ status: string;
152
+ }
153
+
154
+ // @public (undocumented)
155
+ export interface DocumentTranslateHeaderParam {
156
+ // (undocumented)
157
+ headers?: RawHttpHeadersInput & DocumentTranslateHeaders;
158
+ }
159
+
160
+ // @public (undocumented)
161
+ export interface DocumentTranslateHeaders {
162
+ "x-ms-client-request-id"?: string;
163
+ }
164
+
165
+ // @public (undocumented)
166
+ export interface DocumentTranslateMediaTypesParam {
167
+ contentType: "multipart/form-data";
168
+ }
169
+
170
+ // @public (undocumented)
171
+ export type DocumentTranslateParameters = DocumentTranslateQueryParam & DocumentTranslateHeaderParam & DocumentTranslateMediaTypesParam & DocumentTranslateBodyParam & RequestParameters;
172
+
173
+ // @public (undocumented)
174
+ export interface DocumentTranslateQueryParam {
175
+ // (undocumented)
176
+ queryParameters: DocumentTranslateQueryParamProperties;
177
+ }
178
+
179
+ // @public (undocumented)
180
+ export interface DocumentTranslateQueryParamProperties {
181
+ allowFallback?: boolean;
182
+ category?: string;
183
+ sourceLanguage?: string;
184
+ targetLanguage: string;
185
+ }
186
+
187
+ // @public (undocumented)
188
+ export type DocumentTranslationClient = Client & {
189
+ path: Routes;
190
+ };
191
+
192
+ // @public
193
+ export interface DocumentTranslationClientOptions extends ClientOptions {
194
+ apiVersion?: string;
195
+ }
196
+
197
+ // @public
198
+ export interface FileFormatOutput {
199
+ contentTypes: string[];
200
+ defaultVersion?: string;
201
+ fileExtensions: string[];
202
+ format: string;
203
+ type?: string;
204
+ versions?: string[];
205
+ }
206
+
207
+ // @public
208
+ export type FileFormatType = string;
209
+
210
+ // @public
211
+ export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
212
+
213
+ // @public (undocumented)
214
+ export interface GetDocumentsStatus {
215
+ get(options?: GetDocumentsStatusParameters): StreamableMethod<GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse>;
216
+ }
217
+
218
+ // @public
219
+ export interface GetDocumentsStatus200Response extends HttpResponse {
220
+ // (undocumented)
221
+ body: DocumentsStatusOutput;
222
+ // (undocumented)
223
+ status: "200";
224
+ }
225
+
226
+ // @public (undocumented)
227
+ export interface GetDocumentsStatusDefaultHeaders {
228
+ "x-ms-error-code"?: string;
229
+ }
230
+
231
+ // @public (undocumented)
232
+ export interface GetDocumentsStatusDefaultResponse extends HttpResponse {
233
+ // (undocumented)
234
+ body: ErrorResponse;
235
+ // (undocumented)
236
+ headers: RawHttpHeaders & GetDocumentsStatusDefaultHeaders;
237
+ // (undocumented)
238
+ status: string;
239
+ }
240
+
241
+ // @public (undocumented)
242
+ export type GetDocumentsStatusParameters = GetDocumentsStatusQueryParam & RequestParameters;
243
+
244
+ // @public (undocumented)
245
+ export interface GetDocumentsStatusQueryParam {
246
+ // (undocumented)
247
+ queryParameters?: GetDocumentsStatusQueryParamProperties;
248
+ }
249
+
250
+ // @public (undocumented)
251
+ export interface GetDocumentsStatusQueryParamProperties {
252
+ createdDateTimeUtcEnd?: Date | string;
253
+ createdDateTimeUtcStart?: Date | string;
254
+ ids?: string[];
255
+ maxpagesize?: number;
256
+ orderby?: string[];
257
+ skip?: number;
258
+ statuses?: string[];
259
+ top?: number;
260
+ }
261
+
262
+ // @public (undocumented)
263
+ export interface GetDocumentStatus {
264
+ get(options?: GetDocumentStatusParameters): StreamableMethod<GetDocumentStatus200Response | GetDocumentStatusDefaultResponse>;
265
+ }
266
+
267
+ // @public
268
+ export interface GetDocumentStatus200Response extends HttpResponse {
269
+ // (undocumented)
270
+ body: DocumentStatusOutput;
271
+ // (undocumented)
272
+ status: "200";
273
+ }
274
+
275
+ // @public (undocumented)
276
+ export interface GetDocumentStatusDefaultHeaders {
277
+ "x-ms-error-code"?: string;
278
+ }
279
+
280
+ // @public (undocumented)
281
+ export interface GetDocumentStatusDefaultResponse extends HttpResponse {
282
+ // (undocumented)
283
+ body: ErrorResponse;
284
+ // (undocumented)
285
+ headers: RawHttpHeaders & GetDocumentStatusDefaultHeaders;
286
+ // (undocumented)
287
+ status: string;
288
+ }
289
+
290
+ // @public (undocumented)
291
+ export type GetDocumentStatusParameters = RequestParameters;
292
+
293
+ // @public
294
+ export function getLongRunningPoller<TResult extends StartTranslationLogicalResponse | StartTranslationDefaultResponse>(client: Client, initialResponse: StartTranslation202Response | StartTranslationDefaultResponse, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
295
+
296
+ // @public
297
+ export type GetPage<TPage> = (pageLink: string, maxPageSize?: number) => Promise<{
298
+ page: TPage;
299
+ nextPageLink?: string;
300
+ }>;
301
+
302
+ // @public (undocumented)
303
+ export interface GetSupportedFormats {
304
+ get(options?: GetSupportedFormatsParameters): StreamableMethod<GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse>;
305
+ }
306
+
307
+ // @public
308
+ export interface GetSupportedFormats200Response extends HttpResponse {
309
+ // (undocumented)
310
+ body: SupportedFileFormatsOutput;
311
+ // (undocumented)
312
+ status: "200";
313
+ }
314
+
315
+ // @public (undocumented)
316
+ export interface GetSupportedFormatsDefaultHeaders {
317
+ "x-ms-error-code"?: string;
318
+ }
319
+
320
+ // @public (undocumented)
321
+ export interface GetSupportedFormatsDefaultResponse extends HttpResponse {
322
+ // (undocumented)
323
+ body: ErrorResponse;
324
+ // (undocumented)
325
+ headers: RawHttpHeaders & GetSupportedFormatsDefaultHeaders;
326
+ // (undocumented)
327
+ status: string;
328
+ }
329
+
330
+ // @public (undocumented)
331
+ export type GetSupportedFormatsParameters = GetSupportedFormatsQueryParam & RequestParameters;
332
+
333
+ // @public (undocumented)
334
+ export interface GetSupportedFormatsQueryParam {
335
+ // (undocumented)
336
+ queryParameters?: GetSupportedFormatsQueryParamProperties;
337
+ }
338
+
339
+ // @public (undocumented)
340
+ export interface GetSupportedFormatsQueryParamProperties {
341
+ type?: FileFormatType;
342
+ }
343
+
344
+ // @public
345
+ export interface GetTranslationsStatus200Response extends HttpResponse {
346
+ // (undocumented)
347
+ body: TranslationsStatusOutput;
348
+ // (undocumented)
349
+ status: "200";
350
+ }
351
+
352
+ // @public (undocumented)
353
+ export interface GetTranslationsStatusDefaultHeaders {
354
+ "x-ms-error-code"?: string;
355
+ }
356
+
357
+ // @public (undocumented)
358
+ export interface GetTranslationsStatusDefaultResponse extends HttpResponse {
359
+ // (undocumented)
360
+ body: ErrorResponse;
361
+ // (undocumented)
362
+ headers: RawHttpHeaders & GetTranslationsStatusDefaultHeaders;
363
+ // (undocumented)
364
+ status: string;
365
+ }
366
+
367
+ // @public (undocumented)
368
+ export type GetTranslationsStatusParameters = GetTranslationsStatusQueryParam & RequestParameters;
369
+
370
+ // @public (undocumented)
371
+ export interface GetTranslationsStatusQueryParam {
372
+ // (undocumented)
373
+ queryParameters?: GetTranslationsStatusQueryParamProperties;
374
+ }
375
+
376
+ // @public (undocumented)
377
+ export interface GetTranslationsStatusQueryParamProperties {
378
+ createdDateTimeUtcEnd?: Date | string;
379
+ createdDateTimeUtcStart?: Date | string;
380
+ ids?: string[];
381
+ maxpagesize?: number;
382
+ orderby?: string[];
383
+ skip?: number;
384
+ statuses?: string[];
385
+ top?: number;
386
+ }
387
+
388
+ // @public (undocumented)
389
+ export interface GetTranslationStatus {
390
+ delete(options?: CancelTranslationParameters): StreamableMethod<CancelTranslation200Response | CancelTranslationDefaultResponse>;
391
+ get(options?: GetTranslationStatusParameters): StreamableMethod<GetTranslationStatus200Response | GetTranslationStatusDefaultResponse>;
392
+ }
393
+
394
+ // @public
395
+ export interface GetTranslationStatus200Response extends HttpResponse {
396
+ // (undocumented)
397
+ body: TranslationStatusOutput;
398
+ // (undocumented)
399
+ status: "200";
400
+ }
401
+
402
+ // @public (undocumented)
403
+ export interface GetTranslationStatusDefaultHeaders {
404
+ "x-ms-error-code"?: string;
405
+ }
406
+
407
+ // @public (undocumented)
408
+ export interface GetTranslationStatusDefaultResponse extends HttpResponse {
409
+ // (undocumented)
410
+ body: ErrorResponse;
411
+ // (undocumented)
412
+ headers: RawHttpHeaders & GetTranslationStatusDefaultHeaders;
413
+ // (undocumented)
414
+ status: string;
415
+ }
416
+
417
+ // @public (undocumented)
418
+ export type GetTranslationStatusParameters = RequestParameters;
419
+
420
+ // @public
421
+ export interface Glossary {
422
+ format: string;
423
+ glossaryUrl: string;
424
+ storageSource?: StorageSource;
425
+ version?: string;
426
+ }
427
+
428
+ // @public
429
+ export interface InnerTranslationErrorOutput {
430
+ code: string;
431
+ innerError?: InnerTranslationErrorOutput;
432
+ message: string;
433
+ readonly target?: string;
434
+ }
435
+
436
+ // @public (undocumented)
437
+ export function isUnexpected(response: DocumentTranslate200Response | DocumentTranslateDefaultResponse): response is DocumentTranslateDefaultResponse;
438
+
439
+ // @public (undocumented)
440
+ export function isUnexpected(response: StartTranslation202Response | StartTranslationLogicalResponse | StartTranslationDefaultResponse): response is StartTranslationDefaultResponse;
441
+
442
+ // @public (undocumented)
443
+ export function isUnexpected(response: GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse): response is GetTranslationsStatusDefaultResponse;
444
+
445
+ // @public (undocumented)
446
+ export function isUnexpected(response: GetDocumentStatus200Response | GetDocumentStatusDefaultResponse): response is GetDocumentStatusDefaultResponse;
447
+
448
+ // @public (undocumented)
449
+ export function isUnexpected(response: GetTranslationStatus200Response | GetTranslationStatusDefaultResponse): response is GetTranslationStatusDefaultResponse;
450
+
451
+ // @public (undocumented)
452
+ export function isUnexpected(response: CancelTranslation200Response | CancelTranslationDefaultResponse): response is CancelTranslationDefaultResponse;
453
+
454
+ // @public (undocumented)
455
+ export function isUnexpected(response: GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse): response is GetDocumentsStatusDefaultResponse;
456
+
457
+ // @public (undocumented)
458
+ export function isUnexpected(response: GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse): response is GetSupportedFormatsDefaultResponse;
459
+
460
+ // @public
461
+ export function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
462
+
463
+ // @public
464
+ export type PaginateReturn<TResult> = TResult extends {
465
+ body: {
466
+ value?: infer TPage;
467
+ };
468
+ } ? GetArrayType<TPage> : Array<unknown>;
469
+
470
+ // @public
471
+ export interface PagingOptions<TResponse> {
472
+ customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
473
+ }
474
+
475
+ // @public (undocumented)
476
+ export interface Routes {
477
+ (path: "/document:translate"): DocumentTranslate;
478
+ (path: "/document/batches"): StartTranslation;
479
+ (path: "/document/batches/{id}/documents/{documentId}", id: string, documentId: string): GetDocumentStatus;
480
+ (path: "/document/batches/{id}", id: string): GetTranslationStatus;
481
+ (path: "/document/batches/{id}/documents", id: string): GetDocumentsStatus;
482
+ (path: "/document/formats"): GetSupportedFormats;
483
+ }
484
+
485
+ // @public
486
+ export interface SimplePollerLike<TState extends OperationState<TResult>, TResult> {
487
+ getOperationState(): TState;
488
+ getResult(): TResult | undefined;
489
+ isDone(): boolean;
490
+ // @deprecated
491
+ isStopped(): boolean;
492
+ onProgress(callback: (state: TState) => void): CancelOnProgress;
493
+ poll(options?: {
494
+ abortSignal?: AbortSignalLike;
495
+ }): Promise<TState>;
496
+ pollUntilDone(pollOptions?: {
497
+ abortSignal?: AbortSignalLike;
498
+ }): Promise<TResult>;
499
+ serialize(): Promise<string>;
500
+ // @deprecated
501
+ stopPolling(): void;
502
+ submitted(): Promise<void>;
503
+ // @deprecated
504
+ toString(): string;
505
+ }
506
+
507
+ // @public
508
+ export interface SourceInput {
509
+ filter?: DocumentFilter;
510
+ language?: string;
511
+ sourceUrl: string;
512
+ storageSource?: StorageSource;
513
+ }
514
+
515
+ // @public (undocumented)
516
+ export interface StartTranslation {
517
+ get(options?: GetTranslationsStatusParameters): StreamableMethod<GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse>;
518
+ post(options: StartTranslationParameters): StreamableMethod<StartTranslation202Response | StartTranslationDefaultResponse>;
519
+ }
520
+
521
+ // @public (undocumented)
522
+ export interface StartTranslation202Headers {
523
+ "operation-location": string;
524
+ }
525
+
526
+ // @public
527
+ export interface StartTranslation202Response extends HttpResponse {
528
+ // (undocumented)
529
+ headers: RawHttpHeaders & StartTranslation202Headers;
530
+ // (undocumented)
531
+ status: "202";
532
+ }
533
+
534
+ // @public (undocumented)
535
+ export interface StartTranslationBodyParam {
536
+ body: StartTranslationDetails;
537
+ }
538
+
539
+ // @public (undocumented)
540
+ export interface StartTranslationDefaultHeaders {
541
+ "x-ms-error-code"?: string;
542
+ }
543
+
544
+ // @public (undocumented)
545
+ export interface StartTranslationDefaultResponse extends HttpResponse {
546
+ // (undocumented)
547
+ body: ErrorResponse;
548
+ // (undocumented)
549
+ headers: RawHttpHeaders & StartTranslationDefaultHeaders;
550
+ // (undocumented)
551
+ status: string;
552
+ }
553
+
554
+ // @public
555
+ export interface StartTranslationDetails {
556
+ inputs: Array<BatchRequest>;
557
+ }
558
+
559
+ // @public
560
+ export interface StartTranslationLogicalResponse extends HttpResponse {
561
+ // (undocumented)
562
+ status: "200";
563
+ }
564
+
565
+ // @public (undocumented)
566
+ export type StartTranslationParameters = StartTranslationBodyParam & RequestParameters;
567
+
568
+ // @public
569
+ export type StatusOutput = string;
570
+
571
+ // @public
572
+ export interface StatusSummaryOutput {
573
+ cancelled: number;
574
+ failed: number;
575
+ inProgress: number;
576
+ notYetStarted: number;
577
+ success: number;
578
+ total: number;
579
+ totalCharacterCharged: number;
580
+ }
581
+
582
+ // @public
583
+ export type StorageInputType = string;
584
+
585
+ // @public
586
+ export type StorageSource = string;
587
+
588
+ // @public
589
+ export interface SupportedFileFormatsOutput {
590
+ value: Array<FileFormatOutput>;
591
+ }
592
+
593
+ // @public
594
+ export interface TargetInput {
595
+ category?: string;
596
+ glossaries?: Array<Glossary>;
597
+ language: string;
598
+ storageSource?: StorageSource;
599
+ targetUrl: string;
600
+ }
601
+
602
+ // @public
603
+ export type TranslationErrorCodeOutput = string;
604
+
605
+ // @public
606
+ export interface TranslationErrorOutput {
607
+ code: TranslationErrorCodeOutput;
608
+ innerError?: InnerTranslationErrorOutput;
609
+ message: string;
610
+ readonly target?: string;
611
+ }
612
+
613
+ // @public
614
+ export interface TranslationsStatusOutput {
615
+ nextLink?: string;
616
+ value: Array<TranslationStatusOutput>;
617
+ }
618
+
619
+ // @public
620
+ export interface TranslationStatusOutput {
621
+ createdDateTimeUtc: string;
622
+ error?: TranslationErrorOutput;
623
+ id: string;
624
+ lastActionDateTimeUtc: string;
625
+ status: StatusOutput;
626
+ summary: StatusSummaryOutput;
627
+ }
628
+
629
+ // (No @packageDocumentation comment for this package)
630
+
631
+ ```