Class: Google::Apis::TranslateV3::DetectLanguageRequest

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

The request message for language detection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DetectLanguageRequest

Returns a new instance of DetectLanguageRequest.



247
248
249
# File 'lib/google/apis/translate_v3/classes.rb', line 247

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

Instance Attribute Details

#contentString

The content of the input stored as a string. Corresponds to the JSON property content

Returns:

  • (String)


220
221
222
# File 'lib/google/apis/translate_v3/classes.rb', line 220

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


230
231
232
# File 'lib/google/apis/translate_v3/classes.rb', line 230

def labels
  @labels
end

#mime_typeString

Optional. The format of the source text, for example, "text/html", "text/plain" . If left blank, the MIME type defaults to "text/html". Corresponds to the JSON property mimeType

Returns:

  • (String)


236
237
238
# File 'lib/google/apis/translate_v3/classes.rb', line 236

def mime_type
  @mime_type
end

#modelString

Optional. The language detection model to be used. Format: projects/project- number-or-id/locations/location-id/models/language-detection/model-id` Only one language detection model is currently supported:projects/project- number-or-id/locations/location-id/models/language-detection/default. If not specified, the default model is used. Corresponds to the JSON propertymodel`

Returns:

  • (String)


245
246
247
# File 'lib/google/apis/translate_v3/classes.rb', line 245

def model
  @model
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



252
253
254
255
256
257
# File 'lib/google/apis/translate_v3/classes.rb', line 252

def update!(**args)
  @content = args[:content] if args.key?(:content)
  @labels = args[:labels] if args.key?(:labels)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @model = args[:model] if args.key?(:model)
end