Class: Google::Apis::LanguageV2::Document

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

Overview

Represents the input to API methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Document

Returns a new instance of Document.



570
571
572
# File 'lib/google/apis/language_v2/classes.rb', line 570

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

Instance Attribute Details

#contentString

The content of the input in string format. Cloud audit logging exempt since it is based on user data. Corresponds to the JSON property content

Returns:

  • (String)


544
545
546
# File 'lib/google/apis/language_v2/classes.rb', line 544

def content
  @content
end

#gcs_content_uriString

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https:// cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported. Corresponds to the JSON property gcsContentUri

Returns:

  • (String)


552
553
554
# File 'lib/google/apis/language_v2/classes.rb', line 552

def gcs_content_uri
  @gcs_content_uri
end

#language_codeString

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. Language Support lists currently supported languages for each API method. 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 languageCode

Returns:

  • (String)


562
563
564
# File 'lib/google/apis/language_v2/classes.rb', line 562

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


568
569
570
# File 'lib/google/apis/language_v2/classes.rb', line 568

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



575
576
577
578
579
580
# File 'lib/google/apis/language_v2/classes.rb', line 575

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