Class: Google::Apis::TranslateV3::TranslateDocumentRequest
- Inherits:
-
Object
- Object
- Google::Apis::TranslateV3::TranslateDocumentRequest
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/translate_v3/classes.rb,
lib/google/apis/translate_v3/representations.rb,
lib/google/apis/translate_v3/representations.rb
Overview
A document translation request.
Instance Attribute Summary collapse
-
#customized_attribution ⇒ String
Optional.
-
#document_input_config ⇒ Google::Apis::TranslateV3::DocumentInputConfig
A document translation request input config.
-
#document_output_config ⇒ Google::Apis::TranslateV3::DocumentOutputConfig
A document translation request output config.
-
#enable_rotation_correction ⇒ Boolean
(also: #enable_rotation_correction?)
Optional.
-
#enable_shadow_removal_native_pdf ⇒ Boolean
(also: #enable_shadow_removal_native_pdf?)
Optional.
-
#glossary_config ⇒ Google::Apis::TranslateV3::TranslateTextGlossaryConfig
Configures which glossary is used for a specific target language and defines options for applying that glossary.
-
#is_translate_native_pdf_only ⇒ Boolean
(also: #is_translate_native_pdf_only?)
Optional.
-
#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.
2295 2296 2297 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2295 def initialize(**args) update!(**args) end |
Instance Attribute Details
#customized_attribution ⇒ String
Optional. This flag is to support user customized attribution. If not provided,
the default is Machine Translated by Google. Customized attribution should
follow rules in https://cloud.google.com/translate/attribution#
attribution_and_logos
Corresponds to the JSON property customizedAttribution
2218 2219 2220 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2218 def customized_attribution @customized_attribution end |
#document_input_config ⇒ Google::Apis::TranslateV3::DocumentInputConfig
A document translation request input config.
Corresponds to the JSON property documentInputConfig
2223 2224 2225 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2223 def document_input_config @document_input_config end |
#document_output_config ⇒ Google::Apis::TranslateV3::DocumentOutputConfig
A document translation request output config.
Corresponds to the JSON property documentOutputConfig
2228 2229 2230 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2228 def document_output_config @document_output_config end |
#enable_rotation_correction ⇒ Boolean Also known as: enable_rotation_correction?
Optional. If true, enable auto rotation correction in DVS.
Corresponds to the JSON property enableRotationCorrection
2233 2234 2235 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2233 def enable_rotation_correction @enable_rotation_correction end |
#enable_shadow_removal_native_pdf ⇒ Boolean Also known as: enable_shadow_removal_native_pdf?
Optional. If true, use the text removal server to remove the shadow text on
background image for native pdf translation. Shadow removal feature can only
be enabled when is_translate_native_pdf_only: false && pdf_native_only: false
Corresponds to the JSON property enableShadowRemovalNativePdf
2241 2242 2243 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2241 def enable_shadow_removal_native_pdf @enable_shadow_removal_native_pdf end |
#glossary_config ⇒ Google::Apis::TranslateV3::TranslateTextGlossaryConfig
Configures which glossary is used for a specific target language and defines
options for applying that glossary.
Corresponds to the JSON property glossaryConfig
2248 2249 2250 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2248 def glossary_config @glossary_config end |
#is_translate_native_pdf_only ⇒ Boolean Also known as: is_translate_native_pdf_only?
Optional. is_translate_native_pdf_only field for external customers. If true,
the page limit of online native pdf translation is 300 and only native pdf
pages will be translated.
Corresponds to the JSON property isTranslateNativePdfOnly
2255 2256 2257 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2255 def is_translate_native_pdf_only @is_translate_native_pdf_only 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
2266 2267 2268 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2266 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,
If not provided, the default Google model (NMT) will be used for translation.
Corresponds to the JSON propertymodel`
2275 2276 2277 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2275 def model @model end |
#source_language_code ⇒ String
Optional. The ISO-639 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
2286 2287 2288 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2286 def source_language_code @source_language_code end |
#target_language_code ⇒ String
Required. The ISO-639 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
2293 2294 2295 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2293 def target_language_code @target_language_code end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 |
# File 'lib/google/apis/translate_v3/classes.rb', line 2300 def update!(**args) @customized_attribution = args[:customized_attribution] if args.key?(:customized_attribution) @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) @enable_rotation_correction = args[:enable_rotation_correction] if args.key?(:enable_rotation_correction) @enable_shadow_removal_native_pdf = args[:enable_shadow_removal_native_pdf] if args.key?(:enable_shadow_removal_native_pdf) @glossary_config = args[:glossary_config] if args.key?(:glossary_config) @is_translate_native_pdf_only = args[:is_translate_native_pdf_only] if args.key?(:is_translate_native_pdf_only) @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 |