Vector Search V1 API - Class Google::Cloud::VectorSearch::V1::DataObjectService::Rest::Client (v0.1.0)

Reference documentation and code samples for the Vector Search V1 API class Google::Cloud::VectorSearch::V1::DataObjectService::Rest::Client.

REST client for the DataObjectService service.

Service for creating and managing data objects.

Inherits

  • Object

Methods

.configure

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

Configure the DataObjectService 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 DataObjectService clients
::Google::Cloud::VectorSearch::V1::DataObjectService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#batch_create_data_objects

def batch_create_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse
def batch_create_data_objects(parent: nil, requests: nil) -> ::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse

Creates a batch of dataObjects.

Overloads
def batch_create_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse
Pass arguments to batch_create_data_objects via a request object, either of type BatchCreateDataObjectsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsRequest, ::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_create_data_objects(parent: nil, requests: nil) -> ::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse
Pass arguments to batch_create_data_objects 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 resource name of the Collection to create the DataObjects in. Format: projects/{project}/locations/{location}/collections/{collection}. The parent field in the CreateDataObjectRequest messages must match this field.
  • requests (::Array<::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest, ::Hash>) — Required. The request message specifying the resources to create. A maximum of 1000 DataObjects can be created in a batch.
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/vector_search/v1"

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

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

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

# The returned object is of type Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse.
p result

#batch_delete_data_objects

def batch_delete_data_objects(request, options = nil) -> ::Google::Protobuf::Empty
def batch_delete_data_objects(parent: nil, requests: nil) -> ::Google::Protobuf::Empty

Deletes dataObjects in a batch.

Overloads
def batch_delete_data_objects(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to batch_delete_data_objects via a request object, either of type BatchDeleteDataObjectsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::BatchDeleteDataObjectsRequest, ::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_delete_data_objects(parent: nil, requests: nil) -> ::Google::Protobuf::Empty
Pass arguments to batch_delete_data_objects 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 resource name of the Collection to delete the DataObjects in. Format: projects/{project}/locations/{location}/collections/{collection}.
  • requests (::Array<::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest, ::Hash>) — Required. The request message specifying the resources to delete. A maximum of 1000 DataObjects can be deleted in a batch.
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/vector_search/v1"

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

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

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

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

#batch_update_data_objects

def batch_update_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse
def batch_update_data_objects(parent: nil, requests: nil) -> ::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse

Updates dataObjects in a batch.

Overloads
def batch_update_data_objects(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse
Pass arguments to batch_update_data_objects via a request object, either of type BatchUpdateDataObjectsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsRequest, ::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_update_data_objects(parent: nil, requests: nil) -> ::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse
Pass arguments to batch_update_data_objects 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 resource name of the Collection to update the DataObjects in. Format: projects/{project}/locations/{location}/collections/{collection}. The parent field in the UpdateDataObjectRequest messages must match this field.
  • requests (::Array<::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest, ::Hash>) — Required. The request message specifying the resources to update. A maximum of 1000 DataObjects can be updated in a batch.
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/vector_search/v1"

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

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

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

# The returned object is of type Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse.
p result

#configure

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

Configure the DataObjectService 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_object

def create_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
def create_data_object(parent: nil, data_object_id: nil, data_object: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject

Creates a dataObject.

Overloads
def create_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to create_data_object via a request object, either of type CreateDataObjectRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest, ::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_object(parent: nil, data_object_id: nil, data_object: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to create_data_object 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 resource name of the Collection to create the DataObject in. Format: projects/{project}/locations/{location}/collections/{collection}
  • data_object_id (::String) — Required. The id of the dataObject to create. The id must be 1-63 characters long, and comply with RFC1035. Specifically, it must be 1-63 characters long and match the regular expression [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?.
  • data_object (::Google::Cloud::VectorSearch::V1::DataObject, ::Hash) — Required. The DataObject to create.
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/vector_search/v1"

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

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

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

# The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
p result

#delete_data_object

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

Deletes a dataObject.

Overloads
def delete_data_object(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_data_object via a request object, either of type Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest, ::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_object(name: nil, etag: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_data_object 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
  • name (::String) — Required. The name of the DataObject resource to be deleted. Format: projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}
  • etag (::String) — Optional. The current etag of the DataObject. If an etag is provided and does not match the current etag of the DataObject, deletion will be blocked and an ABORTED error will be 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/vector_search/v1"

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

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

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

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

#get_data_object

def get_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
def get_data_object(name: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject

Gets a data object.

Overloads
def get_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to get_data_object via a request object, either of type GetDataObjectRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::GetDataObjectRequest, ::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_object(name: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to get_data_object 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. The name of the DataObject resource. Format: projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}
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/vector_search/v1"

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

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

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

# The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
p result

#initialize

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

Create a new DataObjectService REST client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::VectorSearch::V1::DataObjectService::Rest::Client.new do |config|
  config.timeout = 10.0
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)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_data_object

def update_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
def update_data_object(data_object: nil, update_mask: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject

Updates a dataObject.

Overloads
def update_data_object(request, options = nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to update_data_object via a request object, either of type UpdateDataObjectRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest, ::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_object(data_object: nil, update_mask: nil) -> ::Google::Cloud::VectorSearch::V1::DataObject
Pass arguments to update_data_object 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/vector_search/v1"

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

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

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

# The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
p result