Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::EngineService::Client (v1.0.1)

Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::EngineService::Client.

Client for the EngineService service.

Service for managing Engine configuration.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the EngineService 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_engine

def create_engine(request, options = nil) -> ::Gapic::Operation
def create_engine(parent: nil, engine: nil, engine_id: nil) -> ::Gapic::Operation

Creates a Engine.

Overloads
def create_engine(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_engine via a request object, either of type CreateEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::CreateEngineRequest, ::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_engine(parent: nil, engine: nil, engine_id: nil) -> ::Gapic::Operation
Pass arguments to create_engine 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}.
  • engine (::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash) — Required. The Engine to create.
  • engine_id (::String) — Required. The ID to use for the Engine, which will become the final component of the Engine'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.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

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

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

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

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

Deletes a Engine.

Overloads
def delete_engine(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_engine via a request object, either of type DeleteEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::DeleteEngineRequest, ::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_engine(name: nil) -> ::Gapic::Operation
Pass arguments to delete_engine 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 Engine, such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.

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

    If the Engine to delete does not exist, a NOT_FOUND error is returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

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

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

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

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

Gets a Engine.

Overloads
def get_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine
Pass arguments to get_engine via a request object, either of type GetEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::GetEngineRequest, ::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_engine(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine
Pass arguments to get_engine 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 Engine, such as projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

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

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

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

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

#initialize

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

Create a new EngineService client object.

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

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

#list_engines

def list_engines(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>
def list_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>

Lists all the {::Google::Cloud::DiscoveryEngine::V1::Engine Engine}s associated with the project.

Overloads
def list_engines(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>
Pass arguments to list_engines via a request object, either of type ListEnginesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::ListEnginesRequest, ::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_engines(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Engine>
Pass arguments to list_engines 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_id}.
  • page_size (::Integer) — Optional. Not supported.
  • page_token (::String) — Optional. Not supported.
  • filter (::String) — Optional. Filter by solution type. For example: solution_type=SOLUTION_TYPE_SEARCH
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/discovery_engine/v1"

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

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

# Call the list_engines method.
result = client.list_engines 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::Engine.
  p item
end

#location_client

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

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

Returns
  • (Google::Cloud::Location::Locations::Client)

#operations_client

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

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_engine

def update_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine
def update_engine(engine: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine

Updates an Engine

Overloads
def update_engine(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine
Pass arguments to update_engine via a request object, either of type UpdateEngineRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::UpdateEngineRequest, ::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_engine(engine: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Engine
Pass arguments to update_engine 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
  • engine (::Google::Cloud::DiscoveryEngine::V1::Engine, ::Hash) — Required. The Engine to update.

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

    If the Engine to update does not exist, a NOT_FOUND error is returned.

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided Engine to update.

    If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

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

Basic example

require "google/cloud/discovery_engine/v1"

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

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

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

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