Class: Google::Apis::TranslateV3beta1::Translation

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

Overview

A single translation response.

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) ⇒ Translation

Returns a new instance of Translation.



902
903
904
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 902

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

Instance Attribute Details

#detected_language_codeString

The BCP-47 language code of source text in 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 does not occur and this field is empty. Corresponds to the JSON property detectedLanguageCode

Returns:

  • (String)


878
879
880
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 878

def detected_language_code
  @detected_language_code
end

#glossary_configGoogle::Apis::TranslateV3beta1::TranslateTextGlossaryConfig

Configures which glossary should be used for a specific target language, and defines options for applying that glossary. Corresponds to the JSON property glossaryConfig



884
885
886
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 884

def glossary_config
  @glossary_config
end

#modelString

Only present when model is present in the request. model here is normalized to have project number. For example: If the model requested in TranslationTextRequest is projects/project-id/locations/location-id/models/general/nmt then model here would be normalized to projects/project-number/locations/location-id/models/general/nmt. Corresponds to the JSON property model

Returns:

  • (String)


895
896
897
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 895

def model
  @model
end

#translated_textString

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

Returns:

  • (String)


900
901
902
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 900

def translated_text
  @translated_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



907
908
909
910
911
912
# File 'generated/google/apis/translate_v3beta1/classes.rb', line 907

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