Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::ControlService::Client.
Client for the ControlService service.
Service for performing CRUD operations on Controls. Controls allow for custom logic to be implemented in the serving path. Controls need to be attached to a Serving Config to be considered during a request.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ControlService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all ControlService clients ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the ControlService 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_control
def create_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
def create_control(parent: nil, control: nil, control_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
Creates a Control.
By default 1000 controls are allowed for a data store. A request can be submitted to adjust this limit. If the Control to create already exists, an ALREADY_EXISTS error is returned.
def create_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
create_control
via a request object, either of type
Google::Cloud::DiscoveryEngine::V1::CreateControlRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1::CreateControlRequest, ::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_control(parent: nil, control: nil, control_id: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
create_control
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).
-
parent (::String) — Required. Full resource name of parent data store. Format:
projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}
orprojects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}
. - control (::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash) — Required. The Control to create.
-
control_id (::String) — Required. The ID to use for the Control, which will become the final
component of the Control's resource name.
This value must be within 1-63 characters. Valid characters are /[a-z][0-9]-_/.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1::Control)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ControlService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1::CreateControlRequest.new # Call the create_control method. result = client.create_control request # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. p result
#delete_control
def delete_control(request, options = nil) -> ::Google::Protobuf::Empty
def delete_control(name: nil) -> ::Google::Protobuf::Empty
def delete_control(request, options = nil) -> ::Google::Protobuf::Empty
delete_control
via a request object, either of type
DeleteControlRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest, ::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_control(name: nil) -> ::Google::Protobuf::Empty
delete_control
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).
-
name (::String) — Required. The resource name of the Control to delete. Format:
projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ControlService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1::DeleteControlRequest.new # Call the delete_control method. result = client.delete_control request # The returned object is of type Google::Protobuf::Empty. p result
#get_control
def get_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
def get_control(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
Gets a Control.
def get_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
get_control
via a request object, either of type
GetControlRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1::GetControlRequest, ::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_control(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
get_control
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).
-
name (::String) — Required. The resource name of the Control to get. Format:
projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1::Control)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ControlService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1::GetControlRequest.new # Call the get_control method. result = client.get_control request # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new ControlService client object.
- (config) — Configure the ControlService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::DiscoveryEngine::V1::ControlService::Client.new do |config| config.timeout = 10.0 end
#list_controls
def list_controls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>
def list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>
Lists all Controls by their parent DataStore.
def list_controls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>
list_controls
via a request object, either of type
ListControlsRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1::ListControlsRequest, ::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_controls(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>
list_controls
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).
-
parent (::String) — Required. The data store resource name. Format:
projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}
orprojects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}
. - page_size (::Integer) — Optional. Maximum number of results to return. If unspecified, defaults to 50. Max allowed value is 1000.
-
page_token (::String) — Optional. A page token, received from a previous
ListControls
call. Provide this to retrieve the subsequent page. -
filter (::String) —
Optional. A filter to apply on the list results. Supported features:
- List all the products under the parent branch if filter is unset. Currently this field is unsupported.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Control>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ControlService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1::ListControlsRequest.new # Call the list_controls method. result = client.list_controls 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::Control. p item end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)
#update_control
def update_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
def update_control(control: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
Updates a Control.
Control action type cannot be changed. If the Control to update does not exist, a NOT_FOUND error is returned.
def update_control(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
update_control
via a request object, either of type
UpdateControlRequest or an equivalent Hash.
- request (::Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest, ::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_control(control: nil, update_mask: nil) -> ::Google::Cloud::DiscoveryEngine::V1::Control
update_control
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).
- control (::Google::Cloud::DiscoveryEngine::V1::Control, ::Hash) — Required. The Control to update.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Indicates which fields in the provided
Control to update. The following
are NOT supported:
If not set or empty, all supported fields are updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::DiscoveryEngine::V1::Control)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ControlService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::DiscoveryEngine::V1::UpdateControlRequest.new # Call the update_control method. result = client.update_control request # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Control. p result