Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Rest::Client (v0.14.0)

Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Rest::Client.

REST client for the DataStoreService service.

Service for managing DataStore configuration.

Inherits

  • Object

Methods

.configure

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

Configure the DataStoreService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DataStoreService clients
::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the DataStoreService 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.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_data_store

def create_data_store(request, options = nil) -> ::Gapic::Operation
def create_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) -> ::Gapic::Operation

Creates a DataStore.

DataStore is for storing Documents. To serve these documents for Search, or Recommendation use case, an Engine needs to be created separately.

Overloads
def create_data_store(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_data_store via a request object, either of type CreateDataStoreRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::CreateDataStoreRequest, ::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_data_store(parent: nil, data_store: nil, data_store_id: nil, create_advanced_site_search: nil, skip_default_schema_creation: nil) -> ::Gapic::Operation
Pass arguments to create_data_store 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}.
  • data_store (::Google::Cloud::DiscoveryEngine::V1beta::DataStore, ::Hash) — Required. The DataStore to create.
  • data_store_id (::String) — Required. The ID to use for the DataStore, which will become the final component of the DataStore's resource name.

    This field must conform to RFC-1034 standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned.

  • create_advanced_site_search (::Boolean) — A boolean flag indicating whether user want to directly create an advanced data store for site search. If the data store is not configured as site search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will be ignored.
  • skip_default_schema_creation (::Boolean) — A boolean flag indicating whether to skip the default schema creation for the data store. Only enable this flag if you are certain that the default schema is incompatible with your use case.

    If set to true, you must manually create a schema for the data store before any documents can be ingested.

    This flag cannot be specified if data_store.starting_schema is specified.

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

require "google/cloud/discovery_engine/v1beta"

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

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

# Call the create_data_store method.
result = client.create_data_store 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

#delete_data_store

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

Deletes a DataStore.

Overloads
def delete_data_store(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_data_store via a request object, either of type Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::DeleteDataStoreRequest, ::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_data_store(name: nil) -> ::Gapic::Operation
Pass arguments to delete_data_store 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 DataStore, such as projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}.

    If the caller does not have permission to delete the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

    If the DataStore 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 (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

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

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

# Call the delete_data_store method.
result = client.delete_data_store 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

#get_data_store

def get_data_store(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
def get_data_store(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore

Gets a DataStore.

Overloads
def get_data_store(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
Pass arguments to get_data_store via a request object, either of type GetDataStoreRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::GetDataStoreRequest, ::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_data_store(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
Pass arguments to get_data_store 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 DataStore, such as projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}.

    If the caller does not have permission to access the DataStore, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

    If the requested DataStore does not exist, a NOT_FOUND error is returned.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

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

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

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::DataStore.
p result

#initialize

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

Create a new DataStoreService REST client object.

Yields
  • (config) — Configure the DataStoreService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Rest::Client.new

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

#list_data_stores

def list_data_stores(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>
def list_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>

Lists all the {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}s associated with the project.

Overloads
def list_data_stores(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>
Pass arguments to list_data_stores via a request object, either of type ListDataStoresRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::ListDataStoresRequest, ::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_data_stores(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::DataStore>
Pass arguments to list_data_stores 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_id}.

    If the caller does not have permission to list {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}s under this location, regardless of whether or not this data store exists, a PERMISSION_DENIED error is returned.

  • page_size (::Integer) — Maximum number of DataStores to return. If unspecified, defaults to 10. The maximum allowed value is 50. Values above 50 will be coerced to 50.

    If this field is negative, an INVALID_ARGUMENT is returned.

  • page_token (::String) — A page token ListDataStoresResponse.next_page_token, received from a previous DataStoreService.ListDataStores call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to DataStoreService.ListDataStores must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.

  • filter (::String) — Filter by solution type . For example: filter = 'solution_type:SOLUTION_TYPE_SEARCH'
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

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

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

# Call the list_data_stores method.
result = client.list_data_stores 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::V1beta::DataStore.
  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)

#operations_client

def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStoreService::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_data_store

def update_data_store(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
def update_data_store(data_store: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore

Updates a DataStore

Overloads
def update_data_store(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
Pass arguments to update_data_store via a request object, either of type UpdateDataStoreRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1beta::UpdateDataStoreRequest, ::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_data_store(data_store: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::DataStore
Pass arguments to update_data_store 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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1beta"

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

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

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::DataStore.
p result