Class: Google::Apis::TranslateV2::TranslationsResource
- Inherits:
-
Object
- Object
- Google::Apis::TranslateV2::TranslationsResource
- 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
-
#detected_source_language ⇒ String
The source language of the initial request, detected automatically, if no source language was passed within the initial request.
-
#model ⇒ String
The
modeltype used for this translation. -
#translated_text ⇒ String
Text translated into the target language.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TranslationsResource
constructor
A new instance of TranslationsResource.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ TranslationsResource
Returns a new instance of TranslationsResource
137 138 139 |
# File 'generated/google/apis/translate_v2/classes.rb', line 137 def initialize(**args) update!(**args) end |
Instance Attribute Details
#detected_source_language ⇒ String
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
135 136 137 |
# File 'generated/google/apis/translate_v2/classes.rb', line 135 def detected_source_language @detected_source_language end |
#model ⇒ String
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
122 123 124 |
# File 'generated/google/apis/translate_v2/classes.rb', line 122 def model @model end |
#translated_text ⇒ String
Text translated into the target language.
Corresponds to the JSON property translatedText
127 128 129 |
# File 'generated/google/apis/translate_v2/classes.rb', line 127 def translated_text @translated_text end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
142 143 144 145 146 |
# File 'generated/google/apis/translate_v2/classes.rb', line 142 def update!(**args) @model = args[:model] if args.key?(:model) @translated_text = args[:translated_text] if args.key?(:translated_text) @detected_source_language = args[:detected_source_language] if args.key?(:detected_source_language) end |