# frozen_string_literal: true # Copyright 2021 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 # # https://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. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/errors" require "google/cloud/channel/v1/service_pb" module Google module Cloud module Channel module V1 module CloudChannelService ## # Client for the CloudChannelService service. # # CloudChannelService enables Google cloud resellers and distributors to manage # their customers, channel partners, entitlements and reports. # # Using this service: # 1. Resellers or distributors can manage a customer entity. # 2. Distributors can register an authorized reseller in their channel and then # enable delegated admin access for the reseller. # 3. Resellers or distributors can manage entitlements for their customers. # # The service primarily exposes the following resources: # - {::Google::Cloud::Channel::V1::Customer Customer}s: A Customer represents an entity managed by a reseller or # distributor. A customer typically represents an enterprise. In an n-tier # resale channel hierarchy, customers are generally represented as leaf nodes. # Customers primarily have an Entitlement sub-resource discussed below. # # - {::Google::Cloud::Channel::V1::Entitlement Entitlement}s: An Entitlement represents an entity which provides a # customer means to start using a service. Entitlements are created or updated # as a result of a successful fulfillment. # # - {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink}s: A ChannelPartnerLink is an entity that identifies # links between distributors and their indirect resellers in a channel. # class Client include Paths # @private attr_reader :cloud_channel_service_stub ## # Configure the CloudChannelService Client class. # # See {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration} # for a description of the configuration fields. # # ## Example # # To modify the configuration for all CloudChannelService clients: # # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Channel", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.timeout = 60.0 default_config.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.provision_cloud_identity.timeout = 60.0 default_config.rpcs.create_entitlement.timeout = 60.0 default_config.rpcs.change_parameters.timeout = 60.0 default_config.rpcs.change_renewal_settings.timeout = 60.0 default_config.rpcs.change_offer.timeout = 60.0 default_config.rpcs.start_paid_service.timeout = 60.0 default_config.rpcs.suspend_entitlement.timeout = 60.0 default_config.rpcs.cancel_entitlement.timeout = 60.0 default_config.rpcs.activate_entitlement.timeout = 60.0 default_config.rpcs.transfer_entitlements.timeout = 60.0 default_config.rpcs.transfer_entitlements_to_google.timeout = 60.0 default_config end yield @configure if block_given? @configure end ## # Configure the CloudChannelService 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 {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # Create a new CloudChannelService client object. # # ## Examples # # To create a new CloudChannelService client with the default # configuration: # # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new # # To create a new CloudChannelService client with a custom # configuration: # # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the CloudChannelService client. # @yieldparam config [Client::Configuration] # def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/channel/v1/service_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the scope and endpoint are unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.scope == Client.configure.scope && @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(String) || credentials.is_a?(Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.endpoint = @config.endpoint end @cloud_channel_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Channel::V1::CloudChannelService::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end ## # Get the associated client for long-running operations. # # @return [::Google::Cloud::Channel::V1::CloudChannelService::Operations] # attr_reader :operations_client # Service calls ## # List downstream {::Google::Cloud::Channel::V1::Customer Customer}s. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # Return Value: # List of {::Google::Cloud::Channel::V1::Customer Customer}s pertaining to the reseller or empty list if # there are none. # # @overload list_customers(request, options = nil) # Pass arguments to `list_customers` via a request object, either of type # {::Google::Cloud::Channel::V1::ListCustomersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListCustomersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_customers(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_customers` 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). # # @param parent [::String] # Required. The resource name of the reseller account from which to list customers. # The parent takes the format: accounts/\\{account_id}. # @param page_size [::Integer] # Optional. The maximum number of customers to return. The service may return fewer # than this value. If unspecified, at most 10 customers will be returned. The # maximum value is 50; values about 50 will be coerced to 50. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # Typically obtained via # {::Google::Cloud::Channel::V1::ListCustomersResponse#next_page_token ListCustomersResponse.next_page_token} of the previous # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_customers CloudChannelService.ListCustomers} call. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_customers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListCustomersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_customers.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_customers.timeout, metadata: metadata, retry_policy: @config.rpcs.list_customers.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_customers, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_customers, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Returns a requested {::Google::Cloud::Channel::V1::Customer Customer} resource. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: If the customer resource doesn't exist. Usually # the result of an invalid name parameter. # # Return Value: # {::Google::Cloud::Channel::V1::Customer Customer} resource if found, error otherwise. # # @overload get_customer(request, options = nil) # Pass arguments to `get_customer` via a request object, either of type # {::Google::Cloud::Channel::V1::GetCustomerRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::GetCustomerRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_customer(name: nil) # Pass arguments to `get_customer` 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). # # @param name [::String] # Required. The resource name of the customer to retrieve. # The name takes the format: accounts/\\{account_id}/customers/\\{customer_id} # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::Customer] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::Customer] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_customer request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetCustomerRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_customer.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_customer.timeout, metadata: metadata, retry_policy: @config.rpcs.get_customer.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :get_customer, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Confirms the existence of Cloud Identity accounts, based on the domain and # whether the Cloud Identity accounts are owned by the reseller. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * INVALID_VALUE: Invalid domain value in the request. # # Return Value: # List of {::Google::Cloud::Channel::V1::CloudIdentityCustomerAccount CloudIdentityCustomerAccount} resources for the domain. # List may be empty. # # Note: in the v1alpha1 version of the API, a NOT_FOUND error is returned if # no {::Google::Cloud::Channel::V1::CloudIdentityCustomerAccount CloudIdentityCustomerAccount} resources match the domain. # # @overload check_cloud_identity_accounts_exist(request, options = nil) # Pass arguments to `check_cloud_identity_accounts_exist` via a request object, either of type # {::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload check_cloud_identity_accounts_exist(parent: nil, domain: nil) # Pass arguments to `check_cloud_identity_accounts_exist` 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). # # @param parent [::String] # Required. The resource name of the reseller account. # The parent takes the format: accounts/\\{account_id} # @param domain [::String] # Required. Domain for which the Cloud Identity account customer is fetched. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def check_cloud_identity_accounts_exist request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.check_cloud_identity_accounts_exist.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.check_cloud_identity_accounts_exist.timeout, metadata: metadata, retry_policy: @config.rpcs.check_cloud_identity_accounts_exist.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :check_cloud_identity_accounts_exist, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new {::Google::Cloud::Channel::V1::Customer Customer} resource under the reseller or distributor # account. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: It can happen in following scenarios - # * Missing or invalid required parameters in the request. # * Domain field value doesn't match the domain specified in primary # email. # # Return Value: # If successful, the newly created {::Google::Cloud::Channel::V1::Customer Customer} resource, otherwise # returns an error. # # @overload create_customer(request, options = nil) # Pass arguments to `create_customer` via a request object, either of type # {::Google::Cloud::Channel::V1::CreateCustomerRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::CreateCustomerRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_customer(parent: nil, customer: nil) # Pass arguments to `create_customer` 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). # # @param parent [::String] # Required. The resource name of reseller account in which to create the customer. # The parent takes the format: accounts/\\{account_id} # @param customer [::Google::Cloud::Channel::V1::Customer, ::Hash] # Required. The customer to create. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::Customer] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::Customer] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def create_customer request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateCustomerRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_customer.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_customer.timeout, metadata: metadata, retry_policy: @config.rpcs.create_customer.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :create_customer, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates an existing {::Google::Cloud::Channel::V1::Customer Customer} resource belonging to the reseller or # distributor. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: No {::Google::Cloud::Channel::V1::Customer Customer} resource found for the name # specified in the request. # # Return Value: # If successful, the updated {::Google::Cloud::Channel::V1::Customer Customer} resource, otherwise returns # an error. # # @overload update_customer(request, options = nil) # Pass arguments to `update_customer` via a request object, either of type # {::Google::Cloud::Channel::V1::UpdateCustomerRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::UpdateCustomerRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_customer(customer: nil, update_mask: nil) # Pass arguments to `update_customer` 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). # # @param customer [::Google::Cloud::Channel::V1::Customer, ::Hash] # Required. New contents of the customer. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # The update mask that applies to the resource. # Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::Customer] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::Customer] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def update_customer request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateCustomerRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_customer.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "customer.name" => request.customer.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_customer.timeout, metadata: metadata, retry_policy: @config.rpcs.update_customer.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :update_customer, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes the given {::Google::Cloud::Channel::V1::Customer Customer} permanently and irreversibly. # # Possible Error Codes: # # * PERMISSION_DENIED: If the account making the request does not own # this customer. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * FAILED_PRECONDITION: If the customer has existing entitlements. # * NOT_FOUND: No {::Google::Cloud::Channel::V1::Customer Customer} resource found for the name # specified in the request. # # @overload delete_customer(request, options = nil) # Pass arguments to `delete_customer` via a request object, either of type # {::Google::Cloud::Channel::V1::DeleteCustomerRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::DeleteCustomerRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload delete_customer(name: nil) # Pass arguments to `delete_customer` 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). # # @param name [::String] # Required. The resource name of the customer to delete. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Protobuf::Empty] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def delete_customer request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::DeleteCustomerRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_customer.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_customer.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_customer.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :delete_customer, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a Cloud Identity for the given customer using the customer's # information or the information provided here, if present. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the request. # * NOT_FOUND: If the customer is not found for the reseller. # * ALREADY_EXISTS: If the customer's primary email already exists. In this # case, retry after changing the customer's primary contact email. # * INTERNAL: Any non-user error related to a technical issue in the # backend. Contact Cloud Channel support in this case. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # Contact Cloud Channel support in this case. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload provision_cloud_identity(request, options = nil) # Pass arguments to `provision_cloud_identity` via a request object, either of type # {::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload provision_cloud_identity(customer: nil, cloud_identity_info: nil, user: nil, validate_only: nil) # Pass arguments to `provision_cloud_identity` 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). # # @param customer [::String] # Required. Resource name of the customer. # Format: accounts/\\{account_id}/customers/\\{customer_id} # @param cloud_identity_info [::Google::Cloud::Channel::V1::CloudIdentityInfo, ::Hash] # CloudIdentity-specific customer information. # @param user [::Google::Cloud::Channel::V1::AdminUser, ::Hash] # Admin user information. # @param validate_only [::Boolean] # If set, validate the request and preview the review, but do not actually # post it. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def provision_cloud_identity request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.provision_cloud_identity.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "customer" => request.customer } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.provision_cloud_identity.timeout, metadata: metadata, retry_policy: @config.rpcs.provision_cloud_identity.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :provision_cloud_identity, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # List {::Google::Cloud::Channel::V1::Entitlement Entitlement}s belonging to a customer. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the request. # # Return Value: # List of {::Google::Cloud::Channel::V1::Entitlement Entitlement}s belonging to the customer, or empty list if # there are none. # # @overload list_entitlements(request, options = nil) # Pass arguments to `list_entitlements` via a request object, either of type # {::Google::Cloud::Channel::V1::ListEntitlementsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListEntitlementsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_entitlements` 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). # # @param parent [::String] # Required. The resource name of the reseller's customer account for which to list # entitlements. # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id} # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 50 entitlements will be returned. # The maximum value is 100; values above 100 will be coerced to 100. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # Typically obtained via # {::Google::Cloud::Channel::V1::ListEntitlementsResponse#next_page_token ListEntitlementsResponse.next_page_token} of the previous # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_entitlements CloudChannelService.ListEntitlements} call. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_entitlements request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListEntitlementsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_entitlements.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout, metadata: metadata, retry_policy: @config.rpcs.list_entitlements.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_entitlements, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_entitlements, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # List {::Google::Cloud::Channel::V1::TransferableSku TransferableSku}s of a customer based on Cloud Identity ID or # Customer Name in the request. # # This method is used when a reseller lists the entitlements # information of a customer that is not owned. The reseller should provide # the customer's Cloud Identity ID or Customer Name. # # Possible Error Codes: # # * PERMISSION_DENIED: Appears because of one of the following - # * The customer doesn't belong to the reseller and no auth token. # * The supplied auth token is invalid. # * The reseller account making the request and the queries reseller # account are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the request. # # Return Value: # List of {::Google::Cloud::Channel::V1::TransferableSku TransferableSku} for the given customer. # # @overload list_transferable_skus(request, options = nil) # Pass arguments to `list_transferable_skus` via a request object, either of type # {::Google::Cloud::Channel::V1::ListTransferableSkusRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListTransferableSkusRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_transferable_skus(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, auth_token: nil, language_code: nil) # Pass arguments to `list_transferable_skus` 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). # # @param cloud_identity_id [::String] # Customer's Cloud Identity ID # @param customer_name [::String] # A reseller is required to create a customer and use the resource name of # the created customer here. # The customer_name takes the format: # accounts/\\{account_id}/customers/\\{customer_id} # @param parent [::String] # Required. The resource name of the reseller's account. # The parent takes the format: accounts/\\{account_id} # @param page_size [::Integer] # Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 SKUs will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # Optional. # @param page_token [::String] # A token identifying a page of results, if other than the first one. # Typically obtained via # {::Google::Cloud::Channel::V1::ListTransferableSkusResponse#next_page_token ListTransferableSkusResponse.next_page_token} of the previous # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_skus CloudChannelService.ListTransferableSkus} call. # Optional. # @param auth_token [::String] # This token is generated by the Super Admin of the resold customer to # authorize a reseller to access their Cloud Identity and purchase # entitlements on their behalf. This token can be omitted once the # authorization is generated. See https://support.google.com/a/answer/7643790 # for more details. # @param language_code [::String] # The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # Optional. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_transferable_skus request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListTransferableSkusRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_transferable_skus.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_transferable_skus.timeout, metadata: metadata, retry_policy: @config.rpcs.list_transferable_skus.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_transferable_skus, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_transferable_skus, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # List {::Google::Cloud::Channel::V1::TransferableOffer TransferableOffer}s of a customer based on Cloud Identity ID or # Customer Name in the request. # # This method is used when a reseller gets the entitlement # information of a customer that is not owned. The reseller should provide # the customer's Cloud Identity ID or Customer Name. # # Possible Error Codes: # # * PERMISSION_DENIED: Appears because of one of the following: # * If the customer doesn't belong to the reseller and no auth token or # invalid auth token is supplied. # * If the reseller account making the request and the reseller account # being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # Return Value: # List of {::Google::Cloud::Channel::V1::TransferableOffer TransferableOffer} for the given customer and SKU. # # @overload list_transferable_offers(request, options = nil) # Pass arguments to `list_transferable_offers` via a request object, either of type # {::Google::Cloud::Channel::V1::ListTransferableOffersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListTransferableOffersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_transferable_offers(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, sku: nil, language_code: nil) # Pass arguments to `list_transferable_offers` 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). # # @param cloud_identity_id [::String] # Customer's Cloud Identity ID # @param customer_name [::String] # A reseller should create a customer and use the resource name of # the created customer here. # @param parent [::String] # Required. The resource name of the reseller's account. # @param page_size [::Integer] # Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 Offers will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # A token identifying a page of results, if other than the first one. # Typically obtained via # {::Google::Cloud::Channel::V1::ListTransferableOffersResponse#next_page_token ListTransferableOffersResponse.next_page_token} of the previous # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_offers CloudChannelService.ListTransferableOffers} call. # @param sku [::String] # Required. SKU for which the Offers are being looked up. # @param language_code [::String] # The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_transferable_offers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListTransferableOffersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_transferable_offers.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_transferable_offers.timeout, metadata: metadata, retry_policy: @config.rpcs.list_transferable_offers.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_transferable_offers, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_transferable_offers, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Returns a requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: If the entitlement is not found for the customer. # # Return Value: # If found, the requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource, otherwise returns # an error. # # @overload get_entitlement(request, options = nil) # Pass arguments to `get_entitlement` via a request object, either of type # {::Google::Cloud::Channel::V1::GetEntitlementRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::GetEntitlementRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_entitlement(name: nil) # Pass arguments to `get_entitlement` 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). # # @param name [::String] # Required. The resource name of the entitlement to retrieve. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{id} # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::Entitlement] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::Entitlement] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_entitlement request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetEntitlementRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_entitlement.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout, metadata: metadata, retry_policy: @config.rpcs.get_entitlement.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :get_entitlement, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates an entitlement for a customer. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: It can happen in below scenarios - # * Missing or invalid required parameters in the request. # * Cannot purchase an entitlement if there is already an entitlement for # customer, for a SKU from the same product family. # * INVALID_VALUE: Offer passed in isn't valid. Make sure OfferId is # valid. If it is valid, then contact Google Channel support for further # troubleshooting. # * NOT_FOUND: If the customer or offer resource is not found for the # reseller. # * ALREADY_EXISTS: This failure can happen in the following cases: # * If the SKU has been already purchased for the customer. # * If the customer's primary email already exists. In this case retry # after changing the customer's primary contact email. # * CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can happen in the # following cases: # * Purchasing a SKU that requires domain verification and the domain has # not been verified. # * Purchasing an Add-On SKU like Vault or Drive without purchasing the # pre-requisite SKU, such as Google Workspace Business Starter. # * Applicable only for developer accounts: reseller and resold domain. # Must meet the following domain naming requirements: # * Domain names must start with goog-test. # * Resold domain names must include the reseller domain. # * INTERNAL: Any non-user error related to a technical issue in the # backend. Contact Cloud Channel Support in this case. # * UNKNOWN: Any non-user error related to a technical issue in the # backend. Contact Cloud Channel Support in this case. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload create_entitlement(request, options = nil) # Pass arguments to `create_entitlement` via a request object, either of type # {::Google::Cloud::Channel::V1::CreateEntitlementRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::CreateEntitlementRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_entitlement(parent: nil, entitlement: nil, request_id: nil) # Pass arguments to `create_entitlement` 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). # # @param parent [::String] # Required. The resource name of reseller's customer account in which to create the # entitlement. # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id} # @param entitlement [::Google::Cloud::Channel::V1::Entitlement, ::Hash] # Required. The entitlement to create. # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def create_entitlement request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateEntitlementRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_entitlement.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_entitlement.timeout, metadata: metadata, retry_policy: @config.rpcs.create_entitlement.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :create_entitlement, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Change parameters of the entitlement # # An entitlement parameters update is a long-running operation and results in # updates to the entitlement as a result of fulfillment. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. For example, if the number of seats being changed to is greater # than the allowed number of max seats for the resource. Or decreasing seats # for a commitment based plan. # * NOT_FOUND: Entitlement resource not found. # * INTERNAL: Any non-user error related to a technical issue # in the backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload change_parameters(request, options = nil) # Pass arguments to `change_parameters` via a request object, either of type # {::Google::Cloud::Channel::V1::ChangeParametersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ChangeParametersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload change_parameters(name: nil, parameters: nil, request_id: nil, purchase_order_id: nil) # Pass arguments to `change_parameters` 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). # # @param name [::String] # Required. The name of the entitlement to update. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>] # Required. Entitlement parameters to update. Only editable parameters are allowed to # be changed. # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be # a valid [UUID](https://tools.ietf.org/html/rfc4122) with the exception that # zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # @param purchase_order_id [::String] # Optional. Purchase order ID provided by the reseller. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def change_parameters request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeParametersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.change_parameters.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.change_parameters.timeout, metadata: metadata, retry_policy: @config.rpcs.change_parameters.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :change_parameters, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the renewal settings for an existing customer entitlement. # # An entitlement update is a long-running operation and results in updates to # the entitlement as a result of fulfillment. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Entitlement resource not found. # * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a # commitment plan. Can't enable or disable renewal for non-commitment plans. # * INTERNAL: Any non user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload change_renewal_settings(request, options = nil) # Pass arguments to `change_renewal_settings` via a request object, either of type # {::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload change_renewal_settings(name: nil, renewal_settings: nil, request_id: nil) # Pass arguments to `change_renewal_settings` 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). # # @param name [::String] # Required. The name of the entitlement to update. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param renewal_settings [::Google::Cloud::Channel::V1::RenewalSettings, ::Hash] # Required. New renewal settings. # @param request_id [::String] # Optional. A request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def change_renewal_settings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.change_renewal_settings.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.change_renewal_settings.timeout, metadata: metadata, retry_policy: @config.rpcs.change_renewal_settings.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :change_renewal_settings, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the Offer for an existing customer entitlement. # # An entitlement update is a long-running operation and results in updates to # the entitlement as a result of fulfillment. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Offer or Entitlement resource not found. # * INTERNAL: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload change_offer(request, options = nil) # Pass arguments to `change_offer` via a request object, either of type # {::Google::Cloud::Channel::V1::ChangeOfferRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ChangeOfferRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload change_offer(name: nil, offer: nil, parameters: nil, purchase_order_id: nil, request_id: nil) # Pass arguments to `change_offer` 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). # # @param name [::String] # Required. The name of the entitlement to update. # Format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param offer [::String] # Required. New Offer. # Format: accounts/\\{account_id}/offers/\\{offer_id}. # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>] # Optional. Parameters needed to purchase the Offer. # @param purchase_order_id [::String] # Optional. Purchase order id provided by the reseller. # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def change_offer request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeOfferRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.change_offer.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.change_offer.timeout, metadata: metadata, retry_policy: @config.rpcs.change_offer.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :change_offer, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Starts paid service for a trial entitlement. # # Starts paid service for a trial entitlement immediately. This method is # only applicable if a plan has already been set up for a trial entitlement # but has some trial days remaining. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Entitlement resource not found. # * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for # entitlement on trial plans. # * INTERNAL: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue # in the backend. In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload start_paid_service(request, options = nil) # Pass arguments to `start_paid_service` via a request object, either of type # {::Google::Cloud::Channel::V1::StartPaidServiceRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::StartPaidServiceRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload start_paid_service(name: nil, request_id: nil) # Pass arguments to `start_paid_service` 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). # # @param name [::String] # Required. The name of the entitlement for which paid service is being started. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def start_paid_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::StartPaidServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.start_paid_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.start_paid_service.timeout, metadata: metadata, retry_policy: @config.rpcs.start_paid_service.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :start_paid_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Suspends a previously fulfilled entitlement. # An entitlement suspension is a long-running operation. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Entitlement resource not found. # * NOT_ACTIVE: Entitlement is not active. # * INTERNAL: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload suspend_entitlement(request, options = nil) # Pass arguments to `suspend_entitlement` via a request object, either of type # {::Google::Cloud::Channel::V1::SuspendEntitlementRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::SuspendEntitlementRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload suspend_entitlement(name: nil, request_id: nil) # Pass arguments to `suspend_entitlement` 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). # # @param name [::String] # Required. The resource name of the entitlement to suspend. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def suspend_entitlement request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::SuspendEntitlementRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.suspend_entitlement.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.suspend_entitlement.timeout, metadata: metadata, retry_policy: @config.rpcs.suspend_entitlement.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :suspend_entitlement, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Cancels a previously fulfilled entitlement. # An entitlement cancellation is a long-running operation. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller or # if the reseller account making the request and reseller account being # queried for are different. # * FAILED_PRECONDITION: If there are any Google Cloud projects linked to the # Google Cloud entitlement's Cloud Billing subaccount. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Entitlement resource not found. # * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace # add-ons or entitlements for Google Cloud's development platform. # * INTERNAL: Any non-user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The response will contain # google.protobuf.Empty on success. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload cancel_entitlement(request, options = nil) # Pass arguments to `cancel_entitlement` via a request object, either of type # {::Google::Cloud::Channel::V1::CancelEntitlementRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::CancelEntitlementRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload cancel_entitlement(name: nil, request_id: nil) # Pass arguments to `cancel_entitlement` 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). # # @param name [::String] # Required. The resource name of the entitlement to cancel. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def cancel_entitlement request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CancelEntitlementRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.cancel_entitlement.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.cancel_entitlement.timeout, metadata: metadata, retry_policy: @config.rpcs.cancel_entitlement.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :cancel_entitlement, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Activates a previously suspended entitlement. The entitlement must be in a # suspended state for it to be activated. Entitlements suspended for pending # ToS acceptance can't be activated using this method. An entitlement # activation is a long-running operation and can result in updates to # the state of the customer entitlement. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller or # if the reseller account making the request and reseller account being # queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: Entitlement resource not found. # * SUSPENSION_NOT_RESELLER_INITIATED: Can't activate an # entitlement that is pending TOS acceptance. Only reseller initiated # suspensions can be activated. # * NOT_SUSPENDED: Can't activate entitlements that are already in ACTIVE # state. Can only activate suspended entitlements. # * INTERNAL: Any non-user error related to a technical issue # in the backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload activate_entitlement(request, options = nil) # Pass arguments to `activate_entitlement` via a request object, either of type # {::Google::Cloud::Channel::V1::ActivateEntitlementRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ActivateEntitlementRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload activate_entitlement(name: nil, request_id: nil) # Pass arguments to `activate_entitlement` 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). # # @param name [::String] # Required. The resource name of the entitlement to activate. # The name takes the format: # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id} # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def activate_entitlement request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ActivateEntitlementRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.activate_entitlement.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.activate_entitlement.timeout, metadata: metadata, retry_policy: @config.rpcs.activate_entitlement.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :activate_entitlement, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Transfers customer entitlements to new reseller. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the request. # * NOT_FOUND: If the customer or offer resource is not found for the # reseller. # * ALREADY_EXISTS: If the SKU has been already transferred for the customer. # * CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can happen in the # following cases: # * Transferring a SKU that requires domain verification and the domain # has not been verified. # * Transferring an Add-On SKU like Vault or Drive without transferring # the pre-requisite SKU, such as G Suite Basic. # * Applicable only for developer accounts: reseller and resold domain # must follow the domain naming convention as follows: # * Domain names must start with goog-test. # * Resold domain names must include the reseller domain. # * All transferring entitlements must be specified. # * INTERNAL: Any non-user error related to a technical issue in the backend. # Please contact Cloud Channel Support in this case. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # Please contact Cloud Channel Support in this case. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload transfer_entitlements(request, options = nil) # Pass arguments to `transfer_entitlements` via a request object, either of type # {::Google::Cloud::Channel::V1::TransferEntitlementsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::TransferEntitlementsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload transfer_entitlements(parent: nil, entitlements: nil, auth_token: nil, request_id: nil) # Pass arguments to `transfer_entitlements` 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). # # @param parent [::String] # Required. The resource name of reseller's customer account where the entitlements # transfer to. # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id} # @param entitlements [::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>] # Required. The new entitlements to be created or transferred. # @param auth_token [::String] # This token is generated by the Super Admin of the resold customer to # authorize a reseller to access their Cloud Identity and purchase # entitlements on their behalf. This token can be omitted once the # authorization is generated. See https://support.google.com/a/answer/7643790 # for more details. # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def transfer_entitlements request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::TransferEntitlementsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.transfer_entitlements.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.transfer_entitlements.timeout, metadata: metadata, retry_policy: @config.rpcs.transfer_entitlements.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :transfer_entitlements, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Transfers customer entitlements from current reseller to Google. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller. # * INVALID_ARGUMENT: Missing or invalid required parameters in the request. # * NOT_FOUND: If the customer or offer resource is not found for the # reseller. # * ALREADY_EXISTS: If the SKU has been already transferred for the customer. # * CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can happen in # the following cases: # * Transferring a SKU that requires domain verification and the domain # has not been verified. # * Transferring an Add-On SKU like Vault or Drive without purchasing the # pre-requisite SKU, such as G Suite Basic. # * Applicable only for developer accounts: reseller and resold domain # must follow the domain naming convention as follows: # * Domain names must start with goog-test. # * Resold domain names must include the reseller domain. # * INTERNAL: Any non-user error related to a technical issue in the backend. # Please contact Cloud Channel Support in this case. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # Please contact Cloud Channel Support in this case. # # Return Value: # Long Running Operation ID. # # To get the results of the operation, call the GetOperation method of # CloudChannelOperationsService. The response will contain # google.protobuf.Empty on success. The Operation metadata will contain an # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}. # # @overload transfer_entitlements_to_google(request, options = nil) # Pass arguments to `transfer_entitlements_to_google` via a request object, either of type # {::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload transfer_entitlements_to_google(parent: nil, entitlements: nil, request_id: nil) # Pass arguments to `transfer_entitlements_to_google` 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). # # @param parent [::String] # Required. The resource name of reseller's customer account where the entitlements # transfer from. # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id} # @param entitlements [::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>] # Required. The entitlements to be transferred to Google. # @param request_id [::String] # Optional. An optional request ID to identify requests. Specify a unique request ID so # that if you must retry your request, the server will know to ignore the # request if it has already been completed. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same # request ID, the server can check if the original operation with the same # request ID was received, and if so, will ignore the second request. # # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) # with the exception that zero UUID is not supported # (`00000000-0000-0000-0000-000000000000`). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def transfer_entitlements_to_google request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.transfer_entitlements_to_google.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.transfer_entitlements_to_google.timeout, metadata: metadata, retry_policy: @config.rpcs.transfer_entitlements_to_google.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :transfer_entitlements_to_google, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # List {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink}s belonging to a distributor. # To call this method, you must be a distributor. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # Return Value: # If successful, returns the list of {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resources # for the distributor account, otherwise returns an error. # # @overload list_channel_partner_links(request, options = nil) # Pass arguments to `list_channel_partner_links` via a request object, either of type # {::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_channel_partner_links(parent: nil, page_size: nil, page_token: nil, view: nil) # Pass arguments to `list_channel_partner_links` 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). # # @param parent [::String] # Required. The resource name of the reseller account for listing channel partner # links. # The parent takes the format: accounts/\\{account_id} # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, server will pick a default size (25). # The maximum value is 200, values above 200 will be coerced to 200. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # Typically obtained via # {::Google::Cloud::Channel::V1::ListChannelPartnerLinksResponse#next_page_token ListChannelPartnerLinksResponse.next_page_token} of the previous # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_channel_partner_links CloudChannelService.ListChannelPartnerLinks} call. # @param view [::Google::Cloud::Channel::V1::ChannelPartnerLinkView] # Optional. The level of granularity the ChannelPartnerLink will display. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_channel_partner_links request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_channel_partner_links.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_channel_partner_links.timeout, metadata: metadata, retry_policy: @config.rpcs.list_channel_partner_links.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_channel_partner_links, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_channel_partner_links, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Returns a requested {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource. # To call this method, you must be a distributor. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: ChannelPartnerLink resource not found. Results # due invalid channel partner link name. # # Return Value: # {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource if found, otherwise returns an error. # # @overload get_channel_partner_link(request, options = nil) # Pass arguments to `get_channel_partner_link` via a request object, either of type # {::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload get_channel_partner_link(name: nil, view: nil) # Pass arguments to `get_channel_partner_link` 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). # # @param name [::String] # Required. The resource name of the channel partner link to retrieve. # The name takes the format: accounts/\\{account_id}/channelPartnerLinks/\\{id} # where \\{id} is the Cloud Identity ID of the partner. # @param view [::Google::Cloud::Channel::V1::ChannelPartnerLinkView] # Optional. The level of granularity the ChannelPartnerLink will display. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def get_channel_partner_link request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_channel_partner_link.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_channel_partner_link.timeout, metadata: metadata, retry_policy: @config.rpcs.get_channel_partner_link.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :get_channel_partner_link, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Initiates a channel partner link between a distributor and a reseller or # between resellers in an n-tier reseller channel. # To accept the invite, the invited partner should follow the invite_link_uri # provided in the response. If the link creation is accepted, a valid link is # set up between the two involved parties. # To call this method, you must be a distributor. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * ALREADY_EXISTS: If the ChannelPartnerLink sent in the request already # exists. # * NOT_FOUND: If no Cloud Identity customer exists for domain provided. # * INTERNAL: Any non-user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in # the backend. In this case, contact Cloud Channel support. # # Return Value: # Newly created {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource if successful, # otherwise error is returned. # # @overload create_channel_partner_link(request, options = nil) # Pass arguments to `create_channel_partner_link` via a request object, either of type # {::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload create_channel_partner_link(parent: nil, channel_partner_link: nil) # Pass arguments to `create_channel_partner_link` 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). # # @param parent [::String] # Required. The resource name of reseller's account for which to create a channel # partner link. # The parent takes the format: accounts/\\{account_id} # @param channel_partner_link [::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash] # Required. The channel partner link to create. # Either channel_partner_link.reseller_cloud_identity_id or domain can be # used to create a link. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def create_channel_partner_link request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_channel_partner_link.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_channel_partner_link.timeout, metadata: metadata, retry_policy: @config.rpcs.create_channel_partner_link.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :create_channel_partner_link, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates a channel partner link. A distributor calls this method to change a # link's status. For example, suspend a partner link. # To call this method, you must be a distributor. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being queried for are different. # * INVALID_ARGUMENT: It can happen in following scenarios - # * Missing or invalid required parameters in the request. # * Updating link state from invited to active or suspended. # * Sending reseller_cloud_identity_id, invite_url or name in update # mask. # * NOT_FOUND: ChannelPartnerLink resource not found. # * INTERNAL: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in the backend. # In this case, contact Cloud Channel support. # # Return Value: # If successful, the updated {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource, otherwise # returns an error. # # @overload update_channel_partner_link(request, options = nil) # Pass arguments to `update_channel_partner_link` via a request object, either of type # {::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload update_channel_partner_link(name: nil, channel_partner_link: nil, update_mask: nil) # Pass arguments to `update_channel_partner_link` 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). # # @param name [::String] # Required. The resource name of the channel partner link to cancel. # The name takes the format: accounts/\\{account_id}/channelPartnerLinks/\\{id} # where \\{id} is the Cloud Identity ID of the partner. # @param channel_partner_link [::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash] # Required. The channel partner link to update. Only field # channel_partner_link.link_state is allowed to be updated. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. The update mask that applies to the resource. # The only allowable value for update mask is # channel_partner_link.link_state. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def update_channel_partner_link request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_channel_partner_link.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_channel_partner_link.timeout, metadata: metadata, retry_policy: @config.rpcs.update_channel_partner_link.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :update_channel_partner_link, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the Products the reseller is authorized to sell. # # Possible Error Codes: # # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # @overload list_products(request, options = nil) # Pass arguments to `list_products` via a request object, either of type # {::Google::Cloud::Channel::V1::ListProductsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListProductsRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_products(account: nil, page_size: nil, page_token: nil, language_code: nil) # Pass arguments to `list_products` 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). # # @param account [::String] # Required. The resource name of the reseller account. # Format: accounts/\\{account_id}. # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 Products will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # @param language_code [::String] # Optional. The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_products request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListProductsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_products.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_products.timeout, metadata: metadata, retry_policy: @config.rpcs.list_products.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_products, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_products, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the SKUs for a product the reseller is authorized to sell. # # Possible Error Codes: # # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # @overload list_skus(request, options = nil) # Pass arguments to `list_skus` via a request object, either of type # {::Google::Cloud::Channel::V1::ListSkusRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListSkusRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_skus(parent: nil, account: nil, page_size: nil, page_token: nil, language_code: nil) # Pass arguments to `list_skus` 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). # # @param parent [::String] # Required. The resource name of the Product for which to list SKUs. # The parent takes the format: products/\\{product_id}. # Supports products/- to retrieve SKUs for all products. # @param account [::String] # Required. Resource name of the reseller. # Format: accounts/\\{account_id}. # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 SKUs will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # Optional. # @param language_code [::String] # Optional. The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_skus request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListSkusRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_skus.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_skus.timeout, metadata: metadata, retry_policy: @config.rpcs.list_skus.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_skus, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_skus, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the Offers the reseller can sell. # # Possible Error Codes: # # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # @overload list_offers(request, options = nil) # Pass arguments to `list_offers` via a request object, either of type # {::Google::Cloud::Channel::V1::ListOffersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListOffersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, language_code: nil) # Pass arguments to `list_offers` 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). # # @param parent [::String] # Required. The resource name of the reseller account from which to list Offers. # The parent takes the format: accounts/\\{account_id}. # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 500 Offers will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # @param filter [::String] # Optional. The expression to filter results by name (name of # the Offer), sku.name (name of the SKU) or sku.product.name (name of the # Product). # Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1 # Example 2: name=accounts/a1/offers/o1 # @param language_code [::String] # Optional. The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_offers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListOffersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_offers.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_offers.timeout, metadata: metadata, retry_policy: @config.rpcs.list_offers.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_offers, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_offers, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the Purchasable SKUs for following cases: # # * SKUs that can be newly purchased for a customer # * SKUs that can be upgraded/downgraded to, for an entitlement. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # @overload list_purchasable_skus(request, options = nil) # Pass arguments to `list_purchasable_skus` via a request object, either of type # {::Google::Cloud::Channel::V1::ListPurchasableSkusRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_purchasable_skus(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) # Pass arguments to `list_purchasable_skus` 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). # # @param create_entitlement_purchase [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::CreateEntitlementPurchase, ::Hash] # List SKUs for CreateEntitlement purchase. # @param change_offer_purchase [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::ChangeOfferPurchase, ::Hash] # List SKUs for ChangeOffer purchase with a new SKU. # @param customer [::String] # Required. The resource name of the customer for which to list SKUs. # Format: accounts/\\{account_id}/customers/\\{customer_id}. # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 SKUs will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # @param language_code [::String] # Optional. The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_purchasable_skus request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListPurchasableSkusRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_purchasable_skus.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "customer" => request.customer } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_purchasable_skus.timeout, metadata: metadata, retry_policy: @config.rpcs.list_purchasable_skus.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_purchasable_skus, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_purchasable_skus, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists the Purchasable Offers for the following cases: # # * Offers that can be newly purchased for a customer # * Offers that can be changed to, for an entitlement. # # Possible Error Codes: # # * PERMISSION_DENIED: If the customer doesn't belong to the reseller # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # # @overload list_purchasable_offers(request, options = nil) # Pass arguments to `list_purchasable_offers` via a request object, either of type # {::Google::Cloud::Channel::V1::ListPurchasableOffersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_purchasable_offers(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) # Pass arguments to `list_purchasable_offers` 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). # # @param create_entitlement_purchase [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::CreateEntitlementPurchase, ::Hash] # List Offers for CreateEntitlement purchase. # @param change_offer_purchase [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::ChangeOfferPurchase, ::Hash] # List Offers for ChangeOffer purchase. # @param customer [::String] # Required. The resource name of the customer for which to list Offers. # Format: accounts/\\{account_id}/customers/\\{customer_id}. # @param page_size [::Integer] # Optional. Requested page size. Server might return fewer results than requested. # If unspecified, at most 100 Offers will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A token identifying a page of results, if other than the first one. # @param language_code [::String] # Optional. The BCP-47 language code, such as "en-US". If specified, the # response will be localized to the corresponding language code. Default is # "en-US". # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_purchasable_offers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListPurchasableOffersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_purchasable_offers.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "customer" => request.customer } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_purchasable_offers.timeout, metadata: metadata, retry_policy: @config.rpcs.list_purchasable_offers.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_purchasable_offers, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_purchasable_offers, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Registers a service account with subscriber privileges on the Cloud Pub/Sub # topic created for this Channel Services account. Once you create a # subscriber, you will get the events as per {::Google::Cloud::Channel::V1::SubscriberEvent SubscriberEvent} # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being provided are different, or if the impersonated user # is not a super admin. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * INTERNAL: Any non-user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in # the backend. In this case, contact Cloud Channel support. # # Return Value: # Topic name with service email address registered if successful, # otherwise error is returned. # # @overload register_subscriber(request, options = nil) # Pass arguments to `register_subscriber` via a request object, either of type # {::Google::Cloud::Channel::V1::RegisterSubscriberRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::RegisterSubscriberRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload register_subscriber(account: nil, service_account: nil) # Pass arguments to `register_subscriber` 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). # # @param account [::String] # Required. Resource name of the account. # @param service_account [::String] # Required. Service account which will provide subscriber access to the # registered topic. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::RegisterSubscriberResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::RegisterSubscriberResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def register_subscriber request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::RegisterSubscriberRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.register_subscriber.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "account" => request.account } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.register_subscriber.timeout, metadata: metadata, retry_policy: @config.rpcs.register_subscriber.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :register_subscriber, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Unregisters a service account with subscriber privileges on the Cloud # Pub/Sub topic created for this Channel Services account. If there are no # more service account left with sunbscriber privileges, the topic will be # deleted. You can check this by calling ListSubscribers api. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being provided are different, or if the impersonated user # is not a super admin. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: If the topic resource doesn't exist. # * INTERNAL: Any non-user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in # the backend. In this case, contact Cloud Channel support. # # Return Value: # Topic name from which service email address has been unregistered if # successful, otherwise error is returned. If the service email was already # not associated with the topic, the success response will be returned. # # @overload unregister_subscriber(request, options = nil) # Pass arguments to `unregister_subscriber` via a request object, either of type # {::Google::Cloud::Channel::V1::UnregisterSubscriberRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::UnregisterSubscriberRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload unregister_subscriber(account: nil, service_account: nil) # Pass arguments to `unregister_subscriber` 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). # # @param account [::String] # Required. Resource name of the account. # @param service_account [::String] # Required. Service account which will be unregistered from getting subscriber access # to the topic. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::UnregisterSubscriberResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::UnregisterSubscriberResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def unregister_subscriber request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UnregisterSubscriberRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.unregister_subscriber.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "account" => request.account } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.unregister_subscriber.timeout, metadata: metadata, retry_policy: @config.rpcs.unregister_subscriber.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :unregister_subscriber, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists service accounts with subscriber privileges on the Cloud Pub/Sub # topic created for this Channel Services account. # # Possible Error Codes: # # * PERMISSION_DENIED: If the reseller account making the request and the # reseller account being provided are different, or if the account is not # a super admin. # * INVALID_ARGUMENT: Missing or invalid required parameters in the # request. # * NOT_FOUND: If the topic resource doesn't exist. # * INTERNAL: Any non-user error related to a technical issue in the # backend. In this case, contact Cloud Channel support. # * UNKNOWN: Any non-user error related to a technical issue in # the backend. In this case, contact Cloud Channel support. # # Return Value: # List of service email addresses if successful, otherwise error is # returned. # # @overload list_subscribers(request, options = nil) # Pass arguments to `list_subscribers` via a request object, either of type # {::Google::Cloud::Channel::V1::ListSubscribersRequest} or an equivalent Hash. # # @param request [::Google::Cloud::Channel::V1::ListSubscribersRequest, ::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. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # # @overload list_subscribers(account: nil, page_size: nil, page_token: nil) # Pass arguments to `list_subscribers` 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). # # @param account [::String] # Required. Resource name of the account. # @param page_size [::Integer] # Optional. The maximum number of service accounts to return. The service may return # fewer than this value. # If unspecified, at most 100 service accounts will be returned. # The maximum value is 1000; values above 1000 will be coerced to 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListSubscribers` call. # Provide this to retrieve the subsequent page. # # When paginating, all other parameters provided to `ListSubscribers` must # match the call that provided the page token. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Channel::V1::ListSubscribersResponse] # @yieldparam operation [::GRPC::ActiveCall::Operation] # # @return [::Google::Cloud::Channel::V1::ListSubscribersResponse] # # @raise [::Google::Cloud::Error] if the RPC is aborted. # def list_subscribers request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListSubscribersRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_subscribers.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Channel::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "account" => request.account } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_subscribers.timeout, metadata: metadata, retry_policy: @config.rpcs.list_subscribers.retry_policy options.apply_defaults metadata: @config.metadata, retry_policy: @config.retry_policy @cloud_channel_service_stub.call_rpc :list_subscribers, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the CloudChannelService API. # # This class represents the configuration for CloudChannelService, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # # Examples # # To modify the global config, setting the timeout for list_customers # to 20 seconds, and all remaining timeouts to 10 seconds: # # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_customers.timeout = 20.0 # end # # To apply the above configuration only to a new client: # # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_customers.timeout = 20.0 # end # # @!attribute [rw] endpoint # The hostname or hostname:port of the service endpoint. # Defaults to `"cloudchannel.googleapis.com"`. # @return [::String] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) # * (`GRPC::Core::Channel`) a gRPC channel with included credentials # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] channel_args # Extra parameters passed to the gRPC channel. Note: this is ignored if a # `GRPC::Core::Channel` object is provided as the credential. # @return [::Hash] # @!attribute [rw] interceptors # An array of interceptors that are run before calls are executed. # @return [::Array<::GRPC::ClientInterceptor>] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional gRPC headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # class Configuration extend ::Gapic::Config config_attr :endpoint, "cloudchannel.googleapis.com", ::String config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) config_attr :interceptors, nil, ::Array, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration RPC class for the CloudChannelService API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_customers` # @return [::Gapic::Config::Method] # attr_reader :list_customers ## # RPC-specific configuration for `get_customer` # @return [::Gapic::Config::Method] # attr_reader :get_customer ## # RPC-specific configuration for `check_cloud_identity_accounts_exist` # @return [::Gapic::Config::Method] # attr_reader :check_cloud_identity_accounts_exist ## # RPC-specific configuration for `create_customer` # @return [::Gapic::Config::Method] # attr_reader :create_customer ## # RPC-specific configuration for `update_customer` # @return [::Gapic::Config::Method] # attr_reader :update_customer ## # RPC-specific configuration for `delete_customer` # @return [::Gapic::Config::Method] # attr_reader :delete_customer ## # RPC-specific configuration for `provision_cloud_identity` # @return [::Gapic::Config::Method] # attr_reader :provision_cloud_identity ## # RPC-specific configuration for `list_entitlements` # @return [::Gapic::Config::Method] # attr_reader :list_entitlements ## # RPC-specific configuration for `list_transferable_skus` # @return [::Gapic::Config::Method] # attr_reader :list_transferable_skus ## # RPC-specific configuration for `list_transferable_offers` # @return [::Gapic::Config::Method] # attr_reader :list_transferable_offers ## # RPC-specific configuration for `get_entitlement` # @return [::Gapic::Config::Method] # attr_reader :get_entitlement ## # RPC-specific configuration for `create_entitlement` # @return [::Gapic::Config::Method] # attr_reader :create_entitlement ## # RPC-specific configuration for `change_parameters` # @return [::Gapic::Config::Method] # attr_reader :change_parameters ## # RPC-specific configuration for `change_renewal_settings` # @return [::Gapic::Config::Method] # attr_reader :change_renewal_settings ## # RPC-specific configuration for `change_offer` # @return [::Gapic::Config::Method] # attr_reader :change_offer ## # RPC-specific configuration for `start_paid_service` # @return [::Gapic::Config::Method] # attr_reader :start_paid_service ## # RPC-specific configuration for `suspend_entitlement` # @return [::Gapic::Config::Method] # attr_reader :suspend_entitlement ## # RPC-specific configuration for `cancel_entitlement` # @return [::Gapic::Config::Method] # attr_reader :cancel_entitlement ## # RPC-specific configuration for `activate_entitlement` # @return [::Gapic::Config::Method] # attr_reader :activate_entitlement ## # RPC-specific configuration for `transfer_entitlements` # @return [::Gapic::Config::Method] # attr_reader :transfer_entitlements ## # RPC-specific configuration for `transfer_entitlements_to_google` # @return [::Gapic::Config::Method] # attr_reader :transfer_entitlements_to_google ## # RPC-specific configuration for `list_channel_partner_links` # @return [::Gapic::Config::Method] # attr_reader :list_channel_partner_links ## # RPC-specific configuration for `get_channel_partner_link` # @return [::Gapic::Config::Method] # attr_reader :get_channel_partner_link ## # RPC-specific configuration for `create_channel_partner_link` # @return [::Gapic::Config::Method] # attr_reader :create_channel_partner_link ## # RPC-specific configuration for `update_channel_partner_link` # @return [::Gapic::Config::Method] # attr_reader :update_channel_partner_link ## # RPC-specific configuration for `list_products` # @return [::Gapic::Config::Method] # attr_reader :list_products ## # RPC-specific configuration for `list_skus` # @return [::Gapic::Config::Method] # attr_reader :list_skus ## # RPC-specific configuration for `list_offers` # @return [::Gapic::Config::Method] # attr_reader :list_offers ## # RPC-specific configuration for `list_purchasable_skus` # @return [::Gapic::Config::Method] # attr_reader :list_purchasable_skus ## # RPC-specific configuration for `list_purchasable_offers` # @return [::Gapic::Config::Method] # attr_reader :list_purchasable_offers ## # RPC-specific configuration for `register_subscriber` # @return [::Gapic::Config::Method] # attr_reader :register_subscriber ## # RPC-specific configuration for `unregister_subscriber` # @return [::Gapic::Config::Method] # attr_reader :unregister_subscriber ## # RPC-specific configuration for `list_subscribers` # @return [::Gapic::Config::Method] # attr_reader :list_subscribers # @private def initialize parent_rpcs = nil list_customers_config = parent_rpcs.list_customers if parent_rpcs.respond_to? :list_customers @list_customers = ::Gapic::Config::Method.new list_customers_config get_customer_config = parent_rpcs.get_customer if parent_rpcs.respond_to? :get_customer @get_customer = ::Gapic::Config::Method.new get_customer_config check_cloud_identity_accounts_exist_config = parent_rpcs.check_cloud_identity_accounts_exist if parent_rpcs.respond_to? :check_cloud_identity_accounts_exist @check_cloud_identity_accounts_exist = ::Gapic::Config::Method.new check_cloud_identity_accounts_exist_config create_customer_config = parent_rpcs.create_customer if parent_rpcs.respond_to? :create_customer @create_customer = ::Gapic::Config::Method.new create_customer_config update_customer_config = parent_rpcs.update_customer if parent_rpcs.respond_to? :update_customer @update_customer = ::Gapic::Config::Method.new update_customer_config delete_customer_config = parent_rpcs.delete_customer if parent_rpcs.respond_to? :delete_customer @delete_customer = ::Gapic::Config::Method.new delete_customer_config provision_cloud_identity_config = parent_rpcs.provision_cloud_identity if parent_rpcs.respond_to? :provision_cloud_identity @provision_cloud_identity = ::Gapic::Config::Method.new provision_cloud_identity_config list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config list_transferable_skus_config = parent_rpcs.list_transferable_skus if parent_rpcs.respond_to? :list_transferable_skus @list_transferable_skus = ::Gapic::Config::Method.new list_transferable_skus_config list_transferable_offers_config = parent_rpcs.list_transferable_offers if parent_rpcs.respond_to? :list_transferable_offers @list_transferable_offers = ::Gapic::Config::Method.new list_transferable_offers_config get_entitlement_config = parent_rpcs.get_entitlement if parent_rpcs.respond_to? :get_entitlement @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config create_entitlement_config = parent_rpcs.create_entitlement if parent_rpcs.respond_to? :create_entitlement @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config change_parameters_config = parent_rpcs.change_parameters if parent_rpcs.respond_to? :change_parameters @change_parameters = ::Gapic::Config::Method.new change_parameters_config change_renewal_settings_config = parent_rpcs.change_renewal_settings if parent_rpcs.respond_to? :change_renewal_settings @change_renewal_settings = ::Gapic::Config::Method.new change_renewal_settings_config change_offer_config = parent_rpcs.change_offer if parent_rpcs.respond_to? :change_offer @change_offer = ::Gapic::Config::Method.new change_offer_config start_paid_service_config = parent_rpcs.start_paid_service if parent_rpcs.respond_to? :start_paid_service @start_paid_service = ::Gapic::Config::Method.new start_paid_service_config suspend_entitlement_config = parent_rpcs.suspend_entitlement if parent_rpcs.respond_to? :suspend_entitlement @suspend_entitlement = ::Gapic::Config::Method.new suspend_entitlement_config cancel_entitlement_config = parent_rpcs.cancel_entitlement if parent_rpcs.respond_to? :cancel_entitlement @cancel_entitlement = ::Gapic::Config::Method.new cancel_entitlement_config activate_entitlement_config = parent_rpcs.activate_entitlement if parent_rpcs.respond_to? :activate_entitlement @activate_entitlement = ::Gapic::Config::Method.new activate_entitlement_config transfer_entitlements_config = parent_rpcs.transfer_entitlements if parent_rpcs.respond_to? :transfer_entitlements @transfer_entitlements = ::Gapic::Config::Method.new transfer_entitlements_config transfer_entitlements_to_google_config = parent_rpcs.transfer_entitlements_to_google if parent_rpcs.respond_to? :transfer_entitlements_to_google @transfer_entitlements_to_google = ::Gapic::Config::Method.new transfer_entitlements_to_google_config list_channel_partner_links_config = parent_rpcs.list_channel_partner_links if parent_rpcs.respond_to? :list_channel_partner_links @list_channel_partner_links = ::Gapic::Config::Method.new list_channel_partner_links_config get_channel_partner_link_config = parent_rpcs.get_channel_partner_link if parent_rpcs.respond_to? :get_channel_partner_link @get_channel_partner_link = ::Gapic::Config::Method.new get_channel_partner_link_config create_channel_partner_link_config = parent_rpcs.create_channel_partner_link if parent_rpcs.respond_to? :create_channel_partner_link @create_channel_partner_link = ::Gapic::Config::Method.new create_channel_partner_link_config update_channel_partner_link_config = parent_rpcs.update_channel_partner_link if parent_rpcs.respond_to? :update_channel_partner_link @update_channel_partner_link = ::Gapic::Config::Method.new update_channel_partner_link_config list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products @list_products = ::Gapic::Config::Method.new list_products_config list_skus_config = parent_rpcs.list_skus if parent_rpcs.respond_to? :list_skus @list_skus = ::Gapic::Config::Method.new list_skus_config list_offers_config = parent_rpcs.list_offers if parent_rpcs.respond_to? :list_offers @list_offers = ::Gapic::Config::Method.new list_offers_config list_purchasable_skus_config = parent_rpcs.list_purchasable_skus if parent_rpcs.respond_to? :list_purchasable_skus @list_purchasable_skus = ::Gapic::Config::Method.new list_purchasable_skus_config list_purchasable_offers_config = parent_rpcs.list_purchasable_offers if parent_rpcs.respond_to? :list_purchasable_offers @list_purchasable_offers = ::Gapic::Config::Method.new list_purchasable_offers_config register_subscriber_config = parent_rpcs.register_subscriber if parent_rpcs.respond_to? :register_subscriber @register_subscriber = ::Gapic::Config::Method.new register_subscriber_config unregister_subscriber_config = parent_rpcs.unregister_subscriber if parent_rpcs.respond_to? :unregister_subscriber @unregister_subscriber = ::Gapic::Config::Method.new unregister_subscriber_config list_subscribers_config = parent_rpcs.list_subscribers if parent_rpcs.respond_to? :list_subscribers @list_subscribers = ::Gapic::Config::Method.new list_subscribers_config yield self if block_given? end end end end end end end end end