Class: Google::Apis::TranslateV3::TranslateDocumentRequest

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

A document translation request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TranslateDocumentRequest

Returns a new instance of TranslateDocumentRequest.



1133
1134
1135
# File 'lib/google/apis/translate_v3/classes.rb', line 1133

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

Instance Attribute Details

#customized_attributionString

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

Returns:

  • (String)


1080
1081
1082
# File 'lib/google/apis/translate_v3/classes.rb', line 1080

def customized_attribution
  @customized_attribution
end

#document_input_configGoogle::Apis::TranslateV3::DocumentInputConfig

A document translation request input config. Corresponds to the JSON property documentInputConfig



1085
1086
1087
# File 'lib/google/apis/translate_v3/classes.rb', line 1085

def document_input_config
  @document_input_config
end

#document_output_configGoogle::Apis::TranslateV3::DocumentOutputConfig

A document translation request output config. Corresponds to the JSON property documentOutputConfig



1090
1091
1092
# File 'lib/google/apis/translate_v3/classes.rb', line 1090

def document_output_config
  @document_output_config
end

#glossary_configGoogle::Apis::TranslateV3::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



1096
1097
1098
# File 'lib/google/apis/translate_v3/classes.rb', line 1096

def glossary_config
  @glossary_config
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>)


1106
1107
1108
# File 'lib/google/apis/translate_v3/classes.rb', line 1106

def labels
  @labels
end

#modelString

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`

Returns:

  • (String)


1115
1116
1117
# File 'lib/google/apis/translate_v3/classes.rb', line 1115

def model
  @model
end

#source_language_codeString

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

Returns:

  • (String)


1125
1126
1127
# File 'lib/google/apis/translate_v3/classes.rb', line 1125

def source_language_code
  @source_language_code
end

#target_language_codeString

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

Returns:

  • (String)


1131
1132
1133
# File 'lib/google/apis/translate_v3/classes.rb', line 1131

def target_language_code
  @target_language_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/google/apis/translate_v3/classes.rb', line 1138

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)
  @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