google-apis-translate_v3beta1 0.1.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/lib/google/apis/translate_v3beta1.rb +1 -1
- data/lib/google/apis/translate_v3beta1/classes.rb +319 -0
- 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 +95 -11
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f827b5ee93e55da78e768d075d45c5e5a989f993a6dfbf9d1acee0b6359f9a4
|
4
|
+
data.tar.gz: 3909d7d85e6a1616abd2b6033723e74c497e0bcd7ea3b89d2d6a29da777a27fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87277db9d724bb5fe0a9b7bfc5f22ab5763c5faa8864a5bb849fce4cdd203642f5352dc15ae4639b05cf0ccac66e0748d2abe9f061bd800c0b02693aa26afb79
|
7
|
+
data.tar.gz: 3678c7ade088bca4bdcc69117e436515342bc1ef118413e63509d795c24a490e33fa980e00ce064390826426cc5764a01c5ac900b7ec2d8abf9921c148aa9078
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Release history for google-apis-translate_v3beta1
|
2
2
|
|
3
|
+
### v0.6.0 (2021-05-20)
|
4
|
+
|
5
|
+
* Unspecified changes
|
6
|
+
|
7
|
+
### v0.5.0 (2021-05-11)
|
8
|
+
|
9
|
+
* Regenerated from discovery document revision 20210506
|
10
|
+
|
11
|
+
### v0.4.0 (2021-03-16)
|
12
|
+
|
13
|
+
* Regenerated from discovery document revision 20210312
|
14
|
+
* Regenerated using generator version 0.2.0
|
15
|
+
|
16
|
+
### v0.3.0 (2021-03-04)
|
17
|
+
|
18
|
+
* Unspecified changes
|
19
|
+
|
20
|
+
### v0.2.0 (2021-02-24)
|
21
|
+
|
22
|
+
* Regenerated from discovery document revision 20210219
|
23
|
+
* Regenerated using generator version 0.1.2
|
24
|
+
|
3
25
|
### v0.1.0 (2021-01-07)
|
4
26
|
|
5
27
|
* Regenerated using generator version 0.1.1
|
@@ -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,106 @@ 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`, `projects/`project-number-or-
|
85
|
+
# id`/locations/`location-id`/models/general/base` If the map is empty or a
|
86
|
+
# specific model is not requested for a language pair, then default google model
|
87
|
+
# (nmt) is used.
|
88
|
+
# Corresponds to the JSON property `models`
|
89
|
+
# @return [Hash<String,String>]
|
90
|
+
attr_accessor :models
|
91
|
+
|
92
|
+
# Output configuration for BatchTranslateDocument request.
|
93
|
+
# Corresponds to the JSON property `outputConfig`
|
94
|
+
# @return [Google::Apis::TranslateV3beta1::BatchDocumentOutputConfig]
|
95
|
+
attr_accessor :output_config
|
96
|
+
|
97
|
+
# Required. The BCP-47 language code of the input document if known, for example,
|
98
|
+
# "en-US" or "sr-Latn". Supported language codes are listed in Language Support
|
99
|
+
# (https://cloud.google.com/translate/docs/languages).
|
100
|
+
# Corresponds to the JSON property `sourceLanguageCode`
|
101
|
+
# @return [String]
|
102
|
+
attr_accessor :source_language_code
|
103
|
+
|
104
|
+
# Required. The BCP-47 language code to use for translation of the input
|
105
|
+
# document. Specify up to 10 language codes here.
|
106
|
+
# Corresponds to the JSON property `targetLanguageCodes`
|
107
|
+
# @return [Array<String>]
|
108
|
+
attr_accessor :target_language_codes
|
109
|
+
|
110
|
+
def initialize(**args)
|
111
|
+
update!(**args)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Update properties of this object
|
115
|
+
def update!(**args)
|
116
|
+
@glossaries = args[:glossaries] if args.key?(:glossaries)
|
117
|
+
@input_configs = args[:input_configs] if args.key?(:input_configs)
|
118
|
+
@models = args[:models] if args.key?(:models)
|
119
|
+
@output_config = args[:output_config] if args.key?(:output_config)
|
120
|
+
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
|
121
|
+
@target_language_codes = args[:target_language_codes] if args.key?(:target_language_codes)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
25
125
|
# The batch translation request.
|
26
126
|
class BatchTranslateTextRequest
|
27
127
|
include Google::Apis::Core::Hashable
|
@@ -199,6 +299,111 @@ module Google
|
|
199
299
|
end
|
200
300
|
end
|
201
301
|
|
302
|
+
# A document translation request input config.
|
303
|
+
class DocumentInputConfig
|
304
|
+
include Google::Apis::Core::Hashable
|
305
|
+
|
306
|
+
# Document's content represented as a stream of bytes.
|
307
|
+
# Corresponds to the JSON property `content`
|
308
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
309
|
+
# @return [String]
|
310
|
+
attr_accessor :content
|
311
|
+
|
312
|
+
# The Google Cloud Storage location for the input content.
|
313
|
+
# Corresponds to the JSON property `gcsSource`
|
314
|
+
# @return [Google::Apis::TranslateV3beta1::GcsSource]
|
315
|
+
attr_accessor :gcs_source
|
316
|
+
|
317
|
+
# Specifies the input document's mime_type. If not specified it will be
|
318
|
+
# determined using the file extension for gcs_source provided files. For a file
|
319
|
+
# provided through bytes content the mime_type must be provided. Currently
|
320
|
+
# supported mime types are: - application/pdf - application/vnd.openxmlformats-
|
321
|
+
# officedocument.wordprocessingml.document - application/vnd.openxmlformats-
|
322
|
+
# officedocument.presentationml.presentation - application/vnd.openxmlformats-
|
323
|
+
# officedocument.spreadsheetml.sheet
|
324
|
+
# Corresponds to the JSON property `mimeType`
|
325
|
+
# @return [String]
|
326
|
+
attr_accessor :mime_type
|
327
|
+
|
328
|
+
def initialize(**args)
|
329
|
+
update!(**args)
|
330
|
+
end
|
331
|
+
|
332
|
+
# Update properties of this object
|
333
|
+
def update!(**args)
|
334
|
+
@content = args[:content] if args.key?(:content)
|
335
|
+
@gcs_source = args[:gcs_source] if args.key?(:gcs_source)
|
336
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
337
|
+
end
|
338
|
+
end
|
339
|
+
|
340
|
+
# A document translation request output config.
|
341
|
+
class DocumentOutputConfig
|
342
|
+
include Google::Apis::Core::Hashable
|
343
|
+
|
344
|
+
# The Google Cloud Storage location for the output content.
|
345
|
+
# Corresponds to the JSON property `gcsDestination`
|
346
|
+
# @return [Google::Apis::TranslateV3beta1::GcsDestination]
|
347
|
+
attr_accessor :gcs_destination
|
348
|
+
|
349
|
+
# Optional. Specifies the translated document's mime_type. If not specified, the
|
350
|
+
# translated file's mime type will be the same as the input file's mime type.
|
351
|
+
# Currently only support the output mime type to be the same as input mime type.
|
352
|
+
# - application/pdf - application/vnd.openxmlformats-officedocument.
|
353
|
+
# wordprocessingml.document - application/vnd.openxmlformats-officedocument.
|
354
|
+
# presentationml.presentation - application/vnd.openxmlformats-officedocument.
|
355
|
+
# spreadsheetml.sheet
|
356
|
+
# Corresponds to the JSON property `mimeType`
|
357
|
+
# @return [String]
|
358
|
+
attr_accessor :mime_type
|
359
|
+
|
360
|
+
def initialize(**args)
|
361
|
+
update!(**args)
|
362
|
+
end
|
363
|
+
|
364
|
+
# Update properties of this object
|
365
|
+
def update!(**args)
|
366
|
+
@gcs_destination = args[:gcs_destination] if args.key?(:gcs_destination)
|
367
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
# A translated document message.
|
372
|
+
class DocumentTranslation
|
373
|
+
include Google::Apis::Core::Hashable
|
374
|
+
|
375
|
+
# The array of translated documents. It is expected to be size 1 for now. We may
|
376
|
+
# produce multiple translated documents in the future for other type of file
|
377
|
+
# formats.
|
378
|
+
# Corresponds to the JSON property `byteStreamOutputs`
|
379
|
+
# @return [Array<String>]
|
380
|
+
attr_accessor :byte_stream_outputs
|
381
|
+
|
382
|
+
# The detected language for the input document. If the user did not provide the
|
383
|
+
# source language for the input document, this field will have the language code
|
384
|
+
# automatically detected. If the source language was passed, auto-detection of
|
385
|
+
# the language does not occur and this field is empty.
|
386
|
+
# Corresponds to the JSON property `detectedLanguageCode`
|
387
|
+
# @return [String]
|
388
|
+
attr_accessor :detected_language_code
|
389
|
+
|
390
|
+
# The translated document's mime type.
|
391
|
+
# Corresponds to the JSON property `mimeType`
|
392
|
+
# @return [String]
|
393
|
+
attr_accessor :mime_type
|
394
|
+
|
395
|
+
def initialize(**args)
|
396
|
+
update!(**args)
|
397
|
+
end
|
398
|
+
|
399
|
+
# Update properties of this object
|
400
|
+
def update!(**args)
|
401
|
+
@byte_stream_outputs = args[:byte_stream_outputs] if args.key?(:byte_stream_outputs)
|
402
|
+
@detected_language_code = args[:detected_language_code] if args.key?(:detected_language_code)
|
403
|
+
@mime_type = args[:mime_type] if args.key?(:mime_type)
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
202
407
|
# A generic empty message that you can re-use to avoid defining duplicated empty
|
203
408
|
# messages in your APIs. A typical example is to use it as the request or the
|
204
409
|
# response type of an API method. For instance: service Foo ` rpc Bar(google.
|
@@ -714,6 +919,120 @@ module Google
|
|
714
919
|
end
|
715
920
|
end
|
716
921
|
|
922
|
+
# A document translation request.
|
923
|
+
class TranslateDocumentRequest
|
924
|
+
include Google::Apis::Core::Hashable
|
925
|
+
|
926
|
+
# A document translation request input config.
|
927
|
+
# Corresponds to the JSON property `documentInputConfig`
|
928
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentInputConfig]
|
929
|
+
attr_accessor :document_input_config
|
930
|
+
|
931
|
+
# A document translation request output config.
|
932
|
+
# Corresponds to the JSON property `documentOutputConfig`
|
933
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentOutputConfig]
|
934
|
+
attr_accessor :document_output_config
|
935
|
+
|
936
|
+
# Configures which glossary should be used for a specific target language, and
|
937
|
+
# defines options for applying that glossary.
|
938
|
+
# Corresponds to the JSON property `glossaryConfig`
|
939
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig]
|
940
|
+
attr_accessor :glossary_config
|
941
|
+
|
942
|
+
# Optional. The labels with user-defined metadata for the request. Label keys
|
943
|
+
# and values can be no longer than 63 characters (Unicode codepoints), can only
|
944
|
+
# contain lowercase letters, numeric characters, underscores and dashes.
|
945
|
+
# International characters are allowed. Label values are optional. Label keys
|
946
|
+
# must start with a letter. See https://cloud.google.com/translate/docs/advanced/
|
947
|
+
# labels for more information.
|
948
|
+
# Corresponds to the JSON property `labels`
|
949
|
+
# @return [Hash<String,String>]
|
950
|
+
attr_accessor :labels
|
951
|
+
|
952
|
+
# Optional. The `model` type requested for this translation. The format depends
|
953
|
+
# on model type: - AutoML Translation models: `projects/`project-number-or-id`/
|
954
|
+
# locations/`location-id`/models/`model-id`` - General (built-in) models: `
|
955
|
+
# projects/`project-number-or-id`/locations/`location-id`/models/general/nmt`, `
|
956
|
+
# projects/`project-number-or-id`/locations/`location-id`/models/general/base`
|
957
|
+
# If not provided, the default Google model (NMT) will be used for translation.
|
958
|
+
# Corresponds to the JSON property `model`
|
959
|
+
# @return [String]
|
960
|
+
attr_accessor :model
|
961
|
+
|
962
|
+
# Optional. The BCP-47 language code of the input document if known, for example,
|
963
|
+
# "en-US" or "sr-Latn". Supported language codes are listed in Language Support.
|
964
|
+
# If the source language isn't specified, the API attempts to identify the
|
965
|
+
# source language automatically and returns the source language within the
|
966
|
+
# response. Source language must be specified if the request contains a glossary
|
967
|
+
# or a custom model.
|
968
|
+
# Corresponds to the JSON property `sourceLanguageCode`
|
969
|
+
# @return [String]
|
970
|
+
attr_accessor :source_language_code
|
971
|
+
|
972
|
+
# Required. The BCP-47 language code to use for translation of the input
|
973
|
+
# document, set to one of the language codes listed in Language Support.
|
974
|
+
# Corresponds to the JSON property `targetLanguageCode`
|
975
|
+
# @return [String]
|
976
|
+
attr_accessor :target_language_code
|
977
|
+
|
978
|
+
def initialize(**args)
|
979
|
+
update!(**args)
|
980
|
+
end
|
981
|
+
|
982
|
+
# Update properties of this object
|
983
|
+
def update!(**args)
|
984
|
+
@document_input_config = args[:document_input_config] if args.key?(:document_input_config)
|
985
|
+
@document_output_config = args[:document_output_config] if args.key?(:document_output_config)
|
986
|
+
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
|
987
|
+
@labels = args[:labels] if args.key?(:labels)
|
988
|
+
@model = args[:model] if args.key?(:model)
|
989
|
+
@source_language_code = args[:source_language_code] if args.key?(:source_language_code)
|
990
|
+
@target_language_code = args[:target_language_code] if args.key?(:target_language_code)
|
991
|
+
end
|
992
|
+
end
|
993
|
+
|
994
|
+
# A translated document response message.
|
995
|
+
class TranslateDocumentResponse
|
996
|
+
include Google::Apis::Core::Hashable
|
997
|
+
|
998
|
+
# A translated document message.
|
999
|
+
# Corresponds to the JSON property `documentTranslation`
|
1000
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentTranslation]
|
1001
|
+
attr_accessor :document_translation
|
1002
|
+
|
1003
|
+
# Configures which glossary should be used for a specific target language, and
|
1004
|
+
# defines options for applying that glossary.
|
1005
|
+
# Corresponds to the JSON property `glossaryConfig`
|
1006
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig]
|
1007
|
+
attr_accessor :glossary_config
|
1008
|
+
|
1009
|
+
# A translated document message.
|
1010
|
+
# Corresponds to the JSON property `glossaryDocumentTranslation`
|
1011
|
+
# @return [Google::Apis::TranslateV3beta1::DocumentTranslation]
|
1012
|
+
attr_accessor :glossary_document_translation
|
1013
|
+
|
1014
|
+
# Only present when 'model' is present in the request. 'model' is normalized to
|
1015
|
+
# have a project number. For example: If the 'model' field in
|
1016
|
+
# TranslateDocumentRequest is: `projects/`project-id`/locations/`location-id`/
|
1017
|
+
# models/general/nmt` then `model` here would be normalized to `projects/`
|
1018
|
+
# project-number`/locations/`location-id`/models/general/nmt`.
|
1019
|
+
# Corresponds to the JSON property `model`
|
1020
|
+
# @return [String]
|
1021
|
+
attr_accessor :model
|
1022
|
+
|
1023
|
+
def initialize(**args)
|
1024
|
+
update!(**args)
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
# Update properties of this object
|
1028
|
+
def update!(**args)
|
1029
|
+
@document_translation = args[:document_translation] if args.key?(:document_translation)
|
1030
|
+
@glossary_config = args[:glossary_config] if args.key?(:glossary_config)
|
1031
|
+
@glossary_document_translation = args[:glossary_document_translation] if args.key?(:glossary_document_translation)
|
1032
|
+
@model = args[:model] if args.key?(:model)
|
1033
|
+
end
|
1034
|
+
end
|
1035
|
+
|
717
1036
|
# Configures which glossary should be used for a specific target language, and
|
718
1037
|
# defines options for applying that glossary.
|
719
1038
|
class TranslateTextGlossaryConfig
|
@@ -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.6.0"
|
20
20
|
|
21
21
|
# Version of the code generator used to generate this client
|
22
|
-
GENERATOR_VERSION = "0.
|
22
|
+
GENERATOR_VERSION = "0.2.0"
|
23
23
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
25
|
-
REVISION = "
|
25
|
+
REVISION = "20210506"
|
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
|
@@ -176,6 +176,48 @@ module Google
|
|
176
176
|
execute_or_queue_command(command, &block)
|
177
177
|
end
|
178
178
|
|
179
|
+
# Translates a large volume of document in asynchronous batch mode. This
|
180
|
+
# function provides real-time output as the inputs are being processed. If
|
181
|
+
# caller cancels a request, the partial results (for an input file, it's all or
|
182
|
+
# nothing) may still be available on the specified output location. This call
|
183
|
+
# returns immediately and you can use google.longrunning.Operation.name to poll
|
184
|
+
# the status of the call.
|
185
|
+
# @param [String] parent
|
186
|
+
# Required. Location to make a regional call. Format: `projects/`project-number-
|
187
|
+
# or-id`/locations/`location-id``. The `global` location is not supported for
|
188
|
+
# batch translation. Only AutoML Translation models or glossaries within the
|
189
|
+
# same region (have the same location-id) can be used, otherwise an
|
190
|
+
# INVALID_ARGUMENT (400) error is returned.
|
191
|
+
# @param [Google::Apis::TranslateV3beta1::BatchTranslateDocumentRequest] batch_translate_document_request_object
|
192
|
+
# @param [String] fields
|
193
|
+
# Selector specifying which fields to include in a partial response.
|
194
|
+
# @param [String] quota_user
|
195
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
196
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
197
|
+
# @param [Google::Apis::RequestOptions] options
|
198
|
+
# Request-specific options
|
199
|
+
#
|
200
|
+
# @yield [result, err] Result & error if block supplied
|
201
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::Operation] parsed result object
|
202
|
+
# @yieldparam err [StandardError] error object if request failed
|
203
|
+
#
|
204
|
+
# @return [Google::Apis::TranslateV3beta1::Operation]
|
205
|
+
#
|
206
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
207
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
208
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
209
|
+
def batch_location_translate_document(parent, batch_translate_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
210
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:batchTranslateDocument', options)
|
211
|
+
command.request_representation = Google::Apis::TranslateV3beta1::BatchTranslateDocumentRequest::Representation
|
212
|
+
command.request_object = batch_translate_document_request_object
|
213
|
+
command.response_representation = Google::Apis::TranslateV3beta1::Operation::Representation
|
214
|
+
command.response_class = Google::Apis::TranslateV3beta1::Operation
|
215
|
+
command.params['parent'] = parent unless parent.nil?
|
216
|
+
command.query['fields'] = fields unless fields.nil?
|
217
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
218
|
+
execute_or_queue_command(command, &block)
|
219
|
+
end
|
220
|
+
|
179
221
|
# Translates a large volume of text in asynchronous batch mode. This function
|
180
222
|
# provides real-time output as the inputs are being processed. If caller cancels
|
181
223
|
# a request, the partial results (for an input file, it's all or nothing) may
|
@@ -340,11 +382,15 @@ module Google
|
|
340
382
|
# @param [String] name
|
341
383
|
# The resource that owns the locations collection, if applicable.
|
342
384
|
# @param [String] filter
|
343
|
-
#
|
385
|
+
# A filter to narrow down results to a preferred subset. The filtering language
|
386
|
+
# accepts strings like "displayName=tokyo", and is documented in more detail in [
|
387
|
+
# AIP-160](https://google.aip.dev/160).
|
344
388
|
# @param [Fixnum] page_size
|
345
|
-
# The
|
389
|
+
# The maximum number of results to return. If not set, the service selects a
|
390
|
+
# default.
|
346
391
|
# @param [String] page_token
|
347
|
-
#
|
392
|
+
# A page token received from the `next_page_token` field in the response. Send
|
393
|
+
# that page token to receive the subsequent page.
|
348
394
|
# @param [String] fields
|
349
395
|
# Selector specifying which fields to include in a partial response.
|
350
396
|
# @param [String] quota_user
|
@@ -375,6 +421,44 @@ module Google
|
|
375
421
|
execute_or_queue_command(command, &block)
|
376
422
|
end
|
377
423
|
|
424
|
+
# Translates documents in synchronous mode.
|
425
|
+
# @param [String] parent
|
426
|
+
# Required. Location to make a regional call. Format: `projects/`project-number-
|
427
|
+
# or-id`/locations/`location-id``. For global calls, use `projects/`project-
|
428
|
+
# number-or-id`/locations/global`. Non-global location is required for requests
|
429
|
+
# using AutoML models or custom glossaries. Models and glossaries must be within
|
430
|
+
# the same region (have the same location-id), otherwise an INVALID_ARGUMENT (
|
431
|
+
# 400) error is returned.
|
432
|
+
# @param [Google::Apis::TranslateV3beta1::TranslateDocumentRequest] translate_document_request_object
|
433
|
+
# @param [String] fields
|
434
|
+
# Selector specifying which fields to include in a partial response.
|
435
|
+
# @param [String] quota_user
|
436
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
437
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
438
|
+
# @param [Google::Apis::RequestOptions] options
|
439
|
+
# Request-specific options
|
440
|
+
#
|
441
|
+
# @yield [result, err] Result & error if block supplied
|
442
|
+
# @yieldparam result [Google::Apis::TranslateV3beta1::TranslateDocumentResponse] parsed result object
|
443
|
+
# @yieldparam err [StandardError] error object if request failed
|
444
|
+
#
|
445
|
+
# @return [Google::Apis::TranslateV3beta1::TranslateDocumentResponse]
|
446
|
+
#
|
447
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
448
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
449
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
450
|
+
def translate_location_document(parent, translate_document_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
451
|
+
command = make_simple_command(:post, 'v3beta1/{+parent}:translateDocument', options)
|
452
|
+
command.request_representation = Google::Apis::TranslateV3beta1::TranslateDocumentRequest::Representation
|
453
|
+
command.request_object = translate_document_request_object
|
454
|
+
command.response_representation = Google::Apis::TranslateV3beta1::TranslateDocumentResponse::Representation
|
455
|
+
command.response_class = Google::Apis::TranslateV3beta1::TranslateDocumentResponse
|
456
|
+
command.params['parent'] = parent unless parent.nil?
|
457
|
+
command.query['fields'] = fields unless fields.nil?
|
458
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
459
|
+
execute_or_queue_command(command, &block)
|
460
|
+
end
|
461
|
+
|
378
462
|
# Translates input text and returns translated text.
|
379
463
|
# @param [String] parent
|
380
464
|
# Required. Project or location to make a call. Must refer to a caller's project.
|
@@ -715,14 +799,14 @@ module Google
|
|
715
799
|
execute_or_queue_command(command, &block)
|
716
800
|
end
|
717
801
|
|
718
|
-
# Waits
|
719
|
-
#
|
720
|
-
#
|
721
|
-
#
|
722
|
-
#
|
723
|
-
#
|
724
|
-
#
|
725
|
-
#
|
802
|
+
# Waits until the specified long-running operation is done or reaches at most a
|
803
|
+
# specified timeout, returning the latest state. If the operation is already
|
804
|
+
# done, the latest state is immediately returned. If the timeout specified is
|
805
|
+
# greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If
|
806
|
+
# the server does not support this method, it returns `google.rpc.Code.
|
807
|
+
# UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return
|
808
|
+
# the latest state before the specified timeout (including immediately), meaning
|
809
|
+
# even an immediate response is no guarantee that the operation is done.
|
726
810
|
# @param [String] name
|
727
811
|
# The name of the operation resource to wait on.
|
728
812
|
# @param [Google::Apis::TranslateV3beta1::WaitOperationRequest] wait_operation_request_object
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6.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-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-apis-core
|
@@ -52,7 +52,7 @@ licenses:
|
|
52
52
|
metadata:
|
53
53
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
54
54
|
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.
|
55
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-translate_v3beta1/v0.6.0
|
56
56
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-translate_v3beta1
|
57
57
|
post_install_message:
|
58
58
|
rdoc_options: []
|
@@ -62,14 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '2.
|
65
|
+
version: '2.5'
|
66
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.2.17
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Simple REST client for Cloud Translation API V3beta1
|