Class: Google::Apis::TranslateV2::TranslationsResource

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/translate_v2/classes.rb,
generated/google/apis/translate_v2/representations.rb,
generated/google/apis/translate_v2/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ TranslationsResource

Returns a new instance of TranslationsResource



258
259
260
# File 'generated/google/apis/translate_v2/classes.rb', line 258

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

Instance Attribute Details

#detected_source_languageString

The source language of the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language will not occur and this field will be empty. Corresponds to the JSON property detectedSourceLanguage

Returns:

  • (String)


244
245
246
# File 'generated/google/apis/translate_v2/classes.rb', line 244

def detected_source_language
  @detected_source_language
end

#modelString

The model type used for this translation. Valid values are listed in public documentation. Can be different from requested model. Present only if specific model type was explicitly requested. Corresponds to the JSON property model

Returns:

  • (String)


251
252
253
# File 'generated/google/apis/translate_v2/classes.rb', line 251

def model
  @model
end

#translated_textString

Text translated into the target language. Corresponds to the JSON property translatedText

Returns:

  • (String)


256
257
258
# File 'generated/google/apis/translate_v2/classes.rb', line 256

def translated_text
  @translated_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



263
264
265
266
267
# File 'generated/google/apis/translate_v2/classes.rb', line 263

def update!(**args)
  @detected_source_language = args[:detected_source_language] if args.key?(:detected_source_language)
  @model = args[:model] if args.key?(:model)
  @translated_text = args[:translated_text] if args.key?(:translated_text)
end