google-apis-translate_v3 0.8.0 → 0.12.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d757fb054aa119cfccd90970fbd770b313303821c32ecefa86afaa6ce1c0895
4
- data.tar.gz: f9936d75302ffe87a6797b01753f90db9838732637c1ee11fd199e3b9c792512
3
+ metadata.gz: 0df7ecb1650e4d0c129b4e605273ebecd115d1bab5ea297f3483d4c22ccb6197
4
+ data.tar.gz: 8e77c99307e902aa429785ecfb6996d2e0181ddc7413f48767e08c48ea7db5c9
5
5
  SHA512:
6
- metadata.gz: df8bbf9fbe6f447cd2a9ba9405dcc6b5a074fce817a9ea19c54b0b3b32be33d5cedfe489f50b8bbf6a81ecf1ffaa83e31900fa9ddc1827e10f562f07a19a4738
7
- data.tar.gz: 5b48adb446a6a000c63f2f731d6bdf51a911539d60b6768c00769bb8ab2aed3453eb844865177ea9990c8decf96850e9d27be22a3c83e3d540a73b149cdc8466
6
+ metadata.gz: abc161540740d6f9b9cab4e4eef5cb074d97ee8b0d3f2f8f7584c6f00079c466ef2eadd16d83e03c44ce8f881207b8d7373742a40b9d6d2d7540cc26cc2bce2b
7
+ data.tar.gz: c2244463dd5ade9a58dd8ca57e40c9225c0ae9acb11fcc60f625e8d980e0df29a187485f78227824d92319201b2b7ececb6cf27ab9e8659b644999b2a3e36f23
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
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
+
7
+ ### v0.11.0 (2021-10-21)
8
+
9
+ * Unspecified changes
10
+
11
+ ### v0.10.0 (2021-09-01)
12
+
13
+ * Regenerated from discovery document revision 20210809
14
+
15
+ ### v0.9.0 (2021-06-29)
16
+
17
+ * Regenerated from discovery document revision 20210625
18
+ * Regenerated using generator version 0.4.0
19
+
3
20
  ### v0.8.0 (2021-06-24)
4
21
 
5
22
  * Regenerated using generator version 0.3.0
data/OVERVIEW.md CHANGED
@@ -60,8 +60,8 @@ See the class reference docs for information on the methods you can call from a
60
60
 
61
61
  More detailed descriptions of the Google simple REST clients are available in two documents.
62
62
 
63
- * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
64
- * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
63
+ * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
64
+ * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/main/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
65
65
 
66
66
  (Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Translate service in particular.)
67
67
 
@@ -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
@@ -54,8 +159,7 @@ module Google
54
159
  # AutoML Translation model. The value format depends on model type: - AutoML
55
160
  # Translation models: `projects/`project-number-or-id`/locations/`location-id`/
56
161
  # models/`model-id`` - General (built-in) models: `projects/`project-number-or-
57
- # id`/locations/`location-id`/models/general/nmt`, `projects/`project-number-or-
58
- # id`/locations/`location-id`/models/general/base` If the map is empty or a
162
+ # id`/locations/`location-id`/models/general/nmt`, If the map is empty or a
59
163
  # specific model is not requested for a language pair, then default google model
60
164
  # (nmt) is used.
61
165
  # Corresponds to the JSON property `models`
@@ -199,6 +303,111 @@ module Google
199
303
  end
200
304
  end
201
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
+
202
411
  # A generic empty message that you can re-use to avoid defining duplicated empty
203
412
  # messages in your APIs. A typical example is to use it as the request or the
204
413
  # response type of an API method. For instance: service Foo ` rpc Bar(google.
@@ -716,6 +925,119 @@ module Google
716
925
  end
717
926
  end
718
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
+
719
1041
  # Configures which glossary should be used for a specific target language, and
720
1042
  # defines options for applying that glossary.
721
1043
  class TranslateTextGlossaryConfig
@@ -782,11 +1104,10 @@ module Google
782
1104
  # Optional. The `model` type requested for this translation. The format depends
783
1105
  # on model type: - AutoML Translation models: `projects/`project-number-or-id`/
784
1106
  # locations/`location-id`/models/`model-id`` - General (built-in) models: `
785
- # projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`, `
786
- # projects/`project-number-or-id`/locations/`location-id`/models/general/base`
1107
+ # projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
787
1108
  # For global (non-regionalized) requests, use `location-id` `global`. For
788
1109
  # example, `projects/`project-number-or-id`/locations/global/models/general/nmt`.
789
- # If missing, the system decides which google base model to use.
1110
+ # If not provided, the default Google model (NMT) will be used
790
1111
  # Corresponds to the JSON property `model`
791
1112
  # @return [String]
792
1113
  attr_accessor :model
@@ -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.8.0"
19
+ GEM_VERSION = "0.12.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
- GENERATOR_VERSION = "0.3.0"
22
+ GENERATOR_VERSION = "0.4.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20210521"
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
@@ -104,10 +104,9 @@ module Google
104
104
  # Optional. Get supported languages of this model. The format depends on model
105
105
  # type: - AutoML Translation models: `projects/`project-number-or-id`/locations/`
106
106
  # location-id`/models/`model-id`` - General (built-in) models: `projects/`
107
- # project-number-or-id`/locations/`location-id`/models/general/nmt`, `projects/`
108
- # project-number-or-id`/locations/`location-id`/models/general/base` Returns
107
+ # project-number-or-id`/locations/`location-id`/models/general/nmt`, Returns
109
108
  # languages supported by the specified model. If missing, we get supported
110
- # languages of Google general base (PBMT) model.
109
+ # languages of Google general NMT model.
111
110
  # @param [String] fields
112
111
  # Selector specifying which fields to include in a partial response.
113
112
  # @param [String] quota_user
@@ -176,6 +175,48 @@ module Google
176
175
  execute_or_queue_command(command, &block)
177
176
  end
178
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
+
179
220
  # Translates a large volume of text in asynchronous batch mode. This function
180
221
  # provides real-time output as the inputs are being processed. If caller cancels
181
222
  # a request, the partial results (for an input file, it's all or nothing) may
@@ -303,10 +344,9 @@ module Google
303
344
  # Optional. Get supported languages of this model. The format depends on model
304
345
  # type: - AutoML Translation models: `projects/`project-number-or-id`/locations/`
305
346
  # location-id`/models/`model-id`` - General (built-in) models: `projects/`
306
- # project-number-or-id`/locations/`location-id`/models/general/nmt`, `projects/`
307
- # project-number-or-id`/locations/`location-id`/models/general/base` Returns
347
+ # project-number-or-id`/locations/`location-id`/models/general/nmt`, Returns
308
348
  # languages supported by the specified model. If missing, we get supported
309
- # languages of Google general base (PBMT) model.
349
+ # languages of Google general NMT model.
310
350
  # @param [String] fields
311
351
  # Selector specifying which fields to include in a partial response.
312
352
  # @param [String] quota_user
@@ -379,6 +419,44 @@ module Google
379
419
  execute_or_queue_command(command, &block)
380
420
  end
381
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
+
382
460
  # Translates input text and returns translated text.
383
461
  # @param [String] parent
384
462
  # Required. Project or location to make a call. Must refer to a caller's project.
@@ -29,7 +29,7 @@ module Google
29
29
  # This is NOT the gem version.
30
30
  VERSION = 'V3'
31
31
 
32
- # See, edit, configure, and delete your Google Cloud Platform data
32
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
33
33
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
34
 
35
35
  # Translate text from one language to another using Google Translate
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.8.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-06-28 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
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '0.4'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.3'
29
+ version: '0.4'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -57,9 +57,9 @@ licenses:
57
57
  - Apache-2.0
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
- changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-translate_v3/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3/v0.8.0
62
- source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-translate_v3
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.12.0
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: []
65
65
  require_paths: