Reference documentation and code samples for the Retail V2 API class Google::Cloud::Retail::V2::CatalogService::Rest::Client.
REST client for the CatalogService service.
Service for managing catalog configuration.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the CatalogService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CatalogService clients ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.configure do |config| config.timeout = 10.0 end
#add_catalog_attribute
def add_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
def add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
Adds the specified CatalogAttribute to the AttributesConfig.
If the CatalogAttribute to add already exists, an ALREADY_EXISTS error is returned.
def add_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
add_catalog_attribute
via a request object, either of type
AddCatalogAttributeRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::AddCatalogAttributeRequest, ::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 add_catalog_attribute(attributes_config: nil, catalog_attribute: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
add_catalog_attribute
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).
-
attributes_config (::String) — Required. Full AttributesConfig resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
- catalog_attribute (::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash) — Required. The CatalogAttribute to add.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::AttributesConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the CatalogService 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)
#get_attributes_config
def get_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
def get_attributes_config(name: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
Gets an AttributesConfig.
def get_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
get_attributes_config
via a request object, either of type
GetAttributesConfigRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::GetAttributesConfigRequest, ::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_attributes_config(name: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
get_attributes_config
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. Full AttributesConfig resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::AttributesConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_completion_config
def get_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
def get_completion_config(name: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
Gets a CompletionConfig.
def get_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
get_completion_config
via a request object, either of type
GetCompletionConfigRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::GetCompletionConfigRequest, ::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_completion_config(name: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
get_completion_config
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. Full CompletionConfig resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::CompletionConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_default_branch
def get_default_branch(request, options = nil) -> ::Google::Cloud::Retail::V2::GetDefaultBranchResponse
def get_default_branch(catalog: nil) -> ::Google::Cloud::Retail::V2::GetDefaultBranchResponse
Get which branch is currently default branch set by CatalogService.SetDefaultBranch method under a specified parent catalog.
def get_default_branch(request, options = nil) -> ::Google::Cloud::Retail::V2::GetDefaultBranchResponse
get_default_branch
via a request object, either of type
GetDefaultBranchRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::GetDefaultBranchRequest, ::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_default_branch(catalog: nil) -> ::Google::Cloud::Retail::V2::GetDefaultBranchResponse
get_default_branch
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).
-
catalog (::String) — The parent catalog resource name, such as
projects/*/locations/global/catalogs/default_catalog
.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::GetDefaultBranchResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#initialize
def initialize() { |config| ... } -> Client
Create a new CatalogService REST client object.
- (config) — Configure the CatalogService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Retail::V2::CatalogService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_catalogs
def list_catalogs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>
def list_catalogs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>
Lists all the {::Google::Cloud::Retail::V2::Catalog Catalog}s associated with the project.
def list_catalogs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>
list_catalogs
via a request object, either of type
ListCatalogsRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::ListCatalogsRequest, ::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_catalogs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>
list_catalogs
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 account resource name with an associated location.
If the caller does not have permission to list {::Google::Cloud::Retail::V2::Catalog Catalog}s under this location, regardless of whether or not this location exists, a PERMISSION_DENIED error is returned.
-
page_size (::Integer) — Maximum number of Catalogs to return. If
unspecified, defaults to 50. The maximum allowed value is 1000. Values
above 1000 will be coerced to 1000.
If this field is negative, an INVALID_ARGUMENT is returned.
-
page_token (::String) — A page token
ListCatalogsResponse.next_page_token,
received from a previous
CatalogService.ListCatalogs
call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to CatalogService.ListCatalogs must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Retail::V2::Catalog>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#remove_catalog_attribute
def remove_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
def remove_catalog_attribute(attributes_config: nil, key: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
Removes the specified CatalogAttribute from the AttributesConfig.
If the CatalogAttribute to remove does not exist, a NOT_FOUND error is returned.
def remove_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
remove_catalog_attribute
via a request object, either of type
RemoveCatalogAttributeRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest, ::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 remove_catalog_attribute(attributes_config: nil, key: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
remove_catalog_attribute
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).
-
attributes_config (::String) — Required. Full AttributesConfig resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
- key (::String) — Required. The attribute name key of the CatalogAttribute to remove.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::AttributesConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#replace_catalog_attribute
def replace_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
def replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
Replaces the specified CatalogAttribute in the AttributesConfig by updating the catalog attribute with the same CatalogAttribute.key.
If the CatalogAttribute to replace does not exist, a NOT_FOUND error is returned.
def replace_catalog_attribute(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
replace_catalog_attribute
via a request object, either of type
ReplaceCatalogAttributeRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest, ::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 replace_catalog_attribute(attributes_config: nil, catalog_attribute: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
replace_catalog_attribute
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).
-
attributes_config (::String) — Required. Full AttributesConfig resource name. Format:
projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig
- catalog_attribute (::Google::Cloud::Retail::V2::CatalogAttribute, ::Hash) — Required. The updated CatalogAttribute.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
CatalogAttribute to update. The
following are NOT supported:
If not set, all supported fields are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::AttributesConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#set_default_branch
def set_default_branch(request, options = nil) -> ::Google::Protobuf::Empty
def set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) -> ::Google::Protobuf::Empty
Set a specified branch id as default branch. API methods such as SearchService.Search, ProductService.GetProduct, ProductService.ListProducts will treat requests using "default_branch" to the actual branch id set as default.
For example, if projects//locations//catalogs//branches/1
is set as
default, setting
SearchRequest.branch to
projects//locations//catalogs//branches/default_branch
is equivalent
to setting
SearchRequest.branch to
projects//locations//catalogs/*/branches/1
.
Using multiple branches can be useful when developers would like
to have a staging branch to test and verify for future usage. When it
becomes ready, developers switch on the staging branch using this API while
keeping using projects//locations//catalogs/*/branches/default_branch
as SearchRequest.branch to
route the traffic to this staging branch.
CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one.
More specifically:
- PredictionService will only return product IDs from branch {newBranch}.
- SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set).
- UserEventService will only join events with products from branch {newBranch}.
def set_default_branch(request, options = nil) -> ::Google::Protobuf::Empty
set_default_branch
via a request object, either of type
SetDefaultBranchRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::SetDefaultBranchRequest, ::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 set_default_branch(catalog: nil, branch_id: nil, note: nil, force: nil) -> ::Google::Protobuf::Empty
set_default_branch
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).
-
catalog (::String) — Full resource name of the catalog, such as
projects/*/locations/global/catalogs/default_catalog
. -
branch_id (::String) — The final component of the resource name of a branch.
This field must be one of "0", "1" or "2". Otherwise, an INVALID_ARGUMENT error is returned.
If there are no sufficient active products in the targeted branch and force is not set, a FAILED_PRECONDITION error is returned.
-
note (::String) — Some note on this request, this can be retrieved by
CatalogService.GetDefaultBranch
before next valid default branch set occurs.
This field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
- force (::Boolean) — If set to true, it permits switching to a branch with branch_id even if it has no sufficient active products.
- (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.
#update_attributes_config
def update_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
def update_attributes_config(attributes_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
Updates the AttributesConfig.
The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.
def update_attributes_config(request, options = nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
update_attributes_config
via a request object, either of type
UpdateAttributesConfigRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::UpdateAttributesConfigRequest, ::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_attributes_config(attributes_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::AttributesConfig
update_attributes_config
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).
- attributes_config (::Google::Cloud::Retail::V2::AttributesConfig, ::Hash) — Required. The AttributesConfig to update.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
AttributesConfig to update. The
following is the only supported field:
If not set, all supported fields are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::AttributesConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_catalog
def update_catalog(request, options = nil) -> ::Google::Cloud::Retail::V2::Catalog
def update_catalog(catalog: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::Catalog
Updates the {::Google::Cloud::Retail::V2::Catalog Catalog}s.
def update_catalog(request, options = nil) -> ::Google::Cloud::Retail::V2::Catalog
update_catalog
via a request object, either of type
UpdateCatalogRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::UpdateCatalogRequest, ::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_catalog(catalog: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::Catalog
update_catalog
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).
-
catalog (::Google::Cloud::Retail::V2::Catalog, ::Hash) — Required. The Catalog to update.
If the caller does not have permission to update the Catalog, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the Catalog to update does not exist, a NOT_FOUND error is returned.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
Catalog to update.
If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::Catalog)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_completion_config
def update_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
def update_completion_config(completion_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
Updates the {::Google::Cloud::Retail::V2::CompletionConfig CompletionConfig}s.
def update_completion_config(request, options = nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
update_completion_config
via a request object, either of type
UpdateCompletionConfigRequest or an equivalent Hash.
- request (::Google::Cloud::Retail::V2::UpdateCompletionConfigRequest, ::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_completion_config(completion_config: nil, update_mask: nil) -> ::Google::Cloud::Retail::V2::CompletionConfig
update_completion_config
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).
-
completion_config (::Google::Cloud::Retail::V2::CompletionConfig, ::Hash) — Required. The CompletionConfig
to update.
If the caller does not have permission to update the CompletionConfig, then a PERMISSION_DENIED error is returned.
If the CompletionConfig to update does not exist, a NOT_FOUND error is returned.
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) — Indicates which fields in the provided
CompletionConfig to update. The
following are the only supported fields:
- CompletionConfig.matching_order
- CompletionConfig.max_suggestions
- CompletionConfig.min_prefix_length
- CompletionConfig.auto_learning
If not set, all supported fields are updated.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Retail::V2::CompletionConfig)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.