@maxim_mazurok/gapi.client.translate-v3 0.0.20221111 → 0.0.20230120

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.
Files changed (3) hide show
  1. package/index.d.ts +572 -14
  2. package/package.json +1 -1
  3. package/tests.ts +95 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
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=v3
12
- // Revision: 20221111
12
+ // Revision: 20230120
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -52,6 +52,11 @@ declare namespace gapi.client {
52
52
  gcsDestination?: GcsDestination;
53
53
  }
54
54
  interface BatchTranslateDocumentRequest {
55
+ /**
56
+ * 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
57
+ * https://cloud.google.com/translate/attribution#attribution_and_logos
58
+ */
59
+ customizedAttribution?: string;
55
60
  /** Optional. */
56
61
  formatConversions?: { [P in string]: string };
57
62
  /** Optional. Glossaries to be applied. It's keyed by target language code. */
@@ -106,10 +111,43 @@ declare namespace gapi.client {
106
111
  // tslint:disable-next-line:no-empty-interface
107
112
  interface CancelOperationRequest {
108
113
  }
114
+ interface Dataset {
115
+ /** Output only. Timestamp when this dataset was created. */
116
+ createTime?: string;
117
+ /**
118
+ * The name of the dataset to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits
119
+ * 0-9.
120
+ */
121
+ displayName?: string;
122
+ /** Output only. The number of examples in the dataset. */
123
+ exampleCount?: number;
124
+ /** The resource name of the dataset, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` */
125
+ name?: string;
126
+ /** The BCP-47 language code of the source language. */
127
+ sourceLanguageCode?: string;
128
+ /** The BCP-47 language code of the target language. */
129
+ targetLanguageCode?: string;
130
+ /** Output only. Number of test examples (sentence pairs). */
131
+ testExampleCount?: number;
132
+ /** Output only. Number of training examples (sentence pairs). */
133
+ trainExampleCount?: number;
134
+ /** Output only. Timestamp when this dataset was last updated. */
135
+ updateTime?: string;
136
+ /** Output only. Number of validation examples (sentence pairs). */
137
+ validateExampleCount?: number;
138
+ }
139
+ interface DatasetInputConfig {
140
+ /** Files containing the sentence pairs to be imported to the dataset. */
141
+ inputFiles?: InputFile[];
142
+ }
143
+ interface DatasetOutputConfig {
144
+ /** Google Cloud Storage destination to write the output. */
145
+ gcsDestination?: GcsOutputDestination;
146
+ }
109
147
  interface DetectedLanguage {
110
148
  /** The confidence of the detection result for this language. */
111
149
  confidence?: number;
112
- /** The BCP-47 language code of source content in the request, detected automatically. */
150
+ /** The BCP-47 language code of the source content in the request, detected automatically. */
113
151
  languageCode?: string;
114
152
  }
115
153
  interface DetectLanguageRequest {
@@ -181,6 +219,20 @@ declare namespace gapi.client {
181
219
  // tslint:disable-next-line:no-empty-interface
182
220
  interface Empty {
183
221
  }
222
+ interface Example {
223
+ /** Output only. The resource name of the example, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}' */
224
+ name?: string;
225
+ /** Sentence in source language. */
226
+ sourceText?: string;
227
+ /** Sentence in target language. */
228
+ targetText?: string;
229
+ /** Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST. */
230
+ usage?: string;
231
+ }
232
+ interface ExportDataRequest {
233
+ /** Required. The config for the output content. */
234
+ outputConfig?: DatasetOutputConfig;
235
+ }
184
236
  interface GcsDestination {
185
237
  /**
186
238
  * Required. The bucket used in 'output_uri_prefix' must exist and there must be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with "/" and start with "gs://". One
@@ -188,6 +240,17 @@ declare namespace gapi.client {
188
240
  */
189
241
  outputUriPrefix?: string;
190
242
  }
243
+ interface GcsInputSource {
244
+ /** Required. Source data URI. For example, `gs://my_bucket/my_object`. */
245
+ inputUri?: string;
246
+ }
247
+ interface GcsOutputDestination {
248
+ /**
249
+ * Required. Google Cloud Storage URI to output directory. For example, `gs://bucket/directory`. The requesting user must have write permission to the bucket. The directory will be
250
+ * created if it doesn't exist.
251
+ */
252
+ outputUriPrefix?: string;
253
+ }
191
254
  interface GcsSource {
192
255
  /** Required. Source data URI. For example, `gs://my_bucket/my_object`. */
193
256
  inputUri?: string;
@@ -223,10 +286,10 @@ declare namespace gapi.client {
223
286
  interface GlossaryInputConfig {
224
287
  /**
225
288
  * 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
226
- * 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
227
- * 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
228
- * 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
229
- * glossary terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary).
289
+ * 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`): Two column
290
+ * file, tab- or comma-separated. The first column is source text. The second column is target text. No headers in this file. The first row contains data and not column names. - TMX
291
+ * (`.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
292
+ * terms in multiple languages. See documentation for more information - [glossaries](https://cloud.google.com/translate/docs/advanced/glossary).
230
293
  */
231
294
  gcsSource?: GcsSource;
232
295
  }
@@ -246,6 +309,10 @@ declare namespace gapi.client {
246
309
  /** Each term in the set represents a term that can be replaced by the other terms. */
247
310
  terms?: GlossaryTerm[];
248
311
  }
312
+ interface ImportDataRequest {
313
+ /** Required. The config for the input content. */
314
+ inputConfig?: DatasetInputConfig;
315
+ }
249
316
  interface InputConfig {
250
317
  /**
251
318
  * 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,
@@ -262,6 +329,12 @@ declare namespace gapi.client {
262
329
  */
263
330
  mimeType?: string;
264
331
  }
332
+ interface InputFile {
333
+ /** Google Cloud Storage file source. */
334
+ gcsSource?: GcsInputSource;
335
+ /** Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, or UNASSIGNED (by default) for auto split. */
336
+ usage?: string;
337
+ }
265
338
  interface LanguageCodePair {
266
339
  /** Required. The BCP-47 language code of the input text, for example, "en-US". Expected to be an exact match for GlossaryTerm.language_code. */
267
340
  sourceLanguageCode?: string;
@@ -275,6 +348,18 @@ declare namespace gapi.client {
275
348
  */
276
349
  languageCodes?: string[];
277
350
  }
351
+ interface ListDatasetsResponse {
352
+ /** The datasets read. */
353
+ datasets?: Dataset[];
354
+ /** A token to retrieve next page of results. Pass this token to the page_token field in the ListDatasetsRequest to obtain the corresponding page. */
355
+ nextPageToken?: string;
356
+ }
357
+ interface ListExamplesResponse {
358
+ /** The sentence pairs. */
359
+ examples?: Example[];
360
+ /** A token to retrieve next page of results. Pass this token to the page_token field in the ListExamplesRequest to obtain the corresponding page. */
361
+ nextPageToken?: string;
362
+ }
278
363
  interface ListGlossariesResponse {
279
364
  /** The list of glossaries for a project. */
280
365
  glossaries?: Glossary[];
@@ -296,6 +381,12 @@ declare namespace gapi.client {
296
381
  /** The standard List next-page token. */
297
382
  nextPageToken?: string;
298
383
  }
384
+ interface ListModelsResponse {
385
+ /** The models read. */
386
+ models?: Model[];
387
+ /** A token to retrieve next page of results. Pass this token to the page_token field in the ListModelsRequest to obtain the corresponding page. */
388
+ nextPageToken?: string;
389
+ }
299
390
  interface ListOperationsResponse {
300
391
  /** The standard List next-page token. */
301
392
  nextPageToken?: string;
@@ -314,6 +405,33 @@ declare namespace gapi.client {
314
405
  /** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
315
406
  name?: string;
316
407
  }
408
+ interface Model {
409
+ /** Output only. Timestamp when the model resource was created, which is also when the training started. */
410
+ createTime?: string;
411
+ /** The dataset from which the model is trained, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` */
412
+ dataset?: string;
413
+ /** Output only. Timestamp when the model training finished and ready to be used for translation. */
414
+ deployTime?: string;
415
+ /**
416
+ * The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits
417
+ * 0-9.
418
+ */
419
+ displayName?: string;
420
+ /** The resource name of the model, in form of `projects/{project-number-or-id}/locations/{location_id}/models/{model_id}` */
421
+ name?: string;
422
+ /** Output only. The BCP-47 language code of the source language. */
423
+ sourceLanguageCode?: string;
424
+ /** Output only. The BCP-47 language code of the target language. */
425
+ targetLanguageCode?: string;
426
+ /** Output only. Number of examples (sentence pairs) used to test the model. */
427
+ testExampleCount?: number;
428
+ /** Output only. Number of examples (sentence pairs) used to train the model. */
429
+ trainExampleCount?: number;
430
+ /** Output only. Timestamp when this model was last updated. */
431
+ updateTime?: string;
432
+ /** Output only. Number of examples (sentence pairs) used to validate the model. */
433
+ validateExampleCount?: number;
434
+ }
317
435
  interface Operation {
318
436
  /** 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. */
319
437
  done?: boolean;
@@ -348,7 +466,7 @@ declare namespace gapi.client {
348
466
  * 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
349
467
  * 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
350
468
  * 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
351
- * 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
469
+ * 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
352
470
  * 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.
353
471
  * 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
354
472
  * 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
@@ -372,16 +490,16 @@ declare namespace gapi.client {
372
490
  message?: string;
373
491
  }
374
492
  interface SupportedLanguage {
375
- /** Human readable name of the language localized in the display language specified in the request. */
493
+ /** Human-readable name of the language localized in the display language specified in the request. */
376
494
  displayName?: string;
377
495
  /**
378
496
  * 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
379
- * returned (for example, 'zh-TW' and 'zh-CN')
497
+ * returned (for example, 'zh-TW' and 'zh-CN').
380
498
  */
381
499
  languageCode?: string;
382
- /** Can be used as source language. */
500
+ /** Can be used as a source language. */
383
501
  supportSource?: boolean;
384
- /** Can be used as target language. */
502
+ /** Can be used as a target language. */
385
503
  supportTarget?: boolean;
386
504
  }
387
505
  interface SupportedLanguages {
@@ -401,6 +519,8 @@ declare namespace gapi.client {
401
519
  * be returned through a byte-stream and its output mime type will be the same as the input file's mime type.
402
520
  */
403
521
  documentOutputConfig?: DocumentOutputConfig;
522
+ /** Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. */
523
+ enableShadowRemovalNativePdf?: boolean;
404
524
  /** 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. */
405
525
  glossaryConfig?: TranslateTextGlossaryConfig;
406
526
  /** 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. */
@@ -441,16 +561,16 @@ declare namespace gapi.client {
441
561
  }
442
562
  interface TranslateTextGlossaryConfig {
443
563
  /**
444
- * Required. The `glossary` to be applied for this translation. The format depends on glossary: - User provided custom glossary:
564
+ * Required. The `glossary` to be applied for this translation. The format depends on the glossary: - User-provided custom glossary:
445
565
  * `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
446
566
  */
447
567
  glossary?: string;
448
- /** Optional. Indicates match is case-insensitive. Default value is false if missing. */
568
+ /** Optional. Indicates match is case insensitive. The default value is `false` if missing. */
449
569
  ignoreCase?: boolean;
450
570
  }
451
571
  interface TranslateTextRequest {
452
572
  /**
453
- * 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
573
+ * Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for
454
574
  * larger text.
455
575
  */
456
576
  contents?: string[];
@@ -508,6 +628,297 @@ declare namespace gapi.client {
508
628
  */
509
629
  timeout?: string;
510
630
  }
631
+ interface ExamplesResource {
632
+ /** Lists sentence pairs in the dataset. */
633
+ list(request?: {
634
+ /** V1 error format. */
635
+ "$.xgafv"?: string;
636
+ /** OAuth access token. */
637
+ access_token?: string;
638
+ /** Data format for response. */
639
+ alt?: string;
640
+ /** JSONP */
641
+ callback?: string;
642
+ /** Selector specifying which fields to include in a partial response. */
643
+ fields?: string;
644
+ /** Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN` */
645
+ filter?: string;
646
+ /** 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. */
647
+ key?: string;
648
+ /** OAuth 2.0 token for the current user. */
649
+ oauth_token?: string;
650
+ /** Optional. Requested page size. The server can return fewer results than requested. */
651
+ pageSize?: number;
652
+ /** Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListExamples call. */
653
+ pageToken?: string;
654
+ /** Required. Name of the parent dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` */
655
+ parent: string;
656
+ /** Returns response with indentations and line breaks. */
657
+ prettyPrint?: boolean;
658
+ /** 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. */
659
+ quotaUser?: string;
660
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
661
+ upload_protocol?: string;
662
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
663
+ uploadType?: string;
664
+ }): Request<ListExamplesResponse>;
665
+ }
666
+ interface DatasetsResource {
667
+ /** Creates a Dataset. */
668
+ create(request: {
669
+ /** V1 error format. */
670
+ "$.xgafv"?: string;
671
+ /** OAuth access token. */
672
+ access_token?: string;
673
+ /** Data format for response. */
674
+ alt?: string;
675
+ /** JSONP */
676
+ callback?: string;
677
+ /** Selector specifying which fields to include in a partial response. */
678
+ fields?: string;
679
+ /** 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. */
680
+ key?: string;
681
+ /** OAuth 2.0 token for the current user. */
682
+ oauth_token?: string;
683
+ /** Required. The project name. */
684
+ parent: string;
685
+ /** Returns response with indentations and line breaks. */
686
+ prettyPrint?: boolean;
687
+ /** 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. */
688
+ quotaUser?: string;
689
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
690
+ upload_protocol?: string;
691
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
692
+ uploadType?: string;
693
+ /** Request body */
694
+ resource: Dataset;
695
+ }): Request<Operation>;
696
+ create(request: {
697
+ /** V1 error format. */
698
+ "$.xgafv"?: string;
699
+ /** OAuth access token. */
700
+ access_token?: string;
701
+ /** Data format for response. */
702
+ alt?: string;
703
+ /** JSONP */
704
+ callback?: string;
705
+ /** Selector specifying which fields to include in a partial response. */
706
+ fields?: string;
707
+ /** 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. */
708
+ key?: string;
709
+ /** OAuth 2.0 token for the current user. */
710
+ oauth_token?: string;
711
+ /** Required. The project name. */
712
+ parent: string;
713
+ /** Returns response with indentations and line breaks. */
714
+ prettyPrint?: boolean;
715
+ /** 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. */
716
+ quotaUser?: string;
717
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
718
+ upload_protocol?: string;
719
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
720
+ uploadType?: string;
721
+ },
722
+ body: Dataset): Request<Operation>;
723
+ /** Deletes a dataset and all of its contents. */
724
+ delete(request?: {
725
+ /** V1 error format. */
726
+ "$.xgafv"?: string;
727
+ /** OAuth access token. */
728
+ access_token?: string;
729
+ /** Data format for response. */
730
+ alt?: string;
731
+ /** JSONP */
732
+ callback?: string;
733
+ /** Selector specifying which fields to include in a partial response. */
734
+ fields?: string;
735
+ /** 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. */
736
+ key?: string;
737
+ /** Required. The name of the dataset to delete. */
738
+ name: string;
739
+ /** OAuth 2.0 token for the current user. */
740
+ oauth_token?: string;
741
+ /** Returns response with indentations and line breaks. */
742
+ prettyPrint?: boolean;
743
+ /** 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. */
744
+ quotaUser?: string;
745
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
746
+ upload_protocol?: string;
747
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
748
+ uploadType?: string;
749
+ }): Request<Operation>;
750
+ /** Exports dataset's data to the provided output location. */
751
+ exportData(request: {
752
+ /** V1 error format. */
753
+ "$.xgafv"?: string;
754
+ /** OAuth access token. */
755
+ access_token?: string;
756
+ /** Data format for response. */
757
+ alt?: string;
758
+ /** JSONP */
759
+ callback?: string;
760
+ /** Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` */
761
+ dataset: string;
762
+ /** Selector specifying which fields to include in a partial response. */
763
+ fields?: string;
764
+ /** 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. */
765
+ key?: string;
766
+ /** OAuth 2.0 token for the current user. */
767
+ oauth_token?: string;
768
+ /** Returns response with indentations and line breaks. */
769
+ prettyPrint?: boolean;
770
+ /** 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. */
771
+ quotaUser?: string;
772
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
773
+ upload_protocol?: string;
774
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
775
+ uploadType?: string;
776
+ /** Request body */
777
+ resource: ExportDataRequest;
778
+ }): Request<Operation>;
779
+ exportData(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
+ /** Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` */
789
+ dataset: string;
790
+ /** Selector specifying which fields to include in a partial response. */
791
+ fields?: string;
792
+ /** 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. */
793
+ key?: string;
794
+ /** OAuth 2.0 token for the current user. */
795
+ oauth_token?: 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
+ },
805
+ body: ExportDataRequest): Request<Operation>;
806
+ /** Gets a Dataset. */
807
+ get(request?: {
808
+ /** V1 error format. */
809
+ "$.xgafv"?: string;
810
+ /** OAuth access token. */
811
+ access_token?: string;
812
+ /** Data format for response. */
813
+ alt?: string;
814
+ /** JSONP */
815
+ callback?: string;
816
+ /** Selector specifying which fields to include in a partial response. */
817
+ fields?: string;
818
+ /** 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. */
819
+ key?: string;
820
+ /** Required. The resource name of the dataset to retrieve. */
821
+ name: string;
822
+ /** OAuth 2.0 token for the current user. */
823
+ oauth_token?: string;
824
+ /** Returns response with indentations and line breaks. */
825
+ prettyPrint?: boolean;
826
+ /** 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. */
827
+ quotaUser?: string;
828
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
829
+ upload_protocol?: string;
830
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
831
+ uploadType?: string;
832
+ }): Request<Dataset>;
833
+ /** Import sentence pairs into translation Dataset. */
834
+ importData(request: {
835
+ /** V1 error format. */
836
+ "$.xgafv"?: string;
837
+ /** OAuth access token. */
838
+ access_token?: string;
839
+ /** Data format for response. */
840
+ alt?: string;
841
+ /** JSONP */
842
+ callback?: string;
843
+ /** Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` */
844
+ dataset: string;
845
+ /** Selector specifying which fields to include in a partial response. */
846
+ fields?: string;
847
+ /** 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. */
848
+ key?: string;
849
+ /** OAuth 2.0 token for the current user. */
850
+ oauth_token?: string;
851
+ /** Returns response with indentations and line breaks. */
852
+ prettyPrint?: 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?: string;
855
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
856
+ upload_protocol?: string;
857
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
858
+ uploadType?: string;
859
+ /** Request body */
860
+ resource: ImportDataRequest;
861
+ }): Request<Operation>;
862
+ importData(request: {
863
+ /** V1 error format. */
864
+ "$.xgafv"?: string;
865
+ /** OAuth access token. */
866
+ access_token?: string;
867
+ /** Data format for response. */
868
+ alt?: string;
869
+ /** JSONP */
870
+ callback?: string;
871
+ /** Required. Name of the dataset. In form of `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` */
872
+ dataset: string;
873
+ /** Selector specifying which fields to include in a partial response. */
874
+ fields?: string;
875
+ /** 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. */
876
+ key?: string;
877
+ /** OAuth 2.0 token for the current user. */
878
+ oauth_token?: string;
879
+ /** Returns response with indentations and line breaks. */
880
+ prettyPrint?: boolean;
881
+ /** 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. */
882
+ quotaUser?: string;
883
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
884
+ upload_protocol?: string;
885
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
886
+ uploadType?: string;
887
+ },
888
+ body: ImportDataRequest): Request<Operation>;
889
+ /** Lists datasets. */
890
+ list(request?: {
891
+ /** V1 error format. */
892
+ "$.xgafv"?: string;
893
+ /** OAuth access token. */
894
+ access_token?: string;
895
+ /** Data format for response. */
896
+ alt?: string;
897
+ /** JSONP */
898
+ callback?: string;
899
+ /** Selector specifying which fields to include in a partial response. */
900
+ fields?: string;
901
+ /** 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. */
902
+ key?: string;
903
+ /** OAuth 2.0 token for the current user. */
904
+ oauth_token?: string;
905
+ /** Optional. Requested page size. The server can return fewer results than requested. */
906
+ pageSize?: number;
907
+ /** Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListDatasets call. */
908
+ pageToken?: string;
909
+ /** Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}` */
910
+ parent: string;
911
+ /** Returns response with indentations and line breaks. */
912
+ prettyPrint?: boolean;
913
+ /** 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. */
914
+ quotaUser?: string;
915
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
916
+ upload_protocol?: string;
917
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
918
+ uploadType?: string;
919
+ }): Request<ListDatasetsResponse>;
920
+ examples: ExamplesResource;
921
+ }
511
922
  interface GlossaryEntriesResource {
512
923
  /** Creates a glossary entry. */
513
924
  create(request: {
@@ -926,6 +1337,151 @@ declare namespace gapi.client {
926
1337
  body: Glossary): Request<Operation>;
927
1338
  glossaryEntries: GlossaryEntriesResource;
928
1339
  }
1340
+ interface ModelsResource {
1341
+ /** Creates a Model. */
1342
+ create(request: {
1343
+ /** V1 error format. */
1344
+ "$.xgafv"?: string;
1345
+ /** OAuth access token. */
1346
+ access_token?: string;
1347
+ /** Data format for response. */
1348
+ alt?: string;
1349
+ /** JSONP */
1350
+ callback?: string;
1351
+ /** Selector specifying which fields to include in a partial response. */
1352
+ fields?: string;
1353
+ /** 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. */
1354
+ key?: string;
1355
+ /** OAuth 2.0 token for the current user. */
1356
+ oauth_token?: string;
1357
+ /** Required. The project name, in form of `projects/{project}/locations/{location}` */
1358
+ parent: string;
1359
+ /** Returns response with indentations and line breaks. */
1360
+ prettyPrint?: boolean;
1361
+ /** 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. */
1362
+ quotaUser?: string;
1363
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1364
+ upload_protocol?: string;
1365
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1366
+ uploadType?: string;
1367
+ /** Request body */
1368
+ resource: Model;
1369
+ }): Request<Operation>;
1370
+ create(request: {
1371
+ /** V1 error format. */
1372
+ "$.xgafv"?: string;
1373
+ /** OAuth access token. */
1374
+ access_token?: string;
1375
+ /** Data format for response. */
1376
+ alt?: string;
1377
+ /** JSONP */
1378
+ callback?: string;
1379
+ /** Selector specifying which fields to include in a partial response. */
1380
+ fields?: string;
1381
+ /** 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. */
1382
+ key?: string;
1383
+ /** OAuth 2.0 token for the current user. */
1384
+ oauth_token?: string;
1385
+ /** Required. The project name, in form of `projects/{project}/locations/{location}` */
1386
+ parent: string;
1387
+ /** Returns response with indentations and line breaks. */
1388
+ prettyPrint?: boolean;
1389
+ /** 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. */
1390
+ quotaUser?: string;
1391
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1392
+ upload_protocol?: string;
1393
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1394
+ uploadType?: string;
1395
+ },
1396
+ body: Model): Request<Operation>;
1397
+ /** Deletes a model. */
1398
+ delete(request?: {
1399
+ /** V1 error format. */
1400
+ "$.xgafv"?: string;
1401
+ /** OAuth access token. */
1402
+ access_token?: string;
1403
+ /** Data format for response. */
1404
+ alt?: string;
1405
+ /** JSONP */
1406
+ callback?: string;
1407
+ /** Selector specifying which fields to include in a partial response. */
1408
+ fields?: string;
1409
+ /** 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. */
1410
+ key?: string;
1411
+ /** Required. The name of the model to delete. */
1412
+ name: string;
1413
+ /** OAuth 2.0 token for the current user. */
1414
+ oauth_token?: string;
1415
+ /** Returns response with indentations and line breaks. */
1416
+ prettyPrint?: boolean;
1417
+ /** 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. */
1418
+ quotaUser?: string;
1419
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1420
+ upload_protocol?: string;
1421
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1422
+ uploadType?: string;
1423
+ }): Request<Operation>;
1424
+ /** Gets a model. */
1425
+ get(request?: {
1426
+ /** V1 error format. */
1427
+ "$.xgafv"?: string;
1428
+ /** OAuth access token. */
1429
+ access_token?: string;
1430
+ /** Data format for response. */
1431
+ alt?: string;
1432
+ /** JSONP */
1433
+ callback?: string;
1434
+ /** Selector specifying which fields to include in a partial response. */
1435
+ fields?: string;
1436
+ /** 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. */
1437
+ key?: string;
1438
+ /** Required. The resource name of the model to retrieve. */
1439
+ name: string;
1440
+ /** OAuth 2.0 token for the current user. */
1441
+ oauth_token?: string;
1442
+ /** Returns response with indentations and line breaks. */
1443
+ prettyPrint?: boolean;
1444
+ /** 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. */
1445
+ quotaUser?: string;
1446
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1447
+ upload_protocol?: string;
1448
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1449
+ uploadType?: string;
1450
+ }): Request<Model>;
1451
+ /** Lists models. */
1452
+ list(request?: {
1453
+ /** V1 error format. */
1454
+ "$.xgafv"?: string;
1455
+ /** OAuth access token. */
1456
+ access_token?: string;
1457
+ /** Data format for response. */
1458
+ alt?: string;
1459
+ /** JSONP */
1460
+ callback?: string;
1461
+ /** Selector specifying which fields to include in a partial response. */
1462
+ fields?: string;
1463
+ /** Optional. An expression for filtering the models that will be returned. Supported filter: `dataset_id=${dataset_id}` */
1464
+ filter?: string;
1465
+ /** 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. */
1466
+ key?: string;
1467
+ /** OAuth 2.0 token for the current user. */
1468
+ oauth_token?: string;
1469
+ /** Optional. Requested page size. The server can return fewer results than requested. */
1470
+ pageSize?: number;
1471
+ /** Optional. A token identifying a page of results for the server to return. Typically obtained from next_page_token field in the response of a ListModels call. */
1472
+ pageToken?: string;
1473
+ /** Required. Name of the parent project. In form of `projects/{project-number-or-id}/locations/{location-id}` */
1474
+ parent: string;
1475
+ /** Returns response with indentations and line breaks. */
1476
+ prettyPrint?: boolean;
1477
+ /** 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. */
1478
+ quotaUser?: string;
1479
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
1480
+ upload_protocol?: string;
1481
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
1482
+ uploadType?: string;
1483
+ }): Request<ListModelsResponse>;
1484
+ }
929
1485
  interface OperationsResource {
930
1486
  /**
931
1487
  * 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
@@ -1577,7 +2133,9 @@ declare namespace gapi.client {
1577
2133
  uploadType?: string;
1578
2134
  },
1579
2135
  body: TranslateTextRequest): Request<TranslateTextResponse>;
2136
+ datasets: DatasetsResource;
1580
2137
  glossaries: GlossariesResource;
2138
+ models: ModelsResource;
1581
2139
  operations: OperationsResource;
1582
2140
  }
1583
2141
  interface ProjectsResource {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.translate-v3",
3
- "version": "0.0.20221111",
3
+ "version": "0.0.20230120",
4
4
  "description": "TypeScript typings for Cloud Translation API v3",
5
5
  "license": "MIT",
6
6
  "author": {
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20221111
6
+ // Revision: 20230120
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -75,6 +75,7 @@ gapi.load('client', async () => {
75
75
  await gapi.client.translate.projects.locations.batchTranslateDocument({
76
76
  parent: "Test string",
77
77
  }, {
78
+ customizedAttribution: "Test string",
78
79
  formatConversions: {
79
80
  A: "Test string"
80
81
  },
@@ -188,6 +189,7 @@ gapi.load('client', async () => {
188
189
  },
189
190
  mimeType: "Test string",
190
191
  },
192
+ enableShadowRemovalNativePdf: true,
191
193
  glossaryConfig: {
192
194
  glossary: "Test string",
193
195
  ignoreCase: true,
@@ -219,6 +221,67 @@ gapi.load('client', async () => {
219
221
  sourceLanguageCode: "Test string",
220
222
  targetLanguageCode: "Test string",
221
223
  });
224
+ /** Creates a Dataset. */
225
+ await gapi.client.translate.projects.locations.datasets.create({
226
+ parent: "Test string",
227
+ }, {
228
+ createTime: "Test string",
229
+ displayName: "Test string",
230
+ exampleCount: 42,
231
+ name: "Test string",
232
+ sourceLanguageCode: "Test string",
233
+ targetLanguageCode: "Test string",
234
+ testExampleCount: 42,
235
+ trainExampleCount: 42,
236
+ updateTime: "Test string",
237
+ validateExampleCount: 42,
238
+ });
239
+ /** Deletes a dataset and all of its contents. */
240
+ await gapi.client.translate.projects.locations.datasets.delete({
241
+ name: "Test string",
242
+ });
243
+ /** Exports dataset's data to the provided output location. */
244
+ await gapi.client.translate.projects.locations.datasets.exportData({
245
+ dataset: "Test string",
246
+ }, {
247
+ outputConfig: {
248
+ gcsDestination: {
249
+ outputUriPrefix: "Test string",
250
+ },
251
+ },
252
+ });
253
+ /** Gets a Dataset. */
254
+ await gapi.client.translate.projects.locations.datasets.get({
255
+ name: "Test string",
256
+ });
257
+ /** Import sentence pairs into translation Dataset. */
258
+ await gapi.client.translate.projects.locations.datasets.importData({
259
+ dataset: "Test string",
260
+ }, {
261
+ inputConfig: {
262
+ inputFiles: [
263
+ {
264
+ gcsSource: {
265
+ inputUri: "Test string",
266
+ },
267
+ usage: "Test string",
268
+ }
269
+ ],
270
+ },
271
+ });
272
+ /** Lists datasets. */
273
+ await gapi.client.translate.projects.locations.datasets.list({
274
+ pageSize: 42,
275
+ pageToken: "Test string",
276
+ parent: "Test string",
277
+ });
278
+ /** Lists sentence pairs in the dataset. */
279
+ await gapi.client.translate.projects.locations.datasets.examples.list({
280
+ filter: "Test string",
281
+ pageSize: 42,
282
+ pageToken: "Test string",
283
+ parent: "Test string",
284
+ });
222
285
  /** Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist. */
223
286
  await gapi.client.translate.projects.locations.glossaries.create({
224
287
  parent: "Test string",
@@ -347,6 +410,37 @@ gapi.load('client', async () => {
347
410
  ],
348
411
  },
349
412
  });
413
+ /** Creates a Model. */
414
+ await gapi.client.translate.projects.locations.models.create({
415
+ parent: "Test string",
416
+ }, {
417
+ createTime: "Test string",
418
+ dataset: "Test string",
419
+ deployTime: "Test string",
420
+ displayName: "Test string",
421
+ name: "Test string",
422
+ sourceLanguageCode: "Test string",
423
+ targetLanguageCode: "Test string",
424
+ testExampleCount: 42,
425
+ trainExampleCount: 42,
426
+ updateTime: "Test string",
427
+ validateExampleCount: 42,
428
+ });
429
+ /** Deletes a model. */
430
+ await gapi.client.translate.projects.locations.models.delete({
431
+ name: "Test string",
432
+ });
433
+ /** Gets a model. */
434
+ await gapi.client.translate.projects.locations.models.get({
435
+ name: "Test string",
436
+ });
437
+ /** Lists models. */
438
+ await gapi.client.translate.projects.locations.models.list({
439
+ filter: "Test string",
440
+ pageSize: 42,
441
+ pageToken: "Test string",
442
+ parent: "Test string",
443
+ });
350
444
  /**
351
445
  * 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
352
446
  * 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