google-apis-translate_v3 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f892953c592d22ad50eede9d86101264d77ef17bf3fbb94b124779c8043ab5ea
4
- data.tar.gz: 3119609c8057a1b6e5bc11916e2edb45d8e90de7d5739df5c36e65f29958f5e7
3
+ metadata.gz: 0df7ecb1650e4d0c129b4e605273ebecd115d1bab5ea297f3483d4c22ccb6197
4
+ data.tar.gz: 8e77c99307e902aa429785ecfb6996d2e0181ddc7413f48767e08c48ea7db5c9
5
5
  SHA512:
6
- metadata.gz: d2583aee383e5c5a4cf399d5f89e7c41ae17329eae1c2d452c101752911ea996ed2e3f3f00e061e4992280d8c4ab70bfd2c6322e320de6f0db493b929cca5a65
7
- data.tar.gz: d47083739286bb0410f83b4755301c1c687e21a5a42111d065c73ea9d59f2dc7717c2247774e0aced57410b580046de7e883b5fc2fe9ebe1a97c1a156faf147e
6
+ metadata.gz: abc161540740d6f9b9cab4e4eef5cb074d97ee8b0d3f2f8f7584c6f00079c466ef2eadd16d83e03c44ce8f881207b8d7373742a40b9d6d2d7540cc26cc2bce2b
7
+ data.tar.gz: c2244463dd5ade9a58dd8ca57e40c9225c0ae9acb11fcc60f625e8d980e0df29a187485f78227824d92319201b2b7ececb6cf27ab9e8659b644999b2a3e36f23
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release history for google-apis-translate_v3
2
2
 
3
+ ### v0.12.0 (2021-11-01)
4
+
5
+ * Regenerated from discovery document revision 20211029
6
+
3
7
  ### v0.11.0 (2021-10-21)
4
8
 
5
9
  * Unspecified changes
@@ -22,6 +22,111 @@ module Google
22
22
  module Apis
23
23
  module TranslateV3
24
24
 
25
+ # Input configuration for BatchTranslateDocument request.
26
+ class BatchDocumentInputConfig
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # The Google Cloud Storage location for the input content.
30
+ # Corresponds to the JSON property `gcsSource`
31
+ # @return [Google::Apis::TranslateV3::GcsSource]
32
+ attr_accessor :gcs_source
33
+
34
+ def initialize(**args)
35
+ update!(**args)
36
+ end
37
+
38
+ # Update properties of this object
39
+ def update!(**args)
40
+ @gcs_source = args[:gcs_source] if args.key?(:gcs_source)
41
+ end
42
+ end
43
+
44
+ # Output configuration for BatchTranslateDocument request.
45
+ class BatchDocumentOutputConfig
46
+ include Google::Apis::Core::Hashable
47
+
48
+ # The Google Cloud Storage location for the output content.
49
+ # Corresponds to the JSON property `gcsDestination`
50
+ # @return [Google::Apis::TranslateV3::GcsDestination]
51
+ attr_accessor :gcs_destination
52
+
53
+ def initialize(**args)
54
+ update!(**args)
55
+ end
56
+
57
+ # Update properties of this object
58
+ def update!(**args)
59
+ @gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
60
+ end
61
+ end
62
+
63
+ # The BatchTranslateDocument request.
64
+ class BatchTranslateDocumentRequest
65
+ include Google::Apis::Core::Hashable
66
+
67
+ # Optional.
68
+ # Corresponds to the JSON property `formatConversions`
69
+ # @return [Hash<String,String>]
70
+ attr_accessor :format_conversions
71
+
72
+ # Optional. Glossaries to be applied. It's keyed by target language code.
73
+ # Corresponds to the JSON property `glossaries`
74
+ # @return [Hash<String,Google::Apis::TranslateV3::TranslateTextGlossaryConfig>]
75
+ attr_accessor :glossaries
76
+
77
+ # Required. Input configurations. The total number of files matched should be <=
78
+ # 100. The total content size to translate should be <= 100M Unicode codepoints.
79
+ # The files must use UTF-8 encoding.
80
+ # Corresponds to the JSON property `inputConfigs`
81
+ # @return [Array<Google::Apis::TranslateV3::BatchDocumentInputConfig>]
82
+ attr_accessor :input_configs
83
+
84
+ # Optional. The models to use for translation. Map's key is target language code.
85
+ # Map's value is the model name. Value can be a built-in general model, or an
86
+ # AutoML Translation model. The value format depends on model type: - AutoML
87
+ # Translation models: `projects/`project-number-or-id`/locations/`location-id`/
88
+ # models/`model-id`` - General (built-in) models: `projects/`project-number-or-
89
+ # id`/locations/`location-id`/models/general/nmt`, If the map is empty or a
90
+ # specific model is not requested for a language pair, then default google model
91
+ # (nmt) is used.
92
+ # Corresponds to the JSON property `models`
93
+ # @return [Hash<String,String>]
94
+ attr_accessor :models
95
+
96
+ # Output configuration for BatchTranslateDocument request.
97
+ # Corresponds to the JSON property `outputConfig`
98
+ # @return [Google::Apis::TranslateV3::BatchDocumentOutputConfig]
99
+ attr_accessor :output_config
100
+
101
+ # Required. The BCP-47 language code of the input document if known, for example,
102
+ # "en-US" or "sr-Latn". Supported language codes are listed in Language Support
103
+ # (https://cloud.google.com/translate/docs/languages).
104
+ # Corresponds to the JSON property `sourceLanguageCode`
105
+ # @return [String]
106
+ attr_accessor :source_language_code
107
+
108
+ # Required. The BCP-47 language code to use for translation of the input
109
+ # document. Specify up to 10 language codes here.
110
+ # Corresponds to the JSON property `targetLanguageCodes`
111
+ # @return [Array<String>]
112
+ attr_accessor :target_language_codes
113
+
114
+ def initialize(**args)
115
+ update!(**args)
116
+ end
117
+
118
+ # Update properties of this object
119
+ def update!(**args)
120
+ @format_conversions = args[:format_conversions] if args.key?(:format_conversions)
121
+ @glossaries = args[:glossaries] if args.key?(:glossaries)
122
+ @input_configs = args[:input_configs] if args.key?(:input_configs)
123
+ @models = args[:models] if args.key?(:models)
124
+ @output_config = args[:output_config] if args.key?(:output_config)
125
+ @source_language_code = args[:source_language_code] if args.key?(:source_language_code)
126
+ @target_language_codes = args[:target_language_codes] if args.key?(:target_language_codes)
127
+ end
128
+ end
129
+
25
130
  # The batch translation request.
26
131
  class BatchTranslateTextRequest
27
132
  include Google::Apis::Core::Hashable
@@ -198,6 +303,111 @@ module Google
198
303
  end
199
304
  end
200
305
 
306
+ # A document translation request input config.
307
+ class DocumentInputConfig
308
+ include Google::Apis::Core::Hashable
309
+
310
+ # Document's content represented as a stream of bytes.
311
+ # Corresponds to the JSON property `content`
312
+ # NOTE: Values are automatically base64 encoded/decoded in the client library.
313
+ # @return [String]
314
+ attr_accessor :content
315
+
316
+ # The Google Cloud Storage location for the input content.
317
+ # Corresponds to the JSON property `gcsSource`
318
+ # @return [Google::Apis::TranslateV3::GcsSource]
319
+ attr_accessor :gcs_source
320
+
321
+ # Specifies the input document's mime_type. If not specified it will be
322
+ # determined using the file extension for gcs_source provided files. For a file
323
+ # provided through bytes content the mime_type must be provided. Currently
324
+ # supported mime types are: - application/pdf - application/vnd.openxmlformats-
325
+ # officedocument.wordprocessingml.document - application/vnd.openxmlformats-
326
+ # officedocument.presentationml.presentation - application/vnd.openxmlformats-
327
+ # officedocument.spreadsheetml.sheet
328
+ # Corresponds to the JSON property `mimeType`
329
+ # @return [String]
330
+ attr_accessor :mime_type
331
+
332
+ def initialize(**args)
333
+ update!(**args)
334
+ end
335
+
336
+ # Update properties of this object
337
+ def update!(**args)
338
+ @content = args[:content] if args.key?(:content)
339
+ @gcs_source = args[:gcs_source] if args.key?(:gcs_source)
340
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
341
+ end
342
+ end
343
+
344
+ # A document translation request output config.
345
+ class DocumentOutputConfig
346
+ include Google::Apis::Core::Hashable
347
+
348
+ # The Google Cloud Storage location for the output content.
349
+ # Corresponds to the JSON property `gcsDestination`
350
+ # @return [Google::Apis::TranslateV3::GcsDestination]
351
+ attr_accessor :gcs_destination
352
+
353
+ # Optional. Specifies the translated document's mime_type. If not specified, the
354
+ # translated file's mime type will be the same as the input file's mime type.
355
+ # Currently only support the output mime type to be the same as input mime type.
356
+ # - application/pdf - application/vnd.openxmlformats-officedocument.
357
+ # wordprocessingml.document - application/vnd.openxmlformats-officedocument.
358
+ # presentationml.presentation - application/vnd.openxmlformats-officedocument.
359
+ # spreadsheetml.sheet
360
+ # Corresponds to the JSON property `mimeType`
361
+ # @return [String]
362
+ attr_accessor :mime_type
363
+
364
+ def initialize(**args)
365
+ update!(**args)
366
+ end
367
+
368
+ # Update properties of this object
369
+ def update!(**args)
370
+ @gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
371
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
372
+ end
373
+ end
374
+
375
+ # A translated document message.
376
+ class DocumentTranslation
377
+ include Google::Apis::Core::Hashable
378
+
379
+ # The array of translated documents. It is expected to be size 1 for now. We may
380
+ # produce multiple translated documents in the future for other type of file
381
+ # formats.
382
+ # Corresponds to the JSON property `byteStreamOutputs`
383
+ # @return [Array<String>]
384
+ attr_accessor :byte_stream_outputs
385
+
386
+ # The detected language for the input document. If the user did not provide the
387
+ # source language for the input document, this field will have the language code
388
+ # automatically detected. If the source language was passed, auto-detection of
389
+ # the language does not occur and this field is empty.
390
+ # Corresponds to the JSON property `detectedLanguageCode`
391
+ # @return [String]
392
+ attr_accessor :detected_language_code
393
+
394
+ # The translated document's mime type.
395
+ # Corresponds to the JSON property `mimeType`
396
+ # @return [String]
397
+ attr_accessor :mime_type
398
+
399
+ def initialize(**args)
400
+ update!(**args)
401
+ end
402
+
403
+ # Update properties of this object
404
+ def update!(**args)
405
+ @byte_stream_outputs = args[:byte_stream_outputs] if args.key?(:byte_stream_outputs)
406
+ @detected_language_code = args[:detected_language_code] if args.key?(:detected_language_code)
407
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
408
+ end
409
+ end
410
+
201
411
  # A generic empty message that you can re-use to avoid defining duplicated empty
202
412
  # messages in your APIs. A typical example is to use it as the request or the
203
413
  # response type of an API method. For instance: service Foo ` rpc Bar(google.
@@ -715,6 +925,119 @@ module Google
715
925
  end
716
926
  end
717
927
 
928
+ # A document translation request.
929
+ class TranslateDocumentRequest
930
+ include Google::Apis::Core::Hashable
931
+
932
+ # A document translation request input config.
933
+ # Corresponds to the JSON property `documentInputConfig`
934
+ # @return [Google::Apis::TranslateV3::DocumentInputConfig]
935
+ attr_accessor :document_input_config
936
+
937
+ # A document translation request output config.
938
+ # Corresponds to the JSON property `documentOutputConfig`
939
+ # @return [Google::Apis::TranslateV3::DocumentOutputConfig]
940
+ attr_accessor :document_output_config
941
+
942
+ # Configures which glossary should be used for a specific target language, and
943
+ # defines options for applying that glossary.
944
+ # Corresponds to the JSON property `glossaryConfig`
945
+ # @return [Google::Apis::TranslateV3::TranslateTextGlossaryConfig]
946
+ attr_accessor :glossary_config
947
+
948
+ # Optional. The labels with user-defined metadata for the request. Label keys
949
+ # and values can be no longer than 63 characters (Unicode codepoints), can only
950
+ # contain lowercase letters, numeric characters, underscores and dashes.
951
+ # International characters are allowed. Label values are optional. Label keys
952
+ # must start with a letter. See https://cloud.google.com/translate/docs/advanced/
953
+ # labels for more information.
954
+ # Corresponds to the JSON property `labels`
955
+ # @return [Hash<String,String>]
956
+ attr_accessor :labels
957
+
958
+ # Optional. The `model` type requested for this translation. The format depends
959
+ # on model type: - AutoML Translation models: `projects/`project-number-or-id`/
960
+ # locations/`location-id`/models/`model-id`` - General (built-in) models: `
961
+ # projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
962
+ # If not provided, the default Google model (NMT) will be used for translation.
963
+ # Corresponds to the JSON property `model`
964
+ # @return [String]
965
+ attr_accessor :model
966
+
967
+ # Optional. The BCP-47 language code of the input document if known, for example,
968
+ # "en-US" or "sr-Latn". Supported language codes are listed in Language Support.
969
+ # If the source language isn't specified, the API attempts to identify the
970
+ # source language automatically and returns the source language within the
971
+ # response. Source language must be specified if the request contains a glossary
972
+ # or a custom model.
973
+ # Corresponds to the JSON property `sourceLanguageCode`
974
+ # @return [String]
975
+ attr_accessor :source_language_code
976
+
977
+ # Required. The BCP-47 language code to use for translation of the input
978
+ # document, set to one of the language codes listed in Language Support.
979
+ # Corresponds to the JSON property `targetLanguageCode`
980
+ # @return [String]
981
+ attr_accessor :target_language_code
982
+
983
+ def initialize(**args)
984
+ update!(**args)
985
+ end
986
+
987
+ # Update properties of this object
988
+ def update!(**args)
989
+ @document_input_config = args[:document_input_config] if args.key?(:document_input_config)
990
+ @document_output_config = args[:document_output_config] if args.key?(:document_output_config)
991
+ @glossary_config = args[:glossary_config] if args.key?(:glossary_config)
992
+ @labels = args[:labels] if args.key?(:labels)
993
+ @model = args[:model] if args.key?(:model)
994
+ @source_language_code = args[:source_language_code] if args.key?(:source_language_code)
995
+ @target_language_code = args[:target_language_code] if args.key?(:target_language_code)
996
+ end
997
+ end
998
+
999
+ # A translated document response message.
1000
+ class TranslateDocumentResponse
1001
+ include Google::Apis::Core::Hashable
1002
+
1003
+ # A translated document message.
1004
+ # Corresponds to the JSON property `documentTranslation`
1005
+ # @return [Google::Apis::TranslateV3::DocumentTranslation]
1006
+ attr_accessor :document_translation
1007
+
1008
+ # Configures which glossary should be used for a specific target language, and
1009
+ # defines options for applying that glossary.
1010
+ # Corresponds to the JSON property `glossaryConfig`
1011
+ # @return [Google::Apis::TranslateV3::TranslateTextGlossaryConfig]
1012
+ attr_accessor :glossary_config
1013
+
1014
+ # A translated document message.
1015
+ # Corresponds to the JSON property `glossaryDocumentTranslation`
1016
+ # @return [Google::Apis::TranslateV3::DocumentTranslation]
1017
+ attr_accessor :glossary_document_translation
1018
+
1019
+ # Only present when 'model' is present in the request. 'model' is normalized to
1020
+ # have a project number. For example: If the 'model' field in
1021
+ # TranslateDocumentRequest is: `projects/`project-id`/locations/`location-id`/
1022
+ # models/general/nmt` then `model` here would be normalized to `projects/`
1023
+ # project-number`/locations/`location-id`/models/general/nmt`.
1024
+ # Corresponds to the JSON property `model`
1025
+ # @return [String]
1026
+ attr_accessor :model
1027
+
1028
+ def initialize(**args)
1029
+ update!(**args)
1030
+ end
1031
+
1032
+ # Update properties of this object
1033
+ def update!(**args)
1034
+ @document_translation = args[:document_translation] if args.key?(:document_translation)
1035
+ @glossary_config = args[:glossary_config] if args.key?(:glossary_config)
1036
+ @glossary_document_translation = args[:glossary_document_translation] if args.key?(:glossary_document_translation)
1037
+ @model = args[:model] if args.key?(:model)
1038
+ end
1039
+ end
1040
+
718
1041
  # Configures which glossary should be used for a specific target language, and
719
1042
  # defines options for applying that glossary.
720
1043
  class TranslateTextGlossaryConfig
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module TranslateV3
18
18
  # Version of the google-apis-translate_v3 gem
19
- GEM_VERSION = "0.11.0"
19
+ GEM_VERSION = "0.12.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
22
  GENERATOR_VERSION = "0.4.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20210809"
25
+ REVISION = "20211029"
26
26
  end
27
27
  end
28
28
  end
@@ -22,6 +22,24 @@ module Google
22
22
  module Apis
23
23
  module TranslateV3
24
24
 
25
+ class BatchDocumentInputConfig
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class BatchDocumentOutputConfig
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class BatchTranslateDocumentRequest
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
25
43
  class BatchTranslateTextRequest
26
44
  class Representation < Google::Apis::Core::JsonRepresentation; end
27
45
 
@@ -52,6 +70,24 @@ module Google
52
70
  include Google::Apis::Core::JsonObjectSupport
53
71
  end
54
72
 
73
+ class DocumentInputConfig
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class DocumentOutputConfig
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class DocumentTranslation
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
55
91
  class Empty
56
92
  class Representation < Google::Apis::Core::JsonRepresentation; end
57
93
 
@@ -154,6 +190,18 @@ module Google
154
190
  include Google::Apis::Core::JsonObjectSupport
155
191
  end
156
192
 
193
+ class TranslateDocumentRequest
194
+ class Representation < Google::Apis::Core::JsonRepresentation; end
195
+
196
+ include Google::Apis::Core::JsonObjectSupport
197
+ end
198
+
199
+ class TranslateDocumentResponse
200
+ class Representation < Google::Apis::Core::JsonRepresentation; end
201
+
202
+ include Google::Apis::Core::JsonObjectSupport
203
+ end
204
+
157
205
  class TranslateTextGlossaryConfig
158
206
  class Representation < Google::Apis::Core::JsonRepresentation; end
159
207
 
@@ -184,6 +232,38 @@ module Google
184
232
  include Google::Apis::Core::JsonObjectSupport
185
233
  end
186
234
 
235
+ class BatchDocumentInputConfig
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3::GcsSource, decorator: Google::Apis::TranslateV3::GcsSource::Representation
239
+
240
+ end
241
+ end
242
+
243
+ class BatchDocumentOutputConfig
244
+ # @private
245
+ class Representation < Google::Apis::Core::JsonRepresentation
246
+ property :gcs_destination, as: 'gcsDestination', class: Google::Apis::TranslateV3::GcsDestination, decorator: Google::Apis::TranslateV3::GcsDestination::Representation
247
+
248
+ end
249
+ end
250
+
251
+ class BatchTranslateDocumentRequest
252
+ # @private
253
+ class Representation < Google::Apis::Core::JsonRepresentation
254
+ hash :format_conversions, as: 'formatConversions'
255
+ hash :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
256
+
257
+ collection :input_configs, as: 'inputConfigs', class: Google::Apis::TranslateV3::BatchDocumentInputConfig, decorator: Google::Apis::TranslateV3::BatchDocumentInputConfig::Representation
258
+
259
+ hash :models, as: 'models'
260
+ property :output_config, as: 'outputConfig', class: Google::Apis::TranslateV3::BatchDocumentOutputConfig, decorator: Google::Apis::TranslateV3::BatchDocumentOutputConfig::Representation
261
+
262
+ property :source_language_code, as: 'sourceLanguageCode'
263
+ collection :target_language_codes, as: 'targetLanguageCodes'
264
+ end
265
+ end
266
+
187
267
  class BatchTranslateTextRequest
188
268
  # @private
189
269
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -232,6 +312,34 @@ module Google
232
312
  end
233
313
  end
234
314
 
315
+ class DocumentInputConfig
316
+ # @private
317
+ class Representation < Google::Apis::Core::JsonRepresentation
318
+ property :content, :base64 => true, as: 'content'
319
+ property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3::GcsSource, decorator: Google::Apis::TranslateV3::GcsSource::Representation
320
+
321
+ property :mime_type, as: 'mimeType'
322
+ end
323
+ end
324
+
325
+ class DocumentOutputConfig
326
+ # @private
327
+ class Representation < Google::Apis::Core::JsonRepresentation
328
+ property :gcs_destination, as: 'gcsDestination', class: Google::Apis::TranslateV3::GcsDestination, decorator: Google::Apis::TranslateV3::GcsDestination::Representation
329
+
330
+ property :mime_type, as: 'mimeType'
331
+ end
332
+ end
333
+
334
+ class DocumentTranslation
335
+ # @private
336
+ class Representation < Google::Apis::Core::JsonRepresentation
337
+ collection :byte_stream_outputs, as: 'byteStreamOutputs'
338
+ property :detected_language_code, as: 'detectedLanguageCode'
339
+ property :mime_type, as: 'mimeType'
340
+ end
341
+ end
342
+
235
343
  class Empty
236
344
  # @private
237
345
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -385,6 +493,35 @@ module Google
385
493
  end
386
494
  end
387
495
 
496
+ class TranslateDocumentRequest
497
+ # @private
498
+ class Representation < Google::Apis::Core::JsonRepresentation
499
+ property :document_input_config, as: 'documentInputConfig', class: Google::Apis::TranslateV3::DocumentInputConfig, decorator: Google::Apis::TranslateV3::DocumentInputConfig::Representation
500
+
501
+ property :document_output_config, as: 'documentOutputConfig', class: Google::Apis::TranslateV3::DocumentOutputConfig, decorator: Google::Apis::TranslateV3::DocumentOutputConfig::Representation
502
+
503
+ property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
504
+
505
+ hash :labels, as: 'labels'
506
+ property :model, as: 'model'
507
+ property :source_language_code, as: 'sourceLanguageCode'
508
+ property :target_language_code, as: 'targetLanguageCode'
509
+ end
510
+ end
511
+
512
+ class TranslateDocumentResponse
513
+ # @private
514
+ class Representation < Google::Apis::Core::JsonRepresentation
515
+ property :document_translation, as: 'documentTranslation', class: Google::Apis::TranslateV3::DocumentTranslation, decorator: Google::Apis::TranslateV3::DocumentTranslation::Representation
516
+
517
+ property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3::TranslateTextGlossaryConfig::Representation
518
+
519
+ property :glossary_document_translation, as: 'glossaryDocumentTranslation', class: Google::Apis::TranslateV3::DocumentTranslation, decorator: Google::Apis::TranslateV3::DocumentTranslation::Representation
520
+
521
+ property :model, as: 'model'
522
+ end
523
+ end
524
+
388
525
  class TranslateTextGlossaryConfig
389
526
  # @private
390
527
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -175,6 +175,48 @@ module Google
175
175
  execute_or_queue_command(command, &block)
176
176
  end
177
177
 
178
+ # Translates a large volume of document in asynchronous batch mode. This
179
+ # function provides real-time output as the inputs are being processed. If
180
+ # caller cancels a request, the partial results (for an input file, it's all or
181
+ # nothing) may still be available on the specified output location. This call
182
+ # returns immediately and you can use google.longrunning.Operation.name to poll
183
+ # the status of the call.
184
+ # @param [String] parent
185
+ # Required. Location to make a regional call. Format: `projects/`project-number-
186
+ # or-id`/locations/`location-id``. The `global` location is not supported for
187
+ # batch translation. Only AutoML Translation models or glossaries within the
188
+ # same region (have the same location-id) can be used, otherwise an
189
+ # INVALID_ARGUMENT (400) error is returned.
190
+ # @param [Google::Apis::TranslateV3::BatchTranslateDocumentRequest] batch_translate_document_request_object
191
+ # @param [String] fields
192
+ # Selector specifying which fields to include in a partial response.
193
+ # @param [String] quota_user
194
+ # Available to use for quota purposes for server-side applications. Can be any
195
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
196
+ # @param [Google::Apis::RequestOptions] options
197
+ # Request-specific options
198
+ #
199
+ # @yield [result, err] Result & error if block supplied
200
+ # @yieldparam result [Google::Apis::TranslateV3::Operation] parsed result object
201
+ # @yieldparam err [StandardError] error object if request failed
202
+ #
203
+ # @return [Google::Apis::TranslateV3::Operation]
204
+ #
205
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
206
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
207
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
208
+ def batch_location_translate_document(parent, batch_translate_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
209
+ command = make_simple_command(:post, 'v3/{+parent}:batchTranslateDocument', options)
210
+ command.request_representation = Google::Apis::TranslateV3::BatchTranslateDocumentRequest::Representation
211
+ command.request_object = batch_translate_document_request_object
212
+ command.response_representation = Google::Apis::TranslateV3::Operation::Representation
213
+ command.response_class = Google::Apis::TranslateV3::Operation
214
+ command.params['parent'] = parent unless parent.nil?
215
+ command.query['fields'] = fields unless fields.nil?
216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
217
+ execute_or_queue_command(command, &block)
218
+ end
219
+
178
220
  # Translates a large volume of text in asynchronous batch mode. This function
179
221
  # provides real-time output as the inputs are being processed. If caller cancels
180
222
  # a request, the partial results (for an input file, it's all or nothing) may
@@ -377,6 +419,44 @@ module Google
377
419
  execute_or_queue_command(command, &block)
378
420
  end
379
421
 
422
+ # Translates documents in synchronous mode.
423
+ # @param [String] parent
424
+ # Required. Location to make a regional call. Format: `projects/`project-number-
425
+ # or-id`/locations/`location-id``. For global calls, use `projects/`project-
426
+ # number-or-id`/locations/global` or `projects/`project-number-or-id``. Non-
427
+ # global location is required for requests using AutoML models or custom
428
+ # glossaries. Models and glossaries must be within the same region (have the
429
+ # same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
430
+ # @param [Google::Apis::TranslateV3::TranslateDocumentRequest] translate_document_request_object
431
+ # @param [String] fields
432
+ # Selector specifying which fields to include in a partial response.
433
+ # @param [String] quota_user
434
+ # Available to use for quota purposes for server-side applications. Can be any
435
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
436
+ # @param [Google::Apis::RequestOptions] options
437
+ # Request-specific options
438
+ #
439
+ # @yield [result, err] Result & error if block supplied
440
+ # @yieldparam result [Google::Apis::TranslateV3::TranslateDocumentResponse] parsed result object
441
+ # @yieldparam err [StandardError] error object if request failed
442
+ #
443
+ # @return [Google::Apis::TranslateV3::TranslateDocumentResponse]
444
+ #
445
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
446
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
447
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
448
+ def translate_location_document(parent, translate_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
449
+ command = make_simple_command(:post, 'v3/{+parent}:translateDocument', options)
450
+ command.request_representation = Google::Apis::TranslateV3::TranslateDocumentRequest::Representation
451
+ command.request_object = translate_document_request_object
452
+ command.response_representation = Google::Apis::TranslateV3::TranslateDocumentResponse::Representation
453
+ command.response_class = Google::Apis::TranslateV3::TranslateDocumentResponse
454
+ command.params['parent'] = parent unless parent.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ execute_or_queue_command(command, &block)
458
+ end
459
+
380
460
  # Translates input text and returns translated text.
381
461
  # @param [String] parent
382
462
  # Required. Project or location to make a call. Must refer to a caller's project.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-translate_v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-27 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-apis-core
@@ -58,7 +58,7 @@ licenses:
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
60
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-translate_v3/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3/v0.11.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3/v0.12.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-translate_v3
63
63
  post_install_message:
64
64
  rdoc_options: []