Retail V2 API - Class Google::Cloud::Retail::V2::ControlService::Rest::Client (v2.5.0)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::ControlService::Rest::Client.
REST client for the ControlService service.
Service for modifying Control.
Inherits
- Object
Methods
.configure
defself.configure(){|config|...}->Client::ConfigurationConfigure 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::Retail::V2::ControlService::Rest::Client.configuredo|config| config.timeout=10.0 end
#configure
defconfigure(){|config|...}->Client::ConfigurationConfigure 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
defcreate_control(request,options=nil)->::Google::Cloud::Retail::V2::Control
defcreate_control(parent:nil,control:nil,control_id:nil)->::Google::Cloud::Retail::V2::ControlCreates a Control.
If the Control to create already exists, an ALREADY_EXISTS error is returned.
defcreate_control(request,options=nil)->::Google::Cloud::Retail::V2::Controlcreate_control via a request object, either of type
Google::Cloud::Retail::V2::CreateControlRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::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.
defcreate_control(parent:nil,control:nil,control_id:nil)->::Google::Cloud::Retail::V2::Controlcreate_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 catalog. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} - control (::Google::Cloud::Retail::V2::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 should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::Control)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/retail/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Retail::V2::ControlService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Retail::V2::CreateControlRequest.new # Call the create_control method. result=client.create_controlrequest # The returned object is of type Google::Cloud::Retail::V2::Control. presult
#delete_control
defdelete_control(request,options=nil)->::Google::Protobuf::Empty
defdelete_control(name:nil)->::Google::Protobuf::EmptyDeletes a Control.
If the Control to delete does not exist, a NOT_FOUND error is returned.
defdelete_control(request,options=nil)->::Google::Protobuf::Emptydelete_control via a request object, either of type
DeleteControlRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::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.
defdelete_control(name:nil)->::Google::Protobuf::Emptydelete_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_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Protobuf::Empty)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/retail/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Retail::V2::ControlService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Retail::V2::DeleteControlRequest.new # Call the delete_control method. result=client.delete_controlrequest # The returned object is of type Google::Protobuf::Empty. presult
#get_control
defget_control(request,options=nil)->::Google::Cloud::Retail::V2::Control
defget_control(name:nil)->::Google::Cloud::Retail::V2::ControlGets a Control.
defget_control(request,options=nil)->::Google::Cloud::Retail::V2::Controlget_control via a request object, either of type
GetControlRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::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.
defget_control(name:nil)->::Google::Cloud::Retail::V2::Controlget_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_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::Control)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/retail/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Retail::V2::ControlService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Retail::V2::GetControlRequest.new # Call the get_control method. result=client.get_controlrequest # The returned object is of type Google::Cloud::Retail::V2::Control. presult
#initialize
definitialize(){|config|...}->ClientCreate a new ControlService REST 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::Retail::V2::ControlService::Rest::Client.new # Create a client using a custom configuration client=::Google::Cloud::Retail::V2::ControlService::Rest::Client.newdo|config| config.timeout=10.0 end
#list_controls
deflist_controls(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>
deflist_controls(parent:nil,page_size:nil,page_token:nil,filter:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>Lists all Controls by their parent Catalog .
deflist_controls(request,options=nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>list_controls via a request object, either of type
ListControlsRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::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.
deflist_controls(parent:nil,page_size:nil,page_token:nil,filter:nil)->::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::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 catalog resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_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
ListControlscall. 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.
- List controls that are used in a single ServingConfig: 'serving_config = "boosted_home_page_cvr"'
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Control>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/retail/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Retail::V2::ControlService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Retail::V2::ListControlsRequest.new # Call the list_controls method. result=client.list_controlsrequest # 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.eachdo|item| # Each element is of type ::Google::Cloud::Retail::V2::Control. pitem end
#location_client
deflocation_client()->Google::Cloud::Location::Locations::Rest::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#logger
deflogger()->LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
defuniverse_domain()->StringThe effective universe domain
- (String)
#update_control
defupdate_control(request,options=nil)->::Google::Cloud::Retail::V2::Control
defupdate_control(control:nil,update_mask:nil)->::Google::Cloud::Retail::V2::ControlUpdates a Control.
Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.
defupdate_control(request,options=nil)->::Google::Cloud::Retail::V2::Controlupdate_control via a request object, either of type
UpdateControlRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::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.
defupdate_control(control:nil,update_mask:nil)->::Google::Cloud::Retail::V2::Controlupdate_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::Retail::V2::Control, ::Hash) — Required. The Control to update.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
Control to update. The following are NOT
supported:
If not set or empty, all supported fields are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::Control)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require"google/cloud/retail/v2" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Retail::V2::ControlService::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Retail::V2::UpdateControlRequest.new # Call the update_control method. result=client.update_controlrequest # The returned object is of type Google::Cloud::Retail::V2::Control. presult