Class: Google::Apis::TranslateV3::BatchTranslateDocumentRequest
- Inherits:
-
Object
- Object
- Google::Apis::TranslateV3::BatchTranslateDocumentRequest
- 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
The BatchTranslateDocument request.
Instance Attribute Summary collapse
-
#customized_attribution ⇒ String
Optional.
-
#enable_rotation_correction ⇒ Boolean
(also: #enable_rotation_correction?)
Optional.
-
#enable_shadow_removal_native_pdf ⇒ Boolean
(also: #enable_shadow_removal_native_pdf?)
Optional.
-
#format_conversions ⇒ Hash<String,String>
Optional.
-
#glossaries ⇒ Hash<String,Google::Apis::TranslateV3::TranslateTextGlossaryConfig>
Optional.
-
#input_configs ⇒ Array<Google::Apis::TranslateV3::BatchDocumentInputConfig>
Required.
-
#models ⇒ Hash<String,String>
Optional.
-
#output_config ⇒ Google::Apis::TranslateV3::BatchDocumentOutputConfig
Output configuration for BatchTranslateDocument request.
-
#source_language_code ⇒ String
Required.
-
#target_language_codes ⇒ Array<String>
Required.
Instance Method Summary collapse
-
#initialize(**args) ⇒ BatchTranslateDocumentRequest
constructor
A new instance of BatchTranslateDocumentRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ BatchTranslateDocumentRequest
Returns a new instance of BatchTranslateDocumentRequest.
379 380 381 |
# File 'lib/google/apis/translate_v3/classes.rb', line 379 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
311 312 313 |
# File 'lib/google/apis/translate_v3/classes.rb', line 311 def customized_attribution @customized_attribution 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
316 317 318 |
# File 'lib/google/apis/translate_v3/classes.rb', line 316 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
324 325 326 |
# File 'lib/google/apis/translate_v3/classes.rb', line 324 def enable_shadow_removal_native_pdf @enable_shadow_removal_native_pdf end |
#format_conversions ⇒ Hash<String,String>
Optional. The file format conversion map that is applied to all input files.
The map key is the original mime_type. The map value is the target mime_type
of translated documents. Supported file format conversion includes: -
application/pdf
to application/vnd.openxmlformats-officedocument.
wordprocessingml.document
If nothing specified, output files will be in the
same format as the original file.
Corresponds to the JSON property formatConversions
335 336 337 |
# File 'lib/google/apis/translate_v3/classes.rb', line 335 def format_conversions @format_conversions end |
#glossaries ⇒ Hash<String,Google::Apis::TranslateV3::TranslateTextGlossaryConfig>
Optional. Glossaries to be applied. It's keyed by target language code.
Corresponds to the JSON property glossaries
340 341 342 |
# File 'lib/google/apis/translate_v3/classes.rb', line 340 def glossaries @glossaries end |
#input_configs ⇒ Array<Google::Apis::TranslateV3::BatchDocumentInputConfig>
Required. Input configurations. The total number of files matched should be <=
- The total content size to translate should be <= 100M Unicode codepoints.
The files must use UTF-8 encoding.
Corresponds to the JSON property
inputConfigs
347 348 349 |
# File 'lib/google/apis/translate_v3/classes.rb', line 347 def input_configs @input_configs end |
#models ⇒ Hash<String,String>
Optional. The models to use for translation. Map's key is target language code.
Map's value is the model name. Value can be a built-in general model, or an
AutoML Translation model. The value 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 the map is empty or a
specific model is not requested for a language pair, then default google model
(nmt) is used.
Corresponds to the JSON property
models`
359 360 361 |
# File 'lib/google/apis/translate_v3/classes.rb', line 359 def models @models end |
#output_config ⇒ Google::Apis::TranslateV3::BatchDocumentOutputConfig
Output configuration for BatchTranslateDocument request.
Corresponds to the JSON property outputConfig
364 365 366 |
# File 'lib/google/apis/translate_v3/classes.rb', line 364 def output_config @output_config end |
#source_language_code ⇒ String
Required. 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.
Corresponds to the JSON property sourceLanguageCode
371 372 373 |
# File 'lib/google/apis/translate_v3/classes.rb', line 371 def source_language_code @source_language_code end |
#target_language_codes ⇒ Array<String>
Required. The ISO-639 language code to use for translation of the input
document. Specify up to 10 language codes here.
Corresponds to the JSON property targetLanguageCodes
377 378 379 |
# File 'lib/google/apis/translate_v3/classes.rb', line 377 def target_language_codes @target_language_codes end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/google/apis/translate_v3/classes.rb', line 384 def update!(**args) @customized_attribution = args[:customized_attribution] if args.key?(:customized_attribution) @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) @format_conversions = args[:format_conversions] if args.key?(:format_conversions) @glossaries = args[:glossaries] if args.key?(:glossaries) @input_configs = args[:input_configs] if args.key?(:input_configs) @models = args[:models] if args.key?(:models) @output_config = args[:output_config] if args.key?(:output_config) @source_language_code = args[:source_language_code] if args.key?(:source_language_code) @target_language_codes = args[:target_language_codes] if args.key?(:target_language_codes) end |