google-apis-translate_v3beta1 0.4.0 → 0.9.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 +4 -4
- data/CHANGELOG.md +21 -0
- data/lib/google/apis/translate_v3beta1.rb +1 -1
- data/lib/google/apis/translate_v3beta1/classes.rb +322 -6
- data/lib/google/apis/translate_v3beta1/gem_version.rb +3 -3
- data/lib/google/apis/translate_v3beta1/representations.rb +136 -0
- data/lib/google/apis/translate_v3beta1/service.rb +85 -7
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ca51a28355932b1bb991c614a0a32bd267447adc942af542c342f0a8f53e46a
|
4
|
+
data.tar.gz: 447d64cee0b1d6f867974de8076e6a7c0914be4594f717946cac97c61f019097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 006fd481f0b21f69adcc291f52e71832148bed18d9d6fb6b10adadabfae426a2a2234d54b4dd0cfbd6b4e42c3dd0eddd1bac12b7a640210000114c1254cd01f2
|
7
|
+
data.tar.gz: 6d46b003bfd001b02e5d5123c4e1842cd30f2f3d30404fc8b4e306a8a1eb496a81673437b84c07b62e19865adff20845c6b541e73937af34fcd6fa0bcd87f52c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Release history for google-apis-translate_v3beta1
|
2
2
|
|
3
|
+
### v0.9.0 (2021-06-29)
|
4
|
+
|
5
|
+
* Regenerated from discovery document revision 20210625
|
6
|
+
* Regenerated using generator version 0.4.0
|
7
|
+
|
8
|
+
### v0.8.0 (2021-06-24)
|
9
|
+
|
10
|
+
* Regenerated using generator version 0.3.0
|
11
|
+
|
12
|
+
### v0.7.0 (2021-05-25)
|
13
|
+
|
14
|
+
* Regenerated from discovery document revision 20210521
|
15
|
+
|
16
|
+
### v0.6.0 (2021-05-20)
|
17
|
+
|
18
|
+
* Unspecified changes
|
19
|
+
|
20
|
+
### v0.5.0 (2021-05-11)
|
21
|
+
|
22
|
+
* Regenerated from discovery document revision 20210506
|
23
|
+
|
3
24
|
### v0.4.0 (2021-03-16)
|
4
25
|
|
5
26
|
* Regenerated from discovery document revision 20210312
|
@@ -29,7 +29,7 @@ module Google
|
|
29
29
|
# This is NOT the gem version.
|
30
30
|
VERSION = 'V3beta1'
|
31
31
|
|
32
|
-
#
|
32
|
+
# See, edit, configure, and delete your Google Cloud Platform data
|
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
|
@@ -22,6 +22,105 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module TranslateV3beta1
|
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::TranslateV3beta1::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::TranslateV3beta1::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. Glossaries to be applied. It's keyed by target language code.
|
68
|
+
# Corresponds to the JSON property `glossaries`
|
69
|
+
# @return [Hash<String,Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig>]
|
70
|
+
attr_accessor :glossaries
|
71
|
+
|
72
|
+
# Required. Input configurations. The total number of files matched should be <=
|
73
|
+
# 100. The total content size to translate should be <= 100M Unicode codepoints.
|
74
|
+
# The files must use UTF-8 encoding.
|
75
|
+
# Corresponds to the JSON property `inputConfigs`
|
76
|
+
# @return [Array<Google::Apis::TranslateV3beta1::BatchDocumentInputConfig>]
|
77
|
+
attr_accessor :input_configs
|
78
|
+
|
79
|
+
# Optional. The models to use for translation. Map's key is target language code.
|
80
|
+
# Map's value is the model name. Value can be a built-in general model, or an
|
81
|
+
# AutoML Translation model. The value format depends on model type: - AutoML
|
82
|
+
# Translation models: `projects/`project-number-or-id`/locations/`location-id`/
|
83
|
+
# models/`model-id`` - General (built-in) models: `projects/`project-number-or-
|
84
|
+
# id`/locations/`location-id`/models/general/nmt`, If the map is empty or a
|
85
|
+
# specific model is not requested for a language pair, then default google model
|
86
|
+
# (nmt) is used.
|
87
|
+
# Corresponds to the JSON property `models`
|
88
|
+
# @return [Hash<String,String>]
|
89
|
+
attr_accessor :models
|
90
|
+
|
91
|
+
# Output configuration for BatchTranslateDocument request.
|
92
|
+
# Corresponds to the JSON property `outputConfig`
|
93
|
+
# @return [Google::Apis::TranslateV3beta1::BatchDocumentOutputConfig]
|
94
|
+
attr_accessor :output_config
|
95
|
+
|
96
|
+
# Required. The BCP-47 language code of the input document if known, for example,
|
97
|
+
# "en-US" or "sr-Latn". Supported language codes are listed in Language Support
|
98
|
+
# (https://cloud.google.com/translate/docs/languages).
|
99
|
+
# Corresponds to the JSON property `sourceLanguageCode`
|
100
|
+
# @return [String]
|
101
|
+
attr_accessor :source_language_code
|
102
|
+
|
103
|
+
# Required. The BCP-47 language code to use for translation of the input
|
104
|
+
# document. Specify up to 10 language codes here.
|
105
|
+
# Corresponds to the JSON property `targetLanguageCodes`
|
106
|
+
# @return [Array<String>]
|
107
|
+
attr_accessor :target_language_codes
|
108
|
+
|
109
|
+
def initialize(**args)
|
110
|
+
update!(**args)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Update properties of this object
|
114
|
+
def update!(**args)
|
115
|
+
@glossaries = args[:glossaries] if args.key?(:glossaries)
|
116
|
+
@input_configs = args[:input_configs] if args.key?(:input_configs)
|
117
|
+
@models = args[:models] if args.key?(:models)
|
118
|
+
@output_config = args[:output_config] if args.key?(:output_config)
|
119
|
+
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
|
120
|
+
@target_language_codes = args[:target_language_codes] if args.key?(:target_language_codes)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
25
124
|
# The batch translation request.
|
26
125
|
class BatchTranslateTextRequest
|
27
126
|
include Google::Apis::Core::Hashable
|
@@ -54,8 +153,7 @@ module Google
|
|
54
153
|
# AutoML Translation model. The value format depends on model type: - AutoML
|
55
154
|
# Translation models: `projects/`project-number-or-id`/locations/`location-id`/
|
56
155
|
# models/`model-id`` - General (built-in) models: `projects/`project-number-or-
|
57
|
-
# id`/locations/`location-id`/models/general/nmt`,
|
58
|
-
# id`/locations/`location-id`/models/general/base` If the map is empty or a
|
156
|
+
# id`/locations/`location-id`/models/general/nmt`, If the map is empty or a
|
59
157
|
# specific model is not requested for a language pair, then default google model
|
60
158
|
# (nmt) is used.
|
61
159
|
# Corresponds to the JSON property `models`
|
@@ -199,6 +297,111 @@ module Google
|
|
199
297
|
end
|
200
298
|
end
|
201
299
|
|
300
|
+
# A document translation request input config.
|
301
|
+
class DocumentInputConfig
|
302
|
+
include Google::Apis::Core::Hashable
|
303
|
+
|
304
|
+
# Document's content represented as a stream of bytes.
|
305
|
+
# Corresponds to the JSON property `content`
|
306
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
307
|
+
# @return [String]
|
308
|
+
attr_accessor :content
|
309
|
+
|
310
|
+
# The Google Cloud Storage location for the input content.
|
311
|
+
# Corresponds to the JSON property `gcsSource`
|
312
|
+
# @return [Google::Apis::TranslateV3beta1::GcsSource]
|
313
|
+
attr_accessor :gcs_source
|
314
|
+
|
315
|
+
# Specifies the input document's mime_type. If not specified it will be
|
316
|
+
# determined using the file extension for gcs_source provided files. For a file
|
317
|
+
# provided through bytes content the mime_type must be provided. Currently
|
318
|
+
# supported mime types are: - application/pdf - application/vnd.openxmlformats-
|
319
|
+
# officedocument.wordprocessingml.document - application/vnd.openxmlformats-
|
320
|
+
# officedocument.presentationml.presentation - application/vnd.openxmlformats-
|
321
|
+
# officedocument.spreadsheetml.sheet
|
322
|
+
# Corresponds to the JSON property `mimeType`
|
323
|
+
# @return [String]
|
324
|
+
attr_accessor :mime_type
|
325
|
+
|
326
|
+
def initialize(**args)
|
327
|
+
update!(**args)
|
328
|
+
end
|
329
|
+
|
330
|
+
# Update properties of this object
|
331
|
+
def update!(**args)
|
332
|
+
@content = args[:content] if args.key?(:content)
|
333
|
+
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
|
334
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
338
|
+
# A document translation request output config.
|
339
|
+
class DocumentOutputConfig
|
340
|
+
include Google::Apis::Core::Hashable
|
341
|
+
|
342
|
+
# The Google Cloud Storage location for the output content.
|
343
|
+
# Corresponds to the JSON property `gcsDestination`
|
344
|
+
# @return [Google::Apis::TranslateV3beta1::GcsDestination]
|
345
|
+
attr_accessor :gcs_destination
|
346
|
+
|
347
|
+
# Optional. Specifies the translated document's mime_type. If not specified, the
|
348
|
+
# translated file's mime type will be the same as the input file's mime type.
|
349
|
+
# Currently only support the output mime type to be the same as input mime type.
|
350
|
+
# - application/pdf - application/vnd.openxmlformats-officedocument.
|
351
|
+
# wordprocessingml.document - application/vnd.openxmlformats-officedocument.
|
352
|
+
# presentationml.presentation - application/vnd.openxmlformats-officedocument.
|
353
|
+
# spreadsheetml.sheet
|
354
|
+
# Corresponds to the JSON property `mimeType`
|
355
|
+
# @return [String]
|
356
|
+
attr_accessor :mime_type
|
357
|
+
|
358
|
+
def initialize(**args)
|
359
|
+
update!(**args)
|
360
|
+
end
|
361
|
+
|
362
|
+
# Update properties of this object
|
363
|
+
def update!(**args)
|
364
|
+
@gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
|
365
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
366
|
+
end
|
367
|
+
end
|
368
|
+
|
369
|
+
# A translated document message.
|
370
|
+
class DocumentTranslation
|
371
|
+
include Google::Apis::Core::Hashable
|
372
|
+
|
373
|
+
# The array of translated documents. It is expected to be size 1 for now. We may
|
374
|
+
# produce multiple translated documents in the future for other type of file
|
375
|
+
# formats.
|
376
|
+
# Corresponds to the JSON property `byteStreamOutputs`
|
377
|
+
# @return [Array<String>]
|
378
|
+
attr_accessor :byte_stream_outputs
|
379
|
+
|
380
|
+
# The detected language for the input document. If the user did not provide the
|
381
|
+
# source language for the input document, this field will have the language code
|
382
|
+
# automatically detected. If the source language was passed, auto-detection of
|
383
|
+
# the language does not occur and this field is empty.
|
384
|
+
# Corresponds to the JSON property `detectedLanguageCode`
|
385
|
+
# @return [String]
|
386
|
+
attr_accessor :detected_language_code
|
387
|
+
|
388
|
+
# The translated document's mime type.
|
389
|
+
# Corresponds to the JSON property `mimeType`
|
390
|
+
# @return [String]
|
391
|
+
attr_accessor :mime_type
|
392
|
+
|
393
|
+
def initialize(**args)
|
394
|
+
update!(**args)
|
395
|
+
end
|
396
|
+
|
397
|
+
# Update properties of this object
|
398
|
+
def update!(**args)
|
399
|
+
@byte_stream_outputs = args[:byte_stream_outputs] if args.key?(:byte_stream_outputs)
|
400
|
+
@detected_language_code = args[:detected_language_code] if args.key?(:detected_language_code)
|
401
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
202
405
|
# A generic empty message that you can re-use to avoid defining duplicated empty
|
203
406
|
# messages in your APIs. A typical example is to use it as the request or the
|
204
407
|
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
@@ -714,6 +917,119 @@ module Google
|
|
714
917
|
end
|
715
918
|
end
|
716
919
|
|
920
|
+
# A document translation request.
|
921
|
+
class TranslateDocumentRequest
|
922
|
+
include Google::Apis::Core::Hashable
|
923
|
+
|
924
|
+
# A document translation request input config.
|
925
|
+
# Corresponds to the JSON property `documentInputConfig`
|
926
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentInputConfig]
|
927
|
+
attr_accessor :document_input_config
|
928
|
+
|
929
|
+
# A document translation request output config.
|
930
|
+
# Corresponds to the JSON property `documentOutputConfig`
|
931
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentOutputConfig]
|
932
|
+
attr_accessor :document_output_config
|
933
|
+
|
934
|
+
# Configures which glossary should be used for a specific target language, and
|
935
|
+
# defines options for applying that glossary.
|
936
|
+
# Corresponds to the JSON property `glossaryConfig`
|
937
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig]
|
938
|
+
attr_accessor :glossary_config
|
939
|
+
|
940
|
+
# Optional. The labels with user-defined metadata for the request. Label keys
|
941
|
+
# and values can be no longer than 63 characters (Unicode codepoints), can only
|
942
|
+
# contain lowercase letters, numeric characters, underscores and dashes.
|
943
|
+
# International characters are allowed. Label values are optional. Label keys
|
944
|
+
# must start with a letter. See https://cloud.google.com/translate/docs/advanced/
|
945
|
+
# labels for more information.
|
946
|
+
# Corresponds to the JSON property `labels`
|
947
|
+
# @return [Hash<String,String>]
|
948
|
+
attr_accessor :labels
|
949
|
+
|
950
|
+
# Optional. The `model` type requested for this translation. The format depends
|
951
|
+
# on model type: - AutoML Translation models: `projects/`project-number-or-id`/
|
952
|
+
# locations/`location-id`/models/`model-id`` - General (built-in) models: `
|
953
|
+
# projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
|
954
|
+
# If not provided, the default Google model (NMT) will be used for translation.
|
955
|
+
# Corresponds to the JSON property `model`
|
956
|
+
# @return [String]
|
957
|
+
attr_accessor :model
|
958
|
+
|
959
|
+
# Optional. The BCP-47 language code of the input document if known, for example,
|
960
|
+
# "en-US" or "sr-Latn". Supported language codes are listed in Language Support.
|
961
|
+
# If the source language isn't specified, the API attempts to identify the
|
962
|
+
# source language automatically and returns the source language within the
|
963
|
+
# response. Source language must be specified if the request contains a glossary
|
964
|
+
# or a custom model.
|
965
|
+
# Corresponds to the JSON property `sourceLanguageCode`
|
966
|
+
# @return [String]
|
967
|
+
attr_accessor :source_language_code
|
968
|
+
|
969
|
+
# Required. The BCP-47 language code to use for translation of the input
|
970
|
+
# document, set to one of the language codes listed in Language Support.
|
971
|
+
# Corresponds to the JSON property `targetLanguageCode`
|
972
|
+
# @return [String]
|
973
|
+
attr_accessor :target_language_code
|
974
|
+
|
975
|
+
def initialize(**args)
|
976
|
+
update!(**args)
|
977
|
+
end
|
978
|
+
|
979
|
+
# Update properties of this object
|
980
|
+
def update!(**args)
|
981
|
+
@document_input_config = args[:document_input_config] if args.key?(:document_input_config)
|
982
|
+
@document_output_config = args[:document_output_config] if args.key?(:document_output_config)
|
983
|
+
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
|
984
|
+
@labels = args[:labels] if args.key?(:labels)
|
985
|
+
@model = args[:model] if args.key?(:model)
|
986
|
+
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
|
987
|
+
@target_language_code = args[:target_language_code] if args.key?(:target_language_code)
|
988
|
+
end
|
989
|
+
end
|
990
|
+
|
991
|
+
# A translated document response message.
|
992
|
+
class TranslateDocumentResponse
|
993
|
+
include Google::Apis::Core::Hashable
|
994
|
+
|
995
|
+
# A translated document message.
|
996
|
+
# Corresponds to the JSON property `documentTranslation`
|
997
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentTranslation]
|
998
|
+
attr_accessor :document_translation
|
999
|
+
|
1000
|
+
# Configures which glossary should be used for a specific target language, and
|
1001
|
+
# defines options for applying that glossary.
|
1002
|
+
# Corresponds to the JSON property `glossaryConfig`
|
1003
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig]
|
1004
|
+
attr_accessor :glossary_config
|
1005
|
+
|
1006
|
+
# A translated document message.
|
1007
|
+
# Corresponds to the JSON property `glossaryDocumentTranslation`
|
1008
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentTranslation]
|
1009
|
+
attr_accessor :glossary_document_translation
|
1010
|
+
|
1011
|
+
# Only present when 'model' is present in the request. 'model' is normalized to
|
1012
|
+
# have a project number. For example: If the 'model' field in
|
1013
|
+
# TranslateDocumentRequest is: `projects/`project-id`/locations/`location-id`/
|
1014
|
+
# models/general/nmt` then `model` here would be normalized to `projects/`
|
1015
|
+
# project-number`/locations/`location-id`/models/general/nmt`.
|
1016
|
+
# Corresponds to the JSON property `model`
|
1017
|
+
# @return [String]
|
1018
|
+
attr_accessor :model
|
1019
|
+
|
1020
|
+
def initialize(**args)
|
1021
|
+
update!(**args)
|
1022
|
+
end
|
1023
|
+
|
1024
|
+
# Update properties of this object
|
1025
|
+
def update!(**args)
|
1026
|
+
@document_translation = args[:document_translation] if args.key?(:document_translation)
|
1027
|
+
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
|
1028
|
+
@glossary_document_translation = args[:glossary_document_translation] if args.key?(:glossary_document_translation)
|
1029
|
+
@model = args[:model] if args.key?(:model)
|
1030
|
+
end
|
1031
|
+
end
|
1032
|
+
|
717
1033
|
# Configures which glossary should be used for a specific target language, and
|
718
1034
|
# defines options for applying that glossary.
|
719
1035
|
class TranslateTextGlossaryConfig
|
@@ -779,11 +1095,10 @@ module Google
|
|
779
1095
|
# Optional. The `model` type requested for this translation. The format depends
|
780
1096
|
# on model type: - AutoML Translation models: `projects/`project-number-or-id`/
|
781
1097
|
# locations/`location-id`/models/`model-id`` - General (built-in) models: `
|
782
|
-
# projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
|
783
|
-
# projects/`project-number-or-id`/locations/`location-id`/models/general/base`
|
1098
|
+
# projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`,
|
784
1099
|
# For global (non-regionalized) requests, use `location-id` `global`. For
|
785
1100
|
# example, `projects/`project-number-or-id`/locations/global/models/general/nmt`.
|
786
|
-
# If
|
1101
|
+
# If not provided, the default Google model (NMT) will be used
|
787
1102
|
# Corresponds to the JSON property `model`
|
788
1103
|
# @return [String]
|
789
1104
|
attr_accessor :model
|
@@ -874,7 +1189,8 @@ module Google
|
|
874
1189
|
# @return [String]
|
875
1190
|
attr_accessor :model
|
876
1191
|
|
877
|
-
# Text translated into the target language.
|
1192
|
+
# Text translated into the target language. If an error occurs during
|
1193
|
+
# translation, this field might be excluded from the response.
|
878
1194
|
# Corresponds to the JSON property `translatedText`
|
879
1195
|
# @return [String]
|
880
1196
|
attr_accessor :translated_text
|
@@ -16,13 +16,13 @@ module Google
|
|
16
16
|
module Apis
|
17
17
|
module TranslateV3beta1
|
18
18
|
# Version of the google-apis-translate_v3beta1 gem
|
19
|
-
GEM_VERSION = "0.
|
19
|
+
GEM_VERSION = "0.9.0"
|
20
20
|
|
21
21
|
# Version of the code generator used to generate this client
|
22
|
-
GENERATOR_VERSION = "0.
|
22
|
+
GENERATOR_VERSION = "0.4.0"
|
23
23
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
25
|
-
REVISION = "
|
25
|
+
REVISION = "20210625"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -22,6 +22,24 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module TranslateV3beta1
|
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,37 @@ 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::TranslateV3beta1::GcsSource, decorator: Google::Apis::TranslateV3beta1::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::TranslateV3beta1::GcsDestination, decorator: Google::Apis::TranslateV3beta1::GcsDestination::Representation
|
247
|
+
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
class BatchTranslateDocumentRequest
|
252
|
+
# @private
|
253
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
254
|
+
hash :glossaries, as: 'glossaries', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
255
|
+
|
256
|
+
collection :input_configs, as: 'inputConfigs', class: Google::Apis::TranslateV3beta1::BatchDocumentInputConfig, decorator: Google::Apis::TranslateV3beta1::BatchDocumentInputConfig::Representation
|
257
|
+
|
258
|
+
hash :models, as: 'models'
|
259
|
+
property :output_config, as: 'outputConfig', class: Google::Apis::TranslateV3beta1::BatchDocumentOutputConfig, decorator: Google::Apis::TranslateV3beta1::BatchDocumentOutputConfig::Representation
|
260
|
+
|
261
|
+
property :source_language_code, as: 'sourceLanguageCode'
|
262
|
+
collection :target_language_codes, as: 'targetLanguageCodes'
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
187
266
|
class BatchTranslateTextRequest
|
188
267
|
# @private
|
189
268
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -232,6 +311,34 @@ module Google
|
|
232
311
|
end
|
233
312
|
end
|
234
313
|
|
314
|
+
class DocumentInputConfig
|
315
|
+
# @private
|
316
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
317
|
+
property :content, :base64 => true, as: 'content'
|
318
|
+
property :gcs_source, as: 'gcsSource', class: Google::Apis::TranslateV3beta1::GcsSource, decorator: Google::Apis::TranslateV3beta1::GcsSource::Representation
|
319
|
+
|
320
|
+
property :mime_type, as: 'mimeType'
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
class DocumentOutputConfig
|
325
|
+
# @private
|
326
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
327
|
+
property :gcs_destination, as: 'gcsDestination', class: Google::Apis::TranslateV3beta1::GcsDestination, decorator: Google::Apis::TranslateV3beta1::GcsDestination::Representation
|
328
|
+
|
329
|
+
property :mime_type, as: 'mimeType'
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
class DocumentTranslation
|
334
|
+
# @private
|
335
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
336
|
+
collection :byte_stream_outputs, as: 'byteStreamOutputs'
|
337
|
+
property :detected_language_code, as: 'detectedLanguageCode'
|
338
|
+
property :mime_type, as: 'mimeType'
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
235
342
|
class Empty
|
236
343
|
# @private
|
237
344
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -385,6 +492,35 @@ module Google
|
|
385
492
|
end
|
386
493
|
end
|
387
494
|
|
495
|
+
class TranslateDocumentRequest
|
496
|
+
# @private
|
497
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
498
|
+
property :document_input_config, as: 'documentInputConfig', class: Google::Apis::TranslateV3beta1::DocumentInputConfig, decorator: Google::Apis::TranslateV3beta1::DocumentInputConfig::Representation
|
499
|
+
|
500
|
+
property :document_output_config, as: 'documentOutputConfig', class: Google::Apis::TranslateV3beta1::DocumentOutputConfig, decorator: Google::Apis::TranslateV3beta1::DocumentOutputConfig::Representation
|
501
|
+
|
502
|
+
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
503
|
+
|
504
|
+
hash :labels, as: 'labels'
|
505
|
+
property :model, as: 'model'
|
506
|
+
property :source_language_code, as: 'sourceLanguageCode'
|
507
|
+
property :target_language_code, as: 'targetLanguageCode'
|
508
|
+
end
|
509
|
+
end
|
510
|
+
|
511
|
+
class TranslateDocumentResponse
|
512
|
+
# @private
|
513
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
514
|
+
property :document_translation, as: 'documentTranslation', class: Google::Apis::TranslateV3beta1::DocumentTranslation, decorator: Google::Apis::TranslateV3beta1::DocumentTranslation::Representation
|
515
|
+
|
516
|
+
property :glossary_config, as: 'glossaryConfig', class: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig, decorator: Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig::Representation
|
517
|
+
|
518
|
+
property :glossary_document_translation, as: 'glossaryDocumentTranslation', class: Google::Apis::TranslateV3beta1::DocumentTranslation, decorator: Google::Apis::TranslateV3beta1::DocumentTranslation::Representation
|
519
|
+
|
520
|
+
property :model, as: 'model'
|
521
|
+
end
|
522
|
+
end
|
523
|
+
|
388
524
|
class TranslateTextGlossaryConfig
|
389
525
|
# @private
|
390
526
|
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`,
|
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
|
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::TranslateV3beta1::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::TranslateV3beta1::Operation] parsed result object
|
201
|
+
# @yieldparam err [StandardError] error object if request failed
|
202
|
+
#
|
203
|
+
# @return [Google::Apis::TranslateV3beta1::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, 'v3beta1/{+parent}:batchTranslateDocument', options)
|
210
|
+
command.request_representation = Google::Apis::TranslateV3beta1::BatchTranslateDocumentRequest::Representation
|
211
|
+
command.request_object = batch_translate_document_request_object
|
212
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
213
|
+
command.response_class = Google::Apis::TranslateV3beta1::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`,
|
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
|
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
|
@@ -344,7 +384,7 @@ module Google
|
|
344
384
|
# accepts strings like "displayName=tokyo", and is documented in more detail in [
|
345
385
|
# AIP-160](https://google.aip.dev/160).
|
346
386
|
# @param [Fixnum] page_size
|
347
|
-
# The maximum number of results to return. If not set, the service
|
387
|
+
# The maximum number of results to return. If not set, the service selects a
|
348
388
|
# default.
|
349
389
|
# @param [String] page_token
|
350
390
|
# A page token received from the `next_page_token` field in the response. Send
|
@@ -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`. Non-global location is required for requests
|
427
|
+
# using AutoML models or custom glossaries. Models and glossaries must be within
|
428
|
+
# the same region (have the same location-id), otherwise an INVALID_ARGUMENT (
|
429
|
+
# 400) error is returned.
|
430
|
+
# @param [Google::Apis::TranslateV3beta1::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::TranslateV3beta1::TranslateDocumentResponse] parsed result object
|
441
|
+
# @yieldparam err [StandardError] error object if request failed
|
442
|
+
#
|
443
|
+
# @return [Google::Apis::TranslateV3beta1::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, 'v3beta1/{+parent}:translateDocument', options)
|
450
|
+
command.request_representation = Google::Apis::TranslateV3beta1::TranslateDocumentRequest::Representation
|
451
|
+
command.request_object = translate_document_request_object
|
452
|
+
command.response_representation = Google::Apis::TranslateV3beta1::TranslateDocumentResponse::Representation
|
453
|
+
command.response_class = Google::Apis::TranslateV3beta1::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.
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-translate_v3beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.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-
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-apis-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.4'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.a
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.4'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 2.a
|
27
33
|
description: This is the simple REST client for Cloud Translation API V3beta1. Simple
|
28
34
|
REST clients are Ruby client libraries that provide access to Google services via
|
29
35
|
their HTTP REST API endpoints. These libraries are generated and updated automatically
|
@@ -52,7 +58,7 @@ licenses:
|
|
52
58
|
metadata:
|
53
59
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
54
60
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-translate_v3beta1/CHANGELOG.md
|
55
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3beta1/v0.
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3beta1/v0.9.0
|
56
62
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-translate_v3beta1
|
57
63
|
post_install_message:
|
58
64
|
rdoc_options: []
|
@@ -69,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
75
|
- !ruby/object:Gem::Version
|
70
76
|
version: '0'
|
71
77
|
requirements: []
|
72
|
-
rubygems_version: 3.2.
|
78
|
+
rubygems_version: 3.2.17
|
73
79
|
signing_key:
|
74
80
|
specification_version: 4
|
75
81
|
summary: Simple REST client for Cloud Translation API V3beta1
|