Class: Google::Apis::LanguageV1beta1::Document

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

Overview

##########################################################

Represents the input to API methods.

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

Returns a new instance of Document.



60
61
62
# File 'generated/google/apis/language_v1beta1/classes.rb', line 60

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

Instance Attribute Details

#contentString

The content of the input in string format. Corresponds to the JSON property content

Returns:

  • (String)


58
59
60
# File 'generated/google/apis/language_v1beta1/classes.rb', line 58

def content
  @content
end

#gcs_content_uriString

The Google Cloud Storage URI where the file content is located. Corresponds to the JSON property gcsContentUri

Returns:

  • (String)


47
48
49
# File 'generated/google/apis/language_v1beta1/classes.rb', line 47

def gcs_content_uri
  @gcs_content_uri
end

#languageString

The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.
Current Language Restrictions:

  • Only English, Spanish, and Japanese textual content are supported, with the following additional restriction:
  • analyzeSentiment only supports English text. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property language

Returns:

  • (String)


42
43
44
# File 'generated/google/apis/language_v1beta1/classes.rb', line 42

def language
  @language
end

#typeString

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error. Corresponds to the JSON property type

Returns:

  • (String)


53
54
55
# File 'generated/google/apis/language_v1beta1/classes.rb', line 53

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



65
66
67
68
69
70
# File 'generated/google/apis/language_v1beta1/classes.rb', line 65

def update!(**args)
  @language = args[:language] if args.key?(:language)
  @gcs_content_uri = args[:gcs_content_uri] if args.key?(:gcs_content_uri)
  @type = args[:type] if args.key?(:type)
  @content = args[:content] if args.key?(:content)
end