Class: Google::Apis::TranslateV3beta1::TranslateDocumentRequest
- Inherits:
-
Object
- Object
- Google::Apis::TranslateV3beta1::TranslateDocumentRequest
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/translate_v3beta1/classes.rb,
lib/google/apis/translate_v3beta1/representations.rb,
lib/google/apis/translate_v3beta1/representations.rb
Overview
A document translation request.
Instance Attribute Summary collapse
-
#document_input_config ⇒ Google::Apis::TranslateV3beta1::DocumentInputConfig
A document translation request input config.
-
#document_output_config ⇒ Google::Apis::TranslateV3beta1::DocumentOutputConfig
A document translation request output config.
-
#glossary_config ⇒ Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig
Configures which glossary should be used for a specific target language, and defines options for applying that glossary.
-
#labels ⇒ Hash<String,String>
Optional.
-
#model ⇒ String
Optional.
-
#source_language_code ⇒ String
Optional.
-
#target_language_code ⇒ String
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TranslateDocumentRequest
constructor
A new instance of TranslateDocumentRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TranslateDocumentRequest
Returns a new instance of TranslateDocumentRequest.
978 979 980 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 978 def initialize(**args) update!(**args) end |
Instance Attribute Details
#document_input_config ⇒ Google::Apis::TranslateV3beta1::DocumentInputConfig
A document translation request input config.
Corresponds to the JSON property documentInputConfig
929 930 931 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 929 def document_input_config @document_input_config end |
#document_output_config ⇒ Google::Apis::TranslateV3beta1::DocumentOutputConfig
A document translation request output config.
Corresponds to the JSON property documentOutputConfig
934 935 936 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 934 def document_output_config @document_output_config end |
#glossary_config ⇒ Google::Apis::TranslateV3beta1::TranslateTextGlossaryConfig
Configures which glossary should be used for a specific target language, and
defines options for applying that glossary.
Corresponds to the JSON property glossaryConfig
940 941 942 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 940 def glossary_config @glossary_config end |
#labels ⇒ Hash<String,String>
Optional. The labels with user-defined metadata for the request. Label keys
and values can be no longer than 63 characters (Unicode codepoints), can only
contain lowercase letters, numeric characters, underscores and dashes.
International characters are allowed. Label values are optional. Label keys
must start with a letter. See https://cloud.google.com/translate/docs/advanced/
labels for more information.
Corresponds to the JSON property labels
950 951 952 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 950 def labels @labels end |
#model ⇒ String
Optional. The model type requested for this translation. The format depends
on model type: - AutoML Translation models: projects/project-number-or-id/
locations/location-id/models/model-id`- General (built-in) models:
projects/project-number-or-id/locations/location-id/models/general/nmt,
projects/project-number-or-id/locations/location-id/models/general/base
If not provided, the default Google model (NMT) will be used for translation.
Corresponds to the JSON propertymodel`
960 961 962 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 960 def model @model end |
#source_language_code ⇒ String
Optional. The BCP-47 language code of the input document if known, for example,
"en-US" or "sr-Latn". Supported language codes are listed in Language Support.
If the source language isn't specified, the API attempts to identify the
source language automatically and returns the source language within the
response. Source language must be specified if the request contains a glossary
or a custom model.
Corresponds to the JSON property sourceLanguageCode
970 971 972 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 970 def source_language_code @source_language_code end |
#target_language_code ⇒ String
Required. The BCP-47 language code to use for translation of the input
document, set to one of the language codes listed in Language Support.
Corresponds to the JSON property targetLanguageCode
976 977 978 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 976 def target_language_code @target_language_code end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
983 984 985 986 987 988 989 990 991 |
# File 'lib/google/apis/translate_v3beta1/classes.rb', line 983 def update!(**args) @document_input_config = args[:document_input_config] if args.key?(:document_input_config) @document_output_config = args[:document_output_config] if args.key?(:document_output_config) @glossary_config = args[:glossary_config] if args.key?(:glossary_config) @labels = args[:labels] if args.key?(:labels) @model = args[:model] if args.key?(:model) @source_language_code = args[:source_language_code] if args.key?(:source_language_code) @target_language_code = args[:target_language_code] if args.key?(:target_language_code) end |