Class: Google::Apis::TranslateV2::TranslateTextRequest
- Inherits:
-
Object
- Object
- Google::Apis::TranslateV2::TranslateTextRequest
- 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
Overview
The main translation request message for the Cloud Translation API.
Instance Attribute Summary collapse
-
#format ⇒ String
The format of the source text, in either HTML (default) or plain-text.
-
#model ⇒ String
The
model
type requested for this translation. -
#q ⇒ Array<String>
The input text to translate.
-
#source ⇒ String
The language of the source text, set to one of the language codes listed in Language Support.
-
#target ⇒ String
The language to use for translation of the input text, set to one of the language codes listed in Language Support.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TranslateTextRequest
constructor
A new instance of TranslateTextRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ TranslateTextRequest
Returns a new instance of TranslateTextRequest
236 237 238 |
# File 'generated/google/apis/translate_v2/classes.rb', line 236 def initialize(**args) update!(**args) end |
Instance Attribute Details
#format ⇒ String
The format of the source text, in either HTML (default) or plain-text. A
value of "html" indicates HTML and a value of "text" indicates plain-text.
Corresponds to the JSON property format
214 215 216 |
# File 'generated/google/apis/translate_v2/classes.rb', line 214 def format @format end |
#model ⇒ String
The model
type requested for this translation. Valid values are
listed in public documentation.
Corresponds to the JSON property model
228 229 230 |
# File 'generated/google/apis/translate_v2/classes.rb', line 228 def model @model end |
#q ⇒ Array<String>
The input text to translate. Repeat this parameter to perform translation
operations on multiple text inputs.
Corresponds to the JSON property q
208 209 210 |
# File 'generated/google/apis/translate_v2/classes.rb', line 208 def q @q end |
#source ⇒ String
The language of the source text, set to one of the language codes listed in
Language Support. If the source language is not specified, the API will
attempt to identify the source language automatically and return it within
the response.
Corresponds to the JSON property source
222 223 224 |
# File 'generated/google/apis/translate_v2/classes.rb', line 222 def source @source end |
#target ⇒ String
The language to use for translation of the input text, set to one of the
language codes listed in Language Support.
Corresponds to the JSON property target
234 235 236 |
# File 'generated/google/apis/translate_v2/classes.rb', line 234 def target @target end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
241 242 243 244 245 246 247 |
# File 'generated/google/apis/translate_v2/classes.rb', line 241 def update!(**args) @q = args[:q] if args.key?(:q) @format = args[:format] if args.key?(:format) @source = args[:source] if args.key?(:source) @model = args[:model] if args.key?(:model) @target = args[:target] if args.key?(:target) end |