Reference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::Document.
Represents the input to API methods.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#content
defcontent()->::String
Returns
(::String) — The content of the input in string format.
Cloud audit logging exempt since it is based on user data.
Note: The following fields are mutually exclusive: content, gcs_content_uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
#content=
defcontent=(value)->::String
Parameter
value (::String) — The content of the input in string format.
Cloud audit logging exempt since it is based on user data.
Note: The following fields are mutually exclusive: content, gcs_content_uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — The content of the input in string format.
Cloud audit logging exempt since it is based on user data.
Note: The following fields are mutually exclusive: content, gcs_content_uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
#gcs_content_uri
defgcs_content_uri()->::String
Returns
(::String) — 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.
Note: The following fields are mutually exclusive: gcs_content_uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
#gcs_content_uri=
defgcs_content_uri=(value)->::String
Parameter
value (::String) — 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.
Note: The following fields are mutually exclusive: gcs_content_uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — 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.
Note: The following fields are mutually exclusive: gcs_content_uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
#language_code
deflanguage_code()->::String
Returns
(::String) — 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.
#language_code=
deflanguage_code=(value)->::String
Parameter
value (::String) — 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.
Returns
(::String) — 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Natural Language V2 API - Class Google::Cloud::Language::V2::Document (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-language-v2/latest/Google-Cloud-Language-V2-Document)\n- [1.0.1](/ruby/docs/reference/google-cloud-language-v2/1.0.1/Google-Cloud-Language-V2-Document)\n- [0.7.0](/ruby/docs/reference/google-cloud-language-v2/0.7.0/Google-Cloud-Language-V2-Document)\n- [0.6.0](/ruby/docs/reference/google-cloud-language-v2/0.6.0/Google-Cloud-Language-V2-Document)\n- [0.5.1](/ruby/docs/reference/google-cloud-language-v2/0.5.1/Google-Cloud-Language-V2-Document)\n- [0.4.0](/ruby/docs/reference/google-cloud-language-v2/0.4.0/Google-Cloud-Language-V2-Document)\n- [0.3.2](/ruby/docs/reference/google-cloud-language-v2/0.3.2/Google-Cloud-Language-V2-Document)\n- [0.2.0](/ruby/docs/reference/google-cloud-language-v2/0.2.0/Google-Cloud-Language-V2-Document)\n- [0.1.0](/ruby/docs/reference/google-cloud-language-v2/0.1.0/Google-Cloud-Language-V2-Document) \nReference documentation and code samples for the Cloud Natural Language V2 API class Google::Cloud::Language::V2::Document.\n\nRepresents the input to API methods. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #content\n\n def content() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The content of the input in string format. Cloud audit logging exempt since it is based on user data.\n\n Note: The following fields are mutually exclusive: `content`, `gcs_content_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #content=\n\n def content=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The content of the input in string format. Cloud audit logging exempt since it is based on user data.\n\n\nNote: The following fields are mutually exclusive: `content`, `gcs_content_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- The content of the input in string format. Cloud audit logging exempt since it is based on user data.\n\n Note: The following fields are mutually exclusive: `content`, `gcs_content_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #gcs_content_uri\n\n def gcs_content_uri() -\u003e ::String\n\n**Returns**\n\n- (::String) --- 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.\n\n Note: The following fields are mutually exclusive: `gcs_content_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #gcs_content_uri=\n\n def gcs_content_uri=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- 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.\n\n\nNote: The following fields are mutually exclusive: `gcs_content_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- 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.\n\n Note: The following fields are mutually exclusive: `gcs_content_uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #language_code\n\n def language_code() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. \n [Language\n Support](https://cloud.google.com/natural-language/docs/languages) 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.\n\n### #language_code=\n\n def language_code=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. \n [Language\nSupport](https://cloud.google.com/natural-language/docs/languages) 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. \n**Returns**\n\n- (::String) --- Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted. \n [Language\n Support](https://cloud.google.com/natural-language/docs/languages) 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.\n\n### #type\n\n def type() -\u003e ::Google::Cloud::Language::V2::Document::Type\n\n**Returns**\n\n- ([::Google::Cloud::Language::V2::Document::Type](./Google-Cloud-Language-V2-Document-Type)) --- Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error.\n\n### #type=\n\n def type=(value) -\u003e ::Google::Cloud::Language::V2::Document::Type\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Language::V2::Document::Type](./Google-Cloud-Language-V2-Document-Type)) --- Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error. \n**Returns**\n\n- ([::Google::Cloud::Language::V2::Document::Type](./Google-Cloud-Language-V2-Document-Type)) --- Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `INVALID_ARGUMENT` error."]]