Class: Google::Apis::TranslateV3::BatchTranslateTextRequest

Inherits:
Object
  • Object
show all
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 batch translation request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ BatchTranslateTextRequest

Returns a new instance of BatchTranslateTextRequest.



464
465
466
# File 'lib/google/apis/translate_v3/classes.rb', line 464

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#glossariesHash<String,Google::Apis::TranslateV3::TranslateTextGlossaryConfig>

Optional. Glossaries to be applied for translation. It's keyed by target language code. Corresponds to the JSON property glossaries



415
416
417
# File 'lib/google/apis/translate_v3/classes.rb', line 415

def glossaries
  @glossaries
end

#input_configsArray<Google::Apis::TranslateV3::InputConfig>

Required. Input configurations. The total number of files matched should be <=

  1. The total content size should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. Corresponds to the JSON property inputConfigs


422
423
424
# File 'lib/google/apis/translate_v3/classes.rb', line 422

def input_configs
  @input_configs
end

#labelsHash<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

Returns:

  • (Hash<String,String>)


432
433
434
# File 'lib/google/apis/translate_v3/classes.rb', line 432

def labels
  @labels
end

#modelsHash<String,String>

Optional. The models to use for translation. Map's key is target language code. Map's value is 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 propertymodels`

Returns:

  • (Hash<String,String>)


444
445
446
# File 'lib/google/apis/translate_v3/classes.rb', line 444

def models
  @models
end

#output_configGoogle::Apis::TranslateV3::OutputConfig

Output configuration for BatchTranslateText request. Corresponds to the JSON property outputConfig



449
450
451
# File 'lib/google/apis/translate_v3/classes.rb', line 449

def output_config
  @output_config
end

#source_language_codeString

Required. Source language code. Supported language codes are listed in Language Support. Corresponds to the JSON property sourceLanguageCode

Returns:

  • (String)


455
456
457
# File 'lib/google/apis/translate_v3/classes.rb', line 455

def source_language_code
  @source_language_code
end

#target_language_codesArray<String>

Required. Specify up to 10 language codes here. Supported language codes are listed in Language Support . Corresponds to the JSON property targetLanguageCodes

Returns:

  • (Array<String>)


462
463
464
# File 'lib/google/apis/translate_v3/classes.rb', line 462

def target_language_codes
  @target_language_codes
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



469
470
471
472
473
474
475
476
477
# File 'lib/google/apis/translate_v3/classes.rb', line 469

def update!(**args)
  @glossaries = args[:glossaries] if args.key?(:glossaries)
  @input_configs = args[:input_configs] if args.key?(:input_configs)
  @labels = args[:labels] if args.key?(:labels)
  @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