class Google::Apis::TranslateV2::TranslateTextRequest

The main translation request message for the Cloud Translation API.

Attributes

format[RW]

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` @return [String]

model[RW]

The `model` type requested for this translation. Valid values are listed in public documentation. Corresponds to the JSON property `model` @return [String]

q[RW]

The input text to translate. Repeat this parameter to perform translation operations on multiple text inputs. Corresponds to the JSON property `q` @return [Array<String>]

source[RW]

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` @return [String]

target[RW]

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` @return [String]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/translate_v2/classes.rb, line 201
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/translate_v2/classes.rb, line 206
def update!(**args)
  @format = args[:format] if args.key?(:format)
  @model = args[:model] if args.key?(:model)
  @q = args[:q] if args.key?(:q)
  @source = args[:source] if args.key?(:source)
  @target = args[:target] if args.key?(:target)
end