Class: Google::Cloud::Channel::V1::CloudChannelService::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/channel/v1/cloud_channel_service/client.rb

Overview

Client for the CloudChannelService service.

CloudChannelService lets Google cloud resellers and distributors manage their customers, channel partners, entitlements, and reports.

Using this service:

  1. Resellers and distributors can manage a customer entity.
  2. Distributors can register an authorized reseller in their channel and provide them with delegated admin access.
  3. Resellers and distributors can manage customer entitlements.

CloudChannelService exposes the following resources:

  • Customers: An entity-usually an enterprise-managed by a reseller or distributor.

  • Entitlements: An entity that provides a customer with the means to use a service. Entitlements are created or updated as a result of a successful fulfillment.

  • ChannelPartnerLinks: An entity that identifies links between distributors and their indirect resellers in a channel.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#channel_partner_link_path, #channel_partner_repricing_config_path, #customer_path, #customer_repricing_config_path, #entitlement_path, #offer_path, #product_path, #sku_group_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new CloudChannelService client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the CloudChannelService client.

Yield Parameters:



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 155

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 endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_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.quota_project = @quota_project_id
    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,
    channel_pool_config: @config.channel_pool
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Channel::V1::CloudChannelService::Operations (readonly)

Get the associated client for long-running operations.



203
204
205
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 203

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the CloudChannelService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all CloudChannelService clients
::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 75

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

Instance Method Details

#activate_entitlement(request, options = nil) ⇒ ::Gapic::Operation #activate_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Activates a previously suspended entitlement. Entitlements suspended for pending ToS acceptance can't be activated using this method.

An entitlement activation is a long-running operation and it updates the state of the customer entitlement.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: Entitlement resource not found.
  • SUSPENSION_NOT_RESELLER_INITIATED: Can only activate reseller-initiated suspensions and entitlements that have accepted the TOS.
  • NOT_SUSPENDED: Can only activate suspended entitlements not in an ACTIVE state.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ActivateEntitlementRequest.new

# Call the activate_entitlement method.
result = client.activate_entitlement request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #activate_entitlement(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to activate_entitlement via a request object, either of type ActivateEntitlementRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #activate_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the entitlement to activate. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2610

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
   = @config.rpcs.activate_entitlement..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.activate_entitlement.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.activate_entitlement.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#cancel_entitlement(request, options = nil) ⇒ ::Gapic::Operation #cancel_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Cancels a previously fulfilled entitlement.

An entitlement cancellation is a long-running operation.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • FAILED_PRECONDITION: There are Google Cloud projects linked to the Google Cloud entitlement's Cloud Billing subaccount.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • 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. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

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 OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CancelEntitlementRequest.new

# Call the cancel_entitlement method.
result = client.cancel_entitlement request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #cancel_entitlement(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to cancel_entitlement via a request object, either of type Google::Cloud::Channel::V1::CancelEntitlementRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #cancel_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the entitlement to cancel. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2476

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
   = @config.rpcs.cancel_entitlement..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_entitlement.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_entitlement.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#change_offer(request, options = nil) ⇒ ::Gapic::Operation #change_offer(name: nil, offer: nil, parameters: nil, purchase_order_id: nil, request_id: nil, billing_account: nil) ⇒ ::Gapic::Operation

Updates the Offer for an existing customer entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: Offer or Entitlement resource not found.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ChangeOfferRequest.new

# Call the change_offer method.
result = client.change_offer request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #change_offer(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to change_offer via a request object, either of type Google::Cloud::Channel::V1::ChangeOfferRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #change_offer(name: nil, offer: nil, parameters: nil, purchase_order_id: nil, request_id: nil, billing_account: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • offer (::String) (defaults to: nil)

      Required. New Offer. Format: accounts/{account_id}/offers/{offer_id}.

    • parameters (::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>) (defaults to: nil)

      Optional. Parameters needed to purchase the Offer. To view the available Parameters refer to the Offer.parameter_definitions from the desired offer.

    • purchase_order_id (::String) (defaults to: nil)

      Optional. Purchase order id provided by the reseller.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • billing_account (::String) (defaults to: nil)

      Optional. The billing account resource name that is used to pay for this entitlement when setting up billing on a trial subscription.

      This field is only relevant for multi-currency accounts. It should be left empty for single currency accounts.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2084

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
   = @config.rpcs.change_offer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.change_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.change_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#change_parameters(request, options = nil) ⇒ ::Gapic::Operation #change_parameters(name: nil, parameters: nil, request_id: nil, purchase_order_id: nil) ⇒ ::Gapic::Operation

Change parameters of the entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid. For example, the number of seats being changed is greater than the allowed number of max seats, 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. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ChangeParametersRequest.new

# Call the change_parameters method.
result = client.change_parameters request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #change_parameters(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to change_parameters via a request object, either of type Google::Cloud::Channel::V1::ChangeParametersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #change_parameters(name: nil, parameters: nil, request_id: nil, purchase_order_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • parameters (::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>) (defaults to: nil)

      Required. Entitlement parameters to update. You can only change editable parameters.

      To view the available Parameters for a request, refer to the Offer.parameter_definitions from the desired offer.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

    • purchase_order_id (::String) (defaults to: nil)

      Optional. Purchase order ID provided by the reseller.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1808

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
   = @config.rpcs.change_parameters..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.change_parameters.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.change_parameters.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#change_renewal_settings(request, options = nil) ⇒ ::Gapic::Operation #change_renewal_settings(name: nil, renewal_settings: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the renewal settings for an existing customer entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: Entitlement resource not found.
  • NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a commitment plan. Can't enable or disable renewals for non-commitment plans.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest.new

# Call the change_renewal_settings method.
result = client.change_renewal_settings request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #change_renewal_settings(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to change_renewal_settings via a request object, either of type Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #change_renewal_settings(name: nil, renewal_settings: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • renewal_settings (::Google::Cloud::Channel::V1::RenewalSettings, ::Hash) (defaults to: nil)

      Required. New renewal settings.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1940

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
   = @config.rpcs.change_renewal_settings..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.change_renewal_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.change_renewal_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#check_cloud_identity_accounts_exist(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse #check_cloud_identity_accounts_exist(parent: nil, domain: nil) ⇒ ::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse

Confirms the existence of Cloud Identity accounts based on the domain and if the Cloud Identity accounts are owned by the reseller.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • INVALID_VALUE: Invalid domain value in the request.

Return value: A list of CloudIdentityCustomerAccount resources for the domain (may be empty)

Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if no CloudIdentityCustomerAccount resources match the domain.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest.new

# Call the check_cloud_identity_accounts_exist method.
result = client.check_cloud_identity_accounts_exist request

# The returned object is of type Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 487

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
   = @config.rpcs.check_cloud_identity_accounts_exist..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.check_cloud_identity_accounts_exist.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.check_cloud_identity_accounts_exist.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#configure {|config| ... } ⇒ Client::Configuration

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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



134
135
136
137
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 134

def configure
  yield @config if block_given?
  @config
end

Initiates a channel partner link between a distributor and a reseller, or between resellers in an n-tier reseller channel. Invited partners need to follow the invite_link_uri provided in the response to accept. After accepting the invitation, a link is set up between the two parties. You must be a distributor to call this method.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • ALREADY_EXISTS: The ChannelPartnerLink sent in the request already exists.
  • NOT_FOUND: No Cloud Identity customer exists for provided domain.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The new ChannelPartnerLink resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest.new

# Call the create_channel_partner_link method.
result = client.create_channel_partner_link request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
p result

Overloads:

  • #create_channel_partner_link(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    Pass arguments to create_channel_partner_link via a request object, either of type Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_channel_partner_link(parent: nil, channel_partner_link: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Create a channel partner link for the provided reseller account's resource name. Parent uses the format: accounts/{account_id}

    • channel_partner_link (::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash) (defaults to: nil)

      Required. The channel partner link to create. Either channel_partner_link.reseller_cloud_identity_id or domain can be used to create a link.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3226

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
   = @config.rpcs.create_channel_partner_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_channel_partner_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_channel_partner_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig #create_channel_partner_repricing_config(parent: nil, channel_partner_repricing_config: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig

Creates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. You can only create configs if the RepricingConfig.effective_invoice_month is a future month. If needed, you can create a config for the current month, with some restrictions.

When creating a config for a future month, make sure there are no existing configs for that RepricingConfig.effective_invoice_month.

The following restrictions are for creating configs in the current month.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated ChannelPartnerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CreateChannelPartnerRepricingConfigRequest.new

# Call the create_channel_partner_repricing_config method.
result = client.create_channel_partner_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4302

def create_channel_partner_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateChannelPartnerRepricingConfigRequest

  # 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
   = @config.rpcs.create_channel_partner_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_channel_partner_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_channel_partner_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :create_channel_partner_repricing_config, 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

#create_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer #create_customer(parent: nil, customer: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

Creates a new Customer resource under the reseller or distributor account.

Possible error codes:

  • PERMISSION_DENIED:
  • INVALID_ARGUMENT:
    • Required request parameters are missing or invalid.
    • Domain field value doesn't match the primary email domain.

Return value: The newly created Customer resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CreateCustomerRequest.new

# Call the create_customer method.
result = client.create_customer request

# The returned object is of type Google::Cloud::Channel::V1::Customer.
p result

Overloads:

  • #create_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    Pass arguments to create_customer via a request object, either of type Google::Cloud::Channel::V1::CreateCustomerRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_customer(parent: nil, customer: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of reseller account in which to create the customer. Parent uses the format: accounts/{account_id}

    • customer (::Google::Cloud::Channel::V1::Customer, ::Hash) (defaults to: nil)

      Required. The customer to create.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 590

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
   = @config.rpcs.create_customer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_customer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_customer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#create_customer_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig #create_customer_repricing_config(parent: nil, customer_repricing_config: nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

Creates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. You can only create configs if the RepricingConfig.effective_invoice_month is a future month. If needed, you can create a config for the current month, with some restrictions.

When creating a config for a future month, make sure there are no existing configs for that RepricingConfig.effective_invoice_month.

The following restrictions are for creating configs in the current month.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated CustomerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest.new

# Call the create_customer_repricing_config method.
result = client.create_customer_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig.
p result

Overloads:

  • #create_customer_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

    Pass arguments to create_customer_repricing_config via a request object, either of type Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_customer_repricing_config(parent: nil, customer_repricing_config: nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

    Pass arguments to create_customer_repricing_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the customer that will receive this repricing config. Parent uses the format: accounts/{account_id}/customers/{customer_id}

    • customer_repricing_config (::Google::Cloud::Channel::V1::CustomerRepricingConfig, ::Hash) (defaults to: nil)

      Required. The CustomerRepricingConfig object to update.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3710

def create_customer_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest

  # 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
   = @config.rpcs.create_customer_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_customer_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_customer_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :create_customer_repricing_config, 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

#create_entitlement(request, options = nil) ⇒ ::Gapic::Operation #create_entitlement(parent: nil, entitlement: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates an entitlement for a customer.

Possible error codes:

  • PERMISSION_DENIED:
  • INVALID_ARGUMENT:
    • Required request parameters are missing or invalid.
    • There is already a customer entitlement for a SKU from the same product family.
  • INVALID_VALUE: Make sure the OfferId is valid. If it is, contact Google Channel support for further troubleshooting.
  • NOT_FOUND: The customer or offer resource was not found.
  • ALREADY_EXISTS:
    • The SKU was already purchased for the customer.
    • The customer's primary email already exists. Retry after changing the customer's primary contact email.
  • CONDITION_NOT_MET or FAILED_PRECONDITION:
    • The domain required for purchasing a SKU has not been verified.
    • A pre-requisite SKU required to purchase an Add-On SKU is missing. For example, Google Workspace Business Starter is required to purchase Vault or Drive.
    • (Developer accounts only) Reseller and resold domain must meet the following naming requirements:
      • Domain names must start with goog-test.
      • Domain names must include the reseller domain.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::CreateEntitlementRequest.new

# Call the create_entitlement method.
result = client.create_entitlement request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_entitlement(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_entitlement via a request object, either of type Google::Cloud::Channel::V1::CreateEntitlementRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_entitlement(parent: nil, entitlement: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's customer account in which to create the entitlement. Parent uses the format: accounts/{account_id}/customers/{customer_id}

    • entitlement (::Google::Cloud::Channel::V1::Entitlement, ::Hash) (defaults to: nil)

      Required. The entitlement to create.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1669

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
   = @config.rpcs.create_entitlement..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_entitlement.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_entitlement.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_channel_partner_repricing_config(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the given ChannelPartnerRepricingConfig permanently. You can only delete configs if their RepricingConfig.effective_invoice_month is set to a date after the current month.

Possible error codes:

  • PERMISSION_DENIED: The account making the request does not own this customer.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • FAILED_PRECONDITION: The ChannelPartnerRepricingConfig is active or in the past.
  • NOT_FOUND: No ChannelPartnerRepricingConfig found for the name in the request.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::DeleteChannelPartnerRepricingConfigRequest.new

# Call the delete_channel_partner_repricing_config method.
result = client.delete_channel_partner_repricing_config request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_channel_partner_repricing_config via a request object, either of type DeleteChannelPartnerRepricingConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::DeleteChannelPartnerRepricingConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_channel_partner_repricing_config(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_channel_partner_repricing_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the channel partner repricing config rule to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4520

def delete_channel_partner_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::DeleteChannelPartnerRepricingConfigRequest

  # 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
   = @config.rpcs.delete_channel_partner_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_channel_partner_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_channel_partner_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :delete_channel_partner_repricing_config, 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

#delete_customer(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_customer(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the given Customer permanently.

Possible error codes:

  • PERMISSION_DENIED: The account making the request does not own this customer.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • FAILED_PRECONDITION: The customer has existing entitlements.
  • NOT_FOUND: No Customer resource found for the name in the request.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::DeleteCustomerRequest.new

# Call the delete_customer method.
result = client.delete_customer request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_customer(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_customer via a request object, either of type DeleteCustomerRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_customer(name: nil) ⇒ ::Google::Protobuf::Empty

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the customer to delete.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 784

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
   = @config.rpcs.delete_customer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_customer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_customer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#delete_customer_repricing_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_customer_repricing_config(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the given CustomerRepricingConfig permanently. You can only delete configs if their RepricingConfig.effective_invoice_month is set to a date after the current month.

Possible error codes:

  • PERMISSION_DENIED: The account making the request does not own this customer.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • FAILED_PRECONDITION: The CustomerRepricingConfig is active or in the past.
  • NOT_FOUND: No CustomerRepricingConfig found for the name in the request.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::DeleteCustomerRepricingConfigRequest.new

# Call the delete_customer_repricing_config method.
result = client.delete_customer_repricing_config request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_customer_repricing_config(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_customer_repricing_config via a request object, either of type DeleteCustomerRepricingConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::DeleteCustomerRepricingConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_customer_repricing_config(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_customer_repricing_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the customer repricing config rule to delete. Format: accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3929

def delete_customer_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::DeleteCustomerRepricingConfigRequest

  # 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
   = @config.rpcs.delete_customer_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_customer_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_customer_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :delete_customer_repricing_config, 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

Returns the requested ChannelPartnerLink resource. You must be a distributor to call this method.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: ChannelPartnerLink resource not found because of an invalid channel partner link name.

Return value: The ChannelPartnerLink resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest.new

# Call the get_channel_partner_link method.
result = client.get_channel_partner_link request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
p result

Overloads:

  • #get_channel_partner_link(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    Pass arguments to get_channel_partner_link via a request object, either of type GetChannelPartnerLinkRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_channel_partner_link(name: nil, view: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the channel partner link to retrieve. Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud Identity ID of the partner.

    • view (::Google::Cloud::Channel::V1::ChannelPartnerLinkView) (defaults to: nil)

      Optional. The level of granularity the ChannelPartnerLink will display.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3113

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
   = @config.rpcs.get_channel_partner_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_channel_partner_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_channel_partner_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig #get_channel_partner_repricing_config(name: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig

Gets information about how a Distributor modifies their bill before sending it to a ChannelPartner.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The ChannelPartnerRepricingConfig was not found.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the ChannelPartnerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::GetChannelPartnerRepricingConfigRequest.new

# Call the get_channel_partner_repricing_config method.
result = client.get_channel_partner_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig.
p result

Overloads:

  • #get_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig

    Pass arguments to get_channel_partner_repricing_config via a request object, either of type GetChannelPartnerRepricingConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::GetChannelPartnerRepricingConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_channel_partner_repricing_config(name: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig

    Pass arguments to get_channel_partner_repricing_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the ChannelPartnerRepricingConfig Format: accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4032

def get_channel_partner_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetChannelPartnerRepricingConfigRequest

  # 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
   = @config.rpcs.get_channel_partner_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_channel_partner_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_channel_partner_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :get_channel_partner_repricing_config, 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

#get_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer #get_customer(name: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

Returns the requested Customer resource.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The customer resource doesn't exist. Usually the result of an invalid name parameter.

Return value: The Customer resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::GetCustomerRequest.new

# Call the get_customer method.
result = client.get_customer request

# The returned object is of type Google::Cloud::Channel::V1::Customer.
p result

Overloads:

  • #get_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    Pass arguments to get_customer via a request object, either of type GetCustomerRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_customer(name: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the customer to retrieve. Name uses the format: accounts/{account_id}/customers/{customer_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 381

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
   = @config.rpcs.get_customer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_customer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_customer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#get_customer_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig #get_customer_repricing_config(name: nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

Gets information about how a Reseller modifies their bill before sending it to a Customer.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The CustomerRepricingConfig was not found.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the CustomerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::GetCustomerRepricingConfigRequest.new

# Call the get_customer_repricing_config method.
result = client.get_customer_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig.
p result

Overloads:

  • #get_customer_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

    Pass arguments to get_customer_repricing_config via a request object, either of type GetCustomerRepricingConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::GetCustomerRepricingConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_customer_repricing_config(name: nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

    Pass arguments to get_customer_repricing_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the CustomerRepricingConfig. Format: accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3444

def get_customer_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetCustomerRepricingConfigRequest

  # 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
   = @config.rpcs.get_customer_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_customer_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_customer_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :get_customer_repricing_config, 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

#get_entitlement(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Entitlement #get_entitlement(name: nil) ⇒ ::Google::Cloud::Channel::V1::Entitlement

Returns the requested Entitlement resource.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The customer entitlement was not found.

Return value: The requested Entitlement resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::GetEntitlementRequest.new

# Call the get_entitlement method.
result = client.get_entitlement request

# The returned object is of type Google::Cloud::Channel::V1::Entitlement.
p result

Overloads:

  • #get_entitlement(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Entitlement

    Pass arguments to get_entitlement via a request object, either of type GetEntitlementRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_entitlement(name: nil) ⇒ ::Google::Cloud::Channel::V1::Entitlement

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the entitlement to retrieve. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1522

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
   = @config.rpcs.get_entitlement..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_entitlement.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_entitlement.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#import_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer #import_customer(domain: nil, cloud_identity_id: nil, parent: nil, auth_token: nil, overwrite_if_exists: nil, channel_partner_id: nil, customer: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

Imports a Customer from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data.

Possible error codes:

  • PERMISSION_DENIED:
  • NOT_FOUND: Cloud Identity doesn't exist or was deleted.
  • INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid.
  • ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite.

Return value: The Customer.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ImportCustomerRequest.new

# Call the import_customer method.
result = client.import_customer request

# The returned object is of type Google::Cloud::Channel::V1::Customer.
p result

Overloads:

  • #import_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    Pass arguments to import_customer via a request object, either of type ImportCustomerRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ImportCustomerRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #import_customer(domain: nil, cloud_identity_id: nil, parent: nil, auth_token: nil, overwrite_if_exists: nil, channel_partner_id: nil, customer: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    Pass arguments to import_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).

    Parameters:

    • domain (::String) (defaults to: nil)

      Required. Customer domain.

    • cloud_identity_id (::String) (defaults to: nil)

      Required. Customer's Cloud Identity ID

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's account. Parent takes the format: accounts/{account_id} or accounts/{account_id}/channelPartnerLinks/{channel_partner_id}

    • auth_token (::String) (defaults to: nil)

      Optional. The super admin of the resold customer generates this token to authorize a reseller to access their Cloud Identity and purchase entitlements on their behalf. You can omit this token after authorization. See https://support.google.com/a/answer/7643790 for more details.

    • overwrite_if_exists (::Boolean) (defaults to: nil)

      Required. Choose to overwrite an existing customer if found. This must be set to true if there is an existing customer with a conflicting region code or domain.

    • channel_partner_id (::String) (defaults to: nil)

      Optional. Cloud Identity ID of a channel partner who will be the direct reseller for the customer's order. This field is required for 2-tier transfer scenarios and can be provided via the request Parent binding as well.

    • customer (::String) (defaults to: nil)

      Optional. Specifies the customer that will receive imported Cloud Identity information. Format: accounts/{account_id}/customers/{customer_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 912

def import_customer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ImportCustomerRequest

  # 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
   = @config.rpcs.import_customer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.import_customer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_customer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :import_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

List ChannelPartnerLinks belonging to a distributor. You must be a distributor to call this method.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: The list of the distributor account's ChannelPartnerLink resources.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest.new

# Call the list_channel_partner_links method.
result = client.list_channel_partner_links request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerLink.
  p item
end

Overloads:

  • #list_channel_partner_links(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>

    Pass arguments to list_channel_partner_links via a request object, either of type ListChannelPartnerLinksRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_channel_partner_links(parent: nil, page_size: nil, page_token: nil, view: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller account for listing channel partner links. Parent uses the format: accounts/{account_id}

    • page_size (::Integer) (defaults to: nil)

      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; the server will coerce values above 200.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page. Obtained using ListChannelPartnerLinksResponse.next_page_token of the previous CloudChannelService.ListChannelPartnerLinks call.

    • view (::Google::Cloud::Channel::V1::ChannelPartnerLinkView) (defaults to: nil)

      Optional. The level of granularity the ChannelPartnerLink will display.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3009

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
   = @config.rpcs.list_channel_partner_links..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_channel_partner_links.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_channel_partner_links.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_channel_partner_repricing_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig> #list_channel_partner_repricing_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig>

Lists information about how a Reseller modifies their bill before sending it to a ChannelPartner.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the ChannelPartnerRepricingConfig resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListChannelPartnerRepricingConfigsRequest.new

# Call the list_channel_partner_repricing_configs method.
result = client.list_channel_partner_repricing_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig.
  p item
end

Overloads:

  • #list_channel_partner_repricing_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig>

    Pass arguments to list_channel_partner_repricing_configs via a request object, either of type ListChannelPartnerRepricingConfigsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ListChannelPartnerRepricingConfigsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_channel_partner_repricing_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig>

    Pass arguments to list_channel_partner_repricing_configs 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the account's ChannelPartnerLink. Parent uses the format: accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs for all channel partners.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of repricing configs to return. The service may return fewer than this value. If unspecified, returns a maximum of 50 rules. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results beyond the first page. Obtained through ListChannelPartnerRepricingConfigsResponse.next_page_token of the previous CloudChannelService.ListChannelPartnerRepricingConfigs call.

    • filter (::String) (defaults to: nil)

      Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] results (channel_partner_link only). You can use this filter when you support a BatchGet-like query. To use the filter, you must set parent=accounts/{account_id}/channelPartnerLinks/-.

      Example: channel_partner_link = accounts/account_id/channelPartnerLinks/c1 OR channel_partner_link = accounts/account_id/channelPartnerLinks/c2.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4170

def list_channel_partner_repricing_configs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListChannelPartnerRepricingConfigsRequest

  # 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
   = @config.rpcs.list_channel_partner_repricing_configs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_channel_partner_repricing_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_channel_partner_repricing_configs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :list_channel_partner_repricing_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_channel_partner_repricing_configs, 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_customer_repricing_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::CustomerRepricingConfig> #list_customer_repricing_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::CustomerRepricingConfig>

Lists information about how a Reseller modifies their bill before sending it to a Customer.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the CustomerRepricingConfig resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListCustomerRepricingConfigsRequest.new

# Call the list_customer_repricing_configs method.
result = client.list_customer_repricing_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::CustomerRepricingConfig.
  p item
end

Overloads:

  • #list_customer_repricing_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::CustomerRepricingConfig>

    Pass arguments to list_customer_repricing_configs via a request object, either of type ListCustomerRepricingConfigsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ListCustomerRepricingConfigsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_customer_repricing_configs(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::CustomerRepricingConfig>

    Pass arguments to list_customer_repricing_configs 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the customer. Parent uses the format: accounts/{account_id}/customers/{customer_id}. Supports accounts/{account_id}/customers/- to retrieve configs for all customers.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of repricing configs to return. The service may return fewer than this value. If unspecified, returns a maximum of 50 rules. The maximum value is 100; values above 100 will be coerced to 100.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results beyond the first page. Obtained through ListCustomerRepricingConfigsResponse.next_page_token of the previous CloudChannelService.ListCustomerRepricingConfigs call.

    • filter (::String) (defaults to: nil)

      Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] results (customer only). You can use this filter when you support a BatchGet-like query. To use the filter, you must set parent=accounts/{account_id}/customers/-.

      Example: customer = accounts/account_id/customers/c1 OR customer = accounts/account_id/customers/c2.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3579

def list_customer_repricing_configs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListCustomerRepricingConfigsRequest

  # 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
   = @config.rpcs.list_customer_repricing_configs..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_customer_repricing_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_customer_repricing_configs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :list_customer_repricing_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_customer_repricing_configs, 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_customers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer> #list_customers(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>

List Customers.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: List of Customers, or an empty list if there are no customers.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListCustomersRequest.new

# Call the list_customers method.
result = client.list_customers request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::Customer.
  p item
end

Overloads:

  • #list_customers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>

    Pass arguments to list_customers via a request object, either of type ListCustomersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_customers(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller account to list customers from. Parent uses the format: accounts/{account_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of customers to return. The service may return fewer than this value. If unspecified, returns at most 10 customers. The maximum value is 50.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results other than the first page. Obtained through ListCustomersResponse.next_page_token of the previous CloudChannelService.ListCustomers call.

    • filter (::String) (defaults to: nil)

      Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers for more information.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 282

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
   = @config.rpcs.list_customers..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_customers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_customers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_entitlement_changes(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::EntitlementChange> #list_entitlement_changes(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::EntitlementChange>

List entitlement history.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different.
  • INVALID_ARGUMENT: Missing or invalid required fields in the request.
  • NOT_FOUND: The parent resource doesn't exist. Usually the result of an invalid name parameter.
  • INTERNAL: Any non-user error related to a technical issue in the backend. In this case, contact CloudChannel 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 EntitlementChanges.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListEntitlementChangesRequest.new

# Call the list_entitlement_changes method.
result = client.list_entitlement_changes request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::EntitlementChange.
  p item
end

Overloads:

  • #list_entitlement_changes(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::EntitlementChange>

    Pass arguments to list_entitlement_changes via a request object, either of type ListEntitlementChangesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ListEntitlementChangesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_entitlement_changes(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::EntitlementChange>

    Pass arguments to list_entitlement_changes 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the entitlement for which to list entitlement changes. The - wildcard may be used to match entitlements across a customer. Formats:

      • accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
      • accounts/{account_id}/customers/{customer_id}/entitlements/-
    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of entitlement changes to return. The service may return fewer than this value. If unspecified, returns at most 10 entitlement changes. The maximum value is 50; the server will coerce values above 50.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous CloudChannelService.ListEntitlementChanges call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to CloudChannelService.ListEntitlementChanges must match the call that provided the page token.

    • filter (::String) (defaults to: nil)

      Optional. Filters applied to the list results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5956

def list_entitlement_changes request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListEntitlementChangesRequest

  # 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
   = @config.rpcs.list_entitlement_changes..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_entitlement_changes.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_entitlement_changes.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :list_entitlement_changes, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_entitlement_changes, 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_entitlements(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement> #list_entitlements(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>

Lists Entitlements belonging to a customer.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: A list of the customer's Entitlements.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListEntitlementsRequest.new

# Call the list_entitlements method.
result = client.list_entitlements request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::Entitlement.
  p item
end

Overloads:

  • #list_entitlements(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>

    Pass arguments to list_entitlements via a request object, either of type ListEntitlementsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_entitlements(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's customer account to list entitlements for. Parent uses the format: accounts/{account_id}/customers/{customer_id}

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, return at most 50 entitlements. The maximum value is 100; the server will coerce values above 100.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page. Obtained using ListEntitlementsResponse.next_page_token of the previous CloudChannelService.ListEntitlements call.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1147

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
   = @config.rpcs.list_entitlements..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_entitlements.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_entitlements.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer> #list_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, language_code: nil, show_future_offers: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>

Lists the Offers the reseller can sell.

Possible error codes:

  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListOffersRequest.new

# Call the list_offers method.
result = client.list_offers request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::Offer.
  p item
end

Overloads:

  • #list_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>

    Pass arguments to list_offers via a request object, either of type ListOffersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, language_code: nil, show_future_offers: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller account from which to list Offers. Parent uses the format: accounts/{account_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 500 Offers. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page.

    • filter (::String) (defaults to: nil)

      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

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

    • show_future_offers (::Boolean) (defaults to: nil)

      Optional. A boolean flag that determines if a response returns future offers 30 days from now. If the show_future_offers is true, the response will only contain offers that are scheduled to be available 30 days from now.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5177

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
   = @config.rpcs.list_offers..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_offers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_offers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_products(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product> #list_products(account: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>

Lists the Products the reseller is authorized to sell.

Possible error codes:

  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListProductsRequest.new

# Call the list_products method.
result = client.list_products request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::Product.
  p item
end

Overloads:

  • #list_products(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>

    Pass arguments to list_products via a request object, either of type ListProductsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_products(account: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>

    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).

    Parameters:

    • account (::String) (defaults to: nil)

      Required. The resource name of the reseller account. Format: accounts/{account_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 Products. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page.

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4959

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
   = @config.rpcs.list_products..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_products.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_products.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_purchasable_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer> #list_purchasable_offers(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>

Lists the following:

  • Offers that you can purchase for a customer.
  • Offers that you can change for an entitlement.

Possible error codes:

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListPurchasableOffersRequest.new

# Call the list_purchasable_offers method.
result = client.list_purchasable_offers request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::PurchasableOffer.
  p item
end

Overloads:

  • #list_purchasable_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>

    Pass arguments to list_purchasable_offers via a request object, either of type ListPurchasableOffersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_purchasable_offers(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>

    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).

    Parameters:

    • create_entitlement_purchase (::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::CreateEntitlementPurchase, ::Hash) (defaults to: nil)

      List Offers for CreateEntitlement purchase.

    • change_offer_purchase (::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::ChangeOfferPurchase, ::Hash) (defaults to: nil)

      List Offers for ChangeOffer purchase.

    • customer (::String) (defaults to: nil)

      Required. The resource name of the customer to list Offers for. Format: accounts/{account_id}/customers/{customer_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 Offers. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page.

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5406

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
   = @config.rpcs.list_purchasable_offers..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer
    header_params["customer"] = request.customer
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_purchasable_offers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_purchasable_offers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_purchasable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku> #list_purchasable_skus(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>

Lists the following:

  • SKUs that you can purchase for a customer
  • SKUs that you can upgrade or downgrade for an entitlement.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListPurchasableSkusRequest.new

# Call the list_purchasable_skus method.
result = client.list_purchasable_skus request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::PurchasableSku.
  p item
end

Overloads:

  • #list_purchasable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>

    Pass arguments to list_purchasable_skus via a request object, either of type ListPurchasableSkusRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_purchasable_skus(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>

    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).

    Parameters:

    • create_entitlement_purchase (::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::CreateEntitlementPurchase, ::Hash) (defaults to: nil)

      List SKUs for CreateEntitlement purchase.

    • change_offer_purchase (::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::ChangeOfferPurchase, ::Hash) (defaults to: nil)

      List SKUs for ChangeOffer purchase with a new SKU.

    • customer (::String) (defaults to: nil)

      Required. The resource name of the customer to list SKUs for. Format: accounts/{account_id}/customers/{customer_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 SKUs. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page.

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5290

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
   = @config.rpcs.list_purchasable_skus..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer
    header_params["customer"] = request.customer
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_purchasable_skus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_purchasable_skus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_sku_group_billable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::BillableSku> #list_sku_group_billable_skus(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::BillableSku>

Lists the Billable SKUs in a given SKU group.

Possible error codes: PERMISSION_DENIED: If the account making the request and the account being queried for are different, or the account doesn't exist. INVALID_ARGUMENT: Missing or invalid required parameters in the request. INTERNAL: Any non-user error related to technical issue in the backend. In this case, contact cloud channel support.

Return Value: If successful, the BillableSku resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListSkuGroupBillableSkusRequest.new

# Call the list_sku_group_billable_skus method.
result = client.list_sku_group_billable_skus request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::BillableSku.
  p item
end

Overloads:

  • #list_sku_group_billable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::BillableSku>

    Pass arguments to list_sku_group_billable_skus via a request object, either of type ListSkuGroupBillableSkusRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ListSkuGroupBillableSkusRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_sku_group_billable_skus(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::BillableSku>

    Pass arguments to list_sku_group_billable_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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the SKU group. Format: accounts/{account}/skuGroups/{sku_group}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of SKUs to return. The service may return fewer than this value. If unspecified, returns a maximum of 100000 SKUs. The maximum value is 100000; values above 100000 will be coerced to 100000.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results beyond the first page. Obtained through [ListSkuGroupBillableSkus.next_page_token][] of the previous CloudChannelService.ListSkuGroupBillableSkus call.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4758

def list_sku_group_billable_skus request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListSkuGroupBillableSkusRequest

  # 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
   = @config.rpcs.list_sku_group_billable_skus..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_sku_group_billable_skus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sku_group_billable_skus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :list_sku_group_billable_skus, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_sku_group_billable_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_sku_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::SkuGroup> #list_sku_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::SkuGroup>

Lists the Rebilling supported SKU groups the account is authorized to sell. Reference: https://cloud.google.com/skus/sku-groups

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different, or the account doesn't exist.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the SkuGroup resources. The data for each resource is displayed in the alphabetical order of SKU group display name. The data for each resource is displayed in the ascending order of SkuGroup.display_name

If unsuccessful, returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListSkuGroupsRequest.new

# Call the list_sku_groups method.
result = client.list_sku_groups request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::SkuGroup.
  p item
end

Overloads:

  • #list_sku_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::SkuGroup>

    Pass arguments to list_sku_groups via a request object, either of type ListSkuGroupsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::ListSkuGroupsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_sku_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::SkuGroup>

    Pass arguments to list_sku_groups 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the account from which to list SKU groups. Parent uses the format: accounts/{account}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of SKU groups to return. The service may return fewer than this value. If unspecified, returns a maximum of 1000 SKU groups. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token identifying a page of results beyond the first page. Obtained through [ListSkuGroups.next_page_token][] of the previous CloudChannelService.ListSkuGroups call.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4639

def list_sku_groups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListSkuGroupsRequest

  # 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
   = @config.rpcs.list_sku_groups..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_sku_groups.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sku_groups.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :list_sku_groups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_sku_groups, 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_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku> #list_skus(parent: nil, account: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>

Lists the SKUs for a product the reseller is authorized to sell.

Possible error codes:

  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListSkusRequest.new

# Call the list_skus method.
result = client.list_skus request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::Sku.
  p item
end

Overloads:

  • #list_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>

    Pass arguments to list_skus via a request object, either of type ListSkusRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_skus(parent: nil, account: nil, page_size: nil, page_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the Product to list SKUs for. Parent uses the format: products/{product_id}. Supports products/- to retrieve SKUs for all products.

    • account (::String) (defaults to: nil)

      Required. Resource name of the reseller. Format: accounts/{account_id}.

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 SKUs. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A token for a page of results other than the first page. Optional.

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5061

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
   = @config.rpcs.list_skus..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_skus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_skus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_subscribers(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ListSubscribersResponse #list_subscribers(account: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Channel::V1::ListSubscribersResponse

Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The topic resource doesn't exist.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: A list of service email addresses.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListSubscribersRequest.new

# Call the list_subscribers method.
result = client.list_subscribers request

# The returned object is of type Google::Cloud::Channel::V1::ListSubscribersResponse.
p result

Overloads:

  • #list_subscribers(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ListSubscribersResponse

    Pass arguments to list_subscribers via a request object, either of type ListSubscribersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_subscribers(account: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Channel::V1::ListSubscribersResponse

    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).

    Parameters:

    • account (::String) (defaults to: nil)

      Required. Resource name of the account.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of service accounts to return. The service may return fewer than this value. If unspecified, returns at most 100 service accounts. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5832

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
   = @config.rpcs.list_subscribers..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.
    header_params["account"] = request.
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_subscribers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_subscribers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_transferable_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer> #list_transferable_offers(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, sku: nil, language_code: nil, billing_account: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>

List TransferableOffers of a customer based on Cloud Identity ID or Customer Name in the request.

Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name.

Possible error codes:

  • PERMISSION_DENIED:
    • The customer doesn't belong to the reseller and has no auth token.
    • The customer provided incorrect reseller information when generating auth token.
    • The reseller account making the request is different from the reseller account in the query.
    • The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: List of TransferableOffer for the given customer and SKU.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListTransferableOffersRequest.new

# Call the list_transferable_offers method.
result = client.list_transferable_offers request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::TransferableOffer.
  p item
end

Overloads:

  • #list_transferable_offers(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>

    Pass arguments to list_transferable_offers via a request object, either of type ListTransferableOffersRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_transferable_offers(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, sku: nil, language_code: nil, billing_account: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>

    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).

    Parameters:

    • cloud_identity_id (::String) (defaults to: nil)

      Customer's Cloud Identity ID

    • customer_name (::String) (defaults to: nil)

      A reseller should create a customer and use the resource name of that customer here.

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's account.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 offers. The maximum value is 1000; the server will coerce values above 1000.

    • page_token (::String) (defaults to: nil)

      A token for a page of results other than the first page. Obtained using ListTransferableOffersResponse.next_page_token of the previous CloudChannelService.ListTransferableOffers call.

    • sku (::String) (defaults to: nil)

      Required. The SKU to look up Offers for.

    • language_code (::String) (defaults to: nil)

      Optional. The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US".

    • billing_account (::String) (defaults to: nil)

      Optional. The Billing Account to look up Offers for. Format: accounts/{account_id}/billingAccounts/{billing_account_id}.

      This field is only relevant for multi-currency accounts. It should be left empty for single currency accounts.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1424

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
   = @config.rpcs.list_transferable_offers..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_transferable_offers.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_transferable_offers.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#list_transferable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku> #list_transferable_skus(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, auth_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>

List TransferableSkus of a customer based on the Cloud Identity ID or Customer Name in the request.

Use this method to list the entitlements information of an unowned customer. You should provide the customer's Cloud Identity ID or Customer Name.

Possible error codes:

  • PERMISSION_DENIED:
    • The customer doesn't belong to the reseller and has no auth token.
    • The supplied auth token is invalid.
    • The reseller account making the request is different from the reseller account in the query.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: A list of the customer's TransferableSku.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ListTransferableSkusRequest.new

# Call the list_transferable_skus method.
result = client.list_transferable_skus request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Channel::V1::TransferableSku.
  p item
end

Overloads:

  • #list_transferable_skus(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>

    Pass arguments to list_transferable_skus via a request object, either of type ListTransferableSkusRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_transferable_skus(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, auth_token: nil, language_code: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>

    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).

    Parameters:

    • cloud_identity_id (::String) (defaults to: nil)

      Customer's Cloud Identity ID

    • customer_name (::String) (defaults to: nil)

      A reseller is required to create a customer and use the resource name of the created customer here. Customer_name uses the format: accounts/{account_id}/customers/{customer_id}

    • parent (::String) (defaults to: nil)

      Required. The reseller account's resource name. Parent uses the format: accounts/{account_id}

    • page_size (::Integer) (defaults to: nil)

      The requested page size. Server might return fewer results than requested. If unspecified, returns at most 100 SKUs. The maximum value is 1000; the server will coerce values above 1000. Optional.

    • page_token (::String) (defaults to: nil)

      A token for a page of results other than the first page. Obtained using ListTransferableSkusResponse.next_page_token of the previous CloudChannelService.ListTransferableSkus call. Optional.

    • auth_token (::String) (defaults to: nil)

      Optional. The super admin of the resold customer generates this token to authorize a reseller to access their Cloud Identity and purchase entitlements on their behalf. You can omit this token after authorization. See https://support.google.com/a/answer/7643790 for more details.

    • language_code (::String) (defaults to: nil)

      The BCP-47 language code. For example, "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US". Optional.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1285

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
   = @config.rpcs.list_transferable_skus..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_transferable_skus.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_transferable_skus.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#lookup_offer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Offer #lookup_offer(entitlement: nil) ⇒ ::Google::Cloud::Channel::V1::Offer

Returns the requested Offer resource.

Possible error codes:

  • PERMISSION_DENIED: The entitlement doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: Entitlement or offer was not found.

Return value: The Offer resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::LookupOfferRequest.new

# Call the lookup_offer method.
result = client.lookup_offer request

# The returned object is of type Google::Cloud::Channel::V1::Offer.
p result

Overloads:

  • #lookup_offer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Offer

    Pass arguments to lookup_offer via a request object, either of type LookupOfferRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::LookupOfferRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #lookup_offer(entitlement: nil) ⇒ ::Google::Cloud::Channel::V1::Offer

    Pass arguments to lookup_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).

    Parameters:

    • entitlement (::String) (defaults to: nil)

      Required. The resource name of the entitlement to retrieve the Offer. Entitlement uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4855

def lookup_offer request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::LookupOfferRequest

  # 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
   = @config.rpcs.lookup_offer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.entitlement
    header_params["entitlement"] = request.entitlement
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.lookup_offer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.lookup_offer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :lookup_offer, 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

#provision_cloud_identity(request, options = nil) ⇒ ::Gapic::Operation #provision_cloud_identity(customer: nil, cloud_identity_info: nil, user: nil, validate_only: nil) ⇒ ::Gapic::Operation

Creates a Cloud Identity for the given customer using the customer's information, or the information provided here.

Possible error codes:

  • PERMISSION_DENIED:
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The customer was not found.
  • ALREADY_EXISTS: The customer's primary email already exists. 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.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest.new

# Call the provision_cloud_identity method.
result = client.provision_cloud_identity request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #provision_cloud_identity(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to provision_cloud_identity via a request object, either of type ProvisionCloudIdentityRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #provision_cloud_identity(customer: nil, cloud_identity_info: nil, user: nil, validate_only: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • customer (::String) (defaults to: nil)

      Required. Resource name of the customer. Format: accounts/{account_id}/customers/{customer_id}

    • cloud_identity_info (::Google::Cloud::Channel::V1::CloudIdentityInfo, ::Hash) (defaults to: nil)

      CloudIdentity-specific customer information.

    • user (::Google::Cloud::Channel::V1::AdminUser, ::Hash) (defaults to: nil)

      Admin user information.

    • validate_only (::Boolean) (defaults to: nil)

      Validate the request and preview the review, but do not post it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 1034

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
   = @config.rpcs.provision_cloud_identity..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer
    header_params["customer"] = request.customer
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.provision_cloud_identity.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.provision_cloud_identity.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#query_eligible_billing_accounts(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsResponse #query_eligible_billing_accounts(customer: nil, skus: nil) ⇒ ::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsResponse

Lists the billing accounts that are eligible to purchase particular SKUs for a given customer.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: Based on the provided list of SKUs, returns a list of SKU groups that must be purchased using the same billing account and the billing accounts eligible to purchase each SKU group.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::QueryEligibleBillingAccountsRequest.new

# Call the query_eligible_billing_accounts method.
result = client.query_eligible_billing_accounts request

# The returned object is of type Google::Cloud::Channel::V1::QueryEligibleBillingAccountsResponse.
p result

Overloads:

  • #query_eligible_billing_accounts(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsResponse

    Pass arguments to query_eligible_billing_accounts via a request object, either of type QueryEligibleBillingAccountsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #query_eligible_billing_accounts(customer: nil, skus: nil) ⇒ ::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsResponse

    Pass arguments to query_eligible_billing_accounts 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).

    Parameters:

    • customer (::String) (defaults to: nil)

      Required. The resource name of the customer to list eligible billing accounts for. Format: accounts/{account_id}/customers/{customer_id}.

    • skus (::Array<::String>) (defaults to: nil)

      Required. List of SKUs to list eligible billing accounts for. At least one SKU is required. Format: products/{product_id}/skus/{sku_id}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5507

def query_eligible_billing_accounts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::QueryEligibleBillingAccountsRequest

  # 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
   = @config.rpcs.query_eligible_billing_accounts..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer
    header_params["customer"] = request.customer
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.query_eligible_billing_accounts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.query_eligible_billing_accounts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :query_eligible_billing_accounts, 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

#register_subscriber(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::RegisterSubscriberResponse #register_subscriber(account: nil, service_account: nil) ⇒ ::Google::Cloud::Channel::V1::RegisterSubscriberResponse

Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account. After you create a subscriber, you get the events through SubscriberEvent

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The topic name with the registered service email address.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::RegisterSubscriberRequest.new

# Call the register_subscriber method.
result = client.register_subscriber request

# The returned object is of type Google::Cloud::Channel::V1::RegisterSubscriberResponse.
p result

Overloads:

  • #register_subscriber(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::RegisterSubscriberResponse

    Pass arguments to register_subscriber via a request object, either of type RegisterSubscriberRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #register_subscriber(account: nil, service_account: nil) ⇒ ::Google::Cloud::Channel::V1::RegisterSubscriberResponse

    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).

    Parameters:

    • account (::String) (defaults to: nil)

      Required. Resource name of the account.

    • service_account (::String) (defaults to: nil)

      Required. Service account that provides subscriber access to the registered topic.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5612

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
   = @config.rpcs.register_subscriber..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.
    header_params["account"] = request.
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.register_subscriber.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.register_subscriber.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#start_paid_service(request, options = nil) ⇒ ::Gapic::Operation #start_paid_service(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Starts paid service for a trial entitlement.

Starts paid service for a trial entitlement immediately. This method is only applicable if a plan is set up for a trial entitlement but has some trial days remaining.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • 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. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::StartPaidServiceRequest.new

# Call the start_paid_service method.
result = client.start_paid_service request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #start_paid_service(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to start_paid_service via a request object, either of type StartPaidServiceRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #start_paid_service(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the entitlement to start a paid service for. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2215

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
   = @config.rpcs.start_paid_service..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.start_paid_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_paid_service.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#suspend_entitlement(request, options = nil) ⇒ ::Gapic::Operation #suspend_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Suspends a previously fulfilled entitlement.

An entitlement suspension is a long-running operation.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • 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. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::SuspendEntitlementRequest.new

# Call the suspend_entitlement method.
result = client.suspend_entitlement request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #suspend_entitlement(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to suspend_entitlement via a request object, either of type SuspendEntitlementRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #suspend_entitlement(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the entitlement to suspend. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2343

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
   = @config.rpcs.suspend_entitlement..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.suspend_entitlement.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.suspend_entitlement.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#transfer_entitlements(request, options = nil) ⇒ ::Gapic::Operation #transfer_entitlements(parent: nil, entitlements: nil, auth_token: nil, request_id: nil) ⇒ ::Gapic::Operation

Transfers customer entitlements to new reseller.

Possible error codes:

  • PERMISSION_DENIED:
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The customer or offer resource was not found.
  • ALREADY_EXISTS: The SKU was already transferred for the customer.
  • CONDITION_NOT_MET or FAILED_PRECONDITION:
    • The SKU requires domain verification to transfer, but the domain is not verified.
    • An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic).
    • (Developer accounts only) Reseller and resold domain must meet the following naming requirements:
      • Domain names must start with goog-test.
      • Domain names must include the reseller domain.
    • Specify all transferring entitlements.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::TransferEntitlementsRequest.new

# Call the transfer_entitlements method.
result = client.transfer_entitlements request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #transfer_entitlements(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to transfer_entitlements via a request object, either of type TransferEntitlementsRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #transfer_entitlements(parent: nil, entitlements: nil, auth_token: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's customer account that will receive transferred entitlements. Parent uses the format: accounts/{account_id}/customers/{customer_id}

    • entitlements (::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>) (defaults to: nil)

      Required. The new entitlements to create or transfer.

    • auth_token (::String) (defaults to: nil)

      The super admin of the resold customer generates this token to authorize a reseller to access their Cloud Identity and purchase entitlements on their behalf. You can omit this token after authorization. See https://support.google.com/a/answer/7643790 for more details.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2756

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
   = @config.rpcs.transfer_entitlements..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.transfer_entitlements.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.transfer_entitlements.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#transfer_entitlements_to_google(request, options = nil) ⇒ ::Gapic::Operation #transfer_entitlements_to_google(parent: nil, entitlements: nil, request_id: nil) ⇒ ::Gapic::Operation

Transfers customer entitlements from their current reseller to Google.

Possible error codes:

  • PERMISSION_DENIED: The customer doesn't belong to the reseller.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The customer or offer resource was not found.
  • ALREADY_EXISTS: The SKU was already transferred for the customer.
  • CONDITION_NOT_MET or FAILED_PRECONDITION:
    • The SKU requires domain verification to transfer, but the domain is not verified.
    • An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic).
    • (Developer accounts only) Reseller and resold domain must meet the following naming requirements:
      • Domain names must start with goog-test.
      • Domain names must include the reseller domain.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

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 OperationMetadata.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest.new

# Call the transfer_entitlements_to_google method.
result = client.transfer_entitlements_to_google request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #transfer_entitlements_to_google(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to transfer_entitlements_to_google via a request object, either of type TransferEntitlementsToGoogleRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #transfer_entitlements_to_google(parent: nil, entitlements: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The resource name of the reseller's customer account where the entitlements transfer from. Parent uses the format: accounts/{account_id}/customers/{customer_id}

    • entitlements (::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>) (defaults to: nil)

      Required. The entitlements to transfer to Google.

    • request_id (::String) (defaults to: nil)

      Optional. You can specify an optional unique request ID, and if you need to retry your request, the server will know to ignore the request if it's complete.

      For example, 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 it received the original operation with the same request ID. If it did, it will ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 2894

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
   = @config.rpcs.transfer_entitlements_to_google..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.transfer_entitlements_to_google.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.transfer_entitlements_to_google.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#unregister_subscriber(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::UnregisterSubscriberResponse #unregister_subscriber(account: nil, service_account: nil) ⇒ ::Google::Cloud::Channel::V1::UnregisterSubscriberResponse

Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. If there are no service accounts left with subscriber privileges, this deletes the topic. You can call ListSubscribers to check for these accounts.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: The topic resource doesn't exist.
  • INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The topic name that unregistered the service email address. Returns a success response if the service email address wasn't registered with the topic.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::UnregisterSubscriberRequest.new

# Call the unregister_subscriber method.
result = client.unregister_subscriber request

# The returned object is of type Google::Cloud::Channel::V1::UnregisterSubscriberResponse.
p result

Overloads:

  • #unregister_subscriber(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::UnregisterSubscriberResponse

    Pass arguments to unregister_subscriber via a request object, either of type UnregisterSubscriberRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #unregister_subscriber(account: nil, service_account: nil) ⇒ ::Google::Cloud::Channel::V1::UnregisterSubscriberResponse

    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).

    Parameters:

    • account (::String) (defaults to: nil)

      Required. Resource name of the account.

    • service_account (::String) (defaults to: nil)

      Required. Service account to unregister from subscriber access to the topic.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 5720

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
   = @config.rpcs.unregister_subscriber..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.
    header_params["account"] = request.
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.unregister_subscriber.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.unregister_subscriber.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

Updates a channel partner link. Distributors call this method to change a link's status. For example, to suspend a partner link. You must be a distributor to call this method.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT:
    • Required request parameters are missing or invalid.
    • Link state cannot change from invited to active or suspended.
    • Cannot send 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. Contact Cloud Channel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The updated ChannelPartnerLink resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest.new

# Call the update_channel_partner_link method.
result = client.update_channel_partner_link request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
p result

Overloads:

  • #update_channel_partner_link(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    Pass arguments to update_channel_partner_link via a request object, either of type UpdateChannelPartnerLinkRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_channel_partner_link(name: nil, channel_partner_link: nil, update_mask: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerLink

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of the channel partner link to cancel. Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud Identity ID of the partner.

    • channel_partner_link (::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash) (defaults to: nil)

      Required. The channel partner link to update. Only channel_partner_link.link_state is allowed for updates.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The update mask that applies to the resource. The only allowable value for an update mask is channel_partner_link.link_state.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3341

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
   = @config.rpcs.update_channel_partner_link..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_channel_partner_link.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_channel_partner_link.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_channel_partner_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig #update_channel_partner_repricing_config(channel_partner_repricing_config: nil) ⇒ ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig

Updates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. This method overwrites the existing CustomerRepricingConfig.

You can only update configs if the RepricingConfig.effective_invoice_month is a future month. To make changes to configs for the current month, use CreateChannelPartnerRepricingConfig, taking note of its restrictions. You cannot update the RepricingConfig.effective_invoice_month.

When updating a config in the future:

  • This config must already exist.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated ChannelPartnerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::UpdateChannelPartnerRepricingConfigRequest.new

# Call the update_channel_partner_repricing_config method.
result = client.update_channel_partner_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 4418

def update_channel_partner_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateChannelPartnerRepricingConfigRequest

  # 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
   = @config.rpcs.update_channel_partner_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.channel_partner_repricing_config&.name
    header_params["channel_partner_repricing_config.name"] = request.channel_partner_repricing_config.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_channel_partner_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_channel_partner_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :update_channel_partner_repricing_config, 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

#update_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer #update_customer(customer: nil, update_mask: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

Updates an existing Customer resource for the reseller or distributor.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request.
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
  • NOT_FOUND: No Customer resource found for the name in the request.

Return value: The updated Customer resource.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::UpdateCustomerRequest.new

# Call the update_customer method.
result = client.update_customer request

# The returned object is of type Google::Cloud::Channel::V1::Customer.
p result

Overloads:

  • #update_customer(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    Pass arguments to update_customer via a request object, either of type UpdateCustomerRequest or an equivalent Hash.

    Parameters:

    • 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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_customer(customer: nil, update_mask: nil) ⇒ ::Google::Cloud::Channel::V1::Customer

    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).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 690

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
   = @config.rpcs.update_customer..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer&.name
    header_params["customer.name"] = request.customer.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_customer.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_customer.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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

#update_customer_repricing_config(request, options = nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig #update_customer_repricing_config(customer_repricing_config: nil) ⇒ ::Google::Cloud::Channel::V1::CustomerRepricingConfig

Updates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. This method overwrites the existing CustomerRepricingConfig.

You can only update configs if the RepricingConfig.effective_invoice_month is a future month. To make changes to configs for the current month, use CreateCustomerRepricingConfig, taking note of its restrictions. You cannot update the RepricingConfig.effective_invoice_month.

When updating a config in the future:

  • This config must already exist.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated CustomerRepricingConfig resource, otherwise returns an error.

Examples:

Basic example

require "google/cloud/channel/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Channel::V1::CloudChannelService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Channel::V1::UpdateCustomerRepricingConfigRequest.new

# Call the update_customer_repricing_config method.
result = client.update_customer_repricing_config request

# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
# File 'lib/google/cloud/channel/v1/cloud_channel_service/client.rb', line 3826

def update_customer_repricing_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateCustomerRepricingConfigRequest

  # 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
   = @config.rpcs.update_customer_repricing_config..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"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
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.customer_repricing_config&.name
    header_params["customer_repricing_config.name"] = request.customer_repricing_config.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_customer_repricing_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_customer_repricing_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @cloud_channel_service_stub.call_rpc :update_customer_repricing_config, 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