google-api-ruby-client/generated/google-apis-retail_v2beta/lib/google/apis/retail_v2beta/service.rb

777 lines
50 KiB
Ruby
Raw Normal View History

feat: Automated regeneration of run v1alpha1 client (#2267) This PR was generated using Autosynth. :rainbow: <details><summary>Log from Synthtool</summary> ``` 2021-01-09 03:19:17,744 synthtool [DEBUG] > Executing /home/kbuilder/.cache/synthtool/google-api-ruby-client/synth.py. On branch autosynth-run-v1alpha1 Untracked files: (use "git add <file>..." to include in what will be committed) generated/google-apis-retail_v2/ generated/google-apis-retail_v2alpha/ generated/google-apis-retail_v2beta/ nothing added to commit but untracked files present (use "git add" to track) 2021-01-09 03:19:17,810 synthtool [DEBUG] > Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth run v1alpha1 DEBUG:synthtool:Running: docker run --rm -v/home/kbuilder/.cache/synthtool/google-api-ruby-client:/workspace -v/var/run/docker.sock:/var/run/docker.sock -w /workspace --entrypoint script/synth.rb gcr.io/cloud-devrel-kokoro-resources/yoshi-ruby/autosynth run v1alpha1 bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. The dependency jruby-openssl (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for java. To add those platforms to the bundle, run `bundle lock --add-platform java`. Fetching gem metadata from https://rubygems.org/......... Fetching gem metadata from https://rubygems.org/. Resolving dependencies... Fetching rake 11.3.0 Installing rake 11.3.0 Fetching concurrent-ruby 1.1.7 Installing concurrent-ruby 1.1.7 Fetching i18n 1.8.7 Installing i18n 1.8.7 Fetching minitest 5.14.3 Installing minitest 5.14.3 Fetching tzinfo 2.0.4 Installing tzinfo 2.0.4 Fetching zeitwerk 2.4.2 Installing zeitwerk 2.4.2 Fetching activesupport 6.1.1 Installing activesupport 6.1.1 Fetching public_suffix 4.0.6 Installing public_suffix 4.0.6 Fetching addressable 2.7.0 Installing addressable 2.7.0 Fetching ast 2.4.1 Installing ast 2.4.1 Using bundler 2.1.4 Fetching byebug 11.1.3 Installing byebug 11.1.3 with native extensions Fetching coderay 1.1.3 Installing coderay 1.1.3 Fetching json 2.5.1 Installing json 2.5.1 with native extensions Fetching docile 1.3.4 Installing docile 1.3.4 Fetching simplecov-html 0.10.2 Installing simplecov-html 0.10.2 Fetching simplecov 0.16.1 Installing simplecov 0.16.1 Using sync 0.5.0 Fetching tins 1.26.0 Installing tins 1.26.0 Fetching term-ansicolor 1.7.1 Installing term-ansicolor 1.7.1 Fetching thor 0.20.3 Installing thor 0.20.3 Fetching coveralls 0.8.23 Installing coveralls 0.8.23 Fetching rexml 3.2.4 Installing rexml 3.2.4 Fetching crack 0.4.5 Installing crack 0.4.5 Fetching declarative 0.0.20 Installing declarative 0.0.20 Fetching declarative-option 0.1.0 Installing declarative-option 0.1.0 Fetching diff-lcs 1.4.4 Installing diff-lcs 1.4.4 Fetching dotenv 2.7.6 Installing dotenv 2.7.6 Fetching fakefs 0.20.1 Installing fakefs 0.20.1 Fetching faraday-net_http 1.0.0 Installing faraday-net_http 1.0.0 Fetching multipart-post 2.1.1 Installing multipart-post 2.1.1 Fetching ruby2_keywords 0.0.2 Installing ruby2_keywords 0.0.2 Fetching faraday 1.3.0 Installing faraday 1.3.0 Fetching gems 1.2.0 Installing gems 1.2.0 Fetching github-markup 1.7.0 Installing github-markup 1.7.0 Fetching jwt 2.2.2 Installing jwt 2.2.2 Fetching memoist 0.16.2 Installing memoist 0.16.2 Fetching multi_json 1.15.0 Installing multi_json 1.15.0 Fetching os 0.9.6 Installing os 0.9.6 Fetching signet 0.14.0 Installing signet 0.14.0 Fetching googleauth 0.14.0 Installing googleauth 0.14.0 Fetching httpclient 2.8.3 Installing httpclient 2.8.3 Fetching mini_mime 1.0.2 Installing mini_mime 1.0.2 Fetching uber 0.1.0 Installing uber 0.1.0 Fetching representable 3.0.4 Installing representable 3.0.4 Fetching retriable 3.1.2 Installing retriable 3.1.2 Fetching google-apis-core 0.2.0 Installing google-apis-core 0.2.0 Fetching google-apis-discovery_v1 0.1.0 Installing google-apis-discovery_v1 0.1.0 Using google-apis-generator 0.1.1 from source at `.` Fetching google-id-token 1.4.2 Installing google-id-token 1.4.2 Fetching hashdiff 1.0.1 Installing hashdiff 1.0.1 Fetching mime-types-data 3.2020.1104 Installing mime-types-data 3.2020.1104 Fetching mime-types 3.3.1 Installing mime-types 3.3.1 Fetching multi_xml 0.6.0 Installing multi_xml 0.6.0 Fetching httparty 0.18.1 Installing httparty 0.18.1 Fetching rspec-support 3.10.1 Installing rspec-support 3.10.1 Fetching rspec-core 3.10.1 Installing rspec-core 3.10.1 Fetching rspec-expectations 3.10.1 Installing rspec-expectations 3.10.1 Fetching rspec-mocks 3.10.1 Installing rspec-mocks 3.10.1 Fetching rspec 3.10.0 Installing rspec 3.10.0 Fetching json_spec 1.1.5 Installing json_spec 1.1.5 Fetching launchy 2.5.0 Installing launchy 2.5.0 Fetching little-plugger 1.1.4 Installing little-plugger 1.1.4 Fetching logging 2.3.0 Installing logging 2.3.0 Fetching method_source 1.0.0 Installing method_source 1.0.0 Fetching opencensus 0.5.0 Installing opencensus 0.5.0 Fetching parallel 1.20.1 Installing parallel 1.20.1 Fetching parser 2.7.2.0 Installing parser 2.7.2.0 Fetching powerpack 0.1.3 Installing powerpack 0.1.3 Fetching pry 0.13.1 Installing pry 0.13.1 Fetching pry-byebug 3.9.0 Installing pry-byebug 3.9.0 Fetching yard 0.9.26 Installing yard 0.9.26 Fetching pry-doc 0.13.5 Installing pry-doc 0.13.5 Fetching rainbow 2.2.2 Installing rainbow 2.2.2 with native extensions Fetching redcarpet 3.5.1 Installing redcarpet 3.5.1 with native extensions Fetching redis 3.3.5 Installing redis 3.3.5 Fetching rmail 1.1.4 Installing rmail 1.1.4 Fetching ruby-progressbar 1.11.0 Installing ruby-progressbar 1.11.0 Fetching unicode-display_width 1.7.0 Installing unicode-display_width 1.7.0 Fetching rubocop 0.49.1 Installing rubocop 0.49.1 Fetching webmock 2.3.2 Installing webmock 2.3.2 Bundle complete! 25 Gemfile dependencies, 81 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from i18n: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. But that may break your application. If you are upgrading your Rails application from an older version of Rails: Please check your Rails app for 'config.i18n.fallbacks = true'. If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 'config.i18n.fallbacks = [I18n.default_locale]'. If not, fallbacks will be broken in your app by I18n 1.1.x. If you are starting a NEW Rails application, you can ignore this notice. For more info see: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 Post-install message from httparty: When you HTTParty, you must party hard! echo a | bundle exec bin/generate-api gen /workspace/generated --api=run.v1alpha1 --names=/workspace/api_names.yaml --names-out=/workspace/api_names_out.yaml --spot-check Loading run, version v1alpha1 from https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/master/discoveries/run.v1alpha1.json identical /workspace/api_names_out.yaml 2021-01-09 03:19:45,865 synthtool [DEBUG] > Wrote metadata to generated/google-apis-run_v1alpha1/synth.metadata. DEBUG:synthtool:Wrote metadata to generated/google-apis-run_v1alpha1/synth.metadata. ``` </details> Full log will be available here: https://source.cloud.google.com/results/invocations/2fec3e68-c8da-44a7-8bac-3218258fd2a0/targets - [ ] To automatically regenerate this PR, check this box.
2021-01-09 11:32:03 +00:00
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module RetailV2beta
# Retail API
#
# Cloud Retail service enables customers to build end-to-end personalized
# recommendation systems without requiring a high level of expertise in machine
# learning, recommendation system, or Google Cloud.
#
# @example
# require 'google/apis/retail_v2beta'
#
# Retail = Google::Apis::RetailV2beta # Alias the module
# service = Retail::CloudRetailService.new
#
# @see https://cloud.google.com/recommendations
class CloudRetailService < Google::Apis::Core::BaseService
# @return [String]
# API key. Your API key identifies your project and provides you with API access,
# quota, and reports. Required unless you provide an OAuth 2.0 token.
attr_accessor :key
# @return [String]
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
attr_accessor :quota_user
def initialize
super('https://retail.googleapis.com/', '',
client_name: 'google-apis-retail_v2beta',
client_version: Google::Apis::RetailV2beta::GEM_VERSION)
@batch_path = 'batch'
end
# Lists all the Catalogs associated with the project.
# @param [String] parent
# Required. The account resource name with an associated location. If the caller
# does not have permission to list Catalogs under this location, regardless of
# whether or not this location exists, a PERMISSION_DENIED error is returned.
# @param [Fixnum] page_size
# 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.
# @param [String] page_token
# 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaListCatalogsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaListCatalogsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_location_catalogs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+parent}/catalogs', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaListCatalogsResponse::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaListCatalogsResponse
command.params['parent'] = parent unless parent.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Updates the Catalogs.
# @param [String] name
# Required. Immutable. The fully qualified resource name of the catalog.
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog] google_cloud_retail_v2beta_catalog_object
# @param [String] update_mask
# Indicates which fields in the provided Catalog to update. If not set, will
# only update the Catalog.product_level_config field, which is also the only
# currently supported field to update. If an unsupported or unknown field is
# provided, an INVALID_ARGUMENT error is returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def patch_project_location_catalog(name, google_cloud_retail_v2beta_catalog_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v2beta/{+name}', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog::Representation
command.request_object = google_cloud_retail_v2beta_catalog_object
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCatalog
command.params['name'] = name unless name.nil?
command.query['updateMask'] = update_mask unless update_mask.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this method
# to poll the operation result at intervals as recommended by the API service.
# @param [String] name
# The name of the operation resource.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_catalog_branch_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Creates a Product.
# @param [String] parent
# Required. The parent catalog resource name, such as `projects/*/locations/
# global/catalogs/default_catalog/branches/default_branch`.
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct] google_cloud_retail_v2beta_product_object
# @param [String] product_id
# Required. The ID to use for the Product, which will become the final component
# of the Product.name. If the caller does not have permission to create the
# Product, regardless of whether or not it exists, a PERMISSION_DENIED error is
# returned. This field must be unique among all Products with the same parent.
# Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8
# encoded string with a length limit of 128 characters. Otherwise, an
# INVALID_ARGUMENT error is returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def create_project_location_catalog_branch_product(parent, google_cloud_retail_v2beta_product_object = nil, product_id: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/products', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct::Representation
command.request_object = google_cloud_retail_v2beta_product_object
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct
command.params['parent'] = parent unless parent.nil?
command.query['productId'] = product_id unless product_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes a Product.
# @param [String] name
# Required. Full resource name of Product, such as `projects/*/locations/global/
# catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
# the caller does not have permission to delete the Product, regardless of
# whether or not it exists, a PERMISSION_DENIED error is returned. If the
# Product to delete does not exist, a NOT_FOUND error is returned. The Product
# to delete can neither be a Product.Type.COLLECTION Product member nor a
# Product.Type.PRIMARY Product with more than one variants. Otherwise, an
# INVALID_ARGUMENT error is returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleProtobufEmpty] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleProtobufEmpty]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:delete, 'v2beta/{+name}', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleProtobufEmpty::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleProtobufEmpty
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets a Product.
# @param [String] name
# Required. Full resource name of Product, such as `projects/*/locations/global/
# catalogs/default_catalog/branches/default_branch/products/some_product_id`. If
# the caller does not have permission to access the Product, regardless of
# whether or not it exists, a PERMISSION_DENIED error is returned. If the
# requested Product does not exist, a NOT_FOUND error is returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_catalog_branch_product(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Bulk import of multiple Products. Request processing may be synchronous. No
# partial updating is supported. Non-existing items are created. Note that it is
# possible for a subset of the Products to be successfully updated.
# @param [String] parent
# Required. `projects/1234/locations/global/catalogs/default_catalog/branches/
# default_branch` If no updateMask is specified, requires products.create
# permission. If updateMask is specified, requires products.update permission.
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImportProductsRequest] google_cloud_retail_v2beta_import_products_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def import_project_location_catalog_branch_product(parent, google_cloud_retail_v2beta_import_products_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/products:import', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImportProductsRequest::Representation
command.request_object = google_cloud_retail_v2beta_import_products_request_object
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Updates a Product.
# @param [String] name
# Immutable. Full resource name of the product, such as `projects/*/locations/
# global/catalogs/default_catalog/branches/default_branch/products/product_id`.
# The branch ID must be "default_branch".
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct] google_cloud_retail_v2beta_product_object
# @param [Boolean] allow_missing
# If set to true, and the Product is not found, a new Product will be created.
# In this situation, `update_mask` is ignored.
# @param [String] update_mask
# Indicates which fields in the provided Product to update. The immutable and
# output only fields are NOT supported. If not set, all supported fields (the
# fields that are neither immutable nor output only) are updated. If an
# unsupported or unknown field is provided, an INVALID_ARGUMENT error is
# returned.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def patch_project_location_catalog_branch_product(name, google_cloud_retail_v2beta_product_object = nil, allow_missing: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:patch, 'v2beta/{+name}', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct::Representation
command.request_object = google_cloud_retail_v2beta_product_object
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct
command.params['name'] = name unless name.nil?
command.query['allowMissing'] = allow_missing unless allow_missing.nil?
command.query['updateMask'] = update_mask unless update_mask.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this method
# to poll the operation result at intervals as recommended by the API service.
# @param [String] name
# The name of the operation resource.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_catalog_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists operations that match the specified filter in the request. If the server
# doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
# binding allows API services to override the binding to use different resource
# name schemes, such as `users/*/operations`. To override the binding, API
# services can add a binding such as `"/v1/`name=users/*`/operations"` to their
# service configuration. For backwards compatibility, the default name includes
# the operations collection id, however overriding users must ensure the name
# binding is the parent resource, without the operations collection id.
# @param [String] name
# The name of the operation's parent resource.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_location_catalog_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}/operations', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Makes a recommendation prediction.
# @param [String] placement
# Required. Full resource name of the format: `name=projects/*/locations/global/
# catalogs/default_catalog/placements/*` The id of the recommendation engine
# placement. This id is used to identify the set of models that will be used to
# make the prediction. We currently support three placements with the following
# IDs by default: * `shopping_cart`: Predicts products frequently bought
# together with one or more products in the same shopping session. Commonly
# displayed after `add-to-cart` events, on product detail pages, or on the
# shopping cart page. * `home_page`: Predicts the next product that a user will
# most likely engage with or purchase based on the shopping or viewing history
# of the specified `userId` or `visitorId`. For example - Recommendations for
# you. * `product_detail`: Predicts the next product that a user will most
# likely engage with or purchase. The prediction is based on the shopping or
# viewing history of the specified `userId` or `visitorId` and its relevance to
# a specified `CatalogItem`. Typically used on product detail pages. For example
# - More products like this. * `recently_viewed_default`: Returns up to 75
# products recently viewed by the specified `userId` or `visitorId`, most recent
# ones first. Returns nothing if neither of them has viewed any products yet.
# For example - Recently viewed. The full list of available placements can be
# seen at https://console.cloud.google.com/recommendation/catalogs/
# default_catalog/placements
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictRequest] google_cloud_retail_v2beta_predict_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def predict_project_location_catalog_placement(placement, google_cloud_retail_v2beta_predict_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+placement}:predict', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictRequest::Representation
command.request_object = google_cloud_retail_v2beta_predict_request_object
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictResponse::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPredictResponse
command.params['placement'] = placement unless placement.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Writes a single user event from the browser. This uses a GET request to due to
# browser restriction of POST-ing to a 3rd party domain. This method is used
# only by the Retail API JavaScript pixel and Google Tag Manager. Users should
# not call this method directly.
# @param [String] parent
# Required. The parent catalog name, such as `projects/1234/locations/global/
# catalogs/default_catalog`.
# @param [Fixnum] ets
# The event timestamp in milliseconds. This prevents browser caching of
# otherwise identical get requests. The name is abbreviated to reduce the
# payload bytes.
# @param [String] uri
# The URL including cgi-parameters but excluding the hash fragment with a length
# limit of 5,000 characters. This is often more useful than the referer URL,
# because many browsers only send the domain for 3rd party requests.
# @param [String] user_event
# Required. URL encoded UserEvent proto with a length limit of 2,000,000
# characters.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleApiHttpBody] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleApiHttpBody]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def collect_project_location_catalog_user_event(parent, ets: nil, uri: nil, user_event: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+parent}/userEvents:collect', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleApiHttpBody::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleApiHttpBody
command.params['parent'] = parent unless parent.nil?
command.query['ets'] = ets unless ets.nil?
command.query['uri'] = uri unless uri.nil?
command.query['userEvent'] = user_event unless user_event.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Bulk import of User events. Request processing might be synchronous. Events
# that already exist are skipped. Use this method for backfilling historical
# user events. Operation.response is of type ImportResponse. Note that it is
# possible for a subset of the items to be successfully inserted. Operation.
# metadata is of type ImportMetadata.
# @param [String] parent
# Required. `projects/1234/locations/global/catalogs/default_catalog`
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImportUserEventsRequest] google_cloud_retail_v2beta_import_user_events_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def import_project_location_catalog_user_event(parent, google_cloud_retail_v2beta_import_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/userEvents:import', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImportUserEventsRequest::Representation
command.request_object = google_cloud_retail_v2beta_import_user_events_request_object
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Deletes permanently all user events specified by the filter provided.
# Depending on the number of events specified by the filter, this operation
# could take hours or days to complete. To test a filter, use the list command
# first.
# @param [String] parent
# Required. The resource name of the catalog under which the events are created.
# The format is `projects/$`projectId`/locations/global/catalogs/$`catalogId``
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPurgeUserEventsRequest] google_cloud_retail_v2beta_purge_user_events_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def purge_project_location_catalog_user_event(parent, google_cloud_retail_v2beta_purge_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/userEvents:purge', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPurgeUserEventsRequest::Representation
command.request_object = google_cloud_retail_v2beta_purge_user_events_request_object
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Triggers a user event rejoin operation with latest product catalog. Events
# will not be annotated with detailed product information if product is missing
# from the catalog at the time the user event is ingested, and these events are
# stored as unjoined events with a limited usage on training and serving. This
# API can be used to trigger a 'join' operation on specified events with latest
# version of product catalog. It can also be used to correct events joined with
# wrong product catalog.
# @param [String] parent
# Required. The parent catalog resource name, such as `projects/1234/locations/
# global/catalogs/default_catalog`.
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRejoinUserEventsRequest] google_cloud_retail_v2beta_rejoin_user_events_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def rejoin_project_location_catalog_user_event(parent, google_cloud_retail_v2beta_rejoin_user_events_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/userEvents:rejoin', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaRejoinUserEventsRequest::Representation
command.request_object = google_cloud_retail_v2beta_rejoin_user_events_request_object
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Writes a single user event.
# @param [String] parent
# Required. The parent catalog resource name, such as `projects/1234/locations/
# global/catalogs/default_catalog`.
# @param [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent] google_cloud_retail_v2beta_user_event_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def write_project_location_catalog_user_event(parent, google_cloud_retail_v2beta_user_event_object = nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:post, 'v2beta/{+parent}/userEvents:write', options)
command.request_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent::Representation
command.request_object = google_cloud_retail_v2beta_user_event_object
command.response_representation = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleCloudRetailV2betaUserEvent
command.params['parent'] = parent unless parent.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Gets the latest state of a long-running operation. Clients can use this method
# to poll the operation result at intervals as recommended by the API service.
# @param [String] name
# The name of the operation resource.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningOperation] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningOperation]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningOperation::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningOperation
command.params['name'] = name unless name.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
# Lists operations that match the specified filter in the request. If the server
# doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
# binding allows API services to override the binding to use different resource
# name schemes, such as `users/*/operations`. To override the binding, API
# services can add a binding such as `"/v1/`name=users/*`/operations"` to their
# service configuration. For backwards compatibility, the default name includes
# the operations collection id, however overriding users must ensure the name
# binding is the parent resource, without the operations collection id.
# @param [String] name
# The name of the operation's parent resource.
# @param [String] filter
# The standard list filter.
# @param [Fixnum] page_size
# The standard list page size.
# @param [String] page_token
# The standard list page token.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v2beta/{+name}/operations', options)
command.response_representation = Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse::Representation
command.response_class = Google::Apis::RetailV2beta::GoogleLongrunningListOperationsResponse
command.params['name'] = name unless name.nil?
command.query['filter'] = filter unless filter.nil?
command.query['pageSize'] = page_size unless page_size.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
end
end
end
end
end