# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::Document (v2.8.0)

2.8.0 (latest) 2.7.0 2.6.2 2.5.0 2.4.0 2.3.1 2.2.0 2.1.1 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.2 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.2 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::Document.

Document captures all raw metadata information of items to be recommended or
searched.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #acl_info

    def acl_info() -> ::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo

**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-AclInfo)) --- Access control information for the document.

### #acl_info=

    def acl_info=(value) -> ::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo

**Parameter**

- **value** ([::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-AclInfo)) --- Access control information for the document.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Document::AclInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-AclInfo)) --- Access control information for the document.

### #content

    def content() -> ::Google::Cloud::DiscoveryEngine::V1::Document::Content

**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Document::Content](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-Content)) --- The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.

### #content=

    def content=(value) -> ::Google::Cloud::DiscoveryEngine::V1::Document::Content

**Parameter**

- **value** ([::Google::Cloud::DiscoveryEngine::V1::Document::Content](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-Content)) --- The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Document::Content](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-Content)) --- The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.

### #derived_struct_data

    def derived_struct_data() -> ::Google::Protobuf::Struct

**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Struct)) --- Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.

### #id

    def id() -> ::String

**Returns**

- (::String) --- Immutable. The identifier of the document.

  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 128 characters.

### #id=

    def id=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. The identifier of the document.


  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 128 characters.
**Returns**

- (::String) --- Immutable. The identifier of the document.

  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 128 characters.

### #index_status

    def index_status() -> ::Google::Cloud::DiscoveryEngine::V1::Document::IndexStatus

**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1::Document::IndexStatus](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document-IndexStatus)) ---

  Output only. The index status of the document.
  - If document is indexed successfully, the index_time field is populated.
  - Otherwise, if document is not indexed due to errors, the error_samples field is populated.
  - Otherwise, if document's index is in progress, the pending_message field is populated.

### #index_time

    def index_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The last time the document was indexed. If this field is set, the document could be returned in search results.


  This field is OUTPUT_ONLY. If this field is not populated, it means the
  document has never been indexed.

### #json_data

    def json_data() -> ::String

**Returns**

- (::String) --- The JSON string representation of the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `json_data`, `struct_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #json_data=

    def json_data=(value) -> ::String

**Parameter**

- **value** (::String) --- The JSON string representation of the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `json_data`, `struct_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- The JSON string representation of the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `json_data`, `struct_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.


  This field must be a UTF-8 encoded string with a length limit of 1024
  characters.

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.


  This field must be a UTF-8 encoded string with a length limit of 1024
  characters.
**Returns**

- (::String) --- Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`.


  This field must be a UTF-8 encoded string with a length limit of 1024
  characters.

### #parent_document_id

    def parent_document_id() -> ::String

**Returns**

- (::String) --- The identifier of the parent document. Currently supports at most two level document hierarchy.

  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 63 characters.

### #parent_document_id=

    def parent_document_id=(value) -> ::String

**Parameter**

- **value** (::String) --- The identifier of the parent document. Currently supports at most two level document hierarchy.


  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 63 characters.
**Returns**

- (::String) --- The identifier of the parent document. Currently supports at most two level document hierarchy.

  Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 63 characters.

### #schema_id

    def schema_id() -> ::String

**Returns**

- (::String) --- The identifier of the schema located in the same data store.

### #schema_id=

    def schema_id=(value) -> ::String

**Parameter**

- **value** (::String) --- The identifier of the schema located in the same data store.
**Returns**

- (::String) --- The identifier of the schema located in the same data store.

### #struct_data

    def struct_data() -> ::Google::Protobuf::Struct

**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Struct)) --- The structured JSON data for the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `struct_data`, `json_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #struct_data=

    def struct_data=(value) -> ::Google::Protobuf::Struct

**Parameter**

- **value** ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Struct)) --- The structured JSON data for the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `struct_data`, `json_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- ([::Google::Protobuf::Struct](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Struct)) --- The structured JSON data for the document. It should conform to the registered [Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Schema "Google::Cloud::DiscoveryEngine::V1::Schema (class)") or an `INVALID_ARGUMENT` error is thrown.


  Note: The following fields are mutually exclusive: `struct_data`, `json_data`. If a field in that set is populated, all other fields in the set will automatically be cleared.