# Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client (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::DocumentService::Rest::Client.

REST client for the DocumentService service.


<br />

Service for ingesting [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")
information of the customer's website.

## Inherits

- Object

## Includes

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

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the DocumentService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all DocumentService clients
::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure do |config|
  config.timeout = 10.0
end
```

### #batch_get_documents_metadata

    def batch_get_documents_metadata(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse
    def batch_get_documents_metadata(parent: nil, matcher: nil) -> ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse

Gets index freshness metadata for
{::Google::Cloud::DiscoveryEngine::V1::Document Document}s. Supported for
website search only.
**Overloads**

    def batch_get_documents_metadata(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse

Pass arguments to `batch_get_documents_metadata` via a request object, either of type [BatchGetDocumentsMetadataRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BatchGetDocumentsMetadataRequest "Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BatchGetDocumentsMetadataRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def batch_get_documents_metadata(parent: nil, matcher: nil) -> ::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse

Pass arguments to `batch_get_documents_metadata` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
- **matcher** ([::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest::Matcher](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BatchGetDocumentsMetadataRequest-Matcher), ::Hash) --- Required. Matcher for the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BatchGetDocumentsMetadataResponse))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

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

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataRequest.new

# Call the batch_get_documents_metadata method.
result = client.batch_get_documents_metadata request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::BatchGetDocumentsMetadataResponse.
p result
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the DocumentService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client#Google__Cloud__DiscoveryEngine__V1__DocumentService__Rest__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration))

### #create_document

    def create_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document
    def create_document(parent: nil, document: nil, document_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Creates a [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)").
**Overloads**

    def create_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `create_document` via a request object, either of type [CreateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CreateDocumentRequest "Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CreateDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def create_document(parent: nil, document: nil, document_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `create_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
- **document** ([::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document), ::Hash) --- Required. The [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") to create.
- **document_id** (::String) --- Required. The ID to use for the [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), which becomes the final component of the [Document.name](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document#Google__Cloud__DiscoveryEngine__V1__Document_name_instance_ "Google::Cloud::DiscoveryEngine::V1::Document#name (method)").


  If the caller does not have permission to create the
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), regardless of whether
  or not it exists, a `PERMISSION_DENIED` error is returned.

  This field must be unique among all
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s with the same
  [parent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CreateDocumentRequest#Google__Cloud__DiscoveryEngine__V1__CreateDocumentRequest_parent_instance_ "Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest#parent (method)").
  Otherwise, an `ALREADY_EXISTS` error is returned.

  This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  standard with a length limit of 128 characters. Otherwise, an
  `INVALID_ARGUMENT` error is returned.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

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

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::CreateDocumentRequest.new

# Call the create_document method.
result = client.create_document request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document.
p result
```

### #delete_document

    def delete_document(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_document(name: nil) -> ::Google::Protobuf::Empty

Deletes a [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)").
**Overloads**

    def delete_document(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_document` via a request object, either of type [Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DeleteDocumentRequest "Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DeleteDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def delete_document(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Full resource name of [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.


  If the caller does not have permission to delete the
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), regardless of whether
  or not it exists, a `PERMISSION_DENIED` error is returned.

  If the [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") to delete does
  not exist, a `NOT_FOUND` error is returned.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Empty))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::DeleteDocumentRequest.new

# Call the delete_document method.
result = client.delete_document request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_document

    def get_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document
    def get_document(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Gets a [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)").
**Overloads**

    def get_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `get_document` via a request object, either of type [GetDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GetDocumentRequest "Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GetDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def get_document(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `get_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Full resource name of [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.


  If the caller does not have permission to access the
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), regardless of whether
  or not it exists, a `PERMISSION_DENIED` error is returned.

  If the requested [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") does
  not exist, a `NOT_FOUND` error is returned.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

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

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::GetDocumentRequest.new

# Call the get_document method.
result = client.get_document request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document.
p result
```

### #import_documents

    def import_documents(request, options = nil) -> ::Gapic::Operation
    def import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) -> ::Gapic::Operation

Bulk import of multiple
[Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s. Request processing
may be synchronous. Non-existing items are created.


<br />

Note: It is possible for a subset of the
{::Google::Cloud::DiscoveryEngine::V1::Document Document}s to be successfully
updated.
**Overloads**

    def import_documents(request, options = nil) -> ::Gapic::Operation

Pass arguments to `import_documents` via a request object, either of type [ImportDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest "Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def import_documents(inline_source: nil, gcs_source: nil, bigquery_source: nil, fhir_store_source: nil, spanner_source: nil, cloud_sql_source: nil, firestore_source: nil, alloy_db_source: nil, bigtable_source: nil, parent: nil, error_config: nil, reconciliation_mode: nil, update_mask: nil, auto_generate_ids: nil, id_field: nil, force_refresh_content: nil) -> ::Gapic::Operation

Pass arguments to `import_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **inline_source** ([::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::InlineSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest-InlineSource), ::Hash) --- The Inline source for the input content for documents.


  Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **gcs_source** ([::Google::Cloud::DiscoveryEngine::V1::GcsSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource), ::Hash) --- Cloud Storage location for the input content.


  Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **bigquery_source** ([::Google::Cloud::DiscoveryEngine::V1::BigQuerySource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigQuerySource), ::Hash) --- BigQuery input source.


  Note: The following parameters are mutually exclusive: `bigquery_source`, `inline_source`, `gcs_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **fhir_store_source** ([::Google::Cloud::DiscoveryEngine::V1::FhirStoreSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-FhirStoreSource), ::Hash) --- FhirStore input source.


  Note: The following parameters are mutually exclusive: `fhir_store_source`, `inline_source`, `gcs_source`, `bigquery_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **spanner_source** ([::Google::Cloud::DiscoveryEngine::V1::SpannerSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SpannerSource), ::Hash) --- Spanner input source.


  Note: The following parameters are mutually exclusive: `spanner_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **cloud_sql_source** ([::Google::Cloud::DiscoveryEngine::V1::CloudSqlSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CloudSqlSource), ::Hash) --- Cloud SQL input source.


  Note: The following parameters are mutually exclusive: `cloud_sql_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `firestore_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **firestore_source** ([::Google::Cloud::DiscoveryEngine::V1::FirestoreSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-FirestoreSource), ::Hash) --- Firestore input source.


  Note: The following parameters are mutually exclusive: `firestore_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `alloy_db_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **alloy_db_source** ([::Google::Cloud::DiscoveryEngine::V1::AlloyDbSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-AlloyDbSource), ::Hash) --- AlloyDB input source.


  Note: The following parameters are mutually exclusive: `alloy_db_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `bigtable_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **bigtable_source** ([::Google::Cloud::DiscoveryEngine::V1::BigtableSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigtableSource), ::Hash) --- Cloud Bigtable input source.


  Note: The following parameters are mutually exclusive: `bigtable_source`, `inline_source`, `gcs_source`, `bigquery_source`, `fhir_store_source`, `spanner_source`, `cloud_sql_source`, `firestore_source`, `alloy_db_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **parent** (::String) --- Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission.
- **error_config** ([::Google::Cloud::DiscoveryEngine::V1::ImportErrorConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportErrorConfig), ::Hash) --- The desired location of errors incurred during the Import.
- **reconciliation_mode** ([::Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest-ReconciliationMode)) --- The mode of reconciliation between existing documents and the documents to be imported. Defaults to [ReconciliationMode.INCREMENTAL](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest-ReconciliationMode#Google__Cloud__DiscoveryEngine__V1__ImportDocumentsRequest__ReconciliationMode__INCREMENTAL "Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::INCREMENTAL (constant)").
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided imported documents to update. If not set, the default is to update all fields.
- **auto_generate_ids** (::Boolean) ---

  Whether to automatically generate IDs for the documents if absent.

  If set to `true`,
  [Document.id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document#Google__Cloud__DiscoveryEngine__V1__Document_id_instance_ "Google::Cloud::DiscoveryEngine::V1::Document#id (method)")s are
  automatically generated based on the hash of the payload, where IDs may not
  be consistent during multiple imports. In which case
  [ReconciliationMode.FULL](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest-ReconciliationMode#Google__Cloud__DiscoveryEngine__V1__ImportDocumentsRequest__ReconciliationMode__FULL "Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest::ReconciliationMode::FULL (constant)")
  is highly recommended to avoid duplicate contents. If unset or set to
  `false`, [Document.id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document#Google__Cloud__DiscoveryEngine__V1__Document_id_instance_ "Google::Cloud::DiscoveryEngine::V1::Document#id (method)")s have
  to be specified using
  [id_field](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest#Google__Cloud__DiscoveryEngine__V1__ImportDocumentsRequest_id_field_instance_ "Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#id_field (method)"),
  otherwise, documents without IDs fail to be imported.

  Supported data sources:
  - [GcsSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource "Google::Cloud::DiscoveryEngine::V1::GcsSource (class)"). [GcsSource.data_schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource#Google__Cloud__DiscoveryEngine__V1__GcsSource_data_schema_instance_ "Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema (method)") must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
  - [BigQuerySource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigQuerySource "Google::Cloud::DiscoveryEngine::V1::BigQuerySource (class)"). [BigQuerySource.data_schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigQuerySource#Google__Cloud__DiscoveryEngine__V1__BigQuerySource_data_schema_instance_ "Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema (method)") must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
  - [SpannerSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SpannerSource "Google::Cloud::DiscoveryEngine::V1::SpannerSource (class)").
  - [CloudSqlSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CloudSqlSource "Google::Cloud::DiscoveryEngine::V1::CloudSqlSource (class)").
  - [FirestoreSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-FirestoreSource "Google::Cloud::DiscoveryEngine::V1::FirestoreSource (class)").
  - [BigtableSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigtableSource "Google::Cloud::DiscoveryEngine::V1::BigtableSource (class)").
- **id_field** (::String) ---

  The field indicates the ID field or column to be used as unique IDs of
  the documents.

  For [GcsSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource "Google::Cloud::DiscoveryEngine::V1::GcsSource (class)") it is the key of
  the JSON field. For instance, `my_id` for JSON `{"my_id": "some_uuid"}`.
  For others, it may be the column name of the table where the unique ids are
  stored.

  The values of the JSON field or the table column are used as the
  [Document.id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document#Google__Cloud__DiscoveryEngine__V1__Document_id_instance_ "Google::Cloud::DiscoveryEngine::V1::Document#id (method)")s. The JSON field
  or the table column must be of string type, and the values must be set as
  valid strings conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
  with 1-63 characters. Otherwise, documents without valid IDs fail to be
  imported.

  Only set this field when
  [auto_generate_ids](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ImportDocumentsRequest#Google__Cloud__DiscoveryEngine__V1__ImportDocumentsRequest_auto_generate_ids_instance_ "Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest#auto_generate_ids (method)")
  is unset or set as `false`. Otherwise, an INVALID_ARGUMENT error is thrown.

  If it is unset, a default value `_id` is used when importing from the
  allowed data sources.

  Supported data sources:
  - [GcsSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource "Google::Cloud::DiscoveryEngine::V1::GcsSource (class)"). [GcsSource.data_schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource#Google__Cloud__DiscoveryEngine__V1__GcsSource_data_schema_instance_ "Google::Cloud::DiscoveryEngine::V1::GcsSource#data_schema (method)") must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
  - [BigQuerySource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigQuerySource "Google::Cloud::DiscoveryEngine::V1::BigQuerySource (class)"). [BigQuerySource.data_schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigQuerySource#Google__Cloud__DiscoveryEngine__V1__BigQuerySource_data_schema_instance_ "Google::Cloud::DiscoveryEngine::V1::BigQuerySource#data_schema (method)") must be `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
  - [SpannerSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-SpannerSource "Google::Cloud::DiscoveryEngine::V1::SpannerSource (class)").
  - [CloudSqlSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-CloudSqlSource "Google::Cloud::DiscoveryEngine::V1::CloudSqlSource (class)").
  - [FirestoreSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-FirestoreSource "Google::Cloud::DiscoveryEngine::V1::FirestoreSource (class)").
  - [BigtableSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-BigtableSource "Google::Cloud::DiscoveryEngine::V1::BigtableSource (class)").
- **force_refresh_content** (::Boolean) --- Optional. Whether to force refresh the unstructured content of the documents.


  If set to `true`, the content part of the documents will be refreshed
  regardless of the update status of the referencing content.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::ImportDocumentsRequest.new

# Call the import_documents method.
result = client.import_documents request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new DocumentService REST client object.
**Yields**

- (config) --- Configure the DocumentService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_documents

    def list_documents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>
    def list_documents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>

Gets a list of {::Google::Cloud::DiscoveryEngine::V1::Document Document}s.
**Overloads**

    def list_documents(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>

Pass arguments to `list_documents` via a request object, either of type [ListDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ListDocumentsRequest "Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ListDocumentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def list_documents(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Document>

Pass arguments to `list_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The parent branch resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch.


  If the caller does not have permission to list
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s under this branch,
  regardless of whether or not this branch exists, a `PERMISSION_DENIED`
  error is returned.
- **page_size** (::Integer) --- Maximum number of [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 are set to 1000.


  If this field is negative, an `INVALID_ARGUMENT` error is returned.
- **page_token** (::String) --- A page token [ListDocumentsResponse.next_page_token](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-ListDocumentsResponse#Google__Cloud__DiscoveryEngine__V1__ListDocumentsResponse_next_page_token_instance_ "Google::Cloud::DiscoveryEngine::V1::ListDocumentsResponse#next_page_token (method)"), received from a previous [DocumentService.ListDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client#Google__Cloud__DiscoveryEngine__V1__DocumentService__Rest__Client_list_documents_instance_ "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents (method)") call. Provide this to retrieve the subsequent page.


  When paginating, all other parameters provided to
  [DocumentService.ListDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client#Google__Cloud__DiscoveryEngine__V1__DocumentService__Rest__Client_list_documents_instance_ "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents (method)")
  must match the call that provided the page token. Otherwise, an
  `INVALID_ARGUMENT` error is returned.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::ListDocumentsRequest.new

# Call the list_documents method.
result = client.list_documents request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Document.
  p item
end
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Rest::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Operations

Get the associated client for long-running operations.
**Returns**

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

### #purge_documents

    def purge_documents(request, options = nil) -> ::Gapic::Operation
    def purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) -> ::Gapic::Operation

Permanently deletes all selected
[Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s in a branch.


This process is asynchronous. Depending on the number of
[Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s to be deleted, this
operation can take hours to complete. Before the delete operation
completes, some [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)")s might
still be returned by
[DocumentService.GetDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client#Google__Cloud__DiscoveryEngine__V1__DocumentService__Rest__Client_get_document_instance_ "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#get_document (method)")
or
[DocumentService.ListDocuments](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-DocumentService-Rest-Client#Google__Cloud__DiscoveryEngine__V1__DocumentService__Rest__Client_list_documents_instance_ "Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client#list_documents (method)").

<br />

To get a list of the {::Google::Cloud::DiscoveryEngine::V1::Document Document}s
to be deleted, set
[PurgeDocumentsRequest.force](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-PurgeDocumentsRequest#Google__Cloud__DiscoveryEngine__V1__PurgeDocumentsRequest_force_instance_ "Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest#force (method)")
to false.
**Overloads**

    def purge_documents(request, options = nil) -> ::Gapic::Operation

Pass arguments to `purge_documents` via a request object, either of type [PurgeDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-PurgeDocumentsRequest "Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-PurgeDocumentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def purge_documents(gcs_source: nil, inline_source: nil, parent: nil, filter: nil, error_config: nil, force: nil) -> ::Gapic::Operation

Pass arguments to `purge_documents` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **gcs_source** ([::Google::Cloud::DiscoveryEngine::V1::GcsSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-GcsSource), ::Hash) --- Cloud Storage location for the input content. Supported `data_schema`:


  - `document_id`: One valid [Document.id](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document#Google__Cloud__DiscoveryEngine__V1__Document_id_instance_ "Google::Cloud::DiscoveryEngine::V1::Document#id (method)") per line.

  Note: The following parameters are mutually exclusive: `gcs_source`, `inline_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **inline_source** ([::Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest::InlineSource](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-PurgeDocumentsRequest-InlineSource), ::Hash) --- Inline source for the input content for purge.


  Note: The following parameters are mutually exclusive: `inline_source`, `gcs_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
- **parent** (::String) --- Required. The parent resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
- **filter** (::String) --- Required. Filter matching documents to purge. Only currently supported value is `*` (all items).
- **error_config** ([::Google::Cloud::DiscoveryEngine::V1::PurgeErrorConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-PurgeErrorConfig), ::Hash) --- The desired location of errors incurred during the purge.
- **force** (::Boolean) --- Actually performs the purge. If `force` is set to false, return the expected purge count without deleting any documents.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::PurgeDocumentsRequest.new

# Call the purge_documents method.
result = client.purge_documents request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_document

    def update_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document
    def update_document(document: nil, allow_missing: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Updates a [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)").
**Overloads**

    def update_document(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `update_document` via a request object, either of type [UpdateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-UpdateDocumentRequest "Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-UpdateDocumentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

    def update_document(document: nil, allow_missing: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Document

Pass arguments to `update_document` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **document** ([::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document), ::Hash) --- Required. The document to update/create.


  If the caller does not have permission to update the
  [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)"), regardless of whether
  or not it exists, a `PERMISSION_DENIED` error is returned.

  If the [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") to update does
  not exist and
  [allow_missing](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-UpdateDocumentRequest#Google__Cloud__DiscoveryEngine__V1__UpdateDocumentRequest_allow_missing_instance_ "Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest#allow_missing (method)")
  is not set, a `NOT_FOUND` error is returned.
- **allow_missing** (::Boolean) --- If set to `true` and the [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") is not found, a new [Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document "Google::Cloud::DiscoveryEngine::V1::Document (class)") is be created.
- **update_mask** ([::Google::Protobuf::FieldMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Indicates which fields in the provided imported 'document' to update. If not set, by default updates all fields.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::DiscoveryEngine::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1/latest/Google-Cloud-DiscoveryEngine-V1-Document))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

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

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::DocumentService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::UpdateDocumentRequest.new

# Call the update_document method.
result = client.update_document request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::Document.
p result
```