@maxim_mazurok/gapi.client.translate-v3beta1 0.0.20230922 → 0.0.20231201

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/index.d.ts CHANGED
@@ -9,1957 +9,1191 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://translation.googleapis.com/$discovery/rest?version=v3beta1
12
- // Revision: 20230922
12
+ // Revision: 20231201
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
16
16
  declare namespace gapi.client {
17
- /** Load Cloud Translation API v3beta1 */
18
- function load(urlOrObject: "https://translation.googleapis.com/$discovery/rest?version=v3beta1"): Promise<void>;
19
- /** @deprecated Please load APIs with discovery documents. */
20
- function load(name: "translate", version: "v3beta1"): Promise<void>;
21
- /** @deprecated Please load APIs with discovery documents. */
22
- function load(name: "translate", version: "v3beta1", callback: () => any): void;
17
+ /** Load Cloud Translation API v3beta1 */
18
+ function load(
19
+ urlOrObject: 'https://translation.googleapis.com/$discovery/rest?version=v3beta1'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'translate', version: 'v3beta1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'translate',
26
+ version: 'v3beta1',
27
+ callback: () => any
28
+ ): void;
23
29
 
24
- namespace translate {
25
- interface BatchDocumentInputConfig {
26
- /**
27
- * Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.docx`) or a wildcard (for example,
28
- * `gs://translation-test/*`). File mime type is determined based on extension. Supported mime type includes: - `pdf`, application/pdf - `docx`,
29
- * application/vnd.openxmlformats-officedocument.wordprocessingml.document - `pptx`, application/vnd.openxmlformats-officedocument.presentationml.presentation - `xlsx`,
30
- * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. The max file size to support for `.pdf` is
31
- * 1GB and the max page limit is 1000 pages. The max file size to support for all input documents is 1GB.
32
- */
33
- gcsSource?:
34
- GcsSource;
35
- }
36
- interface BatchDocumentOutputConfig {
37
- /**
38
- * Google Cloud Storage destination for output content. For every single input document (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of
39
- * target_language_codes in the BatchTranslateDocumentRequest). While the input documents are being processed, we write/update an index file `index.csv` under
40
- * `gcs_destination.output_uri_prefix` (for example, gs://translation_output/index.csv) The index file is generated/updated as new files are being translated. The format is:
41
- * input_document,target_language_code,translation_output,error_output, glossary_translation_output,glossary_error_output `input_document` is one file we matched using
42
- * gcs_source.input_uri. `target_language_code` is provided in the request. `translation_output` contains the translations. (details provided below) `error_output` contains the error
43
- * message during processing of the file. Both translations_file and errors_file could be empty strings if we have no content to output. `glossary_translation_output` and
44
- * `glossary_error_output` are the translated output/error when we apply glossaries. They could also be empty if we have no content to output. Once a row is present in index.csv, the
45
- * input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written).
46
- * Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating.
47
- * (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The naming format of translation output files follows (for target language code [trg]): `translation_output`:
48
- * `gs://translation_output/a_b_c_[trg]_translation.[extension]` `glossary_translation_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The output
49
- * document will maintain the same file format as the input document. The naming format of error output files follows (for target language code [trg]): `error_output`:
50
- * `gs://translation_test/a_b_c_[trg]_errors.txt` `glossary_error_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.txt` The error output is a txt file containing error
51
- * details.
52
- */
53
- gcsDestination?:
54
- GcsDestination;
55
- }
56
- interface BatchTranslateDocumentRequest {
57
- /**
58
- * Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in
59
- * https://cloud.google.com/translate/attribution#attribution_and_logos
60
- */
61
- customizedAttribution?:
62
- string;
63
- /** Optional. If true, enable auto rotation correction in DVS. */
64
- enableRotationCorrection?:
65
- boolean;
66
- /**
67
- * Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when
68
- * is_translate_native_pdf_only: false && pdf_native_only: false
69
- */
70
- enableShadowRemovalNativePdf?:
71
- boolean;
72
- /**
73
- * Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents. Supported
74
- * file format conversion includes: - `application/pdf` to `application/vnd.openxmlformats-officedocument.wordprocessingml.document` If nothing specified, output files will be in the
75
- * same format as the original file.
76
- */
77
- formatConversions?:
78
- { [P in string]: string };
79
- /** Optional. Glossaries to be applied. It's keyed by target language code. */
80
- glossaries?:
81
- { [P in string]: TranslateTextGlossaryConfig };
82
- /**
83
- * Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use
84
- * UTF-8 encoding.
85
- */
86
- inputConfigs?:
87
- BatchDocumentInputConfig[];
88
- /**
89
- * Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model.
90
- * The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
91
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model
92
- * (nmt) is used.
93
- */
94
- models?:
95
- { [P in string]: string };
96
- /** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
97
- outputConfig?:
98
- BatchDocumentOutputConfig;
99
- /**
100
- * Required. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language
101
- * Support](https://cloud.google.com/translate/docs/languages).
102
- */
103
- sourceLanguageCode?:
104
- string;
105
- /** Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here. */
106
- targetLanguageCodes?:
107
- string[];
108
- }
109
- interface BatchTranslateTextRequest {
110
- /** Optional. Glossaries to be applied for translation. It's keyed by target language code. */
111
- glossaries?:
112
- { [P in string]: TranslateTextGlossaryConfig };
113
- /** Required. Input configurations. The total number of files matched should be <= 100. The total content size should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. */
114
- inputConfigs?:
115
- InputConfig[];
116
- /**
117
- * Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters,
118
- * numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See
119
- * https://cloud.google.com/translate/docs/labels for more information.
120
- */
121
- labels?:
122
- { [P in string]: string };
123
- /**
124
- * Optional. The models to use for translation. Map's key is target language code. Map's value is model name. Value can be a built-in general model, or an AutoML Translation model. The
125
- * value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
126
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model
127
- * (nmt) is used.
128
- */
129
- models?:
130
- { [P in string]: string };
131
- /** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
132
- outputConfig?:
133
- OutputConfig;
134
- /** Required. Source language code. */
135
- sourceLanguageCode?:
136
- string;
137
- /** Required. Specify up to 10 language codes here. */
138
- targetLanguageCodes?:
139
- string[];
140
- }
141
- // tslint:disable-next-line:no-empty-interface
142
- interface CancelOperationRequest {
143
- }
144
- interface DetectedLanguage {
145
- /** The confidence of the detection result for this language. */
146
- confidence?:
147
- number;
148
- /** The BCP-47 language code of source content in the request, detected automatically. */
149
- languageCode?:
150
- string;
151
- }
152
- interface DetectLanguageRequest {
153
- /** The content of the input stored as a string. */
154
- content?:
155
- string;
156
- /**
157
- * Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters,
158
- * numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See
159
- * https://cloud.google.com/translate/docs/labels for more information.
160
- */
161
- labels?:
162
- { [P in string]: string };
163
- /** Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". */
164
- mimeType?:
165
- string;
166
- /**
167
- * Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection
168
- * model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used.
169
- */
170
- model?:
171
- string;
172
- }
173
- interface DetectLanguageResponse {
174
- /** A list of detected languages sorted by detection confidence in descending order. The most probable language first. */
175
- languages?:
176
- DetectedLanguage[];
177
- }
178
- interface DocumentInputConfig {
179
- /** Document's content represented as a stream of bytes. */
180
- content?:
181
- string;
182
- /** Google Cloud Storage location. This must be a single file. For example: gs://example_bucket/example_file.pdf */
183
- gcsSource?:
184
- GcsSource;
185
- /**
186
- * Specifies the input document's mime_type. If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content
187
- * the mime_type must be provided. Currently supported mime types are: - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document -
188
- * application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
189
- */
190
- mimeType?:
191
- string;
192
- }
193
- interface DocumentOutputConfig {
194
- /**
195
- * Optional. Google Cloud Storage destination for the translation output, e.g., `gs://my_bucket/my_directory/`. The destination directory provided does not have to be empty, but the
196
- * bucket must exist. If a file with the same name as the output file already exists in the destination an error will be returned. For a DocumentInputConfig.contents provided document,
197
- * the output file will have the name "output_[trg]_translations.[ext]", where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's
198
- * extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with
199
- * URI: `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name "my_bucket" will have an output URI: `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where - [trg]
200
- * corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If the document was directly provided through
201
- * the request, then the output document will have the format: `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where - [trg] corresponds to the translated file's
202
- * language code, - [ext] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will
203
- * be equal to the default output URI but have `glossary_translations` instead of `translations`. For the previous example, its glossary URI would be:
204
- * `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no
205
- * partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket.
206
- */
207
- gcsDestination?:
208
- GcsDestination;
209
- /**
210
- * Optional. Specifies the translated document's mime_type. If not specified, the translated file's mime type will be the same as the input file's mime type. Currently only support the
211
- * output mime type to be the same as input mime type. - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document -
212
- * application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
213
- */
214
- mimeType?:
215
- string;
216
- }
217
- interface DocumentTranslation {
218
- /** The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats. */
219
- byteStreamOutputs?:
220
- string[];
221
- /**
222
- * The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected.
223
- * If the source language was passed, auto-detection of the language does not occur and this field is empty.
224
- */
225
- detectedLanguageCode?:
226
- string;
227
- /** The translated document's mime type. */
228
- mimeType?:
229
- string;
230
- }
231
- // tslint:disable-next-line:no-empty-interface
232
- interface Empty {
233
- }
234
- interface GcsDestination {
235
- /** Required. There must be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an INVALID_ARGUMENT (400) error is returned. */
236
- outputUriPrefix?:
237
- string;
238
- }
239
- interface GcsSource {
240
- /** Required. Source data URI. For example, `gs://my_bucket/my_object`. */
241
- inputUri?:
242
- string;
243
- }
244
- interface Glossary {
245
- /** Output only. When the glossary creation was finished. */
246
- endTime?:
247
- string;
248
- /** Output only. The number of entries defined in the glossary. */
249
- entryCount?:
250
- number;
251
- /** Required. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints. */
252
- inputConfig?:
253
- GlossaryInputConfig;
254
- /** Used with equivalent term set glossaries. */
255
- languageCodesSet?:
256
- LanguageCodesSet;
257
- /** Used with unidirectional glossaries. */
258
- languagePair?:
259
- LanguageCodePair;
260
- /** Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. */
261
- name?:
262
- string;
263
- /** Output only. When CreateGlossary was called. */
264
- submitTime?:
265
- string;
266
- }
267
- interface GlossaryInputConfig {
268
- /**
269
- * Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported
270
- * URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): 2 column
271
- * file, tab- or comma-separated. The first column is source text. The second column is target text. The file must not contain headers. That is, the first row is data, not column
272
- * names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent
273
- * glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary).
274
- */
275
- gcsSource?:
276
- GcsSource;
277
- }
278
- interface InputConfig {
279
- /**
280
- * Required. Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.tsv`) or a wildcard (for example,
281
- * `gs://translation-test/*`). If a file extension is `.tsv`, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column
282
- * is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K
283
- * Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant. You could use https://github.com/Clever/csvlint to check potential
284
- * formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv The other supported file extensions are `.txt` or `.html`, which is treated as a single large chunk
285
- * of text.
286
- */
287
- gcsSource?:
288
- GcsSource;
289
- /**
290
- * Optional. Can be "text/plain" or "text/html". For `.tsv`, "text/html" is used if mime_type is missing. For `.html`, this field must be "text/html" or empty. For `.txt`, this field
291
- * must be "text/plain" or empty.
292
- */
293
- mimeType?:
294
- string;
295
- }
296
- interface LanguageCodePair {
297
- /** Required. The BCP-47 language code of the input text, for example, "en-US". Expected to be an exact match for GlossaryTerm.language_code. */
298
- sourceLanguageCode?:
299
- string;
300
- /** Required. The BCP-47 language code for translation output, for example, "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. */
301
- targetLanguageCode?:
302
- string;
303
- }
304
- interface LanguageCodesSet {
305
- /**
306
- * The BCP-47 language code(s) for terms defined in the glossary. All entries are unique. The list contains at least two entries. Expected to be an exact match for
307
- * GlossaryTerm.language_code.
308
- */
309
- languageCodes?:
310
- string[];
311
- }
312
- interface ListGlossariesResponse {
313
- /** The list of glossaries for a project. */
314
- glossaries?:
315
- Glossary[];
316
- /**
317
- * A token to retrieve a page of results. Pass this value in the [ListGlossariesRequest.page_token] field in the subsequent call to `ListGlossaries` method to retrieve the next page of
318
- * results.
319
- */
320
- nextPageToken?:
321
- string;
322
- }
323
- interface ListLocationsResponse {
324
- /** A list of locations that matches the specified filter in the request. */
325
- locations?:
326
- Location[];
327
- /** The standard List next-page token. */
328
- nextPageToken?:
329
- string;
330
- }
331
- interface ListOperationsResponse {
332
- /** The standard List next-page token. */
333
- nextPageToken?:
334
- string;
335
- /** A list of operations that matches the specified filter in the request. */
336
- operations?:
337
- Operation[];
338
- }
339
- interface Location {
340
- /** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
341
- displayName?:
342
- string;
343
- /** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
344
- labels?:
345
- { [P in string]: string };
346
- /** The canonical id for this location. For example: `"us-east1"`. */
347
- locationId?:
348
- string;
349
- /** Service-specific metadata. For example the available capacity at the given location. */
350
- metadata?:
351
- { [P in string]: any };
352
- /** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
353
- name?:
354
- string;
355
- }
356
- interface Operation {
357
- /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
358
- done?:
359
- boolean;
360
- /** The error result of the operation in case of failure or cancellation. */
361
- error?:
362
- Status;
363
- /**
364
- * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such
365
- * metadata. Any method that returns a long-running operation should document the metadata type, if any.
366
- */
367
- metadata?:
368
- { [P in string]: any };
369
- /**
370
- * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
371
- * with `operations/{unique_id}`.
372
- */
373
- name?:
374
- string;
375
- /**
376
- * The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original
377
- * method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original
378
- * method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
379
- */
380
- response?:
381
- { [P in string]: any };
382
- }
383
- interface OutputConfig {
384
- /**
385
- * Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of
386
- * target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\n' instead of '\r\n'. We don't
387
- * provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example,
388
- * gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file,
389
- * glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file
390
- * contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be
391
- * empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we
392
- * have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and
393
- * ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy
394
- * applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language
395
- * code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request
396
- * provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary.
397
- * Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error
398
- * applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output
399
- * file. If glossary is requested, a separate glossary_translations_file has format of `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` The format of errors file
400
- * (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_errors.[extension]` If the input file extension is tsv, errors_file contains the following: Column 1: ID of
401
- * the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the
402
- * translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html,
403
- * glossary_error_file will be generated that contains error details. glossary_error_file has format of `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]`
404
- */
405
- gcsDestination?:
406
- GcsDestination;
407
- }
408
- interface Status {
409
- /** The status code, which should be an enum value of google.rpc.Code. */
410
- code?:
411
- number;
412
- /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
413
- details?:
414
- Array<{ [P in string]: any }>;
415
- /**
416
- * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the
417
- * client.
418
- */
419
- message?:
420
- string;
421
- }
422
- interface SupportedLanguage {
423
- /** Human readable name of the language localized in the display language specified in the request. */
424
- displayName?:
425
- string;
426
- /**
427
- * Supported language code, generally consisting of its ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes including language and region identifiers are
428
- * returned (for example, 'zh-TW' and 'zh-CN')
429
- */
430
- languageCode?:
431
- string;
432
- /** Can be used as source language. */
433
- supportSource?:
434
- boolean;
435
- /** Can be used as target language. */
436
- supportTarget?:
437
- boolean;
438
- }
439
- interface SupportedLanguages {
440
- /** A list of supported language responses. This list contains an entry for each language the Translation API supports. */
441
- languages?:
442
- SupportedLanguage[];
443
- }
444
- interface TranslateDocumentRequest {
445
- /**
446
- * Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in
447
- * https://cloud.google.com/translate/attribution#attribution_and_logos
448
- */
449
- customizedAttribution?:
450
- string;
451
- /** Required. Input configurations. */
452
- documentInputConfig?:
453
- DocumentInputConfig;
454
- /**
455
- * Optional. Output configurations. Defines if the output file should be stored within Cloud Storage as well as the desired output format. If not provided the translated file will only
456
- * be returned through a byte-stream and its output mime type will be the same as the input file's mime type.
457
- */
458
- documentOutputConfig?:
459
- DocumentOutputConfig;
460
- /** Optional. If true, enable auto rotation correction in DVS. */
461
- enableRotationCorrection?:
462
- boolean;
463
- /**
464
- * Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when
465
- * is_translate_native_pdf_only: false && pdf_native_only: false
466
- */
467
- enableShadowRemovalNativePdf?:
468
- boolean;
469
- /** Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned. */
470
- glossaryConfig?:
471
- TranslateTextGlossaryConfig;
472
- /** Optional. is_translate_native_pdf_only field for external customers. If true, the page limit of online native pdf translation is 300 and only native pdf pages will be translated. */
473
- isTranslateNativePdfOnly?:
474
- boolean;
475
- /**
476
- * Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters,
477
- * numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See
478
- * https://cloud.google.com/translate/docs/advanced/labels for more information.
479
- */
480
- labels?:
481
- { [P in string]: string };
482
- /**
483
- * Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models:
484
- * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
485
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If not provided, the default Google model (NMT) will be used for translation.
486
- */
487
- model?:
488
- string;
489
- /**
490
- * Optional. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language
491
- * isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request
492
- * contains a glossary or a custom model.
493
- */
494
- sourceLanguageCode?:
495
- string;
496
- /** Required. The BCP-47 language code to use for translation of the input document, set to one of the language codes listed in Language Support. */
497
- targetLanguageCode?:
498
- string;
499
- }
500
- interface TranslateDocumentResponse {
501
- /** Translated document. */
502
- documentTranslation?:
503
- DocumentTranslation;
504
- /** The `glossary_config` used for this translation. */
505
- glossaryConfig?:
506
- TranslateTextGlossaryConfig;
507
- /** The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply. */
508
- glossaryDocumentTranslation?:
509
- DocumentTranslation;
510
- /**
511
- * Only present when 'model' is present in the request. 'model' is normalized to have a project number. For example: If the 'model' field in TranslateDocumentRequest is:
512
- * `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.
513
- */
514
- model?:
515
- string;
516
- }
517
- interface TranslateTextGlossaryConfig {
518
- /** Required. Specifies the glossary used for this translation. Use this format: projects/*‍/locations/*‍/glossaries/* */
519
- glossary?:
520
- string;
521
- /** Optional. Indicates match is case-insensitive. Default value is false if missing. */
522
- ignoreCase?:
523
- boolean;
524
- }
525
- interface TranslateTextRequest {
526
- /**
527
- * Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. The max length of this field is 1024. Use BatchTranslateText for
528
- * larger text.
529
- */
530
- contents?:
531
- string[];
532
- /** Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned. */
533
- glossaryConfig?:
534
- TranslateTextGlossaryConfig;
535
- /**
536
- * Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters,
537
- * numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See
538
- * https://cloud.google.com/translate/docs/labels for more information.
539
- */
540
- labels?:
541
- { [P in string]: string };
542
- /** Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". */
543
- mimeType?:
544
- string;
545
- /**
546
- * Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models:
547
- * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
548
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, For global (non-regionalized) requests, use `location-id` `global`. For example,
549
- * `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used
550
- */
551
- model?:
552
- string;
553
- /**
554
- * Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language
555
- * isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.
556
- */
557
- sourceLanguageCode?:
558
- string;
559
- /** Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support. */
560
- targetLanguageCode?:
561
- string;
562
- }
563
- interface TranslateTextResponse {
564
- /** Text translation responses if a glossary is provided in the request. This can be the same as `translations` if no terms apply. This field has the same length as `contents`. */
565
- glossaryTranslations?:
566
- Translation[];
567
- /** Text translation responses with no glossary applied. This field has the same length as `contents`. */
568
- translations?:
569
- Translation[];
570
- }
571
- interface Translation {
572
- /**
573
- * The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was
574
- * passed, auto-detection of the language does not occur and this field is empty.
575
- */
576
- detectedLanguageCode?:
577
- string;
578
- /** The `glossary_config` used for this translation. */
579
- glossaryConfig?:
580
- TranslateTextGlossaryConfig;
581
- /**
582
- * Only present when `model` is present in the request. `model` here is normalized to have project number. For example: If the `model` requested in TranslationTextRequest is
583
- * `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`.
584
- */
585
- model?:
586
- string;
587
- /** Text translated into the target language. If an error occurs during translation, this field might be excluded from the response. */
588
- translatedText?:
589
- string;
590
- }
591
- interface WaitOperationRequest {
592
- /**
593
- * The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also
594
- * specified, the shorter one will be used.
595
- */
596
- timeout?:
597
- string;
598
- }
599
- interface GlossariesResource {
600
- /** Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. */
601
- create(request: {
602
- /** V1 error format. */
603
- "$.xgafv"?:
604
- string;
605
- /** OAuth access token. */
606
- access_token?:
607
- string;
608
- /** Data format for response. */
609
- alt?:
610
- string;
611
- /** JSONP */
612
- callback?:
613
- string;
614
- /** Selector specifying which fields to include in a partial response. */
615
- fields?:
616
- string;
617
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
618
- key?:
619
- string;
620
- /** OAuth 2.0 token for the current user. */
621
- oauth_token?:
622
- string;
623
- /** Required. The project name. */
624
- parent:
625
- string;
626
- /** Returns response with indentations and line breaks. */
627
- prettyPrint?:
628
- boolean;
629
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
630
- quotaUser?:
631
- string;
632
- /** Upload protocol for media (e.g. "raw", "multipart"). */
633
- upload_protocol?:
634
- string;
635
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
636
- uploadType?:
637
- string;
638
- /** Request body */
639
- resource:
640
- Glossary;
641
- }): Request<Operation>;
642
- create(request: {
643
- /** V1 error format. */
644
- "$.xgafv"?:
645
- string;
646
- /** OAuth access token. */
647
- access_token?:
648
- string;
649
- /** Data format for response. */
650
- alt?:
651
- string;
652
- /** JSONP */
653
- callback?:
654
- string;
655
- /** Selector specifying which fields to include in a partial response. */
656
- fields?:
657
- string;
658
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
659
- key?:
660
- string;
661
- /** OAuth 2.0 token for the current user. */
662
- oauth_token?:
663
- string;
664
- /** Required. The project name. */
665
- parent:
666
- string;
667
- /** Returns response with indentations and line breaks. */
668
- prettyPrint?:
669
- boolean;
670
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
671
- quotaUser?:
672
- string;
673
- /** Upload protocol for media (e.g. "raw", "multipart"). */
674
- upload_protocol?:
675
- string;
676
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
677
- uploadType?:
678
- string;
679
- },
680
- body: Glossary): Request<Operation>;
681
- /** Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. */
682
- delete(request?: {
683
- /** V1 error format. */
684
- "$.xgafv"?:
685
- string;
686
- /** OAuth access token. */
687
- access_token?:
688
- string;
689
- /** Data format for response. */
690
- alt?:
691
- string;
692
- /** JSONP */
693
- callback?:
694
- string;
695
- /** Selector specifying which fields to include in a partial response. */
696
- fields?:
697
- string;
698
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
699
- key?:
700
- string;
701
- /** Required. The name of the glossary to delete. */
702
- name:
703
- string;
704
- /** OAuth 2.0 token for the current user. */
705
- oauth_token?:
706
- string;
707
- /** Returns response with indentations and line breaks. */
708
- prettyPrint?:
709
- boolean;
710
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
711
- quotaUser?:
712
- string;
713
- /** Upload protocol for media (e.g. "raw", "multipart"). */
714
- upload_protocol?:
715
- string;
716
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
717
- uploadType?:
718
- string;
719
- }): Request<Operation>;
720
- /** Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. */
721
- get(request?: {
722
- /** V1 error format. */
723
- "$.xgafv"?:
724
- string;
725
- /** OAuth access token. */
726
- access_token?:
727
- string;
728
- /** Data format for response. */
729
- alt?:
730
- string;
731
- /** JSONP */
732
- callback?:
733
- string;
734
- /** Selector specifying which fields to include in a partial response. */
735
- fields?:
736
- string;
737
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
738
- key?:
739
- string;
740
- /** Required. The name of the glossary to retrieve. */
741
- name:
742
- string;
743
- /** OAuth 2.0 token for the current user. */
744
- oauth_token?:
745
- string;
746
- /** Returns response with indentations and line breaks. */
747
- prettyPrint?:
748
- boolean;
749
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
750
- quotaUser?:
751
- string;
752
- /** Upload protocol for media (e.g. "raw", "multipart"). */
753
- upload_protocol?:
754
- string;
755
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
756
- uploadType?:
757
- string;
758
- }): Request<Glossary>;
759
- /** Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. */
760
- list(request?: {
761
- /** V1 error format. */
762
- "$.xgafv"?:
763
- string;
764
- /** OAuth access token. */
765
- access_token?:
766
- string;
767
- /** Data format for response. */
768
- alt?:
769
- string;
770
- /** JSONP */
771
- callback?:
772
- string;
773
- /** Selector specifying which fields to include in a partial response. */
774
- fields?:
775
- string;
776
- /**
777
- * Optional. Filter specifying constraints of a list operation. Specify the constraint by the format of "key=value", where key must be "src" or "tgt", and the value must be a valid
778
- * language code. For multiple restrictions, concatenate them by "AND" (uppercase only), such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used here, which means
779
- * using 'en-US' and 'en' can lead to different results, which depends on the language code you used when you create the glossary. For the unidirectional glossaries, the "src" and
780
- * "tgt" add restrictions on the source and target language code separately. For the equivalent term set glossaries, the "src" and/or "tgt" add restrictions on the term set. For
781
- * example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional glossaries which exactly match the source language code as "en-US" and the target language code "zh-CN", but
782
- * all equivalent term set glossaries which contain "en-US" and "zh-CN" in their language set will be picked. If missing, no filtering is performed.
783
- */
784
- filter?:
785
- string;
786
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
787
- key?:
788
- string;
789
- /** OAuth 2.0 token for the current user. */
790
- oauth_token?:
791
- string;
792
- /** Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default. */
793
- pageSize?:
794
- number;
795
- /**
796
- * Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossariesResponse.next_page_token] returned from the previous
797
- * call to `ListGlossaries` method. The first page is returned if `page_token`is empty or missing.
798
- */
799
- pageToken?:
800
- string;
801
- /** Required. The name of the project from which to list all of the glossaries. */
802
- parent:
803
- string;
804
- /** Returns response with indentations and line breaks. */
805
- prettyPrint?:
806
- boolean;
807
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
808
- quotaUser?:
809
- string;
810
- /** Upload protocol for media (e.g. "raw", "multipart"). */
811
- upload_protocol?:
812
- string;
813
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
814
- uploadType?:
815
- string;
816
- }): Request<ListGlossariesResponse>;
817
- }
818
- interface OperationsResource {
819
- /**
820
- * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support
821
- * this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the
822
- * operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a
823
- * google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
824
- */
825
- cancel(request: {
826
- /** V1 error format. */
827
- "$.xgafv"?:
828
- string;
829
- /** OAuth access token. */
830
- access_token?:
831
- string;
832
- /** Data format for response. */
833
- alt?:
834
- string;
835
- /** JSONP */
836
- callback?:
837
- string;
838
- /** Selector specifying which fields to include in a partial response. */
839
- fields?:
840
- string;
841
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
842
- key?:
843
- string;
844
- /** The name of the operation resource to be cancelled. */
845
- name:
846
- string;
847
- /** OAuth 2.0 token for the current user. */
848
- oauth_token?:
849
- string;
850
- /** Returns response with indentations and line breaks. */
851
- prettyPrint?:
852
- boolean;
853
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
854
- quotaUser?:
855
- string;
856
- /** Upload protocol for media (e.g. "raw", "multipart"). */
857
- upload_protocol?:
858
- string;
859
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
860
- uploadType?:
861
- string;
862
- /** Request body */
863
- resource:
864
- CancelOperationRequest;
865
- }): Request<{}>;
866
- cancel(request: {
867
- /** V1 error format. */
868
- "$.xgafv"?:
869
- string;
870
- /** OAuth access token. */
871
- access_token?:
872
- string;
873
- /** Data format for response. */
874
- alt?:
875
- string;
876
- /** JSONP */
877
- callback?:
878
- string;
879
- /** Selector specifying which fields to include in a partial response. */
880
- fields?:
881
- string;
882
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
883
- key?:
884
- string;
885
- /** The name of the operation resource to be cancelled. */
886
- name:
887
- string;
888
- /** OAuth 2.0 token for the current user. */
889
- oauth_token?:
890
- string;
891
- /** Returns response with indentations and line breaks. */
892
- prettyPrint?:
893
- boolean;
894
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
895
- quotaUser?:
896
- string;
897
- /** Upload protocol for media (e.g. "raw", "multipart"). */
898
- upload_protocol?:
899
- string;
900
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
901
- uploadType?:
902
- string;
903
- },
904
- body: CancelOperationRequest): Request<{}>;
905
- /**
906
- * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't
907
- * support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
908
- */
909
- delete(request?: {
910
- /** V1 error format. */
911
- "$.xgafv"?:
912
- string;
913
- /** OAuth access token. */
914
- access_token?:
915
- string;
916
- /** Data format for response. */
917
- alt?:
918
- string;
919
- /** JSONP */
920
- callback?:
921
- string;
922
- /** Selector specifying which fields to include in a partial response. */
923
- fields?:
924
- string;
925
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
926
- key?:
927
- string;
928
- /** The name of the operation resource to be deleted. */
929
- name:
930
- string;
931
- /** OAuth 2.0 token for the current user. */
932
- oauth_token?:
933
- string;
934
- /** Returns response with indentations and line breaks. */
935
- prettyPrint?:
936
- boolean;
937
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
938
- quotaUser?:
939
- string;
940
- /** Upload protocol for media (e.g. "raw", "multipart"). */
941
- upload_protocol?:
942
- string;
943
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
944
- uploadType?:
945
- string;
946
- }): Request<{}>;
947
- /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
948
- get(request?: {
949
- /** V1 error format. */
950
- "$.xgafv"?:
951
- string;
952
- /** OAuth access token. */
953
- access_token?:
954
- string;
955
- /** Data format for response. */
956
- alt?:
957
- string;
958
- /** JSONP */
959
- callback?:
960
- string;
961
- /** Selector specifying which fields to include in a partial response. */
962
- fields?:
963
- string;
964
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
965
- key?:
966
- string;
967
- /** The name of the operation resource. */
968
- name:
969
- string;
970
- /** OAuth 2.0 token for the current user. */
971
- oauth_token?:
972
- string;
973
- /** Returns response with indentations and line breaks. */
974
- prettyPrint?:
975
- boolean;
976
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
977
- quotaUser?:
978
- string;
979
- /** Upload protocol for media (e.g. "raw", "multipart"). */
980
- upload_protocol?:
981
- string;
982
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
983
- uploadType?:
984
- string;
985
- }): Request<Operation>;
986
- /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
987
- list(request?: {
988
- /** V1 error format. */
989
- "$.xgafv"?:
990
- string;
991
- /** OAuth access token. */
992
- access_token?:
993
- string;
994
- /** Data format for response. */
995
- alt?:
996
- string;
997
- /** JSONP */
998
- callback?:
999
- string;
1000
- /** Selector specifying which fields to include in a partial response. */
1001
- fields?:
1002
- string;
1003
- /** The standard list filter. */
1004
- filter?:
1005
- string;
1006
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1007
- key?:
1008
- string;
1009
- /** The name of the operation's parent resource. */
1010
- name:
1011
- string;
1012
- /** OAuth 2.0 token for the current user. */
1013
- oauth_token?:
1014
- string;
1015
- /** The standard list page size. */
1016
- pageSize?:
1017
- number;
1018
- /** The standard list page token. */
1019
- pageToken?:
1020
- string;
1021
- /** Returns response with indentations and line breaks. */
1022
- prettyPrint?:
1023
- boolean;
1024
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1025
- quotaUser?:
1026
- string;
1027
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1028
- upload_protocol?:
1029
- string;
1030
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1031
- uploadType?:
1032
- string;
1033
- }): Request<ListOperationsResponse>;
1034
- /**
1035
- * Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is
1036
- * immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns
1037
- * `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even
1038
- * an immediate response is no guarantee that the operation is done.
1039
- */
1040
- wait(request: {
1041
- /** V1 error format. */
1042
- "$.xgafv"?:
1043
- string;
1044
- /** OAuth access token. */
1045
- access_token?:
1046
- string;
1047
- /** Data format for response. */
1048
- alt?:
1049
- string;
1050
- /** JSONP */
1051
- callback?:
1052
- string;
1053
- /** Selector specifying which fields to include in a partial response. */
1054
- fields?:
1055
- string;
1056
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1057
- key?:
1058
- string;
1059
- /** The name of the operation resource to wait on. */
1060
- name:
1061
- string;
1062
- /** OAuth 2.0 token for the current user. */
1063
- oauth_token?:
1064
- string;
1065
- /** Returns response with indentations and line breaks. */
1066
- prettyPrint?:
1067
- boolean;
1068
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1069
- quotaUser?:
1070
- string;
1071
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1072
- upload_protocol?:
1073
- string;
1074
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1075
- uploadType?:
1076
- string;
1077
- /** Request body */
1078
- resource:
1079
- WaitOperationRequest;
1080
- }): Request<Operation>;
1081
- wait(request: {
1082
- /** V1 error format. */
1083
- "$.xgafv"?:
1084
- string;
1085
- /** OAuth access token. */
1086
- access_token?:
1087
- string;
1088
- /** Data format for response. */
1089
- alt?:
1090
- string;
1091
- /** JSONP */
1092
- callback?:
1093
- string;
1094
- /** Selector specifying which fields to include in a partial response. */
1095
- fields?:
1096
- string;
1097
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1098
- key?:
1099
- string;
1100
- /** The name of the operation resource to wait on. */
1101
- name:
1102
- string;
1103
- /** OAuth 2.0 token for the current user. */
1104
- oauth_token?:
1105
- string;
1106
- /** Returns response with indentations and line breaks. */
1107
- prettyPrint?:
1108
- boolean;
1109
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1110
- quotaUser?:
1111
- string;
1112
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1113
- upload_protocol?:
1114
- string;
1115
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1116
- uploadType?:
1117
- string;
1118
- },
1119
- body: WaitOperationRequest): Request<Operation>;
1120
- }
1121
- interface LocationsResource {
1122
- /**
1123
- * Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial
1124
- * results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use
1125
- * google.longrunning.Operation.name to poll the status of the call.
1126
- */
1127
- batchTranslateDocument(request: {
1128
- /** V1 error format. */
1129
- "$.xgafv"?:
1130
- string;
1131
- /** OAuth access token. */
1132
- access_token?:
1133
- string;
1134
- /** Data format for response. */
1135
- alt?:
1136
- string;
1137
- /** JSONP */
1138
- callback?:
1139
- string;
1140
- /** Selector specifying which fields to include in a partial response. */
1141
- fields?:
1142
- string;
1143
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1144
- key?:
1145
- string;
1146
- /** OAuth 2.0 token for the current user. */
1147
- oauth_token?:
1148
- string;
1149
- /**
1150
- * Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only
1151
- * AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
1152
- */
1153
- parent:
1154
- string;
1155
- /** Returns response with indentations and line breaks. */
1156
- prettyPrint?:
1157
- boolean;
1158
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1159
- quotaUser?:
1160
- string;
1161
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1162
- upload_protocol?:
1163
- string;
1164
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1165
- uploadType?:
1166
- string;
1167
- /** Request body */
1168
- resource:
1169
- BatchTranslateDocumentRequest;
1170
- }): Request<Operation>;
1171
- batchTranslateDocument(request: {
1172
- /** V1 error format. */
1173
- "$.xgafv"?:
1174
- string;
1175
- /** OAuth access token. */
1176
- access_token?:
1177
- string;
1178
- /** Data format for response. */
1179
- alt?:
1180
- string;
1181
- /** JSONP */
1182
- callback?:
1183
- string;
1184
- /** Selector specifying which fields to include in a partial response. */
1185
- fields?:
1186
- string;
1187
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1188
- key?:
1189
- string;
1190
- /** OAuth 2.0 token for the current user. */
1191
- oauth_token?:
1192
- string;
1193
- /**
1194
- * Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only
1195
- * AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
1196
- */
1197
- parent:
1198
- string;
1199
- /** Returns response with indentations and line breaks. */
1200
- prettyPrint?:
1201
- boolean;
1202
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1203
- quotaUser?:
1204
- string;
1205
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1206
- upload_protocol?:
1207
- string;
1208
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1209
- uploadType?:
1210
- string;
1211
- },
1212
- body: BatchTranslateDocumentRequest): Request<Operation>;
1213
- /**
1214
- * Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial
1215
- * results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use
1216
- * google.longrunning.Operation.name to poll the status of the call.
1217
- */
1218
- batchTranslateText(request: {
1219
- /** V1 error format. */
1220
- "$.xgafv"?:
1221
- string;
1222
- /** OAuth access token. */
1223
- access_token?:
1224
- string;
1225
- /** Data format for response. */
1226
- alt?:
1227
- string;
1228
- /** JSONP */
1229
- callback?:
1230
- string;
1231
- /** Selector specifying which fields to include in a partial response. */
1232
- fields?:
1233
- string;
1234
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1235
- key?:
1236
- string;
1237
- /** OAuth 2.0 token for the current user. */
1238
- oauth_token?:
1239
- string;
1240
- /**
1241
- * Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported
1242
- * for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is
1243
- * returned.
1244
- */
1245
- parent:
1246
- string;
1247
- /** Returns response with indentations and line breaks. */
1248
- prettyPrint?:
1249
- boolean;
1250
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1251
- quotaUser?:
1252
- string;
1253
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1254
- upload_protocol?:
1255
- string;
1256
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1257
- uploadType?:
1258
- string;
1259
- /** Request body */
1260
- resource:
1261
- BatchTranslateTextRequest;
1262
- }): Request<Operation>;
1263
- batchTranslateText(request: {
1264
- /** V1 error format. */
1265
- "$.xgafv"?:
1266
- string;
1267
- /** OAuth access token. */
1268
- access_token?:
1269
- string;
1270
- /** Data format for response. */
1271
- alt?:
1272
- string;
1273
- /** JSONP */
1274
- callback?:
1275
- string;
1276
- /** Selector specifying which fields to include in a partial response. */
1277
- fields?:
1278
- string;
1279
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1280
- key?:
1281
- string;
1282
- /** OAuth 2.0 token for the current user. */
1283
- oauth_token?:
1284
- string;
1285
- /**
1286
- * Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported
1287
- * for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is
1288
- * returned.
1289
- */
1290
- parent:
1291
- string;
1292
- /** Returns response with indentations and line breaks. */
1293
- prettyPrint?:
1294
- boolean;
1295
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1296
- quotaUser?:
1297
- string;
1298
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1299
- upload_protocol?:
1300
- string;
1301
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1302
- uploadType?:
1303
- string;
1304
- },
1305
- body: BatchTranslateTextRequest): Request<Operation>;
1306
- /** Detects the language of text within a request. */
1307
- detectLanguage(request: {
1308
- /** V1 error format. */
1309
- "$.xgafv"?:
1310
- string;
1311
- /** OAuth access token. */
1312
- access_token?:
1313
- string;
1314
- /** Data format for response. */
1315
- alt?:
1316
- string;
1317
- /** JSONP */
1318
- callback?:
1319
- string;
1320
- /** Selector specifying which fields to include in a partial response. */
1321
- fields?:
1322
- string;
1323
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1324
- key?:
1325
- string;
1326
- /** OAuth 2.0 token for the current user. */
1327
- oauth_token?:
1328
- string;
1329
- /**
1330
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
1331
- * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same
1332
- * region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
1333
- */
1334
- parent:
1335
- string;
1336
- /** Returns response with indentations and line breaks. */
1337
- prettyPrint?:
1338
- boolean;
1339
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1340
- quotaUser?:
1341
- string;
1342
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1343
- upload_protocol?:
1344
- string;
1345
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1346
- uploadType?:
1347
- string;
1348
- /** Request body */
1349
- resource:
1350
- DetectLanguageRequest;
1351
- }): Request<DetectLanguageResponse>;
1352
- detectLanguage(request: {
1353
- /** V1 error format. */
1354
- "$.xgafv"?:
1355
- string;
1356
- /** OAuth access token. */
1357
- access_token?:
1358
- string;
1359
- /** Data format for response. */
1360
- alt?:
1361
- string;
1362
- /** JSONP */
1363
- callback?:
1364
- string;
1365
- /** Selector specifying which fields to include in a partial response. */
1366
- fields?:
1367
- string;
1368
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1369
- key?:
1370
- string;
1371
- /** OAuth 2.0 token for the current user. */
1372
- oauth_token?:
1373
- string;
1374
- /**
1375
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
1376
- * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same
1377
- * region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
1378
- */
1379
- parent:
1380
- string;
1381
- /** Returns response with indentations and line breaks. */
1382
- prettyPrint?:
1383
- boolean;
1384
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1385
- quotaUser?:
1386
- string;
1387
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1388
- upload_protocol?:
1389
- string;
1390
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1391
- uploadType?:
1392
- string;
1393
- },
1394
- body: DetectLanguageRequest): Request<DetectLanguageResponse>;
1395
- /** Gets information about a location. */
1396
- get(request?: {
1397
- /** V1 error format. */
1398
- "$.xgafv"?:
1399
- string;
1400
- /** OAuth access token. */
1401
- access_token?:
1402
- string;
1403
- /** Data format for response. */
1404
- alt?:
1405
- string;
1406
- /** JSONP */
1407
- callback?:
1408
- string;
1409
- /** Selector specifying which fields to include in a partial response. */
1410
- fields?:
1411
- string;
1412
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1413
- key?:
1414
- string;
1415
- /** Resource name for the location. */
1416
- name:
1417
- string;
1418
- /** OAuth 2.0 token for the current user. */
1419
- oauth_token?:
1420
- string;
1421
- /** Returns response with indentations and line breaks. */
1422
- prettyPrint?:
1423
- boolean;
1424
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1425
- quotaUser?:
1426
- string;
1427
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1428
- upload_protocol?:
1429
- string;
1430
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1431
- uploadType?:
1432
- string;
1433
- }): Request<Location>;
1434
- /** Returns a list of supported languages for translation. */
1435
- getSupportedLanguages(request?: {
1436
- /** V1 error format. */
1437
- "$.xgafv"?:
1438
- string;
1439
- /** OAuth access token. */
1440
- access_token?:
1441
- string;
1442
- /** Data format for response. */
1443
- alt?:
1444
- string;
1445
- /** JSONP */
1446
- callback?:
1447
- string;
1448
- /** Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. */
1449
- displayLanguageCode?:
1450
- string;
1451
- /** Selector specifying which fields to include in a partial response. */
1452
- fields?:
1453
- string;
1454
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1455
- key?:
1456
- string;
1457
- /**
1458
- * Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models:
1459
- * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
1460
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of
1461
- * Google general NMT model.
1462
- */
1463
- model?:
1464
- string;
1465
- /** OAuth 2.0 token for the current user. */
1466
- oauth_token?:
1467
- string;
1468
- /**
1469
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1470
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1471
- * Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
1472
- */
1473
- parent:
1474
- string;
1475
- /** Returns response with indentations and line breaks. */
1476
- prettyPrint?:
1477
- boolean;
1478
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1479
- quotaUser?:
1480
- string;
1481
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1482
- upload_protocol?:
1483
- string;
1484
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1485
- uploadType?:
1486
- string;
1487
- }): Request<SupportedLanguages>;
1488
- /** Lists information about the supported locations for this service. */
1489
- list(request?: {
1490
- /** V1 error format. */
1491
- "$.xgafv"?:
1492
- string;
1493
- /** OAuth access token. */
1494
- access_token?:
1495
- string;
1496
- /** Data format for response. */
1497
- alt?:
1498
- string;
1499
- /** JSONP */
1500
- callback?:
1501
- string;
1502
- /** Selector specifying which fields to include in a partial response. */
1503
- fields?:
1504
- string;
1505
- /**
1506
- * A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in
1507
- * [AIP-160](https://google.aip.dev/160).
1508
- */
1509
- filter?:
1510
- string;
1511
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1512
- key?:
1513
- string;
1514
- /** The resource that owns the locations collection, if applicable. */
1515
- name:
1516
- string;
1517
- /** OAuth 2.0 token for the current user. */
1518
- oauth_token?:
1519
- string;
1520
- /** The maximum number of results to return. If not set, the service selects a default. */
1521
- pageSize?:
1522
- number;
1523
- /** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
1524
- pageToken?:
1525
- string;
1526
- /** Returns response with indentations and line breaks. */
1527
- prettyPrint?:
1528
- boolean;
1529
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1530
- quotaUser?:
1531
- string;
1532
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1533
- upload_protocol?:
1534
- string;
1535
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1536
- uploadType?:
1537
- string;
1538
- }): Request<ListLocationsResponse>;
1539
- /** Translates documents in synchronous mode. */
1540
- translateDocument(request: {
1541
- /** V1 error format. */
1542
- "$.xgafv"?:
1543
- string;
1544
- /** OAuth access token. */
1545
- access_token?:
1546
- string;
1547
- /** Data format for response. */
1548
- alt?:
1549
- string;
1550
- /** JSONP */
1551
- callback?:
1552
- string;
1553
- /** Selector specifying which fields to include in a partial response. */
1554
- fields?:
1555
- string;
1556
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1557
- key?:
1558
- string;
1559
- /** OAuth 2.0 token for the current user. */
1560
- oauth_token?:
1561
- string;
1562
- /**
1563
- * Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use
1564
- * `projects/{project-number-or-id}/locations/global`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within
1565
- * the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
1566
- */
1567
- parent:
1568
- string;
1569
- /** Returns response with indentations and line breaks. */
1570
- prettyPrint?:
1571
- boolean;
1572
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1573
- quotaUser?:
1574
- string;
1575
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1576
- upload_protocol?:
1577
- string;
1578
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1579
- uploadType?:
1580
- string;
1581
- /** Request body */
1582
- resource:
1583
- TranslateDocumentRequest;
1584
- }): Request<TranslateDocumentResponse>;
1585
- translateDocument(request: {
1586
- /** V1 error format. */
1587
- "$.xgafv"?:
1588
- string;
1589
- /** OAuth access token. */
1590
- access_token?:
1591
- string;
1592
- /** Data format for response. */
1593
- alt?:
1594
- string;
1595
- /** JSONP */
1596
- callback?:
1597
- string;
1598
- /** Selector specifying which fields to include in a partial response. */
1599
- fields?:
1600
- string;
1601
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1602
- key?:
1603
- string;
1604
- /** OAuth 2.0 token for the current user. */
1605
- oauth_token?:
1606
- string;
1607
- /**
1608
- * Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use
1609
- * `projects/{project-number-or-id}/locations/global`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within
1610
- * the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
1611
- */
1612
- parent:
1613
- string;
1614
- /** Returns response with indentations and line breaks. */
1615
- prettyPrint?:
1616
- boolean;
1617
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1618
- quotaUser?:
1619
- string;
1620
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1621
- upload_protocol?:
1622
- string;
1623
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1624
- uploadType?:
1625
- string;
1626
- },
1627
- body: TranslateDocumentRequest): Request<TranslateDocumentResponse>;
1628
- /** Translates input text and returns translated text. */
1629
- translateText(request: {
1630
- /** V1 error format. */
1631
- "$.xgafv"?:
1632
- string;
1633
- /** OAuth access token. */
1634
- access_token?:
1635
- string;
1636
- /** Data format for response. */
1637
- alt?:
1638
- string;
1639
- /** JSONP */
1640
- callback?:
1641
- string;
1642
- /** Selector specifying which fields to include in a partial response. */
1643
- fields?:
1644
- string;
1645
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1646
- key?:
1647
- string;
1648
- /** OAuth 2.0 token for the current user. */
1649
- oauth_token?:
1650
- string;
1651
- /**
1652
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1653
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1654
- * Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an
1655
- * INVALID_ARGUMENT (400) error is returned.
1656
- */
1657
- parent:
1658
- string;
1659
- /** Returns response with indentations and line breaks. */
1660
- prettyPrint?:
1661
- boolean;
1662
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1663
- quotaUser?:
1664
- string;
1665
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1666
- upload_protocol?:
1667
- string;
1668
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1669
- uploadType?:
1670
- string;
1671
- /** Request body */
1672
- resource:
1673
- TranslateTextRequest;
1674
- }): Request<TranslateTextResponse>;
1675
- translateText(request: {
1676
- /** V1 error format. */
1677
- "$.xgafv"?:
1678
- string;
1679
- /** OAuth access token. */
1680
- access_token?:
1681
- string;
1682
- /** Data format for response. */
1683
- alt?:
1684
- string;
1685
- /** JSONP */
1686
- callback?:
1687
- string;
1688
- /** Selector specifying which fields to include in a partial response. */
1689
- fields?:
1690
- string;
1691
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1692
- key?:
1693
- string;
1694
- /** OAuth 2.0 token for the current user. */
1695
- oauth_token?:
1696
- string;
1697
- /**
1698
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1699
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1700
- * Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an
1701
- * INVALID_ARGUMENT (400) error is returned.
1702
- */
1703
- parent:
1704
- string;
1705
- /** Returns response with indentations and line breaks. */
1706
- prettyPrint?:
1707
- boolean;
1708
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1709
- quotaUser?:
1710
- string;
1711
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1712
- upload_protocol?:
1713
- string;
1714
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1715
- uploadType?:
1716
- string;
1717
- },
1718
- body: TranslateTextRequest): Request<TranslateTextResponse>;
1719
- glossaries:
1720
- GlossariesResource;
1721
- operations:
1722
- OperationsResource;
1723
- }
1724
- interface ProjectsResource {
1725
- /** Detects the language of text within a request. */
1726
- detectLanguage(request: {
1727
- /** V1 error format. */
1728
- "$.xgafv"?:
1729
- string;
1730
- /** OAuth access token. */
1731
- access_token?:
1732
- string;
1733
- /** Data format for response. */
1734
- alt?:
1735
- string;
1736
- /** JSONP */
1737
- callback?:
1738
- string;
1739
- /** Selector specifying which fields to include in a partial response. */
1740
- fields?:
1741
- string;
1742
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1743
- key?:
1744
- string;
1745
- /** OAuth 2.0 token for the current user. */
1746
- oauth_token?:
1747
- string;
1748
- /**
1749
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
1750
- * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same
1751
- * region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
1752
- */
1753
- parent:
1754
- string;
1755
- /** Returns response with indentations and line breaks. */
1756
- prettyPrint?:
1757
- boolean;
1758
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1759
- quotaUser?:
1760
- string;
1761
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1762
- upload_protocol?:
1763
- string;
1764
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1765
- uploadType?:
1766
- string;
1767
- /** Request body */
1768
- resource:
1769
- DetectLanguageRequest;
1770
- }): Request<DetectLanguageResponse>;
1771
- detectLanguage(request: {
1772
- /** V1 error format. */
1773
- "$.xgafv"?:
1774
- string;
1775
- /** OAuth access token. */
1776
- access_token?:
1777
- string;
1778
- /** Data format for response. */
1779
- alt?:
1780
- string;
1781
- /** JSONP */
1782
- callback?:
1783
- string;
1784
- /** Selector specifying which fields to include in a partial response. */
1785
- fields?:
1786
- string;
1787
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1788
- key?:
1789
- string;
1790
- /** OAuth 2.0 token for the current user. */
1791
- oauth_token?:
1792
- string;
1793
- /**
1794
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or
1795
- * `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same
1796
- * region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
1797
- */
1798
- parent:
1799
- string;
1800
- /** Returns response with indentations and line breaks. */
1801
- prettyPrint?:
1802
- boolean;
1803
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1804
- quotaUser?:
1805
- string;
1806
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1807
- upload_protocol?:
1808
- string;
1809
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1810
- uploadType?:
1811
- string;
1812
- },
1813
- body: DetectLanguageRequest): Request<DetectLanguageResponse>;
1814
- /** Returns a list of supported languages for translation. */
1815
- getSupportedLanguages(request?: {
1816
- /** V1 error format. */
1817
- "$.xgafv"?:
1818
- string;
1819
- /** OAuth access token. */
1820
- access_token?:
1821
- string;
1822
- /** Data format for response. */
1823
- alt?:
1824
- string;
1825
- /** JSONP */
1826
- callback?:
1827
- string;
1828
- /** Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. */
1829
- displayLanguageCode?:
1830
- string;
1831
- /** Selector specifying which fields to include in a partial response. */
1832
- fields?:
1833
- string;
1834
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1835
- key?:
1836
- string;
1837
- /**
1838
- * Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models:
1839
- * `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models:
1840
- * `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of
1841
- * Google general NMT model.
1842
- */
1843
- model?:
1844
- string;
1845
- /** OAuth 2.0 token for the current user. */
1846
- oauth_token?:
1847
- string;
1848
- /**
1849
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1850
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1851
- * Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
1852
- */
1853
- parent:
1854
- string;
1855
- /** Returns response with indentations and line breaks. */
1856
- prettyPrint?:
1857
- boolean;
1858
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1859
- quotaUser?:
1860
- string;
1861
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1862
- upload_protocol?:
1863
- string;
1864
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1865
- uploadType?:
1866
- string;
1867
- }): Request<SupportedLanguages>;
1868
- /** Translates input text and returns translated text. */
1869
- translateText(request: {
1870
- /** V1 error format. */
1871
- "$.xgafv"?:
1872
- string;
1873
- /** OAuth access token. */
1874
- access_token?:
1875
- string;
1876
- /** Data format for response. */
1877
- alt?:
1878
- string;
1879
- /** JSONP */
1880
- callback?:
1881
- string;
1882
- /** Selector specifying which fields to include in a partial response. */
1883
- fields?:
1884
- string;
1885
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1886
- key?:
1887
- string;
1888
- /** OAuth 2.0 token for the current user. */
1889
- oauth_token?:
1890
- string;
1891
- /**
1892
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1893
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1894
- * Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an
1895
- * INVALID_ARGUMENT (400) error is returned.
1896
- */
1897
- parent:
1898
- string;
1899
- /** Returns response with indentations and line breaks. */
1900
- prettyPrint?:
1901
- boolean;
1902
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1903
- quotaUser?:
1904
- string;
1905
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1906
- upload_protocol?:
1907
- string;
1908
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1909
- uploadType?:
1910
- string;
1911
- /** Request body */
1912
- resource:
1913
- TranslateTextRequest;
1914
- }): Request<TranslateTextResponse>;
1915
- translateText(request: {
1916
- /** V1 error format. */
1917
- "$.xgafv"?:
1918
- string;
1919
- /** OAuth access token. */
1920
- access_token?:
1921
- string;
1922
- /** Data format for response. */
1923
- alt?:
1924
- string;
1925
- /** JSONP */
1926
- callback?:
1927
- string;
1928
- /** Selector specifying which fields to include in a partial response. */
1929
- fields?:
1930
- string;
1931
- /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1932
- key?:
1933
- string;
1934
- /** OAuth 2.0 token for the current user. */
1935
- oauth_token?:
1936
- string;
1937
- /**
1938
- * Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or
1939
- * `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`.
1940
- * Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an
1941
- * INVALID_ARGUMENT (400) error is returned.
1942
- */
1943
- parent:
1944
- string;
1945
- /** Returns response with indentations and line breaks. */
1946
- prettyPrint?:
1947
- boolean;
1948
- /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1949
- quotaUser?:
1950
- string;
1951
- /** Upload protocol for media (e.g. "raw", "multipart"). */
1952
- upload_protocol?:
1953
- string;
1954
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1955
- uploadType?:
1956
- string;
1957
- },
1958
- body: TranslateTextRequest): Request<TranslateTextResponse>;
1959
- locations:
1960
- LocationsResource;
1961
- }
1962
-
1963
- const projects: ProjectsResource;
30
+ namespace translate {
31
+ interface BatchDocumentInputConfig {
32
+ /** Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.docx`) or a wildcard (for example, `gs://translation-test/*`). File mime type is determined based on extension. Supported mime type includes: - `pdf`, application/pdf - `docx`, application/vnd.openxmlformats-officedocument.wordprocessingml.document - `pptx`, application/vnd.openxmlformats-officedocument.presentationml.presentation - `xlsx`, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. The max file size to support for `.pdf` is 1GB and the max page limit is 1000 pages. The max file size to support for all input documents is 1GB. */
33
+ gcsSource?: GcsSource;
34
+ }
35
+ interface BatchDocumentOutputConfig {
36
+ /** Google Cloud Storage destination for output content. For every single input document (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateDocumentRequest). While the input documents are being processed, we write/update an index file `index.csv` under `gcs_destination.output_uri_prefix` (for example, gs://translation_output/index.csv) The index file is generated/updated as new files are being translated. The format is: input_document,target_language_code,translation_output,error_output, glossary_translation_output,glossary_error_output `input_document` is one file we matched using gcs_source.input_uri. `target_language_code` is provided in the request. `translation_output` contains the translations. (details provided below) `error_output` contains the error message during processing of the file. Both translations_file and errors_file could be empty strings if we have no content to output. `glossary_translation_output` and `glossary_error_output` are the translated output/error when we apply glossaries. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The naming format of translation output files follows (for target language code [trg]): `translation_output`: `gs://translation_output/a_b_c_[trg]_translation.[extension]` `glossary_translation_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The output document will maintain the same file format as the input document. The naming format of error output files follows (for target language code [trg]): `error_output`: `gs://translation_test/a_b_c_[trg]_errors.txt` `glossary_error_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.txt` The error output is a txt file containing error details. */
37
+ gcsDestination?: GcsDestination;
38
+ }
39
+ interface BatchTranslateDocumentRequest {
40
+ /** Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos */
41
+ customizedAttribution?: string;
42
+ /** Optional. If true, enable auto rotation correction in DVS. */
43
+ enableRotationCorrection?: boolean;
44
+ /** Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when is_translate_native_pdf_only: false && pdf_native_only: false */
45
+ enableShadowRemovalNativePdf?: boolean;
46
+ /** Optional. File format conversion map to be applied to all input files. Map's key is the original mime_type. Map's value is the target mime_type of translated documents. Supported file format conversion includes: - `application/pdf` to `application/vnd.openxmlformats-officedocument.wordprocessingml.document` If nothing specified, output files will be in the same format as the original file. */
47
+ formatConversions?: {[P in string]: string};
48
+ /** Optional. Glossaries to be applied. It's keyed by target language code. */
49
+ glossaries?: {[P in string]: TranslateTextGlossaryConfig};
50
+ /** Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. */
51
+ inputConfigs?: BatchDocumentInputConfig[];
52
+ /** Optional. The models to use for translation. Map's key is target language code. Map's value is the model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used. */
53
+ models?: {[P in string]: string};
54
+ /** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
55
+ outputConfig?: BatchDocumentOutputConfig;
56
+ /** Required. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in [Language Support](https://cloud.google.com/translate/docs/languages). */
57
+ sourceLanguageCode?: string;
58
+ /** Required. The BCP-47 language code to use for translation of the input document. Specify up to 10 language codes here. */
59
+ targetLanguageCodes?: string[];
60
+ }
61
+ interface BatchTranslateTextRequest {
62
+ /** Optional. Glossaries to be applied for translation. It's keyed by target language code. */
63
+ glossaries?: {[P in string]: TranslateTextGlossaryConfig};
64
+ /** Required. Input configurations. The total number of files matched should be <= 100. The total content size should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. */
65
+ inputConfigs?: InputConfig[];
66
+ /** Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information. */
67
+ labels?: {[P in string]: string};
68
+ /** Optional. The models to use for translation. Map's key is target language code. Map's value is model name. Value can be a built-in general model, or an AutoML Translation model. The value format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If the map is empty or a specific model is not requested for a language pair, then default google model (nmt) is used. */
69
+ models?: {[P in string]: string};
70
+ /** Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. */
71
+ outputConfig?: OutputConfig;
72
+ /** Required. Source language code. */
73
+ sourceLanguageCode?: string;
74
+ /** Required. Specify up to 10 language codes here. */
75
+ targetLanguageCodes?: string[];
76
+ }
77
+ interface CancelOperationRequest {}
78
+ interface DetectedLanguage {
79
+ /** The confidence of the detection result for this language. */
80
+ confidence?: number;
81
+ /** The BCP-47 language code of source content in the request, detected automatically. */
82
+ languageCode?: string;
83
+ }
84
+ interface DetectLanguageRequest {
85
+ /** The content of the input stored as a string. */
86
+ content?: string;
87
+ /** Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information. */
88
+ labels?: {[P in string]: string};
89
+ /** Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". */
90
+ mimeType?: string;
91
+ /** Optional. The language detection model to be used. Format: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` Only one language detection model is currently supported: `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. If not specified, the default model is used. */
92
+ model?: string;
93
+ }
94
+ interface DetectLanguageResponse {
95
+ /** A list of detected languages sorted by detection confidence in descending order. The most probable language first. */
96
+ languages?: DetectedLanguage[];
97
+ }
98
+ interface DocumentInputConfig {
99
+ /** Document's content represented as a stream of bytes. */
100
+ content?: string;
101
+ /** Google Cloud Storage location. This must be a single file. For example: gs://example_bucket/example_file.pdf */
102
+ gcsSource?: GcsSource;
103
+ /** Specifies the input document's mime_type. If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content the mime_type must be provided. Currently supported mime types are: - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet */
104
+ mimeType?: string;
105
+ }
106
+ interface DocumentOutputConfig {
107
+ /** Optional. Google Cloud Storage destination for the translation output, e.g., `gs://my_bucket/my_directory/`. The destination directory provided does not have to be empty, but the bucket must exist. If a file with the same name as the output file already exists in the destination an error will be returned. For a DocumentInputConfig.contents provided document, the output file will have the name "output_[trg]_translations.[ext]", where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. For a DocumentInputConfig.gcs_uri provided document, the output file will have a name according to its URI. For example: an input file with URI: `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name "my_bucket" will have an output URI: `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If the document was directly provided through the request, then the output document will have the format: `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where - [trg] corresponds to the translated file's language code, - [ext] corresponds to the translated file's extension according to its mime type. If a glossary was provided, then the output URI for the glossary translation will be equal to the default output URI but have `glossary_translations` instead of `translations`. For the previous example, its glossary URI would be: `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. Thus the max number of output files will be 2 (Translated document, Glossary translated document). Callers should expect no partial outputs. If there is any error during document translation, no output will be stored in the Cloud Storage bucket. */
108
+ gcsDestination?: GcsDestination;
109
+ /** Optional. Specifies the translated document's mime_type. If not specified, the translated file's mime type will be the same as the input file's mime type. Currently only support the output mime type to be the same as input mime type. - application/pdf - application/vnd.openxmlformats-officedocument.wordprocessingml.document - application/vnd.openxmlformats-officedocument.presentationml.presentation - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet */
110
+ mimeType?: string;
111
+ }
112
+ interface DocumentTranslation {
113
+ /** The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats. */
114
+ byteStreamOutputs?: string[];
115
+ /** The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty. */
116
+ detectedLanguageCode?: string;
117
+ /** The translated document's mime type. */
118
+ mimeType?: string;
119
+ }
120
+ interface Empty {}
121
+ interface GcsDestination {
122
+ /** Required. There must be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with "/" and start with "gs://", otherwise an INVALID_ARGUMENT (400) error is returned. */
123
+ outputUriPrefix?: string;
124
+ }
125
+ interface GcsSource {
126
+ /** Required. Source data URI. For example, `gs://my_bucket/my_object`. */
127
+ inputUri?: string;
128
+ }
129
+ interface Glossary {
130
+ /** Output only. When the glossary creation was finished. */
131
+ endTime?: string;
132
+ /** Output only. The number of entries defined in the glossary. */
133
+ entryCount?: number;
134
+ /** Required. Provides examples to build the glossary from. Total glossary must not exceed 10M Unicode codepoints. */
135
+ inputConfig?: GlossaryInputConfig;
136
+ /** Used with equivalent term set glossaries. */
137
+ languageCodesSet?: LanguageCodesSet;
138
+ /** Used with unidirectional glossaries. */
139
+ languagePair?: LanguageCodePair;
140
+ /** Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. */
141
+ name?: string;
142
+ /** Output only. When CreateGlossary was called. */
143
+ submitTime?: string;
144
+ }
145
+ interface GlossaryInputConfig {
146
+ /** Required. Google Cloud Storage location of glossary data. File format is determined based on the filename extension. API returns [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file formats. Wildcards are not allowed. This must be a single file in one of the following formats: For unidirectional glossaries: - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated. The first column is source text. The second column is target text. The file must not contain headers. That is, the first row is data, not column names. - TMX (`.tmx`): TMX file with parallel data defining source/target term pairs. For equivalent term sets glossaries: - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). */
147
+ gcsSource?: GcsSource;
148
+ }
149
+ interface InputConfig {
150
+ /** Required. Google Cloud Storage location for the source input. This can be a single file (for example, `gs://translation-test/input.tsv`) or a wildcard (for example, `gs://translation-test/*`). If a file extension is `.tsv`, it can contain either one or two columns. The first column (optional) is the id of the text request. If the first column is missing, we use the row number (0-based) from the input file as the ID in the output file. The second column is the actual text to be translated. We recommend each row be <= 10K Unicode codepoints, otherwise an error might be returned. Note that the input tsv must be RFC 4180 compliant. You could use https://github.com/Clever/csvlint to check potential formatting errors in your tsv file. csvlint --delimiter='\t' your_input_file.tsv The other supported file extensions are `.txt` or `.html`, which is treated as a single large chunk of text. */
151
+ gcsSource?: GcsSource;
152
+ /** Optional. Can be "text/plain" or "text/html". For `.tsv`, "text/html" is used if mime_type is missing. For `.html`, this field must be "text/html" or empty. For `.txt`, this field must be "text/plain" or empty. */
153
+ mimeType?: string;
154
+ }
155
+ interface LanguageCodePair {
156
+ /** Required. The BCP-47 language code of the input text, for example, "en-US". Expected to be an exact match for GlossaryTerm.language_code. */
157
+ sourceLanguageCode?: string;
158
+ /** Required. The BCP-47 language code for translation output, for example, "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. */
159
+ targetLanguageCode?: string;
160
+ }
161
+ interface LanguageCodesSet {
162
+ /** The BCP-47 language code(s) for terms defined in the glossary. All entries are unique. The list contains at least two entries. Expected to be an exact match for GlossaryTerm.language_code. */
163
+ languageCodes?: string[];
164
+ }
165
+ interface ListGlossariesResponse {
166
+ /** The list of glossaries for a project. */
167
+ glossaries?: Glossary[];
168
+ /** A token to retrieve a page of results. Pass this value in the [ListGlossariesRequest.page_token] field in the subsequent call to `ListGlossaries` method to retrieve the next page of results. */
169
+ nextPageToken?: string;
170
+ }
171
+ interface ListLocationsResponse {
172
+ /** A list of locations that matches the specified filter in the request. */
173
+ locations?: Location[];
174
+ /** The standard List next-page token. */
175
+ nextPageToken?: string;
1964
176
  }
177
+ interface ListOperationsResponse {
178
+ /** The standard List next-page token. */
179
+ nextPageToken?: string;
180
+ /** A list of operations that matches the specified filter in the request. */
181
+ operations?: Operation[];
182
+ }
183
+ interface Location {
184
+ /** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
185
+ displayName?: string;
186
+ /** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
187
+ labels?: {[P in string]: string};
188
+ /** The canonical id for this location. For example: `"us-east1"`. */
189
+ locationId?: string;
190
+ /** Service-specific metadata. For example the available capacity at the given location. */
191
+ metadata?: {[P in string]: any};
192
+ /** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
193
+ name?: string;
194
+ }
195
+ interface Operation {
196
+ /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
197
+ done?: boolean;
198
+ /** The error result of the operation in case of failure or cancellation. */
199
+ error?: Status;
200
+ /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
201
+ metadata?: {[P in string]: any};
202
+ /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
203
+ name?: string;
204
+ /** The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */
205
+ response?: {[P in string]: any};
206
+ }
207
+ interface OutputConfig {
208
+ /** Google Cloud Storage destination for output content. For every single input file (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateTextRequest). Output files (tsv) generated are compliant with RFC 4180 except that record delimiters are '\n' instead of '\r\n'. We don't provide any way to change record delimiters. While the input files are being processed, we write/update an index file 'index.csv' under 'output_uri_prefix' (for example, gs://translation-test/index.csv) The index file is generated/updated as new files are being translated. The format is: input_file,target_language_code,translations_file,errors_file, glossary_translations_file,glossary_errors_file input_file is one file we matched using gcs_source.input_uri. target_language_code is provided in the request. translations_file contains the translations. (details provided below) errors_file contains the errors during processing of the file. (details below). Both translations_file and errors_file could be empty strings if we have no content to output. glossary_translations_file and glossary_errors_file are always empty strings if the input_file is tsv. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_translations.[extension]` If the input file extension is tsv, the output has the following columns: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: translation without applying a glossary. Empty string if there is an error. Column 4 (only present if a glossary is provided in the request): translation after applying the glossary. Empty string if there is an error applying the glossary. Could be same string as column 3 if there is no glossary applied. If input file extension is a txt or html, the translation is directly written to the output file. If glossary is requested, a separate glossary_translations_file has format of `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` The format of errors file (for target language code 'trg') is: `gs://translation_test/a_b_c_'trg'_errors.[extension]` If the input file extension is tsv, errors_file contains the following: Column 1: ID of the request provided in the input, if it's not provided in the input, then the input row number is used (0-based). Column 2: source sentence. Column 3: Error detail for the translation. Could be empty. Column 4 (only present if a glossary is provided in the request): Error when applying the glossary. If the input file extension is txt or html, glossary_error_file will be generated that contains error details. glossary_error_file has format of `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` */
209
+ gcsDestination?: GcsDestination;
210
+ }
211
+ interface Status {
212
+ /** The status code, which should be an enum value of google.rpc.Code. */
213
+ code?: number;
214
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
215
+ details?: Array<{[P in string]: any}>;
216
+ /** A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */
217
+ message?: string;
218
+ }
219
+ interface SupportedLanguage {
220
+ /** Human readable name of the language localized in the display language specified in the request. */
221
+ displayName?: string;
222
+ /** Supported language code, generally consisting of its ISO 639-1 identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes including language and region identifiers are returned (for example, 'zh-TW' and 'zh-CN') */
223
+ languageCode?: string;
224
+ /** Can be used as source language. */
225
+ supportSource?: boolean;
226
+ /** Can be used as target language. */
227
+ supportTarget?: boolean;
228
+ }
229
+ interface SupportedLanguages {
230
+ /** A list of supported language responses. This list contains an entry for each language the Translation API supports. */
231
+ languages?: SupportedLanguage[];
232
+ }
233
+ interface TranslateDocumentRequest {
234
+ /** Optional. This flag is to support user customized attribution. If not provided, the default is `Machine Translated by Google`. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos */
235
+ customizedAttribution?: string;
236
+ /** Required. Input configurations. */
237
+ documentInputConfig?: DocumentInputConfig;
238
+ /** Optional. Output configurations. Defines if the output file should be stored within Cloud Storage as well as the desired output format. If not provided the translated file will only be returned through a byte-stream and its output mime type will be the same as the input file's mime type. */
239
+ documentOutputConfig?: DocumentOutputConfig;
240
+ /** Optional. If true, enable auto rotation correction in DVS. */
241
+ enableRotationCorrection?: boolean;
242
+ /** Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when is_translate_native_pdf_only: false && pdf_native_only: false */
243
+ enableShadowRemovalNativePdf?: boolean;
244
+ /** Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned. */
245
+ glossaryConfig?: TranslateTextGlossaryConfig;
246
+ /** Optional. is_translate_native_pdf_only field for external customers. If true, the page limit of online native pdf translation is 300 and only native pdf pages will be translated. */
247
+ isTranslateNativePdfOnly?: boolean;
248
+ /** Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/advanced/labels for more information. */
249
+ labels?: {[P in string]: string};
250
+ /** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, If not provided, the default Google model (NMT) will be used for translation. */
251
+ model?: string;
252
+ /** Optional. The BCP-47 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. Source language must be specified if the request contains a glossary or a custom model. */
253
+ sourceLanguageCode?: string;
254
+ /** Required. The BCP-47 language code to use for translation of the input document, set to one of the language codes listed in Language Support. */
255
+ targetLanguageCode?: string;
256
+ }
257
+ interface TranslateDocumentResponse {
258
+ /** Translated document. */
259
+ documentTranslation?: DocumentTranslation;
260
+ /** The `glossary_config` used for this translation. */
261
+ glossaryConfig?: TranslateTextGlossaryConfig;
262
+ /** The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply. */
263
+ glossaryDocumentTranslation?: DocumentTranslation;
264
+ /** Only present when 'model' is present in the request. 'model' is normalized to have a project number. For example: If the 'model' field in TranslateDocumentRequest is: `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`. */
265
+ model?: string;
266
+ }
267
+ interface TranslateTextGlossaryConfig {
268
+ /** Required. Specifies the glossary used for this translation. Use this format: projects/*‍/locations/*‍/glossaries/* */
269
+ glossary?: string;
270
+ /** Optional. Indicates match is case-insensitive. Default value is false if missing. */
271
+ ignoreCase?: boolean;
272
+ }
273
+ interface TranslateTextRequest {
274
+ /** Required. The content of the input in string format. We recommend the total content be less than 30k codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. */
275
+ contents?: string[];
276
+ /** Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the model, otherwise an INVALID_ARGUMENT (400) error is returned. */
277
+ glossaryConfig?: TranslateTextGlossaryConfig;
278
+ /** Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information. */
279
+ labels?: {[P in string]: string};
280
+ /** Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". */
281
+ mimeType?: string;
282
+ /** Optional. The `model` type requested for this translation. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, For global (non-regionalized) requests, use `location-id` `global`. For example, `projects/{project-number-or-id}/locations/global/models/general/nmt`. If not provided, the default Google model (NMT) will be used */
283
+ model?: string;
284
+ /** Optional. The BCP-47 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. */
285
+ sourceLanguageCode?: string;
286
+ /** Required. The BCP-47 language code to use for translation of the input text, set to one of the language codes listed in Language Support. */
287
+ targetLanguageCode?: string;
288
+ }
289
+ interface TranslateTextResponse {
290
+ /** Text translation responses if a glossary is provided in the request. This can be the same as `translations` if no terms apply. This field has the same length as `contents`. */
291
+ glossaryTranslations?: Translation[];
292
+ /** Text translation responses with no glossary applied. This field has the same length as `contents`. */
293
+ translations?: Translation[];
294
+ }
295
+ interface Translation {
296
+ /** The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language does not occur and this field is empty. */
297
+ detectedLanguageCode?: string;
298
+ /** The `glossary_config` used for this translation. */
299
+ glossaryConfig?: TranslateTextGlossaryConfig;
300
+ /** Only present when `model` is present in the request. `model` here is normalized to have project number. For example: If the `model` requested in TranslationTextRequest is `projects/{project-id}/locations/{location-id}/models/general/nmt` then `model` here would be normalized to `projects/{project-number}/locations/{location-id}/models/general/nmt`. */
301
+ model?: string;
302
+ /** Text translated into the target language. If an error occurs during translation, this field might be excluded from the response. */
303
+ translatedText?: string;
304
+ }
305
+ interface WaitOperationRequest {
306
+ /** The maximum duration to wait before timing out. If left blank, the wait will be at most the time permitted by the underlying HTTP/RPC protocol. If RPC context deadline is also specified, the shorter one will be used. */
307
+ timeout?: string;
308
+ }
309
+ interface GlossariesResource {
310
+ /** Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. */
311
+ create(request: {
312
+ /** V1 error format. */
313
+ '$.xgafv'?: string;
314
+ /** OAuth access token. */
315
+ access_token?: string;
316
+ /** Data format for response. */
317
+ alt?: string;
318
+ /** JSONP */
319
+ callback?: string;
320
+ /** Selector specifying which fields to include in a partial response. */
321
+ fields?: string;
322
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
323
+ key?: string;
324
+ /** OAuth 2.0 token for the current user. */
325
+ oauth_token?: string;
326
+ /** Required. The project name. */
327
+ parent: string;
328
+ /** Returns response with indentations and line breaks. */
329
+ prettyPrint?: boolean;
330
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
331
+ quotaUser?: string;
332
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
333
+ upload_protocol?: string;
334
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
335
+ uploadType?: string;
336
+ /** Request body */
337
+ resource: Glossary;
338
+ }): Request<Operation>;
339
+ create(
340
+ request: {
341
+ /** V1 error format. */
342
+ '$.xgafv'?: string;
343
+ /** OAuth access token. */
344
+ access_token?: string;
345
+ /** Data format for response. */
346
+ alt?: string;
347
+ /** JSONP */
348
+ callback?: string;
349
+ /** Selector specifying which fields to include in a partial response. */
350
+ fields?: string;
351
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
352
+ key?: string;
353
+ /** OAuth 2.0 token for the current user. */
354
+ oauth_token?: string;
355
+ /** Required. The project name. */
356
+ parent: string;
357
+ /** Returns response with indentations and line breaks. */
358
+ prettyPrint?: boolean;
359
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
360
+ quotaUser?: string;
361
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
362
+ upload_protocol?: string;
363
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
364
+ uploadType?: string;
365
+ },
366
+ body: Glossary
367
+ ): Request<Operation>;
368
+ /** Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist. */
369
+ delete(request?: {
370
+ /** V1 error format. */
371
+ '$.xgafv'?: string;
372
+ /** OAuth access token. */
373
+ access_token?: string;
374
+ /** Data format for response. */
375
+ alt?: string;
376
+ /** JSONP */
377
+ callback?: string;
378
+ /** Selector specifying which fields to include in a partial response. */
379
+ fields?: string;
380
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
381
+ key?: string;
382
+ /** Required. The name of the glossary to delete. */
383
+ name: string;
384
+ /** OAuth 2.0 token for the current user. */
385
+ oauth_token?: string;
386
+ /** Returns response with indentations and line breaks. */
387
+ prettyPrint?: boolean;
388
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
389
+ quotaUser?: string;
390
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
391
+ upload_protocol?: string;
392
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
393
+ uploadType?: string;
394
+ }): Request<Operation>;
395
+ /** Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist. */
396
+ get(request?: {
397
+ /** V1 error format. */
398
+ '$.xgafv'?: string;
399
+ /** OAuth access token. */
400
+ access_token?: string;
401
+ /** Data format for response. */
402
+ alt?: string;
403
+ /** JSONP */
404
+ callback?: string;
405
+ /** Selector specifying which fields to include in a partial response. */
406
+ fields?: string;
407
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
408
+ key?: string;
409
+ /** Required. The name of the glossary to retrieve. */
410
+ name: string;
411
+ /** OAuth 2.0 token for the current user. */
412
+ oauth_token?: string;
413
+ /** Returns response with indentations and line breaks. */
414
+ prettyPrint?: boolean;
415
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
416
+ quotaUser?: string;
417
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
418
+ upload_protocol?: string;
419
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
420
+ uploadType?: string;
421
+ }): Request<Glossary>;
422
+ /** Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist. */
423
+ list(request?: {
424
+ /** V1 error format. */
425
+ '$.xgafv'?: string;
426
+ /** OAuth access token. */
427
+ access_token?: string;
428
+ /** Data format for response. */
429
+ alt?: string;
430
+ /** JSONP */
431
+ callback?: string;
432
+ /** Selector specifying which fields to include in a partial response. */
433
+ fields?: string;
434
+ /** Optional. Filter specifying constraints of a list operation. Specify the constraint by the format of "key=value", where key must be "src" or "tgt", and the value must be a valid language code. For multiple restrictions, concatenate them by "AND" (uppercase only), such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used here, which means using 'en-US' and 'en' can lead to different results, which depends on the language code you used when you create the glossary. For the unidirectional glossaries, the "src" and "tgt" add restrictions on the source and target language code separately. For the equivalent term set glossaries, the "src" and/or "tgt" add restrictions on the term set. For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional glossaries which exactly match the source language code as "en-US" and the target language code "zh-CN", but all equivalent term set glossaries which contain "en-US" and "zh-CN" in their language set will be picked. If missing, no filtering is performed. */
435
+ filter?: string;
436
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
437
+ key?: string;
438
+ /** OAuth 2.0 token for the current user. */
439
+ oauth_token?: string;
440
+ /** Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default. */
441
+ pageSize?: number;
442
+ /** Optional. A token identifying a page of results the server should return. Typically, this is the value of [ListGlossariesResponse.next_page_token] returned from the previous call to `ListGlossaries` method. The first page is returned if `page_token`is empty or missing. */
443
+ pageToken?: string;
444
+ /** Required. The name of the project from which to list all of the glossaries. */
445
+ parent: string;
446
+ /** Returns response with indentations and line breaks. */
447
+ prettyPrint?: boolean;
448
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
449
+ quotaUser?: string;
450
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
451
+ upload_protocol?: string;
452
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
453
+ uploadType?: string;
454
+ }): Request<ListGlossariesResponse>;
455
+ }
456
+ interface OperationsResource {
457
+ /** Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. */
458
+ cancel(request: {
459
+ /** V1 error format. */
460
+ '$.xgafv'?: string;
461
+ /** OAuth access token. */
462
+ access_token?: string;
463
+ /** Data format for response. */
464
+ alt?: string;
465
+ /** JSONP */
466
+ callback?: string;
467
+ /** Selector specifying which fields to include in a partial response. */
468
+ fields?: string;
469
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
470
+ key?: string;
471
+ /** The name of the operation resource to be cancelled. */
472
+ name: string;
473
+ /** OAuth 2.0 token for the current user. */
474
+ oauth_token?: string;
475
+ /** Returns response with indentations and line breaks. */
476
+ prettyPrint?: boolean;
477
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
478
+ quotaUser?: string;
479
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
480
+ upload_protocol?: string;
481
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
482
+ uploadType?: string;
483
+ /** Request body */
484
+ resource: CancelOperationRequest;
485
+ }): Request<{}>;
486
+ cancel(
487
+ request: {
488
+ /** V1 error format. */
489
+ '$.xgafv'?: string;
490
+ /** OAuth access token. */
491
+ access_token?: string;
492
+ /** Data format for response. */
493
+ alt?: string;
494
+ /** JSONP */
495
+ callback?: string;
496
+ /** Selector specifying which fields to include in a partial response. */
497
+ fields?: string;
498
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
499
+ key?: string;
500
+ /** The name of the operation resource to be cancelled. */
501
+ name: string;
502
+ /** OAuth 2.0 token for the current user. */
503
+ oauth_token?: string;
504
+ /** Returns response with indentations and line breaks. */
505
+ prettyPrint?: boolean;
506
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
507
+ quotaUser?: string;
508
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
509
+ upload_protocol?: string;
510
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
511
+ uploadType?: string;
512
+ },
513
+ body: CancelOperationRequest
514
+ ): Request<{}>;
515
+ /** Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. */
516
+ delete(request?: {
517
+ /** V1 error format. */
518
+ '$.xgafv'?: string;
519
+ /** OAuth access token. */
520
+ access_token?: string;
521
+ /** Data format for response. */
522
+ alt?: string;
523
+ /** JSONP */
524
+ callback?: string;
525
+ /** Selector specifying which fields to include in a partial response. */
526
+ fields?: string;
527
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
528
+ key?: string;
529
+ /** The name of the operation resource to be deleted. */
530
+ name: string;
531
+ /** OAuth 2.0 token for the current user. */
532
+ oauth_token?: string;
533
+ /** Returns response with indentations and line breaks. */
534
+ prettyPrint?: boolean;
535
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
536
+ quotaUser?: string;
537
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
538
+ upload_protocol?: string;
539
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
540
+ uploadType?: string;
541
+ }): Request<{}>;
542
+ /** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
543
+ get(request?: {
544
+ /** V1 error format. */
545
+ '$.xgafv'?: string;
546
+ /** OAuth access token. */
547
+ access_token?: string;
548
+ /** Data format for response. */
549
+ alt?: string;
550
+ /** JSONP */
551
+ callback?: string;
552
+ /** Selector specifying which fields to include in a partial response. */
553
+ fields?: string;
554
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
555
+ key?: string;
556
+ /** The name of the operation resource. */
557
+ name: string;
558
+ /** OAuth 2.0 token for the current user. */
559
+ oauth_token?: string;
560
+ /** Returns response with indentations and line breaks. */
561
+ prettyPrint?: boolean;
562
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
563
+ quotaUser?: string;
564
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
565
+ upload_protocol?: string;
566
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
567
+ uploadType?: string;
568
+ }): Request<Operation>;
569
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
570
+ list(request?: {
571
+ /** V1 error format. */
572
+ '$.xgafv'?: string;
573
+ /** OAuth access token. */
574
+ access_token?: string;
575
+ /** Data format for response. */
576
+ alt?: string;
577
+ /** JSONP */
578
+ callback?: string;
579
+ /** Selector specifying which fields to include in a partial response. */
580
+ fields?: string;
581
+ /** The standard list filter. */
582
+ filter?: string;
583
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
584
+ key?: string;
585
+ /** The name of the operation's parent resource. */
586
+ name: string;
587
+ /** OAuth 2.0 token for the current user. */
588
+ oauth_token?: string;
589
+ /** The standard list page size. */
590
+ pageSize?: number;
591
+ /** The standard list page token. */
592
+ pageToken?: string;
593
+ /** Returns response with indentations and line breaks. */
594
+ prettyPrint?: boolean;
595
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
596
+ quotaUser?: string;
597
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
598
+ upload_protocol?: string;
599
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
600
+ uploadType?: string;
601
+ }): Request<ListOperationsResponse>;
602
+ /** Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done. */
603
+ wait(request: {
604
+ /** V1 error format. */
605
+ '$.xgafv'?: string;
606
+ /** OAuth access token. */
607
+ access_token?: string;
608
+ /** Data format for response. */
609
+ alt?: string;
610
+ /** JSONP */
611
+ callback?: string;
612
+ /** Selector specifying which fields to include in a partial response. */
613
+ fields?: string;
614
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
615
+ key?: string;
616
+ /** The name of the operation resource to wait on. */
617
+ name: string;
618
+ /** OAuth 2.0 token for the current user. */
619
+ oauth_token?: string;
620
+ /** Returns response with indentations and line breaks. */
621
+ prettyPrint?: boolean;
622
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
623
+ quotaUser?: string;
624
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
625
+ upload_protocol?: string;
626
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
627
+ uploadType?: string;
628
+ /** Request body */
629
+ resource: WaitOperationRequest;
630
+ }): Request<Operation>;
631
+ wait(
632
+ request: {
633
+ /** V1 error format. */
634
+ '$.xgafv'?: string;
635
+ /** OAuth access token. */
636
+ access_token?: string;
637
+ /** Data format for response. */
638
+ alt?: string;
639
+ /** JSONP */
640
+ callback?: string;
641
+ /** Selector specifying which fields to include in a partial response. */
642
+ fields?: string;
643
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
644
+ key?: string;
645
+ /** The name of the operation resource to wait on. */
646
+ name: string;
647
+ /** OAuth 2.0 token for the current user. */
648
+ oauth_token?: string;
649
+ /** Returns response with indentations and line breaks. */
650
+ prettyPrint?: boolean;
651
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
652
+ quotaUser?: string;
653
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
654
+ upload_protocol?: string;
655
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
656
+ uploadType?: string;
657
+ },
658
+ body: WaitOperationRequest
659
+ ): Request<Operation>;
660
+ }
661
+ interface LocationsResource {
662
+ /** Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. */
663
+ batchTranslateDocument(request: {
664
+ /** V1 error format. */
665
+ '$.xgafv'?: string;
666
+ /** OAuth access token. */
667
+ access_token?: string;
668
+ /** Data format for response. */
669
+ alt?: string;
670
+ /** JSONP */
671
+ callback?: string;
672
+ /** Selector specifying which fields to include in a partial response. */
673
+ fields?: string;
674
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
675
+ key?: string;
676
+ /** OAuth 2.0 token for the current user. */
677
+ oauth_token?: string;
678
+ /** Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
679
+ parent: string;
680
+ /** Returns response with indentations and line breaks. */
681
+ prettyPrint?: boolean;
682
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
683
+ quotaUser?: string;
684
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
685
+ upload_protocol?: string;
686
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
687
+ uploadType?: string;
688
+ /** Request body */
689
+ resource: BatchTranslateDocumentRequest;
690
+ }): Request<Operation>;
691
+ batchTranslateDocument(
692
+ request: {
693
+ /** V1 error format. */
694
+ '$.xgafv'?: string;
695
+ /** OAuth access token. */
696
+ access_token?: string;
697
+ /** Data format for response. */
698
+ alt?: string;
699
+ /** JSONP */
700
+ callback?: string;
701
+ /** Selector specifying which fields to include in a partial response. */
702
+ fields?: string;
703
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
704
+ key?: string;
705
+ /** OAuth 2.0 token for the current user. */
706
+ oauth_token?: string;
707
+ /** Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
708
+ parent: string;
709
+ /** Returns response with indentations and line breaks. */
710
+ prettyPrint?: boolean;
711
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
712
+ quotaUser?: string;
713
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
714
+ upload_protocol?: string;
715
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
716
+ uploadType?: string;
717
+ },
718
+ body: BatchTranslateDocumentRequest
719
+ ): Request<Operation>;
720
+ /** Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. */
721
+ batchTranslateText(request: {
722
+ /** V1 error format. */
723
+ '$.xgafv'?: string;
724
+ /** OAuth access token. */
725
+ access_token?: string;
726
+ /** Data format for response. */
727
+ alt?: string;
728
+ /** JSONP */
729
+ callback?: string;
730
+ /** Selector specifying which fields to include in a partial response. */
731
+ fields?: string;
732
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
733
+ key?: string;
734
+ /** OAuth 2.0 token for the current user. */
735
+ oauth_token?: string;
736
+ /** Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
737
+ parent: string;
738
+ /** Returns response with indentations and line breaks. */
739
+ prettyPrint?: boolean;
740
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
741
+ quotaUser?: string;
742
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
743
+ upload_protocol?: string;
744
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
745
+ uploadType?: string;
746
+ /** Request body */
747
+ resource: BatchTranslateTextRequest;
748
+ }): Request<Operation>;
749
+ batchTranslateText(
750
+ request: {
751
+ /** V1 error format. */
752
+ '$.xgafv'?: string;
753
+ /** OAuth access token. */
754
+ access_token?: string;
755
+ /** Data format for response. */
756
+ alt?: string;
757
+ /** JSONP */
758
+ callback?: string;
759
+ /** Selector specifying which fields to include in a partial response. */
760
+ fields?: string;
761
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
762
+ key?: string;
763
+ /** OAuth 2.0 token for the current user. */
764
+ oauth_token?: string;
765
+ /** Required. Location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}`. The `global` location is not supported for batch translation. Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
766
+ parent: string;
767
+ /** Returns response with indentations and line breaks. */
768
+ prettyPrint?: boolean;
769
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
770
+ quotaUser?: string;
771
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
772
+ upload_protocol?: string;
773
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
774
+ uploadType?: string;
775
+ },
776
+ body: BatchTranslateTextRequest
777
+ ): Request<Operation>;
778
+ /** Detects the language of text within a request. */
779
+ detectLanguage(request: {
780
+ /** V1 error format. */
781
+ '$.xgafv'?: string;
782
+ /** OAuth access token. */
783
+ access_token?: string;
784
+ /** Data format for response. */
785
+ alt?: string;
786
+ /** JSONP */
787
+ callback?: string;
788
+ /** Selector specifying which fields to include in a partial response. */
789
+ fields?: string;
790
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
791
+ key?: string;
792
+ /** OAuth 2.0 token for the current user. */
793
+ oauth_token?: string;
794
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. */
795
+ parent: string;
796
+ /** Returns response with indentations and line breaks. */
797
+ prettyPrint?: boolean;
798
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
799
+ quotaUser?: string;
800
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
801
+ upload_protocol?: string;
802
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
803
+ uploadType?: string;
804
+ /** Request body */
805
+ resource: DetectLanguageRequest;
806
+ }): Request<DetectLanguageResponse>;
807
+ detectLanguage(
808
+ request: {
809
+ /** V1 error format. */
810
+ '$.xgafv'?: string;
811
+ /** OAuth access token. */
812
+ access_token?: string;
813
+ /** Data format for response. */
814
+ alt?: string;
815
+ /** JSONP */
816
+ callback?: string;
817
+ /** Selector specifying which fields to include in a partial response. */
818
+ fields?: string;
819
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
820
+ key?: string;
821
+ /** OAuth 2.0 token for the current user. */
822
+ oauth_token?: string;
823
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. */
824
+ parent: string;
825
+ /** Returns response with indentations and line breaks. */
826
+ prettyPrint?: boolean;
827
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
828
+ quotaUser?: string;
829
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
830
+ upload_protocol?: string;
831
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
832
+ uploadType?: string;
833
+ },
834
+ body: DetectLanguageRequest
835
+ ): Request<DetectLanguageResponse>;
836
+ /** Gets information about a location. */
837
+ get(request?: {
838
+ /** V1 error format. */
839
+ '$.xgafv'?: string;
840
+ /** OAuth access token. */
841
+ access_token?: string;
842
+ /** Data format for response. */
843
+ alt?: string;
844
+ /** JSONP */
845
+ callback?: string;
846
+ /** Selector specifying which fields to include in a partial response. */
847
+ fields?: string;
848
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
849
+ key?: string;
850
+ /** Resource name for the location. */
851
+ name: string;
852
+ /** OAuth 2.0 token for the current user. */
853
+ oauth_token?: string;
854
+ /** Returns response with indentations and line breaks. */
855
+ prettyPrint?: boolean;
856
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
857
+ quotaUser?: string;
858
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
859
+ upload_protocol?: string;
860
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
861
+ uploadType?: string;
862
+ }): Request<Location>;
863
+ /** Returns a list of supported languages for translation. */
864
+ getSupportedLanguages(request?: {
865
+ /** V1 error format. */
866
+ '$.xgafv'?: string;
867
+ /** OAuth access token. */
868
+ access_token?: string;
869
+ /** Data format for response. */
870
+ alt?: string;
871
+ /** JSONP */
872
+ callback?: string;
873
+ /** Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. */
874
+ displayLanguageCode?: string;
875
+ /** Selector specifying which fields to include in a partial response. */
876
+ fields?: string;
877
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
878
+ key?: string;
879
+ /** Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. */
880
+ model?: string;
881
+ /** OAuth 2.0 token for the current user. */
882
+ oauth_token?: string;
883
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
884
+ parent: string;
885
+ /** Returns response with indentations and line breaks. */
886
+ prettyPrint?: boolean;
887
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
888
+ quotaUser?: string;
889
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
890
+ upload_protocol?: string;
891
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
892
+ uploadType?: string;
893
+ }): Request<SupportedLanguages>;
894
+ /** Lists information about the supported locations for this service. */
895
+ list(request?: {
896
+ /** V1 error format. */
897
+ '$.xgafv'?: string;
898
+ /** OAuth access token. */
899
+ access_token?: string;
900
+ /** Data format for response. */
901
+ alt?: string;
902
+ /** JSONP */
903
+ callback?: string;
904
+ /** Selector specifying which fields to include in a partial response. */
905
+ fields?: string;
906
+ /** A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160). */
907
+ filter?: string;
908
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
909
+ key?: string;
910
+ /** The resource that owns the locations collection, if applicable. */
911
+ name: string;
912
+ /** OAuth 2.0 token for the current user. */
913
+ oauth_token?: string;
914
+ /** The maximum number of results to return. If not set, the service selects a default. */
915
+ pageSize?: number;
916
+ /** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
917
+ pageToken?: string;
918
+ /** Returns response with indentations and line breaks. */
919
+ prettyPrint?: boolean;
920
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
921
+ quotaUser?: string;
922
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
923
+ upload_protocol?: string;
924
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
925
+ uploadType?: string;
926
+ }): Request<ListLocationsResponse>;
927
+ /** Translates documents in synchronous mode. */
928
+ translateDocument(request: {
929
+ /** V1 error format. */
930
+ '$.xgafv'?: string;
931
+ /** OAuth access token. */
932
+ access_token?: string;
933
+ /** Data format for response. */
934
+ alt?: string;
935
+ /** JSONP */
936
+ callback?: string;
937
+ /** Selector specifying which fields to include in a partial response. */
938
+ fields?: string;
939
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
940
+ key?: string;
941
+ /** OAuth 2.0 token for the current user. */
942
+ oauth_token?: string;
943
+ /** Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
944
+ parent: string;
945
+ /** Returns response with indentations and line breaks. */
946
+ prettyPrint?: boolean;
947
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
948
+ quotaUser?: string;
949
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
950
+ upload_protocol?: string;
951
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
952
+ uploadType?: string;
953
+ /** Request body */
954
+ resource: TranslateDocumentRequest;
955
+ }): Request<TranslateDocumentResponse>;
956
+ translateDocument(
957
+ request: {
958
+ /** V1 error format. */
959
+ '$.xgafv'?: string;
960
+ /** OAuth access token. */
961
+ access_token?: string;
962
+ /** Data format for response. */
963
+ alt?: string;
964
+ /** JSONP */
965
+ callback?: string;
966
+ /** Selector specifying which fields to include in a partial response. */
967
+ fields?: string;
968
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
969
+ key?: string;
970
+ /** OAuth 2.0 token for the current user. */
971
+ oauth_token?: string;
972
+ /** Required. Location to make a regional call. Format: `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
973
+ parent: string;
974
+ /** Returns response with indentations and line breaks. */
975
+ prettyPrint?: boolean;
976
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
977
+ quotaUser?: string;
978
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
979
+ upload_protocol?: string;
980
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
981
+ uploadType?: string;
982
+ },
983
+ body: TranslateDocumentRequest
984
+ ): Request<TranslateDocumentResponse>;
985
+ /** Translates input text and returns translated text. */
986
+ translateText(request: {
987
+ /** V1 error format. */
988
+ '$.xgafv'?: string;
989
+ /** OAuth access token. */
990
+ access_token?: string;
991
+ /** Data format for response. */
992
+ alt?: string;
993
+ /** JSONP */
994
+ callback?: string;
995
+ /** Selector specifying which fields to include in a partial response. */
996
+ fields?: string;
997
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
998
+ key?: string;
999
+ /** OAuth 2.0 token for the current user. */
1000
+ oauth_token?: string;
1001
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
1002
+ parent: string;
1003
+ /** Returns response with indentations and line breaks. */
1004
+ prettyPrint?: boolean;
1005
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1006
+ quotaUser?: string;
1007
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1008
+ upload_protocol?: string;
1009
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1010
+ uploadType?: string;
1011
+ /** Request body */
1012
+ resource: TranslateTextRequest;
1013
+ }): Request<TranslateTextResponse>;
1014
+ translateText(
1015
+ request: {
1016
+ /** V1 error format. */
1017
+ '$.xgafv'?: string;
1018
+ /** OAuth access token. */
1019
+ access_token?: string;
1020
+ /** Data format for response. */
1021
+ alt?: string;
1022
+ /** JSONP */
1023
+ callback?: string;
1024
+ /** Selector specifying which fields to include in a partial response. */
1025
+ fields?: string;
1026
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1027
+ key?: string;
1028
+ /** OAuth 2.0 token for the current user. */
1029
+ oauth_token?: string;
1030
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
1031
+ parent: string;
1032
+ /** Returns response with indentations and line breaks. */
1033
+ prettyPrint?: boolean;
1034
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1035
+ quotaUser?: string;
1036
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1037
+ upload_protocol?: string;
1038
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1039
+ uploadType?: string;
1040
+ },
1041
+ body: TranslateTextRequest
1042
+ ): Request<TranslateTextResponse>;
1043
+ glossaries: GlossariesResource;
1044
+ operations: OperationsResource;
1045
+ }
1046
+ interface ProjectsResource {
1047
+ /** Detects the language of text within a request. */
1048
+ detectLanguage(request: {
1049
+ /** V1 error format. */
1050
+ '$.xgafv'?: string;
1051
+ /** OAuth access token. */
1052
+ access_token?: string;
1053
+ /** Data format for response. */
1054
+ alt?: string;
1055
+ /** JSONP */
1056
+ callback?: string;
1057
+ /** Selector specifying which fields to include in a partial response. */
1058
+ fields?: string;
1059
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1060
+ key?: string;
1061
+ /** OAuth 2.0 token for the current user. */
1062
+ oauth_token?: string;
1063
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. */
1064
+ parent: string;
1065
+ /** Returns response with indentations and line breaks. */
1066
+ prettyPrint?: boolean;
1067
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1068
+ quotaUser?: string;
1069
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1070
+ upload_protocol?: string;
1071
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1072
+ uploadType?: string;
1073
+ /** Request body */
1074
+ resource: DetectLanguageRequest;
1075
+ }): Request<DetectLanguageResponse>;
1076
+ detectLanguage(
1077
+ request: {
1078
+ /** V1 error format. */
1079
+ '$.xgafv'?: string;
1080
+ /** OAuth access token. */
1081
+ access_token?: string;
1082
+ /** Data format for response. */
1083
+ alt?: string;
1084
+ /** JSONP */
1085
+ callback?: string;
1086
+ /** Selector specifying which fields to include in a partial response. */
1087
+ fields?: string;
1088
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1089
+ key?: string;
1090
+ /** OAuth 2.0 token for the current user. */
1091
+ oauth_token?: string;
1092
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}/locations/{location-id}` or `projects/{project-number-or-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. */
1093
+ parent: string;
1094
+ /** Returns response with indentations and line breaks. */
1095
+ prettyPrint?: boolean;
1096
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1097
+ quotaUser?: string;
1098
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1099
+ upload_protocol?: string;
1100
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1101
+ uploadType?: string;
1102
+ },
1103
+ body: DetectLanguageRequest
1104
+ ): Request<DetectLanguageResponse>;
1105
+ /** Returns a list of supported languages for translation. */
1106
+ getSupportedLanguages(request?: {
1107
+ /** V1 error format. */
1108
+ '$.xgafv'?: string;
1109
+ /** OAuth access token. */
1110
+ access_token?: string;
1111
+ /** Data format for response. */
1112
+ alt?: string;
1113
+ /** JSONP */
1114
+ callback?: string;
1115
+ /** Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. */
1116
+ displayLanguageCode?: string;
1117
+ /** Selector specifying which fields to include in a partial response. */
1118
+ fields?: string;
1119
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1120
+ key?: string;
1121
+ /** Optional. Get supported languages of this model. The format depends on model type: - AutoML Translation models: `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - General (built-in) models: `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. */
1122
+ model?: string;
1123
+ /** OAuth 2.0 token for the current user. */
1124
+ oauth_token?: string;
1125
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. */
1126
+ parent: string;
1127
+ /** Returns response with indentations and line breaks. */
1128
+ prettyPrint?: boolean;
1129
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1130
+ quotaUser?: string;
1131
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1132
+ upload_protocol?: string;
1133
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1134
+ uploadType?: string;
1135
+ }): Request<SupportedLanguages>;
1136
+ /** Translates input text and returns translated text. */
1137
+ translateText(request: {
1138
+ /** V1 error format. */
1139
+ '$.xgafv'?: string;
1140
+ /** OAuth access token. */
1141
+ access_token?: string;
1142
+ /** Data format for response. */
1143
+ alt?: string;
1144
+ /** JSONP */
1145
+ callback?: string;
1146
+ /** Selector specifying which fields to include in a partial response. */
1147
+ fields?: string;
1148
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1149
+ key?: string;
1150
+ /** OAuth 2.0 token for the current user. */
1151
+ oauth_token?: string;
1152
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
1153
+ parent: string;
1154
+ /** Returns response with indentations and line breaks. */
1155
+ prettyPrint?: boolean;
1156
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1157
+ quotaUser?: string;
1158
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1159
+ upload_protocol?: string;
1160
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1161
+ uploadType?: string;
1162
+ /** Request body */
1163
+ resource: TranslateTextRequest;
1164
+ }): Request<TranslateTextResponse>;
1165
+ translateText(
1166
+ request: {
1167
+ /** V1 error format. */
1168
+ '$.xgafv'?: string;
1169
+ /** OAuth access token. */
1170
+ access_token?: string;
1171
+ /** Data format for response. */
1172
+ alt?: string;
1173
+ /** JSONP */
1174
+ callback?: string;
1175
+ /** Selector specifying which fields to include in a partial response. */
1176
+ fields?: string;
1177
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
1178
+ key?: string;
1179
+ /** OAuth 2.0 token for the current user. */
1180
+ oauth_token?: string;
1181
+ /** Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id}` or `projects/{project-number-or-id}/locations/{location-id}`. For global calls, use `projects/{project-number-or-id}/locations/global` or `projects/{project-number-or-id}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. */
1182
+ parent: string;
1183
+ /** Returns response with indentations and line breaks. */
1184
+ prettyPrint?: boolean;
1185
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
1186
+ quotaUser?: string;
1187
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1188
+ upload_protocol?: string;
1189
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1190
+ uploadType?: string;
1191
+ },
1192
+ body: TranslateTextRequest
1193
+ ): Request<TranslateTextResponse>;
1194
+ locations: LocationsResource;
1195
+ }
1196
+
1197
+ const projects: ProjectsResource;
1198
+ }
1965
1199
  }