google-cloud-channel-v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +75 -0
  6. data/lib/google-cloud-channel-v1.rb +21 -0
  7. data/lib/google/cloud/channel/v1.rb +38 -0
  8. data/lib/google/cloud/channel/v1/channel_partner_links_pb.rb +47 -0
  9. data/lib/google/cloud/channel/v1/cloud_channel_service.rb +70 -0
  10. data/lib/google/cloud/channel/v1/cloud_channel_service/client.rb +3498 -0
  11. data/lib/google/cloud/channel/v1/cloud_channel_service/credentials.rb +51 -0
  12. data/lib/google/cloud/channel/v1/cloud_channel_service/operations.rb +570 -0
  13. data/lib/google/cloud/channel/v1/cloud_channel_service/paths.rb +100 -0
  14. data/lib/google/cloud/channel/v1/common_pb.rb +76 -0
  15. data/lib/google/cloud/channel/v1/customers_pb.rb +48 -0
  16. data/lib/google/cloud/channel/v1/entitlements_pb.rb +110 -0
  17. data/lib/google/cloud/channel/v1/offers_pb.rb +142 -0
  18. data/lib/google/cloud/channel/v1/operations_pb.rb +38 -0
  19. data/lib/google/cloud/channel/v1/products_pb.rb +48 -0
  20. data/lib/google/cloud/channel/v1/service_pb.rb +331 -0
  21. data/lib/google/cloud/channel/v1/service_services_pb.rb +680 -0
  22. data/lib/google/cloud/channel/v1/version.rb +28 -0
  23. data/proto_docs/README.md +4 -0
  24. data/proto_docs/google/api/field_behavior.rb +59 -0
  25. data/proto_docs/google/api/resource.rb +283 -0
  26. data/proto_docs/google/cloud/channel/v1/channel_partner_links.rb +92 -0
  27. data/proto_docs/google/cloud/channel/v1/common.rb +155 -0
  28. data/proto_docs/google/cloud/channel/v1/customers.rb +111 -0
  29. data/proto_docs/google/cloud/channel/v1/entitlements.rb +255 -0
  30. data/proto_docs/google/cloud/channel/v1/offers.rb +344 -0
  31. data/proto_docs/google/cloud/channel/v1/operations.rb +74 -0
  32. data/proto_docs/google/cloud/channel/v1/products.rb +98 -0
  33. data/proto_docs/google/cloud/channel/v1/service.rb +1013 -0
  34. data/proto_docs/google/longrunning/operations.rb +150 -0
  35. data/proto_docs/google/protobuf/any.rb +138 -0
  36. data/proto_docs/google/protobuf/empty.rb +36 -0
  37. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  38. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  39. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  40. data/proto_docs/google/rpc/status.rb +46 -0
  41. data/proto_docs/google/type/money.rb +43 -0
  42. data/proto_docs/google/type/postal_address.rb +135 -0
  43. metadata +225 -0
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # This gem does not autoload during Bundler.require. To load this gem,
20
+ # issue explicit require statements for the packages desired, e.g.:
21
+ # require "google/cloud/channel/v1"
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/channel/v1/cloud_channel_service"
20
+ require "google/cloud/channel/v1/version"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Channel
25
+ ##
26
+ # To load this package, including all its services, and instantiate a client:
27
+ #
28
+ # require "google/cloud/channel/v1"
29
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
30
+ #
31
+ module V1
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
38
+ require "google/cloud/channel/v1/_helpers" if ::File.file? helper_path
@@ -0,0 +1,47 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/channel/v1/channel_partner_links.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/cloud/channel/v1/common_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/api/annotations_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_file("google/cloud/channel/v1/channel_partner_links.proto", :syntax => :proto3) do
12
+ add_message "google.cloud.channel.v1.ChannelPartnerLink" do
13
+ optional :name, :string, 1
14
+ optional :reseller_cloud_identity_id, :string, 2
15
+ optional :link_state, :enum, 3, "google.cloud.channel.v1.ChannelPartnerLinkState"
16
+ optional :invite_link_uri, :string, 4
17
+ optional :create_time, :message, 5, "google.protobuf.Timestamp"
18
+ optional :update_time, :message, 6, "google.protobuf.Timestamp"
19
+ optional :public_id, :string, 7
20
+ optional :channel_partner_cloud_identity_info, :message, 8, "google.cloud.channel.v1.CloudIdentityInfo"
21
+ end
22
+ add_enum "google.cloud.channel.v1.ChannelPartnerLinkView" do
23
+ value :UNSPECIFIED, 0
24
+ value :BASIC, 1
25
+ value :FULL, 2
26
+ end
27
+ add_enum "google.cloud.channel.v1.ChannelPartnerLinkState" do
28
+ value :CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED, 0
29
+ value :INVITED, 1
30
+ value :ACTIVE, 2
31
+ value :REVOKED, 3
32
+ value :SUSPENDED, 4
33
+ end
34
+ end
35
+ end
36
+
37
+ module Google
38
+ module Cloud
39
+ module Channel
40
+ module V1
41
+ ChannelPartnerLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.channel.v1.ChannelPartnerLink").msgclass
42
+ ChannelPartnerLinkView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.channel.v1.ChannelPartnerLinkView").enummodule
43
+ ChannelPartnerLinkState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.channel.v1.ChannelPartnerLinkState").enummodule
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/channel/v1/version"
24
+
25
+ require "google/cloud/channel/v1/cloud_channel_service/credentials"
26
+ require "google/cloud/channel/v1/cloud_channel_service/paths"
27
+ require "google/cloud/channel/v1/cloud_channel_service/operations"
28
+ require "google/cloud/channel/v1/cloud_channel_service/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Channel
33
+ module V1
34
+ ##
35
+ # CloudChannelService enables Google cloud resellers and distributors to manage
36
+ # their customers, channel partners, entitlements and reports.
37
+ #
38
+ # Using this service:
39
+ # 1. Resellers or distributors can manage a customer entity.
40
+ # 2. Distributors can register an authorized reseller in their channel and then
41
+ # enable delegated admin access for the reseller.
42
+ # 3. Resellers or distributors can manage entitlements for their customers.
43
+ #
44
+ # The service primarily exposes the following resources:
45
+ # - {::Google::Cloud::Channel::V1::Customer Customer}s: A Customer represents an entity managed by a reseller or
46
+ # distributor. A customer typically represents an enterprise. In an n-tier
47
+ # resale channel hierarchy, customers are generally represented as leaf nodes.
48
+ # Customers primarily have an Entitlement sub-resource discussed below.
49
+ #
50
+ # - {::Google::Cloud::Channel::V1::Entitlement Entitlement}s: An Entitlement represents an entity which provides a
51
+ # customer means to start using a service. Entitlements are created or updated
52
+ # as a result of a successful fulfillment.
53
+ #
54
+ # - {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink}s: A ChannelPartnerLink is an entity that identifies
55
+ # links between distributors and their indirect resellers in a channel.
56
+ #
57
+ # To load this service and instantiate a client:
58
+ #
59
+ # require "google/cloud/channel/v1/cloud_channel_service"
60
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
61
+ #
62
+ module CloudChannelService
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ helper_path = ::File.join __dir__, "cloud_channel_service", "helpers.rb"
70
+ require "google/cloud/channel/v1/cloud_channel_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,3498 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/channel/v1/service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Channel
25
+ module V1
26
+ module CloudChannelService
27
+ ##
28
+ # Client for the CloudChannelService service.
29
+ #
30
+ # CloudChannelService enables Google cloud resellers and distributors to manage
31
+ # their customers, channel partners, entitlements and reports.
32
+ #
33
+ # Using this service:
34
+ # 1. Resellers or distributors can manage a customer entity.
35
+ # 2. Distributors can register an authorized reseller in their channel and then
36
+ # enable delegated admin access for the reseller.
37
+ # 3. Resellers or distributors can manage entitlements for their customers.
38
+ #
39
+ # The service primarily exposes the following resources:
40
+ # - {::Google::Cloud::Channel::V1::Customer Customer}s: A Customer represents an entity managed by a reseller or
41
+ # distributor. A customer typically represents an enterprise. In an n-tier
42
+ # resale channel hierarchy, customers are generally represented as leaf nodes.
43
+ # Customers primarily have an Entitlement sub-resource discussed below.
44
+ #
45
+ # - {::Google::Cloud::Channel::V1::Entitlement Entitlement}s: An Entitlement represents an entity which provides a
46
+ # customer means to start using a service. Entitlements are created or updated
47
+ # as a result of a successful fulfillment.
48
+ #
49
+ # - {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink}s: A ChannelPartnerLink is an entity that identifies
50
+ # links between distributors and their indirect resellers in a channel.
51
+ #
52
+ class Client
53
+ include Paths
54
+
55
+ # @private
56
+ attr_reader :cloud_channel_service_stub
57
+
58
+ ##
59
+ # Configure the CloudChannelService Client class.
60
+ #
61
+ # See {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration}
62
+ # for a description of the configuration fields.
63
+ #
64
+ # ## Example
65
+ #
66
+ # To modify the configuration for all CloudChannelService clients:
67
+ #
68
+ # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
69
+ # config.timeout = 10.0
70
+ # end
71
+ #
72
+ # @yield [config] Configure the Client client.
73
+ # @yieldparam config [Client::Configuration]
74
+ #
75
+ # @return [Client::Configuration]
76
+ #
77
+ def self.configure
78
+ @configure ||= begin
79
+ namespace = ["Google", "Cloud", "Channel", "V1"]
80
+ parent_config = while namespace.any?
81
+ parent_name = namespace.join "::"
82
+ parent_const = const_get parent_name
83
+ break parent_const.configure if parent_const&.respond_to? :configure
84
+ namespace.pop
85
+ end
86
+ default_config = Client::Configuration.new parent_config
87
+
88
+ default_config.timeout = 60.0
89
+ default_config.retry_policy = {
90
+ initial_delay: 1.0,
91
+ max_delay: 10.0,
92
+ multiplier: 1.3,
93
+ retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.provision_cloud_identity.timeout = 60.0
97
+
98
+ default_config.rpcs.create_entitlement.timeout = 60.0
99
+
100
+ default_config.rpcs.change_parameters.timeout = 60.0
101
+
102
+ default_config.rpcs.change_renewal_settings.timeout = 60.0
103
+
104
+ default_config.rpcs.change_offer.timeout = 60.0
105
+
106
+ default_config.rpcs.start_paid_service.timeout = 60.0
107
+
108
+ default_config.rpcs.suspend_entitlement.timeout = 60.0
109
+
110
+ default_config.rpcs.cancel_entitlement.timeout = 60.0
111
+
112
+ default_config.rpcs.activate_entitlement.timeout = 60.0
113
+
114
+ default_config.rpcs.transfer_entitlements.timeout = 60.0
115
+
116
+ default_config.rpcs.transfer_entitlements_to_google.timeout = 60.0
117
+
118
+ default_config
119
+ end
120
+ yield @configure if block_given?
121
+ @configure
122
+ end
123
+
124
+ ##
125
+ # Configure the CloudChannelService Client instance.
126
+ #
127
+ # The configuration is set to the derived mode, meaning that values can be changed,
128
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
129
+ # should be made on {Client.configure}.
130
+ #
131
+ # See {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration}
132
+ # for a description of the configuration fields.
133
+ #
134
+ # @yield [config] Configure the Client client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ # @return [Client::Configuration]
138
+ #
139
+ def configure
140
+ yield @config if block_given?
141
+ @config
142
+ end
143
+
144
+ ##
145
+ # Create a new CloudChannelService client object.
146
+ #
147
+ # ## Examples
148
+ #
149
+ # To create a new CloudChannelService client with the default
150
+ # configuration:
151
+ #
152
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
153
+ #
154
+ # To create a new CloudChannelService client with a custom
155
+ # configuration:
156
+ #
157
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
158
+ # config.timeout = 10.0
159
+ # end
160
+ #
161
+ # @yield [config] Configure the CloudChannelService client.
162
+ # @yieldparam config [Client::Configuration]
163
+ #
164
+ def initialize
165
+ # These require statements are intentionally placed here to initialize
166
+ # the gRPC module only when it's required.
167
+ # See https://github.com/googleapis/toolkit/issues/446
168
+ require "gapic/grpc"
169
+ require "google/cloud/channel/v1/service_services_pb"
170
+
171
+ # Create the configuration object
172
+ @config = Configuration.new Client.configure
173
+
174
+ # Yield the configuration if needed
175
+ yield @config if block_given?
176
+
177
+ # Create credentials
178
+ credentials = @config.credentials
179
+ credentials ||= Credentials.default scope: @config.scope
180
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
181
+ credentials = Credentials.new credentials, scope: @config.scope
182
+ end
183
+ @quota_project_id = @config.quota_project
184
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
185
+
186
+ @operations_client = Operations.new do |config|
187
+ config.credentials = credentials
188
+ config.endpoint = @config.endpoint
189
+ end
190
+
191
+ @cloud_channel_service_stub = ::Gapic::ServiceStub.new(
192
+ ::Google::Cloud::Channel::V1::CloudChannelService::Stub,
193
+ credentials: credentials,
194
+ endpoint: @config.endpoint,
195
+ channel_args: @config.channel_args,
196
+ interceptors: @config.interceptors
197
+ )
198
+ end
199
+
200
+ ##
201
+ # Get the associated client for long-running operations.
202
+ #
203
+ # @return [::Google::Cloud::Channel::V1::CloudChannelService::Operations]
204
+ #
205
+ attr_reader :operations_client
206
+
207
+ # Service calls
208
+
209
+ ##
210
+ # List downstream {::Google::Cloud::Channel::V1::Customer Customer}s.
211
+ #
212
+ # Possible Error Codes:
213
+ #
214
+ # * PERMISSION_DENIED: If the reseller account making the request and the
215
+ # reseller account being queried for are different.
216
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
217
+ # request.
218
+ #
219
+ # Return Value:
220
+ # <br/> List of {::Google::Cloud::Channel::V1::Customer Customer}s pertaining to the reseller or empty list if
221
+ # there are none.
222
+ #
223
+ # @overload list_customers(request, options = nil)
224
+ # Pass arguments to `list_customers` via a request object, either of type
225
+ # {::Google::Cloud::Channel::V1::ListCustomersRequest} or an equivalent Hash.
226
+ #
227
+ # @param request [::Google::Cloud::Channel::V1::ListCustomersRequest, ::Hash]
228
+ # A request object representing the call parameters. Required. To specify no
229
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
230
+ # @param options [::Gapic::CallOptions, ::Hash]
231
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
232
+ #
233
+ # @overload list_customers(parent: nil, page_size: nil, page_token: nil)
234
+ # Pass arguments to `list_customers` via keyword arguments. Note that at
235
+ # least one keyword argument is required. To specify no parameters, or to keep all
236
+ # the default parameter values, pass an empty Hash as a request object (see above).
237
+ #
238
+ # @param parent [::String]
239
+ # Required. The resource name of the reseller account from which to list customers.
240
+ # The parent takes the format: accounts/\\{account_id}.
241
+ # @param page_size [::Integer]
242
+ # Optional. The maximum number of customers to return. The service may return fewer
243
+ # than this value. If unspecified, at most 10 customers will be returned. The
244
+ # maximum value is 50; values about 50 will be coerced to 50.
245
+ # @param page_token [::String]
246
+ # Optional. A token identifying a page of results, if other than the first one.
247
+ # Typically obtained via
248
+ # {::Google::Cloud::Channel::V1::ListCustomersResponse#next_page_token ListCustomersResponse.next_page_token} of the previous
249
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_customers CloudChannelService.ListCustomers} call.
250
+ #
251
+ # @yield [response, operation] Access the result along with the RPC operation
252
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>]
253
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
254
+ #
255
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Customer>]
256
+ #
257
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
258
+ #
259
+ def list_customers request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListCustomersRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ metadata = @config.rpcs.list_customers.metadata.to_h
269
+
270
+ # Set x-goog-api-client and x-goog-user-project headers
271
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
274
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
+
276
+ header_params = {
277
+ "parent" => request.parent
278
+ }
279
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
280
+ metadata[:"x-goog-request-params"] ||= request_params_header
281
+
282
+ options.apply_defaults timeout: @config.rpcs.list_customers.timeout,
283
+ metadata: metadata,
284
+ retry_policy: @config.rpcs.list_customers.retry_policy
285
+ options.apply_defaults metadata: @config.metadata,
286
+ retry_policy: @config.retry_policy
287
+
288
+ @cloud_channel_service_stub.call_rpc :list_customers, request, options: options do |response, operation|
289
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_customers, request, response, operation, options
290
+ yield response, operation if block_given?
291
+ return response
292
+ end
293
+ rescue ::GRPC::BadStatus => e
294
+ raise ::Google::Cloud::Error.from_error(e)
295
+ end
296
+
297
+ ##
298
+ # Returns a requested {::Google::Cloud::Channel::V1::Customer Customer} resource.
299
+ #
300
+ # Possible Error Codes:
301
+ #
302
+ # * PERMISSION_DENIED: If the reseller account making the request and the
303
+ # reseller account being queried for are different.
304
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
305
+ # request.
306
+ # * NOT_FOUND: If the customer resource doesn't exist. Usually
307
+ # the result of an invalid name parameter.
308
+ #
309
+ # Return Value:
310
+ # <br/> {::Google::Cloud::Channel::V1::Customer Customer} resource if found, error otherwise.
311
+ #
312
+ # @overload get_customer(request, options = nil)
313
+ # Pass arguments to `get_customer` via a request object, either of type
314
+ # {::Google::Cloud::Channel::V1::GetCustomerRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::Channel::V1::GetCustomerRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
321
+ #
322
+ # @overload get_customer(name: nil)
323
+ # Pass arguments to `get_customer` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param name [::String]
328
+ # Required. The resource name of the customer to retrieve.
329
+ # The name takes the format: accounts/\\{account_id}/customers/\\{customer_id}
330
+ #
331
+ # @yield [response, operation] Access the result along with the RPC operation
332
+ # @yieldparam response [::Google::Cloud::Channel::V1::Customer]
333
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
334
+ #
335
+ # @return [::Google::Cloud::Channel::V1::Customer]
336
+ #
337
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
338
+ #
339
+ def get_customer request, options = nil
340
+ raise ::ArgumentError, "request must be provided" if request.nil?
341
+
342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetCustomerRequest
343
+
344
+ # Converts hash and nil to an options object
345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
346
+
347
+ # Customize the options with defaults
348
+ metadata = @config.rpcs.get_customer.metadata.to_h
349
+
350
+ # Set x-goog-api-client and x-goog-user-project headers
351
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
353
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
354
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ header_params = {
357
+ "name" => request.name
358
+ }
359
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
360
+ metadata[:"x-goog-request-params"] ||= request_params_header
361
+
362
+ options.apply_defaults timeout: @config.rpcs.get_customer.timeout,
363
+ metadata: metadata,
364
+ retry_policy: @config.rpcs.get_customer.retry_policy
365
+ options.apply_defaults metadata: @config.metadata,
366
+ retry_policy: @config.retry_policy
367
+
368
+ @cloud_channel_service_stub.call_rpc :get_customer, request, options: options do |response, operation|
369
+ yield response, operation if block_given?
370
+ return response
371
+ end
372
+ rescue ::GRPC::BadStatus => e
373
+ raise ::Google::Cloud::Error.from_error(e)
374
+ end
375
+
376
+ ##
377
+ # Confirms the existence of Cloud Identity accounts, based on the domain and
378
+ # whether the Cloud Identity accounts are owned by the reseller.
379
+ #
380
+ # Possible Error Codes:
381
+ #
382
+ # * PERMISSION_DENIED: If the reseller account making the request and the
383
+ # reseller account being queried for are different.
384
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
385
+ # request.
386
+ # * INVALID_VALUE: Invalid domain value in the request.
387
+ # * NOT_FOUND: If there is no {::Google::Cloud::Channel::V1::CloudIdentityCustomerAccount CloudIdentityCustomerAccount} customer
388
+ # for the domain specified in the request.
389
+ #
390
+ # Return Value:
391
+ # <br/> List of {::Google::Cloud::Channel::V1::CloudIdentityCustomerAccount CloudIdentityCustomerAccount} resources if any exist for
392
+ # the domain, otherwise an error is returned.
393
+ #
394
+ # @overload check_cloud_identity_accounts_exist(request, options = nil)
395
+ # Pass arguments to `check_cloud_identity_accounts_exist` via a request object, either of type
396
+ # {::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest} or an equivalent Hash.
397
+ #
398
+ # @param request [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest, ::Hash]
399
+ # A request object representing the call parameters. Required. To specify no
400
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
401
+ # @param options [::Gapic::CallOptions, ::Hash]
402
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
403
+ #
404
+ # @overload check_cloud_identity_accounts_exist(parent: nil, domain: nil)
405
+ # Pass arguments to `check_cloud_identity_accounts_exist` via keyword arguments. Note that at
406
+ # least one keyword argument is required. To specify no parameters, or to keep all
407
+ # the default parameter values, pass an empty Hash as a request object (see above).
408
+ #
409
+ # @param parent [::String]
410
+ # Required. The resource name of the reseller account.
411
+ # The parent takes the format: accounts/\\{account_id}
412
+ # @param domain [::String]
413
+ # Required. Domain for which the Cloud Identity account customer is fetched.
414
+ #
415
+ # @yield [response, operation] Access the result along with the RPC operation
416
+ # @yieldparam response [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse]
417
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
418
+ #
419
+ # @return [::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse]
420
+ #
421
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
422
+ #
423
+ def check_cloud_identity_accounts_exist request, options = nil
424
+ raise ::ArgumentError, "request must be provided" if request.nil?
425
+
426
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest
427
+
428
+ # Converts hash and nil to an options object
429
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
430
+
431
+ # Customize the options with defaults
432
+ metadata = @config.rpcs.check_cloud_identity_accounts_exist.metadata.to_h
433
+
434
+ # Set x-goog-api-client and x-goog-user-project headers
435
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
437
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
438
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
+
440
+ header_params = {
441
+ "parent" => request.parent
442
+ }
443
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
444
+ metadata[:"x-goog-request-params"] ||= request_params_header
445
+
446
+ options.apply_defaults timeout: @config.rpcs.check_cloud_identity_accounts_exist.timeout,
447
+ metadata: metadata,
448
+ retry_policy: @config.rpcs.check_cloud_identity_accounts_exist.retry_policy
449
+ options.apply_defaults metadata: @config.metadata,
450
+ retry_policy: @config.retry_policy
451
+
452
+ @cloud_channel_service_stub.call_rpc :check_cloud_identity_accounts_exist, request, options: options do |response, operation|
453
+ yield response, operation if block_given?
454
+ return response
455
+ end
456
+ rescue ::GRPC::BadStatus => e
457
+ raise ::Google::Cloud::Error.from_error(e)
458
+ end
459
+
460
+ ##
461
+ # Creates a new {::Google::Cloud::Channel::V1::Customer Customer} resource under the reseller or distributor
462
+ # account.
463
+ #
464
+ # Possible Error Codes:
465
+ # <ul>
466
+ # <li>PERMISSION_DENIED: If the reseller account making the request and the
467
+ # reseller account being queried for are different.</li>
468
+ # <li> INVALID_ARGUMENT:
469
+ # <ul>
470
+ # <li> Missing or invalid required parameters in the request. </li>
471
+ # <li> Domain field value doesn't match the domain specified in primary
472
+ # email.</li>
473
+ # </ul>
474
+ # </li>
475
+ # </ul>
476
+ #
477
+ # Return Value:
478
+ # <br/> If successful, the newly created {::Google::Cloud::Channel::V1::Customer Customer} resource, otherwise
479
+ # returns an error.
480
+ #
481
+ # @overload create_customer(request, options = nil)
482
+ # Pass arguments to `create_customer` via a request object, either of type
483
+ # {::Google::Cloud::Channel::V1::CreateCustomerRequest} or an equivalent Hash.
484
+ #
485
+ # @param request [::Google::Cloud::Channel::V1::CreateCustomerRequest, ::Hash]
486
+ # A request object representing the call parameters. Required. To specify no
487
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
488
+ # @param options [::Gapic::CallOptions, ::Hash]
489
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
490
+ #
491
+ # @overload create_customer(parent: nil, customer: nil)
492
+ # Pass arguments to `create_customer` via keyword arguments. Note that at
493
+ # least one keyword argument is required. To specify no parameters, or to keep all
494
+ # the default parameter values, pass an empty Hash as a request object (see above).
495
+ #
496
+ # @param parent [::String]
497
+ # Required. The resource name of reseller account in which to create the customer.
498
+ # The parent takes the format: accounts/\\{account_id}
499
+ # @param customer [::Google::Cloud::Channel::V1::Customer, ::Hash]
500
+ # Required. The customer to create.
501
+ #
502
+ # @yield [response, operation] Access the result along with the RPC operation
503
+ # @yieldparam response [::Google::Cloud::Channel::V1::Customer]
504
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
505
+ #
506
+ # @return [::Google::Cloud::Channel::V1::Customer]
507
+ #
508
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
509
+ #
510
+ def create_customer request, options = nil
511
+ raise ::ArgumentError, "request must be provided" if request.nil?
512
+
513
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateCustomerRequest
514
+
515
+ # Converts hash and nil to an options object
516
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
517
+
518
+ # Customize the options with defaults
519
+ metadata = @config.rpcs.create_customer.metadata.to_h
520
+
521
+ # Set x-goog-api-client and x-goog-user-project headers
522
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
523
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
524
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
525
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ header_params = {
528
+ "parent" => request.parent
529
+ }
530
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
531
+ metadata[:"x-goog-request-params"] ||= request_params_header
532
+
533
+ options.apply_defaults timeout: @config.rpcs.create_customer.timeout,
534
+ metadata: metadata,
535
+ retry_policy: @config.rpcs.create_customer.retry_policy
536
+ options.apply_defaults metadata: @config.metadata,
537
+ retry_policy: @config.retry_policy
538
+
539
+ @cloud_channel_service_stub.call_rpc :create_customer, request, options: options do |response, operation|
540
+ yield response, operation if block_given?
541
+ return response
542
+ end
543
+ rescue ::GRPC::BadStatus => e
544
+ raise ::Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Updates an existing {::Google::Cloud::Channel::V1::Customer Customer} resource belonging to the reseller or
549
+ # distributor.
550
+ #
551
+ # Possible Error Codes:
552
+ #
553
+ # * PERMISSION_DENIED: If the reseller account making the request and the
554
+ # reseller account being queried for are different.
555
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
556
+ # request.
557
+ # * NOT_FOUND: No {::Google::Cloud::Channel::V1::Customer Customer} resource found for the name
558
+ # specified in the request.
559
+ #
560
+ # Return Value:
561
+ # <br/> If successful, the updated {::Google::Cloud::Channel::V1::Customer Customer} resource, otherwise returns
562
+ # an error.
563
+ #
564
+ # @overload update_customer(request, options = nil)
565
+ # Pass arguments to `update_customer` via a request object, either of type
566
+ # {::Google::Cloud::Channel::V1::UpdateCustomerRequest} or an equivalent Hash.
567
+ #
568
+ # @param request [::Google::Cloud::Channel::V1::UpdateCustomerRequest, ::Hash]
569
+ # A request object representing the call parameters. Required. To specify no
570
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
571
+ # @param options [::Gapic::CallOptions, ::Hash]
572
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
573
+ #
574
+ # @overload update_customer(customer: nil, update_mask: nil)
575
+ # Pass arguments to `update_customer` via keyword arguments. Note that at
576
+ # least one keyword argument is required. To specify no parameters, or to keep all
577
+ # the default parameter values, pass an empty Hash as a request object (see above).
578
+ #
579
+ # @param customer [::Google::Cloud::Channel::V1::Customer, ::Hash]
580
+ # Required. New contents of the customer.
581
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
582
+ # The update mask that applies to the resource.
583
+ # Optional.
584
+ #
585
+ # @yield [response, operation] Access the result along with the RPC operation
586
+ # @yieldparam response [::Google::Cloud::Channel::V1::Customer]
587
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
588
+ #
589
+ # @return [::Google::Cloud::Channel::V1::Customer]
590
+ #
591
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
592
+ #
593
+ def update_customer request, options = nil
594
+ raise ::ArgumentError, "request must be provided" if request.nil?
595
+
596
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateCustomerRequest
597
+
598
+ # Converts hash and nil to an options object
599
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
600
+
601
+ # Customize the options with defaults
602
+ metadata = @config.rpcs.update_customer.metadata.to_h
603
+
604
+ # Set x-goog-api-client and x-goog-user-project headers
605
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
606
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
607
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
608
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ header_params = {
611
+ "customer.name" => request.customer.name
612
+ }
613
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
614
+ metadata[:"x-goog-request-params"] ||= request_params_header
615
+
616
+ options.apply_defaults timeout: @config.rpcs.update_customer.timeout,
617
+ metadata: metadata,
618
+ retry_policy: @config.rpcs.update_customer.retry_policy
619
+ options.apply_defaults metadata: @config.metadata,
620
+ retry_policy: @config.retry_policy
621
+
622
+ @cloud_channel_service_stub.call_rpc :update_customer, request, options: options do |response, operation|
623
+ yield response, operation if block_given?
624
+ return response
625
+ end
626
+ rescue ::GRPC::BadStatus => e
627
+ raise ::Google::Cloud::Error.from_error(e)
628
+ end
629
+
630
+ ##
631
+ # Deletes the given {::Google::Cloud::Channel::V1::Customer Customer} permanently and irreversibly.
632
+ #
633
+ # Possible Error Codes:
634
+ #
635
+ # * PERMISSION_DENIED: If the account making the request does not own
636
+ # this customer.
637
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
638
+ # request.
639
+ # * FAILED_PRECONDITION: If the customer has existing entitlements.
640
+ # * NOT_FOUND: No {::Google::Cloud::Channel::V1::Customer Customer} resource found for the name
641
+ # specified in the request.
642
+ #
643
+ # @overload delete_customer(request, options = nil)
644
+ # Pass arguments to `delete_customer` via a request object, either of type
645
+ # {::Google::Cloud::Channel::V1::DeleteCustomerRequest} or an equivalent Hash.
646
+ #
647
+ # @param request [::Google::Cloud::Channel::V1::DeleteCustomerRequest, ::Hash]
648
+ # A request object representing the call parameters. Required. To specify no
649
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
650
+ # @param options [::Gapic::CallOptions, ::Hash]
651
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
652
+ #
653
+ # @overload delete_customer(name: nil)
654
+ # Pass arguments to `delete_customer` via keyword arguments. Note that at
655
+ # least one keyword argument is required. To specify no parameters, or to keep all
656
+ # the default parameter values, pass an empty Hash as a request object (see above).
657
+ #
658
+ # @param name [::String]
659
+ # Required. The resource name of the customer to delete.
660
+ #
661
+ # @yield [response, operation] Access the result along with the RPC operation
662
+ # @yieldparam response [::Google::Protobuf::Empty]
663
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
664
+ #
665
+ # @return [::Google::Protobuf::Empty]
666
+ #
667
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
668
+ #
669
+ def delete_customer request, options = nil
670
+ raise ::ArgumentError, "request must be provided" if request.nil?
671
+
672
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::DeleteCustomerRequest
673
+
674
+ # Converts hash and nil to an options object
675
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
676
+
677
+ # Customize the options with defaults
678
+ metadata = @config.rpcs.delete_customer.metadata.to_h
679
+
680
+ # Set x-goog-api-client and x-goog-user-project headers
681
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
682
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
683
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
684
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
685
+
686
+ header_params = {
687
+ "name" => request.name
688
+ }
689
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
690
+ metadata[:"x-goog-request-params"] ||= request_params_header
691
+
692
+ options.apply_defaults timeout: @config.rpcs.delete_customer.timeout,
693
+ metadata: metadata,
694
+ retry_policy: @config.rpcs.delete_customer.retry_policy
695
+ options.apply_defaults metadata: @config.metadata,
696
+ retry_policy: @config.retry_policy
697
+
698
+ @cloud_channel_service_stub.call_rpc :delete_customer, request, options: options do |response, operation|
699
+ yield response, operation if block_given?
700
+ return response
701
+ end
702
+ rescue ::GRPC::BadStatus => e
703
+ raise ::Google::Cloud::Error.from_error(e)
704
+ end
705
+
706
+ ##
707
+ # Creates a Cloud Identity for the given customer using the customer's
708
+ # information or the information provided here, if present.
709
+ #
710
+ # Possible Error Codes:
711
+ #
712
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
713
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the request.
714
+ # * NOT_FOUND: If the customer is not found for the reseller.
715
+ # * ALREADY_EXISTS: If the customer's primary email already exists. In this
716
+ # case, retry after changing the customer's primary contact email.
717
+ # * INTERNAL: Any non-user error related to a technical issue in the
718
+ # backend. Contact Cloud Channel support in this case.
719
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
720
+ # Contact Cloud Channel support in this case.
721
+ #
722
+ # Return Value:
723
+ # <br/> Long Running Operation ID.
724
+ #
725
+ # To get the results of the operation, call the GetOperation method of
726
+ # CloudChannelOperationsService. The Operation metadata will contain an
727
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
728
+ #
729
+ # @overload provision_cloud_identity(request, options = nil)
730
+ # Pass arguments to `provision_cloud_identity` via a request object, either of type
731
+ # {::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest} or an equivalent Hash.
732
+ #
733
+ # @param request [::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest, ::Hash]
734
+ # A request object representing the call parameters. Required. To specify no
735
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
736
+ # @param options [::Gapic::CallOptions, ::Hash]
737
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
738
+ #
739
+ # @overload provision_cloud_identity(customer: nil, cloud_identity_info: nil, user: nil, validate_only: nil)
740
+ # Pass arguments to `provision_cloud_identity` via keyword arguments. Note that at
741
+ # least one keyword argument is required. To specify no parameters, or to keep all
742
+ # the default parameter values, pass an empty Hash as a request object (see above).
743
+ #
744
+ # @param customer [::String]
745
+ # Required. Resource name of the customer.
746
+ # Format: accounts/\\{account_id}/customers/\\{customer_id}
747
+ # @param cloud_identity_info [::Google::Cloud::Channel::V1::CloudIdentityInfo, ::Hash]
748
+ # CloudIdentity-specific customer information.
749
+ # @param user [::Google::Cloud::Channel::V1::AdminUser, ::Hash]
750
+ # Admin user information.
751
+ # @param validate_only [::Boolean]
752
+ # If set, validate the request and preview the review, but do not actually
753
+ # post it.
754
+ #
755
+ # @yield [response, operation] Access the result along with the RPC operation
756
+ # @yieldparam response [::Gapic::Operation]
757
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
758
+ #
759
+ # @return [::Gapic::Operation]
760
+ #
761
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
762
+ #
763
+ def provision_cloud_identity request, options = nil
764
+ raise ::ArgumentError, "request must be provided" if request.nil?
765
+
766
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest
767
+
768
+ # Converts hash and nil to an options object
769
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
770
+
771
+ # Customize the options with defaults
772
+ metadata = @config.rpcs.provision_cloud_identity.metadata.to_h
773
+
774
+ # Set x-goog-api-client and x-goog-user-project headers
775
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
776
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
777
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
778
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
779
+
780
+ header_params = {
781
+ "customer" => request.customer
782
+ }
783
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
784
+ metadata[:"x-goog-request-params"] ||= request_params_header
785
+
786
+ options.apply_defaults timeout: @config.rpcs.provision_cloud_identity.timeout,
787
+ metadata: metadata,
788
+ retry_policy: @config.rpcs.provision_cloud_identity.retry_policy
789
+ options.apply_defaults metadata: @config.metadata,
790
+ retry_policy: @config.retry_policy
791
+
792
+ @cloud_channel_service_stub.call_rpc :provision_cloud_identity, request, options: options do |response, operation|
793
+ response = ::Gapic::Operation.new response, @operations_client, options: options
794
+ yield response, operation if block_given?
795
+ return response
796
+ end
797
+ rescue ::GRPC::BadStatus => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
801
+ ##
802
+ # List {::Google::Cloud::Channel::V1::Entitlement Entitlement}s belonging to a customer.
803
+ #
804
+ # Possible Error Codes:
805
+ #
806
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
807
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the request.
808
+ #
809
+ # Return Value:
810
+ # <br/> List of {::Google::Cloud::Channel::V1::Entitlement Entitlement}s belonging to the customer, or empty list if
811
+ # there are none.
812
+ #
813
+ # @overload list_entitlements(request, options = nil)
814
+ # Pass arguments to `list_entitlements` via a request object, either of type
815
+ # {::Google::Cloud::Channel::V1::ListEntitlementsRequest} or an equivalent Hash.
816
+ #
817
+ # @param request [::Google::Cloud::Channel::V1::ListEntitlementsRequest, ::Hash]
818
+ # A request object representing the call parameters. Required. To specify no
819
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
820
+ # @param options [::Gapic::CallOptions, ::Hash]
821
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
822
+ #
823
+ # @overload list_entitlements(parent: nil, page_size: nil, page_token: nil)
824
+ # Pass arguments to `list_entitlements` via keyword arguments. Note that at
825
+ # least one keyword argument is required. To specify no parameters, or to keep all
826
+ # the default parameter values, pass an empty Hash as a request object (see above).
827
+ #
828
+ # @param parent [::String]
829
+ # Required. The resource name of the reseller's customer account for which to list
830
+ # entitlements.
831
+ # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id}
832
+ # @param page_size [::Integer]
833
+ # Optional. Requested page size. Server might return fewer results than requested.
834
+ # If unspecified, at most 50 entitlements will be returned.
835
+ # The maximum value is 100; values above 100 will be coerced to 100.
836
+ # @param page_token [::String]
837
+ # Optional. A token identifying a page of results, if other than the first one.
838
+ # Typically obtained via
839
+ # {::Google::Cloud::Channel::V1::ListEntitlementsResponse#next_page_token ListEntitlementsResponse.next_page_token} of the previous
840
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_entitlements CloudChannelService.ListEntitlements} call.
841
+ #
842
+ # @yield [response, operation] Access the result along with the RPC operation
843
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>]
844
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
845
+ #
846
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Entitlement>]
847
+ #
848
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
849
+ #
850
+ def list_entitlements request, options = nil
851
+ raise ::ArgumentError, "request must be provided" if request.nil?
852
+
853
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListEntitlementsRequest
854
+
855
+ # Converts hash and nil to an options object
856
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
857
+
858
+ # Customize the options with defaults
859
+ metadata = @config.rpcs.list_entitlements.metadata.to_h
860
+
861
+ # Set x-goog-api-client and x-goog-user-project headers
862
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
863
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
864
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
865
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
866
+
867
+ header_params = {
868
+ "parent" => request.parent
869
+ }
870
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
871
+ metadata[:"x-goog-request-params"] ||= request_params_header
872
+
873
+ options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout,
874
+ metadata: metadata,
875
+ retry_policy: @config.rpcs.list_entitlements.retry_policy
876
+ options.apply_defaults metadata: @config.metadata,
877
+ retry_policy: @config.retry_policy
878
+
879
+ @cloud_channel_service_stub.call_rpc :list_entitlements, request, options: options do |response, operation|
880
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_entitlements, request, response, operation, options
881
+ yield response, operation if block_given?
882
+ return response
883
+ end
884
+ rescue ::GRPC::BadStatus => e
885
+ raise ::Google::Cloud::Error.from_error(e)
886
+ end
887
+
888
+ ##
889
+ # List {::Google::Cloud::Channel::V1::TransferableSku TransferableSku}s of a customer based on Cloud Identity ID or
890
+ # Customer Name in the request.
891
+ #
892
+ # This method is used when a reseller lists the entitlements
893
+ # information of a customer that is not owned. The reseller should provide
894
+ # the customer's Cloud Identity ID or Customer Name.
895
+ #
896
+ # Possible Error Codes:
897
+ # <ul>
898
+ # <li>PERMISSION_DENIED, due to one of the following reasons:
899
+ # <ul>
900
+ # <li> If the customer doesn't belong to the reseller and no auth token,
901
+ # or an invalid auth token is supplied. </li> <li> If the reseller account
902
+ # making the request and the reseller account being queried for are
903
+ # different. </li>
904
+ # </ul>
905
+ # </li>
906
+ # <li> INVALID_ARGUMENT: Missing or invalid required parameters in the
907
+ # request.</li>
908
+ # </ul>
909
+ #
910
+ # Return Value:
911
+ # <br/> List of {::Google::Cloud::Channel::V1::TransferableSku TransferableSku} for the given customer.
912
+ #
913
+ # @overload list_transferable_skus(request, options = nil)
914
+ # Pass arguments to `list_transferable_skus` via a request object, either of type
915
+ # {::Google::Cloud::Channel::V1::ListTransferableSkusRequest} or an equivalent Hash.
916
+ #
917
+ # @param request [::Google::Cloud::Channel::V1::ListTransferableSkusRequest, ::Hash]
918
+ # A request object representing the call parameters. Required. To specify no
919
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
920
+ # @param options [::Gapic::CallOptions, ::Hash]
921
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
922
+ #
923
+ # @overload list_transferable_skus(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, auth_token: nil, language_code: nil)
924
+ # Pass arguments to `list_transferable_skus` via keyword arguments. Note that at
925
+ # least one keyword argument is required. To specify no parameters, or to keep all
926
+ # the default parameter values, pass an empty Hash as a request object (see above).
927
+ #
928
+ # @param cloud_identity_id [::String]
929
+ # Customer's Cloud Identity ID
930
+ # @param customer_name [::String]
931
+ # A reseller is required to create a customer and use the resource name of
932
+ # the created customer here.
933
+ # The customer_name takes the format:
934
+ # accounts/\\{account_id}/customers/\\{customer_id}
935
+ # @param parent [::String]
936
+ # Required. The resource name of the reseller's account.
937
+ # The parent takes the format: accounts/\\{account_id}
938
+ # @param page_size [::Integer]
939
+ # Requested page size. Server might return fewer results than requested.
940
+ # If unspecified, at most 100 SKUs will be returned.
941
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
942
+ # Optional.
943
+ # @param page_token [::String]
944
+ # A token identifying a page of results, if other than the first one.
945
+ # Typically obtained via
946
+ # {::Google::Cloud::Channel::V1::ListTransferableSkusResponse#next_page_token ListTransferableSkusResponse.next_page_token} of the previous
947
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_skus CloudChannelService.ListTransferableSkus} call.
948
+ # Optional.
949
+ # @param auth_token [::String]
950
+ # This token is generated by the Super Admin of the resold customer to
951
+ # authorize a reseller to access their Cloud Identity and purchase
952
+ # entitlements on their behalf. This token can be omitted once the
953
+ # authorization is generated. See https://support.google.com/a/answer/7643790
954
+ # for more details.
955
+ # @param language_code [::String]
956
+ # The BCP-47 language code, such as "en-US". If specified, the
957
+ # response will be localized to the corresponding language code. Default is
958
+ # "en-US".
959
+ # Optional.
960
+ #
961
+ # @yield [response, operation] Access the result along with the RPC operation
962
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>]
963
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
964
+ #
965
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableSku>]
966
+ #
967
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
968
+ #
969
+ def list_transferable_skus request, options = nil
970
+ raise ::ArgumentError, "request must be provided" if request.nil?
971
+
972
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListTransferableSkusRequest
973
+
974
+ # Converts hash and nil to an options object
975
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
976
+
977
+ # Customize the options with defaults
978
+ metadata = @config.rpcs.list_transferable_skus.metadata.to_h
979
+
980
+ # Set x-goog-api-client and x-goog-user-project headers
981
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
982
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
983
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
984
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
985
+
986
+ header_params = {
987
+ "parent" => request.parent
988
+ }
989
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
990
+ metadata[:"x-goog-request-params"] ||= request_params_header
991
+
992
+ options.apply_defaults timeout: @config.rpcs.list_transferable_skus.timeout,
993
+ metadata: metadata,
994
+ retry_policy: @config.rpcs.list_transferable_skus.retry_policy
995
+ options.apply_defaults metadata: @config.metadata,
996
+ retry_policy: @config.retry_policy
997
+
998
+ @cloud_channel_service_stub.call_rpc :list_transferable_skus, request, options: options do |response, operation|
999
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_transferable_skus, request, response, operation, options
1000
+ yield response, operation if block_given?
1001
+ return response
1002
+ end
1003
+ rescue ::GRPC::BadStatus => e
1004
+ raise ::Google::Cloud::Error.from_error(e)
1005
+ end
1006
+
1007
+ ##
1008
+ # List {::Google::Cloud::Channel::V1::TransferableOffer TransferableOffer}s of a customer based on Cloud Identity ID or
1009
+ # Customer Name in the request.
1010
+ #
1011
+ # This method is used when a reseller gets the entitlement
1012
+ # information of a customer that is not owned. The reseller should provide
1013
+ # the customer's Cloud Identity ID or Customer Name.
1014
+ #
1015
+ # Possible Error Codes:
1016
+ #
1017
+ # * PERMISSION_DENIED, due to one of the following reasons: (a) If the
1018
+ # customer doesn't belong to the reseller and no auth token or invalid auth
1019
+ # token is supplied. (b) If the reseller account making the request and the
1020
+ # reseller account being queried for are different.
1021
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1022
+ # request.
1023
+ #
1024
+ # Return Value:
1025
+ # List of {::Google::Cloud::Channel::V1::TransferableOffer TransferableOffer} for the given customer and SKU.
1026
+ #
1027
+ # @overload list_transferable_offers(request, options = nil)
1028
+ # Pass arguments to `list_transferable_offers` via a request object, either of type
1029
+ # {::Google::Cloud::Channel::V1::ListTransferableOffersRequest} or an equivalent Hash.
1030
+ #
1031
+ # @param request [::Google::Cloud::Channel::V1::ListTransferableOffersRequest, ::Hash]
1032
+ # A request object representing the call parameters. Required. To specify no
1033
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1034
+ # @param options [::Gapic::CallOptions, ::Hash]
1035
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1036
+ #
1037
+ # @overload list_transferable_offers(cloud_identity_id: nil, customer_name: nil, parent: nil, page_size: nil, page_token: nil, sku: nil, language_code: nil)
1038
+ # Pass arguments to `list_transferable_offers` via keyword arguments. Note that at
1039
+ # least one keyword argument is required. To specify no parameters, or to keep all
1040
+ # the default parameter values, pass an empty Hash as a request object (see above).
1041
+ #
1042
+ # @param cloud_identity_id [::String]
1043
+ # Customer's Cloud Identity ID
1044
+ # @param customer_name [::String]
1045
+ # A reseller should create a customer and use the resource name of
1046
+ # the created customer here.
1047
+ # @param parent [::String]
1048
+ # Required. The resource name of the reseller's account.
1049
+ # @param page_size [::Integer]
1050
+ # Requested page size. Server might return fewer results than requested.
1051
+ # If unspecified, at most 100 Offers will be returned.
1052
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1053
+ # @param page_token [::String]
1054
+ # A token identifying a page of results, if other than the first one.
1055
+ # Typically obtained via
1056
+ # {::Google::Cloud::Channel::V1::ListTransferableOffersResponse#next_page_token ListTransferableOffersResponse.next_page_token} of the previous
1057
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_offers CloudChannelService.ListTransferableOffers} call.
1058
+ # @param sku [::String]
1059
+ # Required. SKU for which the Offers are being looked up.
1060
+ # @param language_code [::String]
1061
+ # The BCP-47 language code, such as "en-US". If specified, the
1062
+ # response will be localized to the corresponding language code. Default is
1063
+ # "en-US".
1064
+ #
1065
+ # @yield [response, operation] Access the result along with the RPC operation
1066
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>]
1067
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1068
+ #
1069
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::TransferableOffer>]
1070
+ #
1071
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1072
+ #
1073
+ def list_transferable_offers request, options = nil
1074
+ raise ::ArgumentError, "request must be provided" if request.nil?
1075
+
1076
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListTransferableOffersRequest
1077
+
1078
+ # Converts hash and nil to an options object
1079
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1080
+
1081
+ # Customize the options with defaults
1082
+ metadata = @config.rpcs.list_transferable_offers.metadata.to_h
1083
+
1084
+ # Set x-goog-api-client and x-goog-user-project headers
1085
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1086
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1087
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1088
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1089
+
1090
+ header_params = {
1091
+ "parent" => request.parent
1092
+ }
1093
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1094
+ metadata[:"x-goog-request-params"] ||= request_params_header
1095
+
1096
+ options.apply_defaults timeout: @config.rpcs.list_transferable_offers.timeout,
1097
+ metadata: metadata,
1098
+ retry_policy: @config.rpcs.list_transferable_offers.retry_policy
1099
+ options.apply_defaults metadata: @config.metadata,
1100
+ retry_policy: @config.retry_policy
1101
+
1102
+ @cloud_channel_service_stub.call_rpc :list_transferable_offers, request, options: options do |response, operation|
1103
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_transferable_offers, request, response, operation, options
1104
+ yield response, operation if block_given?
1105
+ return response
1106
+ end
1107
+ rescue ::GRPC::BadStatus => e
1108
+ raise ::Google::Cloud::Error.from_error(e)
1109
+ end
1110
+
1111
+ ##
1112
+ # Returns a requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource.
1113
+ #
1114
+ # Possible Error Codes:
1115
+ #
1116
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1117
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1118
+ # request.
1119
+ # * NOT_FOUND: If the entitlement is not found for the customer.
1120
+ #
1121
+ # Return Value:
1122
+ # <br/> If found, the requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource, otherwise returns
1123
+ # an error.
1124
+ #
1125
+ # @overload get_entitlement(request, options = nil)
1126
+ # Pass arguments to `get_entitlement` via a request object, either of type
1127
+ # {::Google::Cloud::Channel::V1::GetEntitlementRequest} or an equivalent Hash.
1128
+ #
1129
+ # @param request [::Google::Cloud::Channel::V1::GetEntitlementRequest, ::Hash]
1130
+ # A request object representing the call parameters. Required. To specify no
1131
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1132
+ # @param options [::Gapic::CallOptions, ::Hash]
1133
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1134
+ #
1135
+ # @overload get_entitlement(name: nil)
1136
+ # Pass arguments to `get_entitlement` via keyword arguments. Note that at
1137
+ # least one keyword argument is required. To specify no parameters, or to keep all
1138
+ # the default parameter values, pass an empty Hash as a request object (see above).
1139
+ #
1140
+ # @param name [::String]
1141
+ # Required. The resource name of the entitlement to retrieve.
1142
+ # The name takes the format:
1143
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{id}
1144
+ #
1145
+ # @yield [response, operation] Access the result along with the RPC operation
1146
+ # @yieldparam response [::Google::Cloud::Channel::V1::Entitlement]
1147
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1148
+ #
1149
+ # @return [::Google::Cloud::Channel::V1::Entitlement]
1150
+ #
1151
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1152
+ #
1153
+ def get_entitlement request, options = nil
1154
+ raise ::ArgumentError, "request must be provided" if request.nil?
1155
+
1156
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetEntitlementRequest
1157
+
1158
+ # Converts hash and nil to an options object
1159
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1160
+
1161
+ # Customize the options with defaults
1162
+ metadata = @config.rpcs.get_entitlement.metadata.to_h
1163
+
1164
+ # Set x-goog-api-client and x-goog-user-project headers
1165
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1166
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1167
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1168
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1169
+
1170
+ header_params = {
1171
+ "name" => request.name
1172
+ }
1173
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1174
+ metadata[:"x-goog-request-params"] ||= request_params_header
1175
+
1176
+ options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout,
1177
+ metadata: metadata,
1178
+ retry_policy: @config.rpcs.get_entitlement.retry_policy
1179
+ options.apply_defaults metadata: @config.metadata,
1180
+ retry_policy: @config.retry_policy
1181
+
1182
+ @cloud_channel_service_stub.call_rpc :get_entitlement, request, options: options do |response, operation|
1183
+ yield response, operation if block_given?
1184
+ return response
1185
+ end
1186
+ rescue ::GRPC::BadStatus => e
1187
+ raise ::Google::Cloud::Error.from_error(e)
1188
+ end
1189
+
1190
+ ##
1191
+ # Creates an entitlement for a customer.
1192
+ #
1193
+ # Possible Error Codes:
1194
+ # <ul>
1195
+ # <li> PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1196
+ # </li> <li> INVALID_ARGUMENT: <ul>
1197
+ # <li> Missing or invalid required parameters in the request. </li>
1198
+ # <li> Cannot purchase an entitlement if there is already an
1199
+ # entitlement for customer, for a SKU from the same product family. </li>
1200
+ # <li> INVALID_VALUE: Offer passed in isn't valid. Make sure OfferId is
1201
+ # valid. If it is valid, then contact Google Channel support for further
1202
+ # troubleshooting. </li>
1203
+ # </ul>
1204
+ # </li>
1205
+ # <li> NOT_FOUND: If the customer or offer resource is not found for the
1206
+ # reseller. </li>
1207
+ # <li> ALREADY_EXISTS: This failure can happen in the following cases:
1208
+ # <ul>
1209
+ # <li>If the SKU has been already purchased for the customer.</li>
1210
+ # <li>If the customer's primary email already exists. In this case retry
1211
+ # after changing the customer's primary contact email.
1212
+ # </li>
1213
+ # </ul>
1214
+ # </li>
1215
+ # <li> CONDITION_NOT_MET or FAILED_PRECONDITION: This
1216
+ # failure can happen in the following cases:
1217
+ # <ul>
1218
+ # <li> Purchasing a SKU that requires domain verification and the
1219
+ # domain has not been verified. </li>
1220
+ # <li> Purchasing an Add-On SKU like Vault or Drive without purchasing
1221
+ # the pre-requisite SKU, such as Google Workspace Business Starter. </li>
1222
+ # <li> Applicable only for developer accounts: reseller and resold
1223
+ # domain. Must meet the following domain naming requirements:
1224
+ # <ul>
1225
+ # <li> Domain names must start with goog-test. </li>
1226
+ # <li> Resold domain names must include the reseller domain. </li>
1227
+ # </ul>
1228
+ # </li>
1229
+ # </ul>
1230
+ # </li>
1231
+ # <li> INTERNAL: Any non-user error related to a technical issue in the
1232
+ # backend. Contact Cloud Channel Support in this case. </li>
1233
+ # <li> UNKNOWN: Any non-user error related to a technical issue in the
1234
+ # backend. Contact Cloud Channel Support in this case. </li>
1235
+ # </ul>
1236
+ #
1237
+ # Return Value:
1238
+ # <br/> Long Running Operation ID.
1239
+ #
1240
+ # To get the results of the operation, call the GetOperation method of
1241
+ # CloudChannelOperationsService. The Operation metadata will contain an
1242
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1243
+ #
1244
+ # @overload create_entitlement(request, options = nil)
1245
+ # Pass arguments to `create_entitlement` via a request object, either of type
1246
+ # {::Google::Cloud::Channel::V1::CreateEntitlementRequest} or an equivalent Hash.
1247
+ #
1248
+ # @param request [::Google::Cloud::Channel::V1::CreateEntitlementRequest, ::Hash]
1249
+ # A request object representing the call parameters. Required. To specify no
1250
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1251
+ # @param options [::Gapic::CallOptions, ::Hash]
1252
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1253
+ #
1254
+ # @overload create_entitlement(parent: nil, entitlement: nil, request_id: nil)
1255
+ # Pass arguments to `create_entitlement` via keyword arguments. Note that at
1256
+ # least one keyword argument is required. To specify no parameters, or to keep all
1257
+ # the default parameter values, pass an empty Hash as a request object (see above).
1258
+ #
1259
+ # @param parent [::String]
1260
+ # Required. The resource name of reseller's customer account in which to create the
1261
+ # entitlement.
1262
+ # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id}
1263
+ # @param entitlement [::Google::Cloud::Channel::V1::Entitlement, ::Hash]
1264
+ # Required. The entitlement to create.
1265
+ # @param request_id [::String]
1266
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1267
+ # that if you must retry your request, the server will know to ignore the
1268
+ # request if it has already been completed.
1269
+ #
1270
+ # For example, consider a situation where you make an initial request and
1271
+ # the request times out. If you make the request again with the same
1272
+ # request ID, the server can check if the original operation with the same
1273
+ # request ID was received, and if so, will ignore the second request.
1274
+ #
1275
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1276
+ # with the exception that zero UUID is not supported
1277
+ # (`00000000-0000-0000-0000-000000000000`).
1278
+ #
1279
+ # @yield [response, operation] Access the result along with the RPC operation
1280
+ # @yieldparam response [::Gapic::Operation]
1281
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1282
+ #
1283
+ # @return [::Gapic::Operation]
1284
+ #
1285
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1286
+ #
1287
+ def create_entitlement request, options = nil
1288
+ raise ::ArgumentError, "request must be provided" if request.nil?
1289
+
1290
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateEntitlementRequest
1291
+
1292
+ # Converts hash and nil to an options object
1293
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1294
+
1295
+ # Customize the options with defaults
1296
+ metadata = @config.rpcs.create_entitlement.metadata.to_h
1297
+
1298
+ # Set x-goog-api-client and x-goog-user-project headers
1299
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1300
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1301
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1302
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1303
+
1304
+ header_params = {
1305
+ "parent" => request.parent
1306
+ }
1307
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1308
+ metadata[:"x-goog-request-params"] ||= request_params_header
1309
+
1310
+ options.apply_defaults timeout: @config.rpcs.create_entitlement.timeout,
1311
+ metadata: metadata,
1312
+ retry_policy: @config.rpcs.create_entitlement.retry_policy
1313
+ options.apply_defaults metadata: @config.metadata,
1314
+ retry_policy: @config.retry_policy
1315
+
1316
+ @cloud_channel_service_stub.call_rpc :create_entitlement, request, options: options do |response, operation|
1317
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1318
+ yield response, operation if block_given?
1319
+ return response
1320
+ end
1321
+ rescue ::GRPC::BadStatus => e
1322
+ raise ::Google::Cloud::Error.from_error(e)
1323
+ end
1324
+
1325
+ ##
1326
+ # Change parameters of the entitlement
1327
+ #
1328
+ # An entitlement parameters update is a long-running operation and results in
1329
+ # updates to the entitlement as a result of fulfillment.
1330
+ #
1331
+ # Possible Error Codes:
1332
+ #
1333
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1334
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1335
+ # request. For example, if the number of seats being changed to is greater
1336
+ # than the allowed number of max seats for the resource. Or decreasing seats
1337
+ # for a commitment based plan.
1338
+ # * NOT_FOUND: Entitlement resource not found.
1339
+ # * INTERNAL: Any non-user error related to a technical issue
1340
+ # in the backend. In this case, contact Cloud Channel support.
1341
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
1342
+ # In this case, contact Cloud Channel support.
1343
+ #
1344
+ # Return Value:
1345
+ # <br/> Long Running Operation ID.
1346
+ #
1347
+ # To get the results of the operation, call the GetOperation method of
1348
+ # CloudChannelOperationsService. The Operation metadata will contain an
1349
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1350
+ #
1351
+ # @overload change_parameters(request, options = nil)
1352
+ # Pass arguments to `change_parameters` via a request object, either of type
1353
+ # {::Google::Cloud::Channel::V1::ChangeParametersRequest} or an equivalent Hash.
1354
+ #
1355
+ # @param request [::Google::Cloud::Channel::V1::ChangeParametersRequest, ::Hash]
1356
+ # A request object representing the call parameters. Required. To specify no
1357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1358
+ # @param options [::Gapic::CallOptions, ::Hash]
1359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1360
+ #
1361
+ # @overload change_parameters(name: nil, parameters: nil, request_id: nil, purchase_order_id: nil)
1362
+ # Pass arguments to `change_parameters` via keyword arguments. Note that at
1363
+ # least one keyword argument is required. To specify no parameters, or to keep all
1364
+ # the default parameter values, pass an empty Hash as a request object (see above).
1365
+ #
1366
+ # @param name [::String]
1367
+ # Required. The name of the entitlement to update.
1368
+ # The name takes the format:
1369
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1370
+ # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>]
1371
+ # Required. Entitlement parameters to update. Only editable parameters are allowed to
1372
+ # be changed.
1373
+ # @param request_id [::String]
1374
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1375
+ # that if you must retry your request, the server will know to ignore the
1376
+ # request if it has already been completed.
1377
+ #
1378
+ # For example, consider a situation where you make an initial request and
1379
+ # the request times out. If you make the request again with the same
1380
+ # request ID, the server can check if the original operation with the same
1381
+ # request ID was received, and if so, will ignore the second request.
1382
+ #
1383
+ # The request ID must be
1384
+ # a valid [UUID](https://tools.ietf.org/html/rfc4122) with the exception that
1385
+ # zero UUID is not supported
1386
+ # (`00000000-0000-0000-0000-000000000000`).
1387
+ # @param purchase_order_id [::String]
1388
+ # Optional. Purchase order ID provided by the reseller.
1389
+ #
1390
+ # @yield [response, operation] Access the result along with the RPC operation
1391
+ # @yieldparam response [::Gapic::Operation]
1392
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1393
+ #
1394
+ # @return [::Gapic::Operation]
1395
+ #
1396
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1397
+ #
1398
+ def change_parameters request, options = nil
1399
+ raise ::ArgumentError, "request must be provided" if request.nil?
1400
+
1401
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeParametersRequest
1402
+
1403
+ # Converts hash and nil to an options object
1404
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1405
+
1406
+ # Customize the options with defaults
1407
+ metadata = @config.rpcs.change_parameters.metadata.to_h
1408
+
1409
+ # Set x-goog-api-client and x-goog-user-project headers
1410
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1411
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1412
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1413
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1414
+
1415
+ header_params = {
1416
+ "name" => request.name
1417
+ }
1418
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1419
+ metadata[:"x-goog-request-params"] ||= request_params_header
1420
+
1421
+ options.apply_defaults timeout: @config.rpcs.change_parameters.timeout,
1422
+ metadata: metadata,
1423
+ retry_policy: @config.rpcs.change_parameters.retry_policy
1424
+ options.apply_defaults metadata: @config.metadata,
1425
+ retry_policy: @config.retry_policy
1426
+
1427
+ @cloud_channel_service_stub.call_rpc :change_parameters, request, options: options do |response, operation|
1428
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1429
+ yield response, operation if block_given?
1430
+ return response
1431
+ end
1432
+ rescue ::GRPC::BadStatus => e
1433
+ raise ::Google::Cloud::Error.from_error(e)
1434
+ end
1435
+
1436
+ ##
1437
+ # Updates the renewal settings for an existing customer entitlement.
1438
+ #
1439
+ # An entitlement update is a long-running operation and results in updates to
1440
+ # the entitlement as a result of fulfillment.
1441
+ #
1442
+ # Possible Error Codes:
1443
+ #
1444
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1445
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1446
+ # request.
1447
+ # * NOT_FOUND: Entitlement resource not found.
1448
+ # * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a
1449
+ # commitment plan. Can't enable or disable renewal for non-commitment plans.
1450
+ # * INTERNAL: Any non user error related to a technical issue in the
1451
+ # backend. In this case, contact Cloud Channel support.
1452
+ # * UNKNOWN: Any non user error related to a technical issue in the backend.
1453
+ # In this case, contact Cloud Channel support.
1454
+ #
1455
+ # Return Value:
1456
+ # <br/> Long Running Operation ID.
1457
+ #
1458
+ # To get the results of the operation, call the GetOperation method of
1459
+ # CloudChannelOperationsService. The Operation metadata will contain an
1460
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1461
+ #
1462
+ # @overload change_renewal_settings(request, options = nil)
1463
+ # Pass arguments to `change_renewal_settings` via a request object, either of type
1464
+ # {::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest} or an equivalent Hash.
1465
+ #
1466
+ # @param request [::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest, ::Hash]
1467
+ # A request object representing the call parameters. Required. To specify no
1468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1469
+ # @param options [::Gapic::CallOptions, ::Hash]
1470
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1471
+ #
1472
+ # @overload change_renewal_settings(name: nil, renewal_settings: nil, request_id: nil)
1473
+ # Pass arguments to `change_renewal_settings` via keyword arguments. Note that at
1474
+ # least one keyword argument is required. To specify no parameters, or to keep all
1475
+ # the default parameter values, pass an empty Hash as a request object (see above).
1476
+ #
1477
+ # @param name [::String]
1478
+ # Required. The name of the entitlement to update.
1479
+ # The name takes the format:
1480
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1481
+ # @param renewal_settings [::Google::Cloud::Channel::V1::RenewalSettings, ::Hash]
1482
+ # Required. New renewal settings.
1483
+ # @param request_id [::String]
1484
+ # Optional. A request ID to identify requests. Specify a unique request ID so
1485
+ # that if you must retry your request, the server will know to ignore the
1486
+ # request if it has already been completed.
1487
+ #
1488
+ # For example, consider a situation where you make an initial request and
1489
+ # the request times out. If you make the request again with the same
1490
+ # request ID, the server can check if the original operation with the same
1491
+ # request ID was received, and if so, will ignore the second request.
1492
+ #
1493
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1494
+ # with the exception that zero UUID is not supported
1495
+ # (`00000000-0000-0000-0000-000000000000`).
1496
+ #
1497
+ # @yield [response, operation] Access the result along with the RPC operation
1498
+ # @yieldparam response [::Gapic::Operation]
1499
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1500
+ #
1501
+ # @return [::Gapic::Operation]
1502
+ #
1503
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1504
+ #
1505
+ def change_renewal_settings request, options = nil
1506
+ raise ::ArgumentError, "request must be provided" if request.nil?
1507
+
1508
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest
1509
+
1510
+ # Converts hash and nil to an options object
1511
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1512
+
1513
+ # Customize the options with defaults
1514
+ metadata = @config.rpcs.change_renewal_settings.metadata.to_h
1515
+
1516
+ # Set x-goog-api-client and x-goog-user-project headers
1517
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1518
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1519
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1520
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1521
+
1522
+ header_params = {
1523
+ "name" => request.name
1524
+ }
1525
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1526
+ metadata[:"x-goog-request-params"] ||= request_params_header
1527
+
1528
+ options.apply_defaults timeout: @config.rpcs.change_renewal_settings.timeout,
1529
+ metadata: metadata,
1530
+ retry_policy: @config.rpcs.change_renewal_settings.retry_policy
1531
+ options.apply_defaults metadata: @config.metadata,
1532
+ retry_policy: @config.retry_policy
1533
+
1534
+ @cloud_channel_service_stub.call_rpc :change_renewal_settings, request, options: options do |response, operation|
1535
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1536
+ yield response, operation if block_given?
1537
+ return response
1538
+ end
1539
+ rescue ::GRPC::BadStatus => e
1540
+ raise ::Google::Cloud::Error.from_error(e)
1541
+ end
1542
+
1543
+ ##
1544
+ # Updates the Offer for an existing customer entitlement.
1545
+ #
1546
+ # An entitlement update is a long-running operation and results in updates to
1547
+ # the entitlement as a result of fulfillment.
1548
+ #
1549
+ # Possible Error Codes:
1550
+ #
1551
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1552
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1553
+ # request.
1554
+ # * NOT_FOUND: Offer or Entitlement resource not found.
1555
+ # * INTERNAL: Any non-user error related to a technical issue in the backend.
1556
+ # In this case, contact Cloud Channel support.
1557
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
1558
+ # In this case, contact Cloud Channel support.
1559
+ #
1560
+ # Return Value:
1561
+ # <br/> Long Running Operation ID.
1562
+ #
1563
+ # To get the results of the operation, call the GetOperation method of
1564
+ # CloudChannelOperationsService. The Operation metadata will contain an
1565
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1566
+ #
1567
+ # @overload change_offer(request, options = nil)
1568
+ # Pass arguments to `change_offer` via a request object, either of type
1569
+ # {::Google::Cloud::Channel::V1::ChangeOfferRequest} or an equivalent Hash.
1570
+ #
1571
+ # @param request [::Google::Cloud::Channel::V1::ChangeOfferRequest, ::Hash]
1572
+ # A request object representing the call parameters. Required. To specify no
1573
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1574
+ # @param options [::Gapic::CallOptions, ::Hash]
1575
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1576
+ #
1577
+ # @overload change_offer(name: nil, offer: nil, parameters: nil, purchase_order_id: nil, request_id: nil)
1578
+ # Pass arguments to `change_offer` via keyword arguments. Note that at
1579
+ # least one keyword argument is required. To specify no parameters, or to keep all
1580
+ # the default parameter values, pass an empty Hash as a request object (see above).
1581
+ #
1582
+ # @param name [::String]
1583
+ # Required. The name of the entitlement to update.
1584
+ # Format:
1585
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1586
+ # @param offer [::String]
1587
+ # Required. New Offer.
1588
+ # Format: accounts/\\{account_id}/offers/\\{offer_id}.
1589
+ # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>]
1590
+ # Optional. Parameters needed to purchase the Offer.
1591
+ # @param purchase_order_id [::String]
1592
+ # Optional. Purchase order id provided by the reseller.
1593
+ # @param request_id [::String]
1594
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1595
+ # that if you must retry your request, the server will know to ignore the
1596
+ # request if it has already been completed.
1597
+ #
1598
+ # For example, consider a situation where you make an initial request and
1599
+ # the request times out. If you make the request again with the same
1600
+ # request ID, the server can check if the original operation with the same
1601
+ # request ID was received, and if so, will ignore the second request.
1602
+ #
1603
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1604
+ # with the exception that zero UUID is not supported
1605
+ # (`00000000-0000-0000-0000-000000000000`).
1606
+ #
1607
+ # @yield [response, operation] Access the result along with the RPC operation
1608
+ # @yieldparam response [::Gapic::Operation]
1609
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1610
+ #
1611
+ # @return [::Gapic::Operation]
1612
+ #
1613
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1614
+ #
1615
+ def change_offer request, options = nil
1616
+ raise ::ArgumentError, "request must be provided" if request.nil?
1617
+
1618
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ChangeOfferRequest
1619
+
1620
+ # Converts hash and nil to an options object
1621
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1622
+
1623
+ # Customize the options with defaults
1624
+ metadata = @config.rpcs.change_offer.metadata.to_h
1625
+
1626
+ # Set x-goog-api-client and x-goog-user-project headers
1627
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1628
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1629
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1630
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1631
+
1632
+ header_params = {
1633
+ "name" => request.name
1634
+ }
1635
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1636
+ metadata[:"x-goog-request-params"] ||= request_params_header
1637
+
1638
+ options.apply_defaults timeout: @config.rpcs.change_offer.timeout,
1639
+ metadata: metadata,
1640
+ retry_policy: @config.rpcs.change_offer.retry_policy
1641
+ options.apply_defaults metadata: @config.metadata,
1642
+ retry_policy: @config.retry_policy
1643
+
1644
+ @cloud_channel_service_stub.call_rpc :change_offer, request, options: options do |response, operation|
1645
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1646
+ yield response, operation if block_given?
1647
+ return response
1648
+ end
1649
+ rescue ::GRPC::BadStatus => e
1650
+ raise ::Google::Cloud::Error.from_error(e)
1651
+ end
1652
+
1653
+ ##
1654
+ # Starts paid service for a trial entitlement.
1655
+ #
1656
+ # Starts paid service for a trial entitlement immediately. This method is
1657
+ # only applicable if a plan has already been set up for a trial entitlement
1658
+ # but has some trial days remaining.
1659
+ #
1660
+ # Possible Error Codes:
1661
+ #
1662
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1663
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1664
+ # request.
1665
+ # * NOT_FOUND: Entitlement resource not found.
1666
+ # * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for
1667
+ # entitlement on trial plans.
1668
+ # * INTERNAL: Any non-user error related to a technical issue in the backend.
1669
+ # In this case, contact Cloud Channel support.
1670
+ # * UNKNOWN: Any non-user error related to a technical issue
1671
+ # in the backend. In this case, contact Cloud Channel support.
1672
+ #
1673
+ # Return Value:
1674
+ # <br/> Long Running Operation ID.
1675
+ #
1676
+ # To get the results of the operation, call the GetOperation method of
1677
+ # CloudChannelOperationsService. The Operation metadata will contain an
1678
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1679
+ #
1680
+ # @overload start_paid_service(request, options = nil)
1681
+ # Pass arguments to `start_paid_service` via a request object, either of type
1682
+ # {::Google::Cloud::Channel::V1::StartPaidServiceRequest} or an equivalent Hash.
1683
+ #
1684
+ # @param request [::Google::Cloud::Channel::V1::StartPaidServiceRequest, ::Hash]
1685
+ # A request object representing the call parameters. Required. To specify no
1686
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1687
+ # @param options [::Gapic::CallOptions, ::Hash]
1688
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1689
+ #
1690
+ # @overload start_paid_service(name: nil, request_id: nil)
1691
+ # Pass arguments to `start_paid_service` via keyword arguments. Note that at
1692
+ # least one keyword argument is required. To specify no parameters, or to keep all
1693
+ # the default parameter values, pass an empty Hash as a request object (see above).
1694
+ #
1695
+ # @param name [::String]
1696
+ # Required. The name of the entitlement for which paid service is being started.
1697
+ # The name takes the format:
1698
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1699
+ # @param request_id [::String]
1700
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1701
+ # that if you must retry your request, the server will know to ignore the
1702
+ # request if it has already been completed.
1703
+ #
1704
+ # For example, consider a situation where you make an initial request and
1705
+ # the request times out. If you make the request again with the same
1706
+ # request ID, the server can check if the original operation with the same
1707
+ # request ID was received, and if so, will ignore the second request.
1708
+ #
1709
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1710
+ # with the exception that zero UUID is not supported
1711
+ # (`00000000-0000-0000-0000-000000000000`).
1712
+ #
1713
+ # @yield [response, operation] Access the result along with the RPC operation
1714
+ # @yieldparam response [::Gapic::Operation]
1715
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1716
+ #
1717
+ # @return [::Gapic::Operation]
1718
+ #
1719
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1720
+ #
1721
+ def start_paid_service request, options = nil
1722
+ raise ::ArgumentError, "request must be provided" if request.nil?
1723
+
1724
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::StartPaidServiceRequest
1725
+
1726
+ # Converts hash and nil to an options object
1727
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1728
+
1729
+ # Customize the options with defaults
1730
+ metadata = @config.rpcs.start_paid_service.metadata.to_h
1731
+
1732
+ # Set x-goog-api-client and x-goog-user-project headers
1733
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1734
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1735
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1736
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1737
+
1738
+ header_params = {
1739
+ "name" => request.name
1740
+ }
1741
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1742
+ metadata[:"x-goog-request-params"] ||= request_params_header
1743
+
1744
+ options.apply_defaults timeout: @config.rpcs.start_paid_service.timeout,
1745
+ metadata: metadata,
1746
+ retry_policy: @config.rpcs.start_paid_service.retry_policy
1747
+ options.apply_defaults metadata: @config.metadata,
1748
+ retry_policy: @config.retry_policy
1749
+
1750
+ @cloud_channel_service_stub.call_rpc :start_paid_service, request, options: options do |response, operation|
1751
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1752
+ yield response, operation if block_given?
1753
+ return response
1754
+ end
1755
+ rescue ::GRPC::BadStatus => e
1756
+ raise ::Google::Cloud::Error.from_error(e)
1757
+ end
1758
+
1759
+ ##
1760
+ # Suspends a previously fulfilled entitlement.
1761
+ # An entitlement suspension is a long-running operation.
1762
+ #
1763
+ # Possible Error Codes:
1764
+ #
1765
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller.
1766
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1767
+ # request.
1768
+ # * NOT_FOUND: Entitlement resource not found.
1769
+ # * NOT_ACTIVE: Entitlement is not active.
1770
+ # * INTERNAL: Any non-user error related to a technical issue in the backend.
1771
+ # In this case, contact Cloud Channel support.
1772
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
1773
+ # In this case, contact Cloud Channel support.
1774
+ #
1775
+ # Return Value:
1776
+ # <br/> Long Running Operation ID.
1777
+ #
1778
+ # To get the results of the operation, call the GetOperation method of
1779
+ # CloudChannelOperationsService. The Operation metadata will contain an
1780
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1781
+ #
1782
+ # @overload suspend_entitlement(request, options = nil)
1783
+ # Pass arguments to `suspend_entitlement` via a request object, either of type
1784
+ # {::Google::Cloud::Channel::V1::SuspendEntitlementRequest} or an equivalent Hash.
1785
+ #
1786
+ # @param request [::Google::Cloud::Channel::V1::SuspendEntitlementRequest, ::Hash]
1787
+ # A request object representing the call parameters. Required. To specify no
1788
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1789
+ # @param options [::Gapic::CallOptions, ::Hash]
1790
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1791
+ #
1792
+ # @overload suspend_entitlement(name: nil, request_id: nil)
1793
+ # Pass arguments to `suspend_entitlement` via keyword arguments. Note that at
1794
+ # least one keyword argument is required. To specify no parameters, or to keep all
1795
+ # the default parameter values, pass an empty Hash as a request object (see above).
1796
+ #
1797
+ # @param name [::String]
1798
+ # Required. The resource name of the entitlement to suspend.
1799
+ # The name takes the format:
1800
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1801
+ # @param request_id [::String]
1802
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1803
+ # that if you must retry your request, the server will know to ignore the
1804
+ # request if it has already been completed.
1805
+ #
1806
+ # For example, consider a situation where you make an initial request and
1807
+ # the request times out. If you make the request again with the same
1808
+ # request ID, the server can check if the original operation with the same
1809
+ # request ID was received, and if so, will ignore the second request.
1810
+ #
1811
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1812
+ # with the exception that zero UUID is not supported
1813
+ # (`00000000-0000-0000-0000-000000000000`).
1814
+ #
1815
+ # @yield [response, operation] Access the result along with the RPC operation
1816
+ # @yieldparam response [::Gapic::Operation]
1817
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1818
+ #
1819
+ # @return [::Gapic::Operation]
1820
+ #
1821
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1822
+ #
1823
+ def suspend_entitlement request, options = nil
1824
+ raise ::ArgumentError, "request must be provided" if request.nil?
1825
+
1826
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::SuspendEntitlementRequest
1827
+
1828
+ # Converts hash and nil to an options object
1829
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1830
+
1831
+ # Customize the options with defaults
1832
+ metadata = @config.rpcs.suspend_entitlement.metadata.to_h
1833
+
1834
+ # Set x-goog-api-client and x-goog-user-project headers
1835
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1836
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1837
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1838
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1839
+
1840
+ header_params = {
1841
+ "name" => request.name
1842
+ }
1843
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1844
+ metadata[:"x-goog-request-params"] ||= request_params_header
1845
+
1846
+ options.apply_defaults timeout: @config.rpcs.suspend_entitlement.timeout,
1847
+ metadata: metadata,
1848
+ retry_policy: @config.rpcs.suspend_entitlement.retry_policy
1849
+ options.apply_defaults metadata: @config.metadata,
1850
+ retry_policy: @config.retry_policy
1851
+
1852
+ @cloud_channel_service_stub.call_rpc :suspend_entitlement, request, options: options do |response, operation|
1853
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1854
+ yield response, operation if block_given?
1855
+ return response
1856
+ end
1857
+ rescue ::GRPC::BadStatus => e
1858
+ raise ::Google::Cloud::Error.from_error(e)
1859
+ end
1860
+
1861
+ ##
1862
+ # Cancels a previously fulfilled entitlement.
1863
+ # An entitlement cancellation is a long-running operation.
1864
+ #
1865
+ # Possible Error Codes:
1866
+ #
1867
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller or
1868
+ # if the reseller account making the request and reseller account being
1869
+ # queried for are different.
1870
+ # * FAILED_PRECONDITION: If there are any Google Cloud projects linked to the
1871
+ # Google Cloud entitlement's Cloud Billing subaccount.
1872
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1873
+ # request.
1874
+ # * NOT_FOUND: Entitlement resource not found.
1875
+ # * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace
1876
+ # add-ons or entitlements for Google Cloud's development platform.
1877
+ # * INTERNAL: Any non-user error related to a technical issue in the
1878
+ # backend. In this case, contact Cloud Channel support.
1879
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
1880
+ # In this case, contact Cloud Channel support.
1881
+ #
1882
+ # Return Value:
1883
+ # <br/> Long Running Operation ID.
1884
+ #
1885
+ # To get the results of the operation, call the GetOperation method of
1886
+ # CloudChannelOperationsService. The response will contain
1887
+ # google.protobuf.Empty on success. The Operation metadata will contain an
1888
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
1889
+ #
1890
+ # @overload cancel_entitlement(request, options = nil)
1891
+ # Pass arguments to `cancel_entitlement` via a request object, either of type
1892
+ # {::Google::Cloud::Channel::V1::CancelEntitlementRequest} or an equivalent Hash.
1893
+ #
1894
+ # @param request [::Google::Cloud::Channel::V1::CancelEntitlementRequest, ::Hash]
1895
+ # A request object representing the call parameters. Required. To specify no
1896
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1897
+ # @param options [::Gapic::CallOptions, ::Hash]
1898
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1899
+ #
1900
+ # @overload cancel_entitlement(name: nil, request_id: nil)
1901
+ # Pass arguments to `cancel_entitlement` via keyword arguments. Note that at
1902
+ # least one keyword argument is required. To specify no parameters, or to keep all
1903
+ # the default parameter values, pass an empty Hash as a request object (see above).
1904
+ #
1905
+ # @param name [::String]
1906
+ # Required. The resource name of the entitlement to cancel.
1907
+ # The name takes the format:
1908
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1909
+ # @param request_id [::String]
1910
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
1911
+ # that if you must retry your request, the server will know to ignore the
1912
+ # request if it has already been completed.
1913
+ #
1914
+ # For example, consider a situation where you make an initial request and
1915
+ # the request times out. If you make the request again with the same
1916
+ # request ID, the server can check if the original operation with the same
1917
+ # request ID was received, and if so, will ignore the second request.
1918
+ #
1919
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
1920
+ # with the exception that zero UUID is not supported
1921
+ # (`00000000-0000-0000-0000-000000000000`).
1922
+ #
1923
+ # @yield [response, operation] Access the result along with the RPC operation
1924
+ # @yieldparam response [::Gapic::Operation]
1925
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1926
+ #
1927
+ # @return [::Gapic::Operation]
1928
+ #
1929
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1930
+ #
1931
+ def cancel_entitlement request, options = nil
1932
+ raise ::ArgumentError, "request must be provided" if request.nil?
1933
+
1934
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CancelEntitlementRequest
1935
+
1936
+ # Converts hash and nil to an options object
1937
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1938
+
1939
+ # Customize the options with defaults
1940
+ metadata = @config.rpcs.cancel_entitlement.metadata.to_h
1941
+
1942
+ # Set x-goog-api-client and x-goog-user-project headers
1943
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1944
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1945
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
1946
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1947
+
1948
+ header_params = {
1949
+ "name" => request.name
1950
+ }
1951
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1952
+ metadata[:"x-goog-request-params"] ||= request_params_header
1953
+
1954
+ options.apply_defaults timeout: @config.rpcs.cancel_entitlement.timeout,
1955
+ metadata: metadata,
1956
+ retry_policy: @config.rpcs.cancel_entitlement.retry_policy
1957
+ options.apply_defaults metadata: @config.metadata,
1958
+ retry_policy: @config.retry_policy
1959
+
1960
+ @cloud_channel_service_stub.call_rpc :cancel_entitlement, request, options: options do |response, operation|
1961
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1962
+ yield response, operation if block_given?
1963
+ return response
1964
+ end
1965
+ rescue ::GRPC::BadStatus => e
1966
+ raise ::Google::Cloud::Error.from_error(e)
1967
+ end
1968
+
1969
+ ##
1970
+ # Activates a previously suspended entitlement. The entitlement must be in a
1971
+ # suspended state for it to be activated. Entitlements suspended for pending
1972
+ # ToS acceptance can't be activated using this method. An entitlement
1973
+ # activation is a long-running operation and can result in updates to
1974
+ # the state of the customer entitlement.
1975
+ #
1976
+ # Possible Error Codes:
1977
+ #
1978
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller or
1979
+ # if the reseller account making the request and reseller account being
1980
+ # queried for are different.
1981
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
1982
+ # request.
1983
+ # * NOT_FOUND: Entitlement resource not found.
1984
+ # * SUSPENSION_NOT_RESELLER_INITIATED: Can't activate an
1985
+ # entitlement that is pending TOS acceptance. Only reseller initiated
1986
+ # suspensions can be activated.
1987
+ # * NOT_SUSPENDED: Can't activate entitlements that are already in ACTIVE
1988
+ # state. Can only activate suspended entitlements.
1989
+ # * INTERNAL: Any non-user error related to a technical issue
1990
+ # in the backend. In this case, contact Cloud Channel support.
1991
+ # * UNKNOWN: Any non-user error related to a technical issue in the backend.
1992
+ # In this case, contact Cloud Channel support.
1993
+ #
1994
+ # Return Value:
1995
+ # <br/> Long Running Operation ID.
1996
+ #
1997
+ # To get the results of the operation, call the GetOperation method of
1998
+ # CloudChannelOperationsService. The Operation metadata will contain an
1999
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
2000
+ #
2001
+ # @overload activate_entitlement(request, options = nil)
2002
+ # Pass arguments to `activate_entitlement` via a request object, either of type
2003
+ # {::Google::Cloud::Channel::V1::ActivateEntitlementRequest} or an equivalent Hash.
2004
+ #
2005
+ # @param request [::Google::Cloud::Channel::V1::ActivateEntitlementRequest, ::Hash]
2006
+ # A request object representing the call parameters. Required. To specify no
2007
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2008
+ # @param options [::Gapic::CallOptions, ::Hash]
2009
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2010
+ #
2011
+ # @overload activate_entitlement(name: nil, request_id: nil)
2012
+ # Pass arguments to `activate_entitlement` via keyword arguments. Note that at
2013
+ # least one keyword argument is required. To specify no parameters, or to keep all
2014
+ # the default parameter values, pass an empty Hash as a request object (see above).
2015
+ #
2016
+ # @param name [::String]
2017
+ # Required. The resource name of the entitlement to activate.
2018
+ # The name takes the format:
2019
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
2020
+ # @param request_id [::String]
2021
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
2022
+ # that if you must retry your request, the server will know to ignore the
2023
+ # request if it has already been completed.
2024
+ #
2025
+ # For example, consider a situation where you make an initial request and
2026
+ # the request times out. If you make the request again with the same
2027
+ # request ID, the server can check if the original operation with the same
2028
+ # request ID was received, and if so, will ignore the second request.
2029
+ #
2030
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
2031
+ # with the exception that zero UUID is not supported
2032
+ # (`00000000-0000-0000-0000-000000000000`).
2033
+ #
2034
+ # @yield [response, operation] Access the result along with the RPC operation
2035
+ # @yieldparam response [::Gapic::Operation]
2036
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2037
+ #
2038
+ # @return [::Gapic::Operation]
2039
+ #
2040
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2041
+ #
2042
+ def activate_entitlement request, options = nil
2043
+ raise ::ArgumentError, "request must be provided" if request.nil?
2044
+
2045
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ActivateEntitlementRequest
2046
+
2047
+ # Converts hash and nil to an options object
2048
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2049
+
2050
+ # Customize the options with defaults
2051
+ metadata = @config.rpcs.activate_entitlement.metadata.to_h
2052
+
2053
+ # Set x-goog-api-client and x-goog-user-project headers
2054
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2055
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2056
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2057
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2058
+
2059
+ header_params = {
2060
+ "name" => request.name
2061
+ }
2062
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2063
+ metadata[:"x-goog-request-params"] ||= request_params_header
2064
+
2065
+ options.apply_defaults timeout: @config.rpcs.activate_entitlement.timeout,
2066
+ metadata: metadata,
2067
+ retry_policy: @config.rpcs.activate_entitlement.retry_policy
2068
+ options.apply_defaults metadata: @config.metadata,
2069
+ retry_policy: @config.retry_policy
2070
+
2071
+ @cloud_channel_service_stub.call_rpc :activate_entitlement, request, options: options do |response, operation|
2072
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2073
+ yield response, operation if block_given?
2074
+ return response
2075
+ end
2076
+ rescue ::GRPC::BadStatus => e
2077
+ raise ::Google::Cloud::Error.from_error(e)
2078
+ end
2079
+
2080
+ ##
2081
+ # Transfers customer entitlements to new reseller.
2082
+ #
2083
+ # Possible Error Codes:
2084
+ # <ul>
2085
+ # <li> PERMISSION_DENIED: If the customer doesn't belong to the
2086
+ # reseller.</li> <li> INVALID_ARGUMENT: Missing or invalid required
2087
+ # parameters in the request. </li> <li> NOT_FOUND: If the customer or offer
2088
+ # resource is not found for the reseller. </li> <li> ALREADY_EXISTS: If the
2089
+ # SKU has been already transferred for the customer. </li> <li>
2090
+ # CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can happen in the
2091
+ # following cases: <ul>
2092
+ # <li> Transferring a SKU that requires domain verification and the
2093
+ # domain has not been verified. </li>
2094
+ # <li> Transferring an Add-On SKU like Vault or Drive without transferring
2095
+ # the pre-requisite SKU, such as G Suite Basic </li> <li> Applicable only for
2096
+ # developer accounts: reseller and resold domain must follow the domain
2097
+ # naming convention as follows:
2098
+ # <ul>
2099
+ # <li> Domain names must start with goog-test. </li>
2100
+ # <li> Resold domain names must include the reseller domain. </li>
2101
+ # </ul>
2102
+ # </li>
2103
+ # <li> All transferring entitlements must be specified. </li>
2104
+ # </ul>
2105
+ # </li>
2106
+ # <li> INTERNAL: Any non-user error related to a technical issue in the
2107
+ # backend. Please contact Cloud Channel Support in this case. </li>
2108
+ # <li> UNKNOWN: Any non-user error related to a technical issue in the
2109
+ # backend. Please contact Cloud Channel Support in this case. </li>
2110
+ # </ul>
2111
+ #
2112
+ # Return Value:
2113
+ # <br/> Long Running Operation ID.
2114
+ #
2115
+ # To get the results of the operation, call the GetOperation method of
2116
+ # CloudChannelOperationsService. The Operation metadata will contain an
2117
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
2118
+ #
2119
+ # @overload transfer_entitlements(request, options = nil)
2120
+ # Pass arguments to `transfer_entitlements` via a request object, either of type
2121
+ # {::Google::Cloud::Channel::V1::TransferEntitlementsRequest} or an equivalent Hash.
2122
+ #
2123
+ # @param request [::Google::Cloud::Channel::V1::TransferEntitlementsRequest, ::Hash]
2124
+ # A request object representing the call parameters. Required. To specify no
2125
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2126
+ # @param options [::Gapic::CallOptions, ::Hash]
2127
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2128
+ #
2129
+ # @overload transfer_entitlements(parent: nil, entitlements: nil, auth_token: nil, request_id: nil)
2130
+ # Pass arguments to `transfer_entitlements` via keyword arguments. Note that at
2131
+ # least one keyword argument is required. To specify no parameters, or to keep all
2132
+ # the default parameter values, pass an empty Hash as a request object (see above).
2133
+ #
2134
+ # @param parent [::String]
2135
+ # Required. The resource name of reseller's customer account where the entitlements
2136
+ # transfer to.
2137
+ # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id}
2138
+ # @param entitlements [::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>]
2139
+ # Required. The new entitlements to be created or transferred.
2140
+ # @param auth_token [::String]
2141
+ # This token is generated by the Super Admin of the resold customer to
2142
+ # authorize a reseller to access their Cloud Identity and purchase
2143
+ # entitlements on their behalf. This token can be omitted once the
2144
+ # authorization is generated. See https://support.google.com/a/answer/7643790
2145
+ # for more details.
2146
+ # @param request_id [::String]
2147
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
2148
+ # that if you must retry your request, the server will know to ignore the
2149
+ # request if it has already been completed.
2150
+ #
2151
+ # For example, consider a situation where you make an initial request and
2152
+ # the request times out. If you make the request again with the same
2153
+ # request ID, the server can check if the original operation with the same
2154
+ # request ID was received, and if so, will ignore the second request.
2155
+ #
2156
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
2157
+ # with the exception that zero UUID is not supported
2158
+ # (`00000000-0000-0000-0000-000000000000`).
2159
+ #
2160
+ # @yield [response, operation] Access the result along with the RPC operation
2161
+ # @yieldparam response [::Gapic::Operation]
2162
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2163
+ #
2164
+ # @return [::Gapic::Operation]
2165
+ #
2166
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2167
+ #
2168
+ def transfer_entitlements request, options = nil
2169
+ raise ::ArgumentError, "request must be provided" if request.nil?
2170
+
2171
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::TransferEntitlementsRequest
2172
+
2173
+ # Converts hash and nil to an options object
2174
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2175
+
2176
+ # Customize the options with defaults
2177
+ metadata = @config.rpcs.transfer_entitlements.metadata.to_h
2178
+
2179
+ # Set x-goog-api-client and x-goog-user-project headers
2180
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2181
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2182
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2183
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2184
+
2185
+ header_params = {
2186
+ "parent" => request.parent
2187
+ }
2188
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2189
+ metadata[:"x-goog-request-params"] ||= request_params_header
2190
+
2191
+ options.apply_defaults timeout: @config.rpcs.transfer_entitlements.timeout,
2192
+ metadata: metadata,
2193
+ retry_policy: @config.rpcs.transfer_entitlements.retry_policy
2194
+ options.apply_defaults metadata: @config.metadata,
2195
+ retry_policy: @config.retry_policy
2196
+
2197
+ @cloud_channel_service_stub.call_rpc :transfer_entitlements, request, options: options do |response, operation|
2198
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2199
+ yield response, operation if block_given?
2200
+ return response
2201
+ end
2202
+ rescue ::GRPC::BadStatus => e
2203
+ raise ::Google::Cloud::Error.from_error(e)
2204
+ end
2205
+
2206
+ ##
2207
+ # Transfers customer entitlements from current reseller to Google.
2208
+ #
2209
+ # Possible Error Codes:
2210
+ # <ul>
2211
+ # <li> PERMISSION_DENIED: If the customer doesn't belong to the reseller.
2212
+ # </li> <li> INVALID_ARGUMENT: Missing or invalid required parameters in the
2213
+ # request. </li>
2214
+ # <li> NOT_FOUND: If the customer or offer resource is not found
2215
+ # for the reseller. </li>
2216
+ # <li> ALREADY_EXISTS: If the SKU has been already
2217
+ # transferred for the customer. </li>
2218
+ # <li> CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can happen in
2219
+ # the following cases:
2220
+ # <ul>
2221
+ # <li> Transferring a SKU that requires domain verification and the
2222
+ # domain has not been verified. </li>
2223
+ # <li> Transferring an Add-On SKU like Vault or Drive without purchasing
2224
+ # the pre-requisite SKU, such as G Suite Basic </li> <li> Applicable only for
2225
+ # developer accounts: reseller and resold domain must follow the domain
2226
+ # naming convention as follows:
2227
+ # <ul>
2228
+ # <li> Domain names must start with goog-test. </li>
2229
+ # <li> Resold domain names must include the reseller domain. </li>
2230
+ # </ul>
2231
+ # </li>
2232
+ # </ul>
2233
+ # </li>
2234
+ # <li> INTERNAL: Any non-user error related to a technical issue in the
2235
+ # backend. Please contact Cloud Channel Support in this case. </li>
2236
+ # <li> UNKNOWN: Any non-user error related to a technical issue in the
2237
+ # backend. Please contact Cloud Channel Support in this case.</li>
2238
+ # </ul>
2239
+ #
2240
+ # Return Value:
2241
+ # <br/> Long Running Operation ID.
2242
+ #
2243
+ # To get the results of the operation, call the GetOperation method of
2244
+ # CloudChannelOperationsService. The response will contain
2245
+ # google.protobuf.Empty on success. The Operation metadata will contain an
2246
+ # instance of {::Google::Cloud::Channel::V1::OperationMetadata OperationMetadata}.
2247
+ #
2248
+ # @overload transfer_entitlements_to_google(request, options = nil)
2249
+ # Pass arguments to `transfer_entitlements_to_google` via a request object, either of type
2250
+ # {::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest} or an equivalent Hash.
2251
+ #
2252
+ # @param request [::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest, ::Hash]
2253
+ # A request object representing the call parameters. Required. To specify no
2254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2255
+ # @param options [::Gapic::CallOptions, ::Hash]
2256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2257
+ #
2258
+ # @overload transfer_entitlements_to_google(parent: nil, entitlements: nil, request_id: nil)
2259
+ # Pass arguments to `transfer_entitlements_to_google` via keyword arguments. Note that at
2260
+ # least one keyword argument is required. To specify no parameters, or to keep all
2261
+ # the default parameter values, pass an empty Hash as a request object (see above).
2262
+ #
2263
+ # @param parent [::String]
2264
+ # Required. The resource name of reseller's customer account where the entitlements
2265
+ # transfer from.
2266
+ # The parent takes the format: accounts/\\{account_id}/customers/\\{customer_id}
2267
+ # @param entitlements [::Array<::Google::Cloud::Channel::V1::Entitlement, ::Hash>]
2268
+ # Required. The entitlements to be transferred to Google.
2269
+ # @param request_id [::String]
2270
+ # Optional. An optional request ID to identify requests. Specify a unique request ID so
2271
+ # that if you must retry your request, the server will know to ignore the
2272
+ # request if it has already been completed.
2273
+ #
2274
+ # For example, consider a situation where you make an initial request and
2275
+ # the request times out. If you make the request again with the same
2276
+ # request ID, the server can check if the original operation with the same
2277
+ # request ID was received, and if so, will ignore the second request.
2278
+ #
2279
+ # The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122)
2280
+ # with the exception that zero UUID is not supported
2281
+ # (`00000000-0000-0000-0000-000000000000`).
2282
+ #
2283
+ # @yield [response, operation] Access the result along with the RPC operation
2284
+ # @yieldparam response [::Gapic::Operation]
2285
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2286
+ #
2287
+ # @return [::Gapic::Operation]
2288
+ #
2289
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2290
+ #
2291
+ def transfer_entitlements_to_google request, options = nil
2292
+ raise ::ArgumentError, "request must be provided" if request.nil?
2293
+
2294
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest
2295
+
2296
+ # Converts hash and nil to an options object
2297
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2298
+
2299
+ # Customize the options with defaults
2300
+ metadata = @config.rpcs.transfer_entitlements_to_google.metadata.to_h
2301
+
2302
+ # Set x-goog-api-client and x-goog-user-project headers
2303
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2304
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2305
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2306
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2307
+
2308
+ header_params = {
2309
+ "parent" => request.parent
2310
+ }
2311
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2312
+ metadata[:"x-goog-request-params"] ||= request_params_header
2313
+
2314
+ options.apply_defaults timeout: @config.rpcs.transfer_entitlements_to_google.timeout,
2315
+ metadata: metadata,
2316
+ retry_policy: @config.rpcs.transfer_entitlements_to_google.retry_policy
2317
+ options.apply_defaults metadata: @config.metadata,
2318
+ retry_policy: @config.retry_policy
2319
+
2320
+ @cloud_channel_service_stub.call_rpc :transfer_entitlements_to_google, request, options: options do |response, operation|
2321
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2322
+ yield response, operation if block_given?
2323
+ return response
2324
+ end
2325
+ rescue ::GRPC::BadStatus => e
2326
+ raise ::Google::Cloud::Error.from_error(e)
2327
+ end
2328
+
2329
+ ##
2330
+ # List {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink}s belonging to a distributor.
2331
+ # To call this method, you must be a distributor.
2332
+ #
2333
+ # Possible Error Codes:
2334
+ #
2335
+ # * PERMISSION_DENIED: If the reseller account making the request and the
2336
+ # reseller account being queried for are different.
2337
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2338
+ # request.
2339
+ #
2340
+ # Return Value:
2341
+ # <br/> If successful, returns the list of {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resources
2342
+ # for the distributor account, otherwise returns an error.
2343
+ #
2344
+ # @overload list_channel_partner_links(request, options = nil)
2345
+ # Pass arguments to `list_channel_partner_links` via a request object, either of type
2346
+ # {::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest} or an equivalent Hash.
2347
+ #
2348
+ # @param request [::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest, ::Hash]
2349
+ # A request object representing the call parameters. Required. To specify no
2350
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2351
+ # @param options [::Gapic::CallOptions, ::Hash]
2352
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2353
+ #
2354
+ # @overload list_channel_partner_links(parent: nil, page_size: nil, page_token: nil, view: nil)
2355
+ # Pass arguments to `list_channel_partner_links` via keyword arguments. Note that at
2356
+ # least one keyword argument is required. To specify no parameters, or to keep all
2357
+ # the default parameter values, pass an empty Hash as a request object (see above).
2358
+ #
2359
+ # @param parent [::String]
2360
+ # Required. The resource name of the reseller account for listing channel partner
2361
+ # links.
2362
+ # The parent takes the format: accounts/\\{account_id}
2363
+ # @param page_size [::Integer]
2364
+ # Optional. Requested page size. Server might return fewer results than requested.
2365
+ # If unspecified, server will pick a default size (25).
2366
+ # The maximum value is 200, values above 200 will be coerced to 200.
2367
+ # @param page_token [::String]
2368
+ # Optional. A token identifying a page of results, if other than the first one.
2369
+ # Typically obtained via
2370
+ # {::Google::Cloud::Channel::V1::ListChannelPartnerLinksResponse#next_page_token ListChannelPartnerLinksResponse.next_page_token} of the previous
2371
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client#list_channel_partner_links CloudChannelService.ListChannelPartnerLinks} call.
2372
+ # @param view [::Google::Cloud::Channel::V1::ChannelPartnerLinkView]
2373
+ # Optional. The level of granularity the ChannelPartnerLink will display.
2374
+ #
2375
+ # @yield [response, operation] Access the result along with the RPC operation
2376
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>]
2377
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2378
+ #
2379
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::ChannelPartnerLink>]
2380
+ #
2381
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2382
+ #
2383
+ def list_channel_partner_links request, options = nil
2384
+ raise ::ArgumentError, "request must be provided" if request.nil?
2385
+
2386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest
2387
+
2388
+ # Converts hash and nil to an options object
2389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2390
+
2391
+ # Customize the options with defaults
2392
+ metadata = @config.rpcs.list_channel_partner_links.metadata.to_h
2393
+
2394
+ # Set x-goog-api-client and x-goog-user-project headers
2395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2397
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2398
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2399
+
2400
+ header_params = {
2401
+ "parent" => request.parent
2402
+ }
2403
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2404
+ metadata[:"x-goog-request-params"] ||= request_params_header
2405
+
2406
+ options.apply_defaults timeout: @config.rpcs.list_channel_partner_links.timeout,
2407
+ metadata: metadata,
2408
+ retry_policy: @config.rpcs.list_channel_partner_links.retry_policy
2409
+ options.apply_defaults metadata: @config.metadata,
2410
+ retry_policy: @config.retry_policy
2411
+
2412
+ @cloud_channel_service_stub.call_rpc :list_channel_partner_links, request, options: options do |response, operation|
2413
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_channel_partner_links, request, response, operation, options
2414
+ yield response, operation if block_given?
2415
+ return response
2416
+ end
2417
+ rescue ::GRPC::BadStatus => e
2418
+ raise ::Google::Cloud::Error.from_error(e)
2419
+ end
2420
+
2421
+ ##
2422
+ # Returns a requested {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource.
2423
+ # To call this method, you must be a distributor.
2424
+ #
2425
+ # Possible Error Codes:
2426
+ #
2427
+ # * PERMISSION_DENIED: If the reseller account making the request and the
2428
+ # reseller account being queried for are different.
2429
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2430
+ # request.
2431
+ # * NOT_FOUND: ChannelPartnerLink resource not found. Results
2432
+ # due invalid channel partner link name.
2433
+ #
2434
+ # Return Value:
2435
+ # <br/> {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource if found, otherwise returns an error.
2436
+ #
2437
+ # @overload get_channel_partner_link(request, options = nil)
2438
+ # Pass arguments to `get_channel_partner_link` via a request object, either of type
2439
+ # {::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest} or an equivalent Hash.
2440
+ #
2441
+ # @param request [::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest, ::Hash]
2442
+ # A request object representing the call parameters. Required. To specify no
2443
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2444
+ # @param options [::Gapic::CallOptions, ::Hash]
2445
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2446
+ #
2447
+ # @overload get_channel_partner_link(name: nil, view: nil)
2448
+ # Pass arguments to `get_channel_partner_link` via keyword arguments. Note that at
2449
+ # least one keyword argument is required. To specify no parameters, or to keep all
2450
+ # the default parameter values, pass an empty Hash as a request object (see above).
2451
+ #
2452
+ # @param name [::String]
2453
+ # Required. The resource name of the channel partner link to retrieve.
2454
+ # The name takes the format: accounts/\\{account_id}/channelPartnerLinks/\\{id}
2455
+ # where \\{id} is the Cloud Identity ID of the partner.
2456
+ # @param view [::Google::Cloud::Channel::V1::ChannelPartnerLinkView]
2457
+ # Optional. The level of granularity the ChannelPartnerLink will display.
2458
+ #
2459
+ # @yield [response, operation] Access the result along with the RPC operation
2460
+ # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2461
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2462
+ #
2463
+ # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2464
+ #
2465
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2466
+ #
2467
+ def get_channel_partner_link request, options = nil
2468
+ raise ::ArgumentError, "request must be provided" if request.nil?
2469
+
2470
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest
2471
+
2472
+ # Converts hash and nil to an options object
2473
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2474
+
2475
+ # Customize the options with defaults
2476
+ metadata = @config.rpcs.get_channel_partner_link.metadata.to_h
2477
+
2478
+ # Set x-goog-api-client and x-goog-user-project headers
2479
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2480
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2481
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2482
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2483
+
2484
+ header_params = {
2485
+ "name" => request.name
2486
+ }
2487
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2488
+ metadata[:"x-goog-request-params"] ||= request_params_header
2489
+
2490
+ options.apply_defaults timeout: @config.rpcs.get_channel_partner_link.timeout,
2491
+ metadata: metadata,
2492
+ retry_policy: @config.rpcs.get_channel_partner_link.retry_policy
2493
+ options.apply_defaults metadata: @config.metadata,
2494
+ retry_policy: @config.retry_policy
2495
+
2496
+ @cloud_channel_service_stub.call_rpc :get_channel_partner_link, request, options: options do |response, operation|
2497
+ yield response, operation if block_given?
2498
+ return response
2499
+ end
2500
+ rescue ::GRPC::BadStatus => e
2501
+ raise ::Google::Cloud::Error.from_error(e)
2502
+ end
2503
+
2504
+ ##
2505
+ # Initiates a channel partner link between a distributor and a reseller or
2506
+ # between resellers in an n-tier reseller channel.
2507
+ # To accept the invite, the invited partner should follow the invite_link_uri
2508
+ # provided in the response. If the link creation is accepted, a valid link is
2509
+ # set up between the two involved parties.
2510
+ # To call this method, you must be a distributor.
2511
+ #
2512
+ # Possible Error Codes:
2513
+ #
2514
+ # * PERMISSION_DENIED: If the reseller account making the request and the
2515
+ # reseller account being queried for are different.
2516
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2517
+ # request.
2518
+ # * ALREADY_EXISTS: If the ChannelPartnerLink sent in the request already
2519
+ # exists.
2520
+ # * NOT_FOUND: If no Cloud Identity customer exists for domain provided.
2521
+ # * INTERNAL: Any non-user error related to a technical issue in the
2522
+ # backend. In this case, contact Cloud Channel support.
2523
+ # * UNKNOWN: Any non-user error related to a technical issue in
2524
+ # the backend. In this case, contact Cloud Channel support.
2525
+ #
2526
+ # Return Value:
2527
+ # <br/> Newly created {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource if successful,
2528
+ # otherwise error is returned.
2529
+ #
2530
+ # @overload create_channel_partner_link(request, options = nil)
2531
+ # Pass arguments to `create_channel_partner_link` via a request object, either of type
2532
+ # {::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest} or an equivalent Hash.
2533
+ #
2534
+ # @param request [::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest, ::Hash]
2535
+ # A request object representing the call parameters. Required. To specify no
2536
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2537
+ # @param options [::Gapic::CallOptions, ::Hash]
2538
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2539
+ #
2540
+ # @overload create_channel_partner_link(parent: nil, channel_partner_link: nil, domain: nil)
2541
+ # Pass arguments to `create_channel_partner_link` via keyword arguments. Note that at
2542
+ # least one keyword argument is required. To specify no parameters, or to keep all
2543
+ # the default parameter values, pass an empty Hash as a request object (see above).
2544
+ #
2545
+ # @param parent [::String]
2546
+ # Required. The resource name of reseller's account for which to create a channel
2547
+ # partner link.
2548
+ # The parent takes the format: accounts/\\{account_id}
2549
+ # @param channel_partner_link [::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash]
2550
+ # Required. The channel partner link to create.
2551
+ # Either channel_partner_link.reseller_cloud_identity_id or domain can be
2552
+ # used to create a link.
2553
+ # @param domain [::String]
2554
+ # Optional. The invited partner's domain. Either domain or
2555
+ # channel_partner_link.reseller_cloud_identity_id can be used to create a
2556
+ # link.
2557
+ #
2558
+ # @yield [response, operation] Access the result along with the RPC operation
2559
+ # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2560
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2561
+ #
2562
+ # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2563
+ #
2564
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2565
+ #
2566
+ def create_channel_partner_link request, options = nil
2567
+ raise ::ArgumentError, "request must be provided" if request.nil?
2568
+
2569
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest
2570
+
2571
+ # Converts hash and nil to an options object
2572
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2573
+
2574
+ # Customize the options with defaults
2575
+ metadata = @config.rpcs.create_channel_partner_link.metadata.to_h
2576
+
2577
+ # Set x-goog-api-client and x-goog-user-project headers
2578
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2579
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2580
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2581
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2582
+
2583
+ header_params = {
2584
+ "parent" => request.parent
2585
+ }
2586
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2587
+ metadata[:"x-goog-request-params"] ||= request_params_header
2588
+
2589
+ options.apply_defaults timeout: @config.rpcs.create_channel_partner_link.timeout,
2590
+ metadata: metadata,
2591
+ retry_policy: @config.rpcs.create_channel_partner_link.retry_policy
2592
+ options.apply_defaults metadata: @config.metadata,
2593
+ retry_policy: @config.retry_policy
2594
+
2595
+ @cloud_channel_service_stub.call_rpc :create_channel_partner_link, request, options: options do |response, operation|
2596
+ yield response, operation if block_given?
2597
+ return response
2598
+ end
2599
+ rescue ::GRPC::BadStatus => e
2600
+ raise ::Google::Cloud::Error.from_error(e)
2601
+ end
2602
+
2603
+ ##
2604
+ # Updates a channel partner link. A distributor calls this method to change a
2605
+ # link's status. For example, suspend a partner link.
2606
+ # To call this method, you must be a distributor.
2607
+ #
2608
+ # Possible Error Codes:
2609
+ # <ul>
2610
+ # <li> PERMISSION_DENIED: If the reseller account making the request and the
2611
+ # reseller account being queried for are different. </li>
2612
+ # <li> INVALID_ARGUMENT:
2613
+ # <ul>
2614
+ # <li> Missing or invalid required parameters in the request. </li>
2615
+ # <li> Updating link state from invited to active or suspended. </li>
2616
+ # <li> Sending reseller_cloud_identity_id, invite_url or name in update
2617
+ # mask. </li>
2618
+ # </ul>
2619
+ # </li>
2620
+ # <li> NOT_FOUND: ChannelPartnerLink resource not found.</li>
2621
+ # <li> INTERNAL: Any non-user error related to a technical issue in the
2622
+ # backend. In this case, contact Cloud Channel support. </li>
2623
+ # <li> UNKNOWN: Any non-user error related to a technical issue in the
2624
+ # backend. In this case, contact Cloud Channel support.</li>
2625
+ # </ul>
2626
+ #
2627
+ # Return Value:
2628
+ # <br/> If successful, the updated {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource, otherwise
2629
+ # returns an error.
2630
+ #
2631
+ # @overload update_channel_partner_link(request, options = nil)
2632
+ # Pass arguments to `update_channel_partner_link` via a request object, either of type
2633
+ # {::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest} or an equivalent Hash.
2634
+ #
2635
+ # @param request [::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest, ::Hash]
2636
+ # A request object representing the call parameters. Required. To specify no
2637
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2638
+ # @param options [::Gapic::CallOptions, ::Hash]
2639
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2640
+ #
2641
+ # @overload update_channel_partner_link(name: nil, channel_partner_link: nil, update_mask: nil)
2642
+ # Pass arguments to `update_channel_partner_link` via keyword arguments. Note that at
2643
+ # least one keyword argument is required. To specify no parameters, or to keep all
2644
+ # the default parameter values, pass an empty Hash as a request object (see above).
2645
+ #
2646
+ # @param name [::String]
2647
+ # Required. The resource name of the channel partner link to cancel.
2648
+ # The name takes the format: accounts/\\{account_id}/channelPartnerLinks/\\{id}
2649
+ # where \\{id} is the Cloud Identity ID of the partner.
2650
+ # @param channel_partner_link [::Google::Cloud::Channel::V1::ChannelPartnerLink, ::Hash]
2651
+ # Required. The channel partner link to update. Only field
2652
+ # channel_partner_link.link_state is allowed to be updated.
2653
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2654
+ # Required. The update mask that applies to the resource.
2655
+ # The only allowable value for update mask is
2656
+ # channel_partner_link.link_state.
2657
+ #
2658
+ # @yield [response, operation] Access the result along with the RPC operation
2659
+ # @yieldparam response [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2660
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2661
+ #
2662
+ # @return [::Google::Cloud::Channel::V1::ChannelPartnerLink]
2663
+ #
2664
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2665
+ #
2666
+ def update_channel_partner_link request, options = nil
2667
+ raise ::ArgumentError, "request must be provided" if request.nil?
2668
+
2669
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest
2670
+
2671
+ # Converts hash and nil to an options object
2672
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2673
+
2674
+ # Customize the options with defaults
2675
+ metadata = @config.rpcs.update_channel_partner_link.metadata.to_h
2676
+
2677
+ # Set x-goog-api-client and x-goog-user-project headers
2678
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2679
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2680
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2681
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2682
+
2683
+ header_params = {
2684
+ "name" => request.name
2685
+ }
2686
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2687
+ metadata[:"x-goog-request-params"] ||= request_params_header
2688
+
2689
+ options.apply_defaults timeout: @config.rpcs.update_channel_partner_link.timeout,
2690
+ metadata: metadata,
2691
+ retry_policy: @config.rpcs.update_channel_partner_link.retry_policy
2692
+ options.apply_defaults metadata: @config.metadata,
2693
+ retry_policy: @config.retry_policy
2694
+
2695
+ @cloud_channel_service_stub.call_rpc :update_channel_partner_link, request, options: options do |response, operation|
2696
+ yield response, operation if block_given?
2697
+ return response
2698
+ end
2699
+ rescue ::GRPC::BadStatus => e
2700
+ raise ::Google::Cloud::Error.from_error(e)
2701
+ end
2702
+
2703
+ ##
2704
+ # Lists the Products the reseller is authorized to sell.
2705
+ #
2706
+ # Possible Error Codes:
2707
+ #
2708
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2709
+ # request.
2710
+ #
2711
+ # @overload list_products(request, options = nil)
2712
+ # Pass arguments to `list_products` via a request object, either of type
2713
+ # {::Google::Cloud::Channel::V1::ListProductsRequest} or an equivalent Hash.
2714
+ #
2715
+ # @param request [::Google::Cloud::Channel::V1::ListProductsRequest, ::Hash]
2716
+ # A request object representing the call parameters. Required. To specify no
2717
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2718
+ # @param options [::Gapic::CallOptions, ::Hash]
2719
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2720
+ #
2721
+ # @overload list_products(account: nil, page_size: nil, page_token: nil, language_code: nil)
2722
+ # Pass arguments to `list_products` via keyword arguments. Note that at
2723
+ # least one keyword argument is required. To specify no parameters, or to keep all
2724
+ # the default parameter values, pass an empty Hash as a request object (see above).
2725
+ #
2726
+ # @param account [::String]
2727
+ # Required. The resource name of the reseller account.
2728
+ # Format: accounts/\\{account_id}.
2729
+ # @param page_size [::Integer]
2730
+ # Optional. Requested page size. Server might return fewer results than requested.
2731
+ # If unspecified, at most 100 Products will be returned.
2732
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2733
+ # @param page_token [::String]
2734
+ # Optional. A token identifying a page of results, if other than the first one.
2735
+ # @param language_code [::String]
2736
+ # Optional. The BCP-47 language code, such as "en-US". If specified, the
2737
+ # response will be localized to the corresponding language code. Default is
2738
+ # "en-US".
2739
+ #
2740
+ # @yield [response, operation] Access the result along with the RPC operation
2741
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>]
2742
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2743
+ #
2744
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Product>]
2745
+ #
2746
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2747
+ #
2748
+ def list_products request, options = nil
2749
+ raise ::ArgumentError, "request must be provided" if request.nil?
2750
+
2751
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListProductsRequest
2752
+
2753
+ # Converts hash and nil to an options object
2754
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2755
+
2756
+ # Customize the options with defaults
2757
+ metadata = @config.rpcs.list_products.metadata.to_h
2758
+
2759
+ # Set x-goog-api-client and x-goog-user-project headers
2760
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2761
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2762
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2763
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2764
+
2765
+ options.apply_defaults timeout: @config.rpcs.list_products.timeout,
2766
+ metadata: metadata,
2767
+ retry_policy: @config.rpcs.list_products.retry_policy
2768
+ options.apply_defaults metadata: @config.metadata,
2769
+ retry_policy: @config.retry_policy
2770
+
2771
+ @cloud_channel_service_stub.call_rpc :list_products, request, options: options do |response, operation|
2772
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_products, request, response, operation, options
2773
+ yield response, operation if block_given?
2774
+ return response
2775
+ end
2776
+ rescue ::GRPC::BadStatus => e
2777
+ raise ::Google::Cloud::Error.from_error(e)
2778
+ end
2779
+
2780
+ ##
2781
+ # Lists the SKUs for a product the reseller is authorized to sell.
2782
+ #
2783
+ # Possible Error Codes:
2784
+ #
2785
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2786
+ # request.
2787
+ #
2788
+ # @overload list_skus(request, options = nil)
2789
+ # Pass arguments to `list_skus` via a request object, either of type
2790
+ # {::Google::Cloud::Channel::V1::ListSkusRequest} or an equivalent Hash.
2791
+ #
2792
+ # @param request [::Google::Cloud::Channel::V1::ListSkusRequest, ::Hash]
2793
+ # A request object representing the call parameters. Required. To specify no
2794
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2795
+ # @param options [::Gapic::CallOptions, ::Hash]
2796
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2797
+ #
2798
+ # @overload list_skus(parent: nil, account: nil, page_size: nil, page_token: nil, language_code: nil)
2799
+ # Pass arguments to `list_skus` via keyword arguments. Note that at
2800
+ # least one keyword argument is required. To specify no parameters, or to keep all
2801
+ # the default parameter values, pass an empty Hash as a request object (see above).
2802
+ #
2803
+ # @param parent [::String]
2804
+ # Required. The resource name of the Product for which to list SKUs.
2805
+ # The parent takes the format: products/\\{product_id}.
2806
+ # Supports products/- to retrieve SKUs for all products.
2807
+ # @param account [::String]
2808
+ # Required. Resource name of the reseller.
2809
+ # Format: accounts/\\{account_id}.
2810
+ # @param page_size [::Integer]
2811
+ # Optional. Requested page size. Server might return fewer results than requested.
2812
+ # If unspecified, at most 100 SKUs will be returned.
2813
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2814
+ # @param page_token [::String]
2815
+ # Optional. A token identifying a page of results, if other than the first one.
2816
+ # Optional.
2817
+ # @param language_code [::String]
2818
+ # Optional. The BCP-47 language code, such as "en-US". If specified, the
2819
+ # response will be localized to the corresponding language code. Default is
2820
+ # "en-US".
2821
+ #
2822
+ # @yield [response, operation] Access the result along with the RPC operation
2823
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>]
2824
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2825
+ #
2826
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Sku>]
2827
+ #
2828
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2829
+ #
2830
+ def list_skus request, options = nil
2831
+ raise ::ArgumentError, "request must be provided" if request.nil?
2832
+
2833
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListSkusRequest
2834
+
2835
+ # Converts hash and nil to an options object
2836
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2837
+
2838
+ # Customize the options with defaults
2839
+ metadata = @config.rpcs.list_skus.metadata.to_h
2840
+
2841
+ # Set x-goog-api-client and x-goog-user-project headers
2842
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2843
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2844
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2845
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2846
+
2847
+ header_params = {
2848
+ "parent" => request.parent
2849
+ }
2850
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2851
+ metadata[:"x-goog-request-params"] ||= request_params_header
2852
+
2853
+ options.apply_defaults timeout: @config.rpcs.list_skus.timeout,
2854
+ metadata: metadata,
2855
+ retry_policy: @config.rpcs.list_skus.retry_policy
2856
+ options.apply_defaults metadata: @config.metadata,
2857
+ retry_policy: @config.retry_policy
2858
+
2859
+ @cloud_channel_service_stub.call_rpc :list_skus, request, options: options do |response, operation|
2860
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_skus, request, response, operation, options
2861
+ yield response, operation if block_given?
2862
+ return response
2863
+ end
2864
+ rescue ::GRPC::BadStatus => e
2865
+ raise ::Google::Cloud::Error.from_error(e)
2866
+ end
2867
+
2868
+ ##
2869
+ # Lists the Offers the reseller can sell.
2870
+ #
2871
+ # Possible Error Codes:
2872
+ #
2873
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2874
+ # request.
2875
+ #
2876
+ # @overload list_offers(request, options = nil)
2877
+ # Pass arguments to `list_offers` via a request object, either of type
2878
+ # {::Google::Cloud::Channel::V1::ListOffersRequest} or an equivalent Hash.
2879
+ #
2880
+ # @param request [::Google::Cloud::Channel::V1::ListOffersRequest, ::Hash]
2881
+ # A request object representing the call parameters. Required. To specify no
2882
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2883
+ # @param options [::Gapic::CallOptions, ::Hash]
2884
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2885
+ #
2886
+ # @overload list_offers(parent: nil, page_size: nil, page_token: nil, filter: nil, language_code: nil)
2887
+ # Pass arguments to `list_offers` via keyword arguments. Note that at
2888
+ # least one keyword argument is required. To specify no parameters, or to keep all
2889
+ # the default parameter values, pass an empty Hash as a request object (see above).
2890
+ #
2891
+ # @param parent [::String]
2892
+ # Required. The resource name of the reseller account from which to list Offers.
2893
+ # The parent takes the format: accounts/\\{account_id}.
2894
+ # @param page_size [::Integer]
2895
+ # Optional. Requested page size. Server might return fewer results than requested.
2896
+ # If unspecified, at most 500 Offers will be returned.
2897
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2898
+ # @param page_token [::String]
2899
+ # Optional. A token identifying a page of results, if other than the first one.
2900
+ # @param filter [::String]
2901
+ # Optional. The expression to filter results by name (name of
2902
+ # the Offer), sku.name (name of the SKU) or sku.product.name (name of the
2903
+ # Product).
2904
+ # Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1
2905
+ # Example 2: name=accounts/a1/offers/o1
2906
+ # @param language_code [::String]
2907
+ # Optional. The BCP-47 language code, such as "en-US". If specified, the
2908
+ # response will be localized to the corresponding language code. Default is
2909
+ # "en-US".
2910
+ #
2911
+ # @yield [response, operation] Access the result along with the RPC operation
2912
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>]
2913
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2914
+ #
2915
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::Offer>]
2916
+ #
2917
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2918
+ #
2919
+ def list_offers request, options = nil
2920
+ raise ::ArgumentError, "request must be provided" if request.nil?
2921
+
2922
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListOffersRequest
2923
+
2924
+ # Converts hash and nil to an options object
2925
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2926
+
2927
+ # Customize the options with defaults
2928
+ metadata = @config.rpcs.list_offers.metadata.to_h
2929
+
2930
+ # Set x-goog-api-client and x-goog-user-project headers
2931
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2932
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2933
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2934
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2935
+
2936
+ header_params = {
2937
+ "parent" => request.parent
2938
+ }
2939
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2940
+ metadata[:"x-goog-request-params"] ||= request_params_header
2941
+
2942
+ options.apply_defaults timeout: @config.rpcs.list_offers.timeout,
2943
+ metadata: metadata,
2944
+ retry_policy: @config.rpcs.list_offers.retry_policy
2945
+ options.apply_defaults metadata: @config.metadata,
2946
+ retry_policy: @config.retry_policy
2947
+
2948
+ @cloud_channel_service_stub.call_rpc :list_offers, request, options: options do |response, operation|
2949
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_offers, request, response, operation, options
2950
+ yield response, operation if block_given?
2951
+ return response
2952
+ end
2953
+ rescue ::GRPC::BadStatus => e
2954
+ raise ::Google::Cloud::Error.from_error(e)
2955
+ end
2956
+
2957
+ ##
2958
+ # Lists the Purchasable SKUs for following cases:
2959
+ #
2960
+ # * SKUs that can be newly purchased for a customer
2961
+ # * SKUs that can be upgraded/downgraded to, for an entitlement.
2962
+ #
2963
+ # Possible Error Codes:
2964
+ #
2965
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller
2966
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
2967
+ # request.
2968
+ #
2969
+ # @overload list_purchasable_skus(request, options = nil)
2970
+ # Pass arguments to `list_purchasable_skus` via a request object, either of type
2971
+ # {::Google::Cloud::Channel::V1::ListPurchasableSkusRequest} or an equivalent Hash.
2972
+ #
2973
+ # @param request [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest, ::Hash]
2974
+ # A request object representing the call parameters. Required. To specify no
2975
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2976
+ # @param options [::Gapic::CallOptions, ::Hash]
2977
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2978
+ #
2979
+ # @overload list_purchasable_skus(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil)
2980
+ # Pass arguments to `list_purchasable_skus` via keyword arguments. Note that at
2981
+ # least one keyword argument is required. To specify no parameters, or to keep all
2982
+ # the default parameter values, pass an empty Hash as a request object (see above).
2983
+ #
2984
+ # @param create_entitlement_purchase [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::CreateEntitlementPurchase, ::Hash]
2985
+ # List SKUs for CreateEntitlement purchase.
2986
+ # @param change_offer_purchase [::Google::Cloud::Channel::V1::ListPurchasableSkusRequest::ChangeOfferPurchase, ::Hash]
2987
+ # List SKUs for ChangeOffer purchase with a new SKU.
2988
+ # @param customer [::String]
2989
+ # Required. The resource name of the customer for which to list SKUs.
2990
+ # Format: accounts/\\{account_id}/customers/\\{customer_id}.
2991
+ # @param page_size [::Integer]
2992
+ # Optional. Requested page size. Server might return fewer results than requested.
2993
+ # If unspecified, at most 100 SKUs will be returned.
2994
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2995
+ # @param page_token [::String]
2996
+ # Optional. A token identifying a page of results, if other than the first one.
2997
+ # @param language_code [::String]
2998
+ # Optional. The BCP-47 language code, such as "en-US". If specified, the
2999
+ # response will be localized to the corresponding language code. Default is
3000
+ # "en-US".
3001
+ #
3002
+ # @yield [response, operation] Access the result along with the RPC operation
3003
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>]
3004
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3005
+ #
3006
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableSku>]
3007
+ #
3008
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3009
+ #
3010
+ def list_purchasable_skus request, options = nil
3011
+ raise ::ArgumentError, "request must be provided" if request.nil?
3012
+
3013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListPurchasableSkusRequest
3014
+
3015
+ # Converts hash and nil to an options object
3016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3017
+
3018
+ # Customize the options with defaults
3019
+ metadata = @config.rpcs.list_purchasable_skus.metadata.to_h
3020
+
3021
+ # Set x-goog-api-client and x-goog-user-project headers
3022
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3024
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
3025
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3026
+
3027
+ header_params = {
3028
+ "customer" => request.customer
3029
+ }
3030
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3031
+ metadata[:"x-goog-request-params"] ||= request_params_header
3032
+
3033
+ options.apply_defaults timeout: @config.rpcs.list_purchasable_skus.timeout,
3034
+ metadata: metadata,
3035
+ retry_policy: @config.rpcs.list_purchasable_skus.retry_policy
3036
+ options.apply_defaults metadata: @config.metadata,
3037
+ retry_policy: @config.retry_policy
3038
+
3039
+ @cloud_channel_service_stub.call_rpc :list_purchasable_skus, request, options: options do |response, operation|
3040
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_purchasable_skus, request, response, operation, options
3041
+ yield response, operation if block_given?
3042
+ return response
3043
+ end
3044
+ rescue ::GRPC::BadStatus => e
3045
+ raise ::Google::Cloud::Error.from_error(e)
3046
+ end
3047
+
3048
+ ##
3049
+ # Lists the Purchasable Offers for the following cases:
3050
+ #
3051
+ # * Offers that can be newly purchased for a customer
3052
+ # * Offers that can be changed to, for an entitlement.
3053
+ #
3054
+ # Possible Error Codes:
3055
+ #
3056
+ # * PERMISSION_DENIED: If the customer doesn't belong to the reseller
3057
+ # * INVALID_ARGUMENT: Missing or invalid required parameters in the
3058
+ # request.
3059
+ #
3060
+ # @overload list_purchasable_offers(request, options = nil)
3061
+ # Pass arguments to `list_purchasable_offers` via a request object, either of type
3062
+ # {::Google::Cloud::Channel::V1::ListPurchasableOffersRequest} or an equivalent Hash.
3063
+ #
3064
+ # @param request [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest, ::Hash]
3065
+ # A request object representing the call parameters. Required. To specify no
3066
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3067
+ # @param options [::Gapic::CallOptions, ::Hash]
3068
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3069
+ #
3070
+ # @overload list_purchasable_offers(create_entitlement_purchase: nil, change_offer_purchase: nil, customer: nil, page_size: nil, page_token: nil, language_code: nil)
3071
+ # Pass arguments to `list_purchasable_offers` via keyword arguments. Note that at
3072
+ # least one keyword argument is required. To specify no parameters, or to keep all
3073
+ # the default parameter values, pass an empty Hash as a request object (see above).
3074
+ #
3075
+ # @param create_entitlement_purchase [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::CreateEntitlementPurchase, ::Hash]
3076
+ # List Offers for CreateEntitlement purchase.
3077
+ # @param change_offer_purchase [::Google::Cloud::Channel::V1::ListPurchasableOffersRequest::ChangeOfferPurchase, ::Hash]
3078
+ # List Offers for ChangeOffer purchase.
3079
+ # @param customer [::String]
3080
+ # Required. The resource name of the customer for which to list Offers.
3081
+ # Format: accounts/\\{account_id}/customers/\\{customer_id}.
3082
+ # @param page_size [::Integer]
3083
+ # Optional. Requested page size. Server might return fewer results than requested.
3084
+ # If unspecified, at most 100 Offers will be returned.
3085
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
3086
+ # @param page_token [::String]
3087
+ # Optional. A token identifying a page of results, if other than the first one.
3088
+ # @param language_code [::String]
3089
+ # Optional. The BCP-47 language code, such as "en-US". If specified, the
3090
+ # response will be localized to the corresponding language code. Default is
3091
+ # "en-US".
3092
+ #
3093
+ # @yield [response, operation] Access the result along with the RPC operation
3094
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>]
3095
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3096
+ #
3097
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Channel::V1::PurchasableOffer>]
3098
+ #
3099
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3100
+ #
3101
+ def list_purchasable_offers request, options = nil
3102
+ raise ::ArgumentError, "request must be provided" if request.nil?
3103
+
3104
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ListPurchasableOffersRequest
3105
+
3106
+ # Converts hash and nil to an options object
3107
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3108
+
3109
+ # Customize the options with defaults
3110
+ metadata = @config.rpcs.list_purchasable_offers.metadata.to_h
3111
+
3112
+ # Set x-goog-api-client and x-goog-user-project headers
3113
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3114
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3115
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
3116
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3117
+
3118
+ header_params = {
3119
+ "customer" => request.customer
3120
+ }
3121
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3122
+ metadata[:"x-goog-request-params"] ||= request_params_header
3123
+
3124
+ options.apply_defaults timeout: @config.rpcs.list_purchasable_offers.timeout,
3125
+ metadata: metadata,
3126
+ retry_policy: @config.rpcs.list_purchasable_offers.retry_policy
3127
+ options.apply_defaults metadata: @config.metadata,
3128
+ retry_policy: @config.retry_policy
3129
+
3130
+ @cloud_channel_service_stub.call_rpc :list_purchasable_offers, request, options: options do |response, operation|
3131
+ response = ::Gapic::PagedEnumerable.new @cloud_channel_service_stub, :list_purchasable_offers, request, response, operation, options
3132
+ yield response, operation if block_given?
3133
+ return response
3134
+ end
3135
+ rescue ::GRPC::BadStatus => e
3136
+ raise ::Google::Cloud::Error.from_error(e)
3137
+ end
3138
+
3139
+ ##
3140
+ # Configuration class for the CloudChannelService API.
3141
+ #
3142
+ # This class represents the configuration for CloudChannelService,
3143
+ # providing control over timeouts, retry behavior, logging, transport
3144
+ # parameters, and other low-level controls. Certain parameters can also be
3145
+ # applied individually to specific RPCs. See
3146
+ # {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration::Rpcs}
3147
+ # for a list of RPCs that can be configured independently.
3148
+ #
3149
+ # Configuration can be applied globally to all clients, or to a single client
3150
+ # on construction.
3151
+ #
3152
+ # # Examples
3153
+ #
3154
+ # To modify the global config, setting the timeout for list_customers
3155
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
3156
+ #
3157
+ # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
3158
+ # config.timeout = 10.0
3159
+ # config.rpcs.list_customers.timeout = 20.0
3160
+ # end
3161
+ #
3162
+ # To apply the above configuration only to a new client:
3163
+ #
3164
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
3165
+ # config.timeout = 10.0
3166
+ # config.rpcs.list_customers.timeout = 20.0
3167
+ # end
3168
+ #
3169
+ # @!attribute [rw] endpoint
3170
+ # The hostname or hostname:port of the service endpoint.
3171
+ # Defaults to `"cloudchannel.googleapis.com"`.
3172
+ # @return [::String]
3173
+ # @!attribute [rw] credentials
3174
+ # Credentials to send with calls. You may provide any of the following types:
3175
+ # * (`String`) The path to a service account key file in JSON format
3176
+ # * (`Hash`) A service account key as a Hash
3177
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3178
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
3179
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3180
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
3181
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
3182
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
3183
+ # * (`nil`) indicating no credentials
3184
+ # @return [::Object]
3185
+ # @!attribute [rw] scope
3186
+ # The OAuth scopes
3187
+ # @return [::Array<::String>]
3188
+ # @!attribute [rw] lib_name
3189
+ # The library name as recorded in instrumentation and logging
3190
+ # @return [::String]
3191
+ # @!attribute [rw] lib_version
3192
+ # The library version as recorded in instrumentation and logging
3193
+ # @return [::String]
3194
+ # @!attribute [rw] channel_args
3195
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
3196
+ # `GRPC::Core::Channel` object is provided as the credential.
3197
+ # @return [::Hash]
3198
+ # @!attribute [rw] interceptors
3199
+ # An array of interceptors that are run before calls are executed.
3200
+ # @return [::Array<::GRPC::ClientInterceptor>]
3201
+ # @!attribute [rw] timeout
3202
+ # The call timeout in seconds.
3203
+ # @return [::Numeric]
3204
+ # @!attribute [rw] metadata
3205
+ # Additional gRPC headers to be sent with the call.
3206
+ # @return [::Hash{::Symbol=>::String}]
3207
+ # @!attribute [rw] retry_policy
3208
+ # The retry policy. The value is a hash with the following keys:
3209
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3210
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3211
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3212
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3213
+ # trigger a retry.
3214
+ # @return [::Hash]
3215
+ # @!attribute [rw] quota_project
3216
+ # A separate project against which to charge quota.
3217
+ # @return [::String]
3218
+ #
3219
+ class Configuration
3220
+ extend ::Gapic::Config
3221
+
3222
+ config_attr :endpoint, "cloudchannel.googleapis.com", ::String
3223
+ config_attr :credentials, nil do |value|
3224
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3225
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
3226
+ allowed.any? { |klass| klass === value }
3227
+ end
3228
+ config_attr :scope, nil, ::String, ::Array, nil
3229
+ config_attr :lib_name, nil, ::String, nil
3230
+ config_attr :lib_version, nil, ::String, nil
3231
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
3232
+ config_attr :interceptors, nil, ::Array, nil
3233
+ config_attr :timeout, nil, ::Numeric, nil
3234
+ config_attr :metadata, nil, ::Hash, nil
3235
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3236
+ config_attr :quota_project, nil, ::String, nil
3237
+
3238
+ # @private
3239
+ def initialize parent_config = nil
3240
+ @parent_config = parent_config unless parent_config.nil?
3241
+
3242
+ yield self if block_given?
3243
+ end
3244
+
3245
+ ##
3246
+ # Configurations for individual RPCs
3247
+ # @return [Rpcs]
3248
+ #
3249
+ def rpcs
3250
+ @rpcs ||= begin
3251
+ parent_rpcs = nil
3252
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
3253
+ Rpcs.new parent_rpcs
3254
+ end
3255
+ end
3256
+
3257
+ ##
3258
+ # Configuration RPC class for the CloudChannelService API.
3259
+ #
3260
+ # Includes fields providing the configuration for each RPC in this service.
3261
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3262
+ # the following configuration fields:
3263
+ #
3264
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
3265
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
3266
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3267
+ # include the following keys:
3268
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3269
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3270
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3271
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3272
+ # trigger a retry.
3273
+ #
3274
+ class Rpcs
3275
+ ##
3276
+ # RPC-specific configuration for `list_customers`
3277
+ # @return [::Gapic::Config::Method]
3278
+ #
3279
+ attr_reader :list_customers
3280
+ ##
3281
+ # RPC-specific configuration for `get_customer`
3282
+ # @return [::Gapic::Config::Method]
3283
+ #
3284
+ attr_reader :get_customer
3285
+ ##
3286
+ # RPC-specific configuration for `check_cloud_identity_accounts_exist`
3287
+ # @return [::Gapic::Config::Method]
3288
+ #
3289
+ attr_reader :check_cloud_identity_accounts_exist
3290
+ ##
3291
+ # RPC-specific configuration for `create_customer`
3292
+ # @return [::Gapic::Config::Method]
3293
+ #
3294
+ attr_reader :create_customer
3295
+ ##
3296
+ # RPC-specific configuration for `update_customer`
3297
+ # @return [::Gapic::Config::Method]
3298
+ #
3299
+ attr_reader :update_customer
3300
+ ##
3301
+ # RPC-specific configuration for `delete_customer`
3302
+ # @return [::Gapic::Config::Method]
3303
+ #
3304
+ attr_reader :delete_customer
3305
+ ##
3306
+ # RPC-specific configuration for `provision_cloud_identity`
3307
+ # @return [::Gapic::Config::Method]
3308
+ #
3309
+ attr_reader :provision_cloud_identity
3310
+ ##
3311
+ # RPC-specific configuration for `list_entitlements`
3312
+ # @return [::Gapic::Config::Method]
3313
+ #
3314
+ attr_reader :list_entitlements
3315
+ ##
3316
+ # RPC-specific configuration for `list_transferable_skus`
3317
+ # @return [::Gapic::Config::Method]
3318
+ #
3319
+ attr_reader :list_transferable_skus
3320
+ ##
3321
+ # RPC-specific configuration for `list_transferable_offers`
3322
+ # @return [::Gapic::Config::Method]
3323
+ #
3324
+ attr_reader :list_transferable_offers
3325
+ ##
3326
+ # RPC-specific configuration for `get_entitlement`
3327
+ # @return [::Gapic::Config::Method]
3328
+ #
3329
+ attr_reader :get_entitlement
3330
+ ##
3331
+ # RPC-specific configuration for `create_entitlement`
3332
+ # @return [::Gapic::Config::Method]
3333
+ #
3334
+ attr_reader :create_entitlement
3335
+ ##
3336
+ # RPC-specific configuration for `change_parameters`
3337
+ # @return [::Gapic::Config::Method]
3338
+ #
3339
+ attr_reader :change_parameters
3340
+ ##
3341
+ # RPC-specific configuration for `change_renewal_settings`
3342
+ # @return [::Gapic::Config::Method]
3343
+ #
3344
+ attr_reader :change_renewal_settings
3345
+ ##
3346
+ # RPC-specific configuration for `change_offer`
3347
+ # @return [::Gapic::Config::Method]
3348
+ #
3349
+ attr_reader :change_offer
3350
+ ##
3351
+ # RPC-specific configuration for `start_paid_service`
3352
+ # @return [::Gapic::Config::Method]
3353
+ #
3354
+ attr_reader :start_paid_service
3355
+ ##
3356
+ # RPC-specific configuration for `suspend_entitlement`
3357
+ # @return [::Gapic::Config::Method]
3358
+ #
3359
+ attr_reader :suspend_entitlement
3360
+ ##
3361
+ # RPC-specific configuration for `cancel_entitlement`
3362
+ # @return [::Gapic::Config::Method]
3363
+ #
3364
+ attr_reader :cancel_entitlement
3365
+ ##
3366
+ # RPC-specific configuration for `activate_entitlement`
3367
+ # @return [::Gapic::Config::Method]
3368
+ #
3369
+ attr_reader :activate_entitlement
3370
+ ##
3371
+ # RPC-specific configuration for `transfer_entitlements`
3372
+ # @return [::Gapic::Config::Method]
3373
+ #
3374
+ attr_reader :transfer_entitlements
3375
+ ##
3376
+ # RPC-specific configuration for `transfer_entitlements_to_google`
3377
+ # @return [::Gapic::Config::Method]
3378
+ #
3379
+ attr_reader :transfer_entitlements_to_google
3380
+ ##
3381
+ # RPC-specific configuration for `list_channel_partner_links`
3382
+ # @return [::Gapic::Config::Method]
3383
+ #
3384
+ attr_reader :list_channel_partner_links
3385
+ ##
3386
+ # RPC-specific configuration for `get_channel_partner_link`
3387
+ # @return [::Gapic::Config::Method]
3388
+ #
3389
+ attr_reader :get_channel_partner_link
3390
+ ##
3391
+ # RPC-specific configuration for `create_channel_partner_link`
3392
+ # @return [::Gapic::Config::Method]
3393
+ #
3394
+ attr_reader :create_channel_partner_link
3395
+ ##
3396
+ # RPC-specific configuration for `update_channel_partner_link`
3397
+ # @return [::Gapic::Config::Method]
3398
+ #
3399
+ attr_reader :update_channel_partner_link
3400
+ ##
3401
+ # RPC-specific configuration for `list_products`
3402
+ # @return [::Gapic::Config::Method]
3403
+ #
3404
+ attr_reader :list_products
3405
+ ##
3406
+ # RPC-specific configuration for `list_skus`
3407
+ # @return [::Gapic::Config::Method]
3408
+ #
3409
+ attr_reader :list_skus
3410
+ ##
3411
+ # RPC-specific configuration for `list_offers`
3412
+ # @return [::Gapic::Config::Method]
3413
+ #
3414
+ attr_reader :list_offers
3415
+ ##
3416
+ # RPC-specific configuration for `list_purchasable_skus`
3417
+ # @return [::Gapic::Config::Method]
3418
+ #
3419
+ attr_reader :list_purchasable_skus
3420
+ ##
3421
+ # RPC-specific configuration for `list_purchasable_offers`
3422
+ # @return [::Gapic::Config::Method]
3423
+ #
3424
+ attr_reader :list_purchasable_offers
3425
+
3426
+ # @private
3427
+ def initialize parent_rpcs = nil
3428
+ list_customers_config = parent_rpcs&.list_customers if parent_rpcs&.respond_to? :list_customers
3429
+ @list_customers = ::Gapic::Config::Method.new list_customers_config
3430
+ get_customer_config = parent_rpcs&.get_customer if parent_rpcs&.respond_to? :get_customer
3431
+ @get_customer = ::Gapic::Config::Method.new get_customer_config
3432
+ check_cloud_identity_accounts_exist_config = parent_rpcs&.check_cloud_identity_accounts_exist if parent_rpcs&.respond_to? :check_cloud_identity_accounts_exist
3433
+ @check_cloud_identity_accounts_exist = ::Gapic::Config::Method.new check_cloud_identity_accounts_exist_config
3434
+ create_customer_config = parent_rpcs&.create_customer if parent_rpcs&.respond_to? :create_customer
3435
+ @create_customer = ::Gapic::Config::Method.new create_customer_config
3436
+ update_customer_config = parent_rpcs&.update_customer if parent_rpcs&.respond_to? :update_customer
3437
+ @update_customer = ::Gapic::Config::Method.new update_customer_config
3438
+ delete_customer_config = parent_rpcs&.delete_customer if parent_rpcs&.respond_to? :delete_customer
3439
+ @delete_customer = ::Gapic::Config::Method.new delete_customer_config
3440
+ provision_cloud_identity_config = parent_rpcs&.provision_cloud_identity if parent_rpcs&.respond_to? :provision_cloud_identity
3441
+ @provision_cloud_identity = ::Gapic::Config::Method.new provision_cloud_identity_config
3442
+ list_entitlements_config = parent_rpcs&.list_entitlements if parent_rpcs&.respond_to? :list_entitlements
3443
+ @list_entitlements = ::Gapic::Config::Method.new list_entitlements_config
3444
+ list_transferable_skus_config = parent_rpcs&.list_transferable_skus if parent_rpcs&.respond_to? :list_transferable_skus
3445
+ @list_transferable_skus = ::Gapic::Config::Method.new list_transferable_skus_config
3446
+ list_transferable_offers_config = parent_rpcs&.list_transferable_offers if parent_rpcs&.respond_to? :list_transferable_offers
3447
+ @list_transferable_offers = ::Gapic::Config::Method.new list_transferable_offers_config
3448
+ get_entitlement_config = parent_rpcs&.get_entitlement if parent_rpcs&.respond_to? :get_entitlement
3449
+ @get_entitlement = ::Gapic::Config::Method.new get_entitlement_config
3450
+ create_entitlement_config = parent_rpcs&.create_entitlement if parent_rpcs&.respond_to? :create_entitlement
3451
+ @create_entitlement = ::Gapic::Config::Method.new create_entitlement_config
3452
+ change_parameters_config = parent_rpcs&.change_parameters if parent_rpcs&.respond_to? :change_parameters
3453
+ @change_parameters = ::Gapic::Config::Method.new change_parameters_config
3454
+ change_renewal_settings_config = parent_rpcs&.change_renewal_settings if parent_rpcs&.respond_to? :change_renewal_settings
3455
+ @change_renewal_settings = ::Gapic::Config::Method.new change_renewal_settings_config
3456
+ change_offer_config = parent_rpcs&.change_offer if parent_rpcs&.respond_to? :change_offer
3457
+ @change_offer = ::Gapic::Config::Method.new change_offer_config
3458
+ start_paid_service_config = parent_rpcs&.start_paid_service if parent_rpcs&.respond_to? :start_paid_service
3459
+ @start_paid_service = ::Gapic::Config::Method.new start_paid_service_config
3460
+ suspend_entitlement_config = parent_rpcs&.suspend_entitlement if parent_rpcs&.respond_to? :suspend_entitlement
3461
+ @suspend_entitlement = ::Gapic::Config::Method.new suspend_entitlement_config
3462
+ cancel_entitlement_config = parent_rpcs&.cancel_entitlement if parent_rpcs&.respond_to? :cancel_entitlement
3463
+ @cancel_entitlement = ::Gapic::Config::Method.new cancel_entitlement_config
3464
+ activate_entitlement_config = parent_rpcs&.activate_entitlement if parent_rpcs&.respond_to? :activate_entitlement
3465
+ @activate_entitlement = ::Gapic::Config::Method.new activate_entitlement_config
3466
+ transfer_entitlements_config = parent_rpcs&.transfer_entitlements if parent_rpcs&.respond_to? :transfer_entitlements
3467
+ @transfer_entitlements = ::Gapic::Config::Method.new transfer_entitlements_config
3468
+ transfer_entitlements_to_google_config = parent_rpcs&.transfer_entitlements_to_google if parent_rpcs&.respond_to? :transfer_entitlements_to_google
3469
+ @transfer_entitlements_to_google = ::Gapic::Config::Method.new transfer_entitlements_to_google_config
3470
+ list_channel_partner_links_config = parent_rpcs&.list_channel_partner_links if parent_rpcs&.respond_to? :list_channel_partner_links
3471
+ @list_channel_partner_links = ::Gapic::Config::Method.new list_channel_partner_links_config
3472
+ get_channel_partner_link_config = parent_rpcs&.get_channel_partner_link if parent_rpcs&.respond_to? :get_channel_partner_link
3473
+ @get_channel_partner_link = ::Gapic::Config::Method.new get_channel_partner_link_config
3474
+ create_channel_partner_link_config = parent_rpcs&.create_channel_partner_link if parent_rpcs&.respond_to? :create_channel_partner_link
3475
+ @create_channel_partner_link = ::Gapic::Config::Method.new create_channel_partner_link_config
3476
+ update_channel_partner_link_config = parent_rpcs&.update_channel_partner_link if parent_rpcs&.respond_to? :update_channel_partner_link
3477
+ @update_channel_partner_link = ::Gapic::Config::Method.new update_channel_partner_link_config
3478
+ list_products_config = parent_rpcs&.list_products if parent_rpcs&.respond_to? :list_products
3479
+ @list_products = ::Gapic::Config::Method.new list_products_config
3480
+ list_skus_config = parent_rpcs&.list_skus if parent_rpcs&.respond_to? :list_skus
3481
+ @list_skus = ::Gapic::Config::Method.new list_skus_config
3482
+ list_offers_config = parent_rpcs&.list_offers if parent_rpcs&.respond_to? :list_offers
3483
+ @list_offers = ::Gapic::Config::Method.new list_offers_config
3484
+ list_purchasable_skus_config = parent_rpcs&.list_purchasable_skus if parent_rpcs&.respond_to? :list_purchasable_skus
3485
+ @list_purchasable_skus = ::Gapic::Config::Method.new list_purchasable_skus_config
3486
+ list_purchasable_offers_config = parent_rpcs&.list_purchasable_offers if parent_rpcs&.respond_to? :list_purchasable_offers
3487
+ @list_purchasable_offers = ::Gapic::Config::Method.new list_purchasable_offers_config
3488
+
3489
+ yield self if block_given?
3490
+ end
3491
+ end
3492
+ end
3493
+ end
3494
+ end
3495
+ end
3496
+ end
3497
+ end
3498
+ end