google-cloud-channel-v1 0.7.1 → 0.9.1

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.
@@ -59,13 +59,12 @@ module Google
59
59
  # See {::Google::Cloud::Channel::V1::CloudChannelService::Client::Configuration}
60
60
  # for a description of the configuration fields.
61
61
  #
62
- # ## Example
62
+ # @example
63
63
  #
64
- # To modify the configuration for all CloudChannelService clients:
65
- #
66
- # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
67
- # config.timeout = 10.0
68
- # end
64
+ # # Modify the configuration for all CloudChannelService clients
65
+ # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
66
+ # config.timeout = 10.0
67
+ # end
69
68
  #
70
69
  # @yield [config] Configure the Client client.
71
70
  # @yieldparam config [Client::Configuration]
@@ -139,19 +138,15 @@ module Google
139
138
  ##
140
139
  # Create a new CloudChannelService client object.
141
140
  #
142
- # ## Examples
143
- #
144
- # To create a new CloudChannelService client with the default
145
- # configuration:
146
- #
147
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
141
+ # @example
148
142
  #
149
- # To create a new CloudChannelService client with a custom
150
- # configuration:
143
+ # # Create a client using the default configuration
144
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
151
145
  #
152
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
153
- # config.timeout = 10.0
154
- # end
146
+ # # Create a client using a custom configuration
147
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
148
+ # config.timeout = 10.0
149
+ # end
155
150
  #
156
151
  # @yield [config] Configure the CloudChannelService client.
157
152
  # @yieldparam config [Client::Configuration]
@@ -171,10 +166,9 @@ module Google
171
166
 
172
167
  # Create credentials
173
168
  credentials = @config.credentials
174
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
169
+ # Use self-signed JWT if the endpoint is unchanged from default,
175
170
  # but only if the default endpoint does not have a region prefix.
176
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
177
- @config.endpoint == Client.configure.endpoint &&
171
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
178
172
  !@config.endpoint.split(".").first.include?("-")
179
173
  credentials ||= Credentials.default scope: @config.scope,
180
174
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -255,6 +249,27 @@ module Google
255
249
  #
256
250
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
257
251
  #
252
+ # @example Basic example
253
+ # require "google/cloud/channel/v1"
254
+ #
255
+ # # Create a client object. The client can be reused for multiple calls.
256
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
257
+ #
258
+ # # Create a request. To set request fields, pass in keyword arguments.
259
+ # request = Google::Cloud::Channel::V1::ListCustomersRequest.new
260
+ #
261
+ # # Call the list_customers method.
262
+ # result = client.list_customers request
263
+ #
264
+ # # The returned object is of type Gapic::PagedEnumerable. You can
265
+ # # iterate over all elements by calling #each, and the enumerable
266
+ # # will lazily make API calls to fetch subsequent pages. Other
267
+ # # methods are also available for managing paging directly.
268
+ # result.each do |response|
269
+ # # Each element is of type ::Google::Cloud::Channel::V1::Customer.
270
+ # p response
271
+ # end
272
+ #
258
273
  def list_customers request, options = nil
259
274
  raise ::ArgumentError, "request must be provided" if request.nil?
260
275
 
@@ -272,16 +287,20 @@ module Google
272
287
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
273
288
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
289
 
275
- header_params = {
276
- "parent" => request.parent
277
- }
290
+ header_params = {}
291
+ if request.parent
292
+ header_params["parent"] = request.parent
293
+ end
294
+
278
295
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
279
296
  metadata[:"x-goog-request-params"] ||= request_params_header
280
297
 
281
298
  options.apply_defaults timeout: @config.rpcs.list_customers.timeout,
282
299
  metadata: metadata,
283
300
  retry_policy: @config.rpcs.list_customers.retry_policy
284
- options.apply_defaults metadata: @config.metadata,
301
+
302
+ options.apply_defaults timeout: @config.timeout,
303
+ metadata: @config.metadata,
285
304
  retry_policy: @config.retry_policy
286
305
 
287
306
  @cloud_channel_service_stub.call_rpc :list_customers, request, options: options do |response, operation|
@@ -334,6 +353,21 @@ module Google
334
353
  #
335
354
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
355
  #
356
+ # @example Basic example
357
+ # require "google/cloud/channel/v1"
358
+ #
359
+ # # Create a client object. The client can be reused for multiple calls.
360
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
361
+ #
362
+ # # Create a request. To set request fields, pass in keyword arguments.
363
+ # request = Google::Cloud::Channel::V1::GetCustomerRequest.new
364
+ #
365
+ # # Call the get_customer method.
366
+ # result = client.get_customer request
367
+ #
368
+ # # The returned object is of type Google::Cloud::Channel::V1::Customer.
369
+ # p result
370
+ #
337
371
  def get_customer request, options = nil
338
372
  raise ::ArgumentError, "request must be provided" if request.nil?
339
373
 
@@ -351,16 +385,20 @@ module Google
351
385
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
352
386
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
387
 
354
- header_params = {
355
- "name" => request.name
356
- }
388
+ header_params = {}
389
+ if request.name
390
+ header_params["name"] = request.name
391
+ end
392
+
357
393
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
394
  metadata[:"x-goog-request-params"] ||= request_params_header
359
395
 
360
396
  options.apply_defaults timeout: @config.rpcs.get_customer.timeout,
361
397
  metadata: metadata,
362
398
  retry_policy: @config.rpcs.get_customer.retry_policy
363
- options.apply_defaults metadata: @config.metadata,
399
+
400
+ options.apply_defaults timeout: @config.timeout,
401
+ metadata: @config.metadata,
364
402
  retry_policy: @config.retry_policy
365
403
 
366
404
  @cloud_channel_service_stub.call_rpc :get_customer, request, options: options do |response, operation|
@@ -418,6 +456,21 @@ module Google
418
456
  #
419
457
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
420
458
  #
459
+ # @example Basic example
460
+ # require "google/cloud/channel/v1"
461
+ #
462
+ # # Create a client object. The client can be reused for multiple calls.
463
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
464
+ #
465
+ # # Create a request. To set request fields, pass in keyword arguments.
466
+ # request = Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest.new
467
+ #
468
+ # # Call the check_cloud_identity_accounts_exist method.
469
+ # result = client.check_cloud_identity_accounts_exist request
470
+ #
471
+ # # The returned object is of type Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse.
472
+ # p result
473
+ #
421
474
  def check_cloud_identity_accounts_exist request, options = nil
422
475
  raise ::ArgumentError, "request must be provided" if request.nil?
423
476
 
@@ -435,16 +488,20 @@ module Google
435
488
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
436
489
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
437
490
 
438
- header_params = {
439
- "parent" => request.parent
440
- }
491
+ header_params = {}
492
+ if request.parent
493
+ header_params["parent"] = request.parent
494
+ end
495
+
441
496
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
442
497
  metadata[:"x-goog-request-params"] ||= request_params_header
443
498
 
444
499
  options.apply_defaults timeout: @config.rpcs.check_cloud_identity_accounts_exist.timeout,
445
500
  metadata: metadata,
446
501
  retry_policy: @config.rpcs.check_cloud_identity_accounts_exist.retry_policy
447
- options.apply_defaults metadata: @config.metadata,
502
+
503
+ options.apply_defaults timeout: @config.timeout,
504
+ metadata: @config.metadata,
448
505
  retry_policy: @config.retry_policy
449
506
 
450
507
  @cloud_channel_service_stub.call_rpc :check_cloud_identity_accounts_exist, request, options: options do |response, operation|
@@ -499,6 +556,21 @@ module Google
499
556
  #
500
557
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
501
558
  #
559
+ # @example Basic example
560
+ # require "google/cloud/channel/v1"
561
+ #
562
+ # # Create a client object. The client can be reused for multiple calls.
563
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
564
+ #
565
+ # # Create a request. To set request fields, pass in keyword arguments.
566
+ # request = Google::Cloud::Channel::V1::CreateCustomerRequest.new
567
+ #
568
+ # # Call the create_customer method.
569
+ # result = client.create_customer request
570
+ #
571
+ # # The returned object is of type Google::Cloud::Channel::V1::Customer.
572
+ # p result
573
+ #
502
574
  def create_customer request, options = nil
503
575
  raise ::ArgumentError, "request must be provided" if request.nil?
504
576
 
@@ -516,16 +588,20 @@ module Google
516
588
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
517
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
518
590
 
519
- header_params = {
520
- "parent" => request.parent
521
- }
591
+ header_params = {}
592
+ if request.parent
593
+ header_params["parent"] = request.parent
594
+ end
595
+
522
596
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
523
597
  metadata[:"x-goog-request-params"] ||= request_params_header
524
598
 
525
599
  options.apply_defaults timeout: @config.rpcs.create_customer.timeout,
526
600
  metadata: metadata,
527
601
  retry_policy: @config.rpcs.create_customer.retry_policy
528
- options.apply_defaults metadata: @config.metadata,
602
+
603
+ options.apply_defaults timeout: @config.timeout,
604
+ metadata: @config.metadata,
529
605
  retry_policy: @config.retry_policy
530
606
 
531
607
  @cloud_channel_service_stub.call_rpc :create_customer, request, options: options do |response, operation|
@@ -579,6 +655,21 @@ module Google
579
655
  #
580
656
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
581
657
  #
658
+ # @example Basic example
659
+ # require "google/cloud/channel/v1"
660
+ #
661
+ # # Create a client object. The client can be reused for multiple calls.
662
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
663
+ #
664
+ # # Create a request. To set request fields, pass in keyword arguments.
665
+ # request = Google::Cloud::Channel::V1::UpdateCustomerRequest.new
666
+ #
667
+ # # Call the update_customer method.
668
+ # result = client.update_customer request
669
+ #
670
+ # # The returned object is of type Google::Cloud::Channel::V1::Customer.
671
+ # p result
672
+ #
582
673
  def update_customer request, options = nil
583
674
  raise ::ArgumentError, "request must be provided" if request.nil?
584
675
 
@@ -596,16 +687,20 @@ module Google
596
687
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
597
688
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
598
689
 
599
- header_params = {
600
- "customer.name" => request.customer.name
601
- }
690
+ header_params = {}
691
+ if request.customer&.name
692
+ header_params["customer.name"] = request.customer.name
693
+ end
694
+
602
695
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
603
696
  metadata[:"x-goog-request-params"] ||= request_params_header
604
697
 
605
698
  options.apply_defaults timeout: @config.rpcs.update_customer.timeout,
606
699
  metadata: metadata,
607
700
  retry_policy: @config.rpcs.update_customer.retry_policy
608
- options.apply_defaults metadata: @config.metadata,
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
609
704
  retry_policy: @config.retry_policy
610
705
 
611
706
  @cloud_channel_service_stub.call_rpc :update_customer, request, options: options do |response, operation|
@@ -653,6 +748,21 @@ module Google
653
748
  #
654
749
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
655
750
  #
751
+ # @example Basic example
752
+ # require "google/cloud/channel/v1"
753
+ #
754
+ # # Create a client object. The client can be reused for multiple calls.
755
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
756
+ #
757
+ # # Create a request. To set request fields, pass in keyword arguments.
758
+ # request = Google::Cloud::Channel::V1::DeleteCustomerRequest.new
759
+ #
760
+ # # Call the delete_customer method.
761
+ # result = client.delete_customer request
762
+ #
763
+ # # The returned object is of type Google::Protobuf::Empty.
764
+ # p result
765
+ #
656
766
  def delete_customer request, options = nil
657
767
  raise ::ArgumentError, "request must be provided" if request.nil?
658
768
 
@@ -670,16 +780,20 @@ module Google
670
780
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
671
781
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
672
782
 
673
- header_params = {
674
- "name" => request.name
675
- }
783
+ header_params = {}
784
+ if request.name
785
+ header_params["name"] = request.name
786
+ end
787
+
676
788
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
677
789
  metadata[:"x-goog-request-params"] ||= request_params_header
678
790
 
679
791
  options.apply_defaults timeout: @config.rpcs.delete_customer.timeout,
680
792
  metadata: metadata,
681
793
  retry_policy: @config.rpcs.delete_customer.retry_policy
682
- options.apply_defaults metadata: @config.metadata,
794
+
795
+ options.apply_defaults timeout: @config.timeout,
796
+ metadata: @config.metadata,
683
797
  retry_policy: @config.retry_policy
684
798
 
685
799
  @cloud_channel_service_stub.call_rpc :delete_customer, request, options: options do |response, operation|
@@ -690,6 +804,130 @@ module Google
690
804
  raise ::Google::Cloud::Error.from_error(e)
691
805
  end
692
806
 
807
+ ##
808
+ # Imports a {::Google::Cloud::Channel::V1::Customer Customer} from the Cloud Identity associated with the provided
809
+ # Cloud Identity ID or domain before a TransferEntitlements call. If a
810
+ # linked Customer already exists and overwrite_if_exists is true, it will
811
+ # update that Customer's data.
812
+ #
813
+ # Possible error codes:
814
+ #
815
+ # * PERMISSION_DENIED: The reseller account making the request is different
816
+ # from the reseller account in the API request.
817
+ # * NOT_FOUND: Cloud Identity doesn't exist or was deleted.
818
+ # * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is
819
+ # expired or invalid.
820
+ # * ALREADY_EXISTS: A customer already exists and has conflicting critical
821
+ # fields. Requires an overwrite.
822
+ #
823
+ # Return value:
824
+ # The {::Google::Cloud::Channel::V1::Customer Customer}.
825
+ #
826
+ # @overload import_customer(request, options = nil)
827
+ # Pass arguments to `import_customer` via a request object, either of type
828
+ # {::Google::Cloud::Channel::V1::ImportCustomerRequest} or an equivalent Hash.
829
+ #
830
+ # @param request [::Google::Cloud::Channel::V1::ImportCustomerRequest, ::Hash]
831
+ # A request object representing the call parameters. Required. To specify no
832
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
833
+ # @param options [::Gapic::CallOptions, ::Hash]
834
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
835
+ #
836
+ # @overload import_customer(domain: nil, cloud_identity_id: nil, parent: nil, auth_token: nil, overwrite_if_exists: nil, channel_partner_id: nil, customer: nil)
837
+ # Pass arguments to `import_customer` via keyword arguments. Note that at
838
+ # least one keyword argument is required. To specify no parameters, or to keep all
839
+ # the default parameter values, pass an empty Hash as a request object (see above).
840
+ #
841
+ # @param domain [::String]
842
+ # Required. Customer domain.
843
+ # @param cloud_identity_id [::String]
844
+ # Required. Customer's Cloud Identity ID
845
+ # @param parent [::String]
846
+ # Required. The resource name of the reseller's account.
847
+ # Parent takes the format: accounts/\\{account_id} or
848
+ # accounts/\\{account_id}/channelPartnerLinks/\\{channel_partner_id}
849
+ # @param auth_token [::String]
850
+ # Optional. The super admin of the resold customer generates this token to
851
+ # authorize a reseller to access their Cloud Identity and purchase
852
+ # entitlements on their behalf. You can omit this token after authorization.
853
+ # See https://support.google.com/a/answer/7643790 for more details.
854
+ # @param overwrite_if_exists [::Boolean]
855
+ # Required. Choose to overwrite an existing customer if found.
856
+ # This must be set to true if there is an existing customer with a
857
+ # conflicting region code or domain.
858
+ # @param channel_partner_id [::String]
859
+ # Optional. Cloud Identity ID of a channel partner who will be the direct reseller for
860
+ # the customer's order. This field is required for 2-tier transfer scenarios
861
+ # and can be provided via the request Parent binding as well.
862
+ # @param customer [::String]
863
+ # Optional. Specifies the customer that will receive imported Cloud Identity
864
+ # information.
865
+ # Format: accounts/\\{account_id}/customers/\\{customer_id}
866
+ #
867
+ # @yield [response, operation] Access the result along with the RPC operation
868
+ # @yieldparam response [::Google::Cloud::Channel::V1::Customer]
869
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
870
+ #
871
+ # @return [::Google::Cloud::Channel::V1::Customer]
872
+ #
873
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
874
+ #
875
+ # @example Basic example
876
+ # require "google/cloud/channel/v1"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Channel::V1::ImportCustomerRequest.new
883
+ #
884
+ # # Call the import_customer method.
885
+ # result = client.import_customer request
886
+ #
887
+ # # The returned object is of type Google::Cloud::Channel::V1::Customer.
888
+ # p result
889
+ #
890
+ def import_customer request, options = nil
891
+ raise ::ArgumentError, "request must be provided" if request.nil?
892
+
893
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ImportCustomerRequest
894
+
895
+ # Converts hash and nil to an options object
896
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
897
+
898
+ # Customize the options with defaults
899
+ metadata = @config.rpcs.import_customer.metadata.to_h
900
+
901
+ # Set x-goog-api-client and x-goog-user-project headers
902
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
903
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
904
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
905
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
906
+
907
+ header_params = {}
908
+ if request.parent
909
+ header_params["parent"] = request.parent
910
+ end
911
+
912
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
913
+ metadata[:"x-goog-request-params"] ||= request_params_header
914
+
915
+ options.apply_defaults timeout: @config.rpcs.import_customer.timeout,
916
+ metadata: metadata,
917
+ retry_policy: @config.rpcs.import_customer.retry_policy
918
+
919
+ options.apply_defaults timeout: @config.timeout,
920
+ metadata: @config.metadata,
921
+ retry_policy: @config.retry_policy
922
+
923
+ @cloud_channel_service_stub.call_rpc :import_customer, request, options: options do |response, operation|
924
+ yield response, operation if block_given?
925
+ return response
926
+ end
927
+ rescue ::GRPC::BadStatus => e
928
+ raise ::Google::Cloud::Error.from_error(e)
929
+ end
930
+
693
931
  ##
694
932
  # Creates a Cloud Identity for the given customer using the customer's
695
933
  # information, or the information provided here.
@@ -746,6 +984,28 @@ module Google
746
984
  #
747
985
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
748
986
  #
987
+ # @example Basic example
988
+ # require "google/cloud/channel/v1"
989
+ #
990
+ # # Create a client object. The client can be reused for multiple calls.
991
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
992
+ #
993
+ # # Create a request. To set request fields, pass in keyword arguments.
994
+ # request = Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest.new
995
+ #
996
+ # # Call the provision_cloud_identity method.
997
+ # result = client.provision_cloud_identity request
998
+ #
999
+ # # The returned object is of type Gapic::Operation. You can use this
1000
+ # # object to check the status of an operation, cancel it, or wait
1001
+ # # for results. Here is how to block until completion:
1002
+ # result.wait_until_done! timeout: 60
1003
+ # if result.response?
1004
+ # p result.response
1005
+ # else
1006
+ # puts "Error!"
1007
+ # end
1008
+ #
749
1009
  def provision_cloud_identity request, options = nil
750
1010
  raise ::ArgumentError, "request must be provided" if request.nil?
751
1011
 
@@ -763,16 +1023,20 @@ module Google
763
1023
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
764
1024
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
765
1025
 
766
- header_params = {
767
- "customer" => request.customer
768
- }
1026
+ header_params = {}
1027
+ if request.customer
1028
+ header_params["customer"] = request.customer
1029
+ end
1030
+
769
1031
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
770
1032
  metadata[:"x-goog-request-params"] ||= request_params_header
771
1033
 
772
1034
  options.apply_defaults timeout: @config.rpcs.provision_cloud_identity.timeout,
773
1035
  metadata: metadata,
774
1036
  retry_policy: @config.rpcs.provision_cloud_identity.retry_policy
775
- options.apply_defaults metadata: @config.metadata,
1037
+
1038
+ options.apply_defaults timeout: @config.timeout,
1039
+ metadata: @config.metadata,
776
1040
  retry_policy: @config.retry_policy
777
1041
 
778
1042
  @cloud_channel_service_stub.call_rpc :provision_cloud_identity, request, options: options do |response, operation|
@@ -832,6 +1096,27 @@ module Google
832
1096
  #
833
1097
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
834
1098
  #
1099
+ # @example Basic example
1100
+ # require "google/cloud/channel/v1"
1101
+ #
1102
+ # # Create a client object. The client can be reused for multiple calls.
1103
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1104
+ #
1105
+ # # Create a request. To set request fields, pass in keyword arguments.
1106
+ # request = Google::Cloud::Channel::V1::ListEntitlementsRequest.new
1107
+ #
1108
+ # # Call the list_entitlements method.
1109
+ # result = client.list_entitlements request
1110
+ #
1111
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1112
+ # # iterate over all elements by calling #each, and the enumerable
1113
+ # # will lazily make API calls to fetch subsequent pages. Other
1114
+ # # methods are also available for managing paging directly.
1115
+ # result.each do |response|
1116
+ # # Each element is of type ::Google::Cloud::Channel::V1::Entitlement.
1117
+ # p response
1118
+ # end
1119
+ #
835
1120
  def list_entitlements request, options = nil
836
1121
  raise ::ArgumentError, "request must be provided" if request.nil?
837
1122
 
@@ -849,16 +1134,20 @@ module Google
849
1134
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
850
1135
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
851
1136
 
852
- header_params = {
853
- "parent" => request.parent
854
- }
1137
+ header_params = {}
1138
+ if request.parent
1139
+ header_params["parent"] = request.parent
1140
+ end
1141
+
855
1142
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
856
1143
  metadata[:"x-goog-request-params"] ||= request_params_header
857
1144
 
858
1145
  options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout,
859
1146
  metadata: metadata,
860
1147
  retry_policy: @config.rpcs.list_entitlements.retry_policy
861
- options.apply_defaults metadata: @config.metadata,
1148
+
1149
+ options.apply_defaults timeout: @config.timeout,
1150
+ metadata: @config.metadata,
862
1151
  retry_policy: @config.retry_policy
863
1152
 
864
1153
  @cloud_channel_service_stub.call_rpc :list_entitlements, request, options: options do |response, operation|
@@ -945,6 +1234,27 @@ module Google
945
1234
  #
946
1235
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
947
1236
  #
1237
+ # @example Basic example
1238
+ # require "google/cloud/channel/v1"
1239
+ #
1240
+ # # Create a client object. The client can be reused for multiple calls.
1241
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1242
+ #
1243
+ # # Create a request. To set request fields, pass in keyword arguments.
1244
+ # request = Google::Cloud::Channel::V1::ListTransferableSkusRequest.new
1245
+ #
1246
+ # # Call the list_transferable_skus method.
1247
+ # result = client.list_transferable_skus request
1248
+ #
1249
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1250
+ # # iterate over all elements by calling #each, and the enumerable
1251
+ # # will lazily make API calls to fetch subsequent pages. Other
1252
+ # # methods are also available for managing paging directly.
1253
+ # result.each do |response|
1254
+ # # Each element is of type ::Google::Cloud::Channel::V1::TransferableSku.
1255
+ # p response
1256
+ # end
1257
+ #
948
1258
  def list_transferable_skus request, options = nil
949
1259
  raise ::ArgumentError, "request must be provided" if request.nil?
950
1260
 
@@ -962,16 +1272,20 @@ module Google
962
1272
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
963
1273
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
964
1274
 
965
- header_params = {
966
- "parent" => request.parent
967
- }
1275
+ header_params = {}
1276
+ if request.parent
1277
+ header_params["parent"] = request.parent
1278
+ end
1279
+
968
1280
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
969
1281
  metadata[:"x-goog-request-params"] ||= request_params_header
970
1282
 
971
1283
  options.apply_defaults timeout: @config.rpcs.list_transferable_skus.timeout,
972
1284
  metadata: metadata,
973
1285
  retry_policy: @config.rpcs.list_transferable_skus.retry_policy
974
- options.apply_defaults metadata: @config.metadata,
1286
+
1287
+ options.apply_defaults timeout: @config.timeout,
1288
+ metadata: @config.metadata,
975
1289
  retry_policy: @config.retry_policy
976
1290
 
977
1291
  @cloud_channel_service_stub.call_rpc :list_transferable_skus, request, options: options do |response, operation|
@@ -1049,6 +1363,27 @@ module Google
1049
1363
  #
1050
1364
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1051
1365
  #
1366
+ # @example Basic example
1367
+ # require "google/cloud/channel/v1"
1368
+ #
1369
+ # # Create a client object. The client can be reused for multiple calls.
1370
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1371
+ #
1372
+ # # Create a request. To set request fields, pass in keyword arguments.
1373
+ # request = Google::Cloud::Channel::V1::ListTransferableOffersRequest.new
1374
+ #
1375
+ # # Call the list_transferable_offers method.
1376
+ # result = client.list_transferable_offers request
1377
+ #
1378
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1379
+ # # iterate over all elements by calling #each, and the enumerable
1380
+ # # will lazily make API calls to fetch subsequent pages. Other
1381
+ # # methods are also available for managing paging directly.
1382
+ # result.each do |response|
1383
+ # # Each element is of type ::Google::Cloud::Channel::V1::TransferableOffer.
1384
+ # p response
1385
+ # end
1386
+ #
1052
1387
  def list_transferable_offers request, options = nil
1053
1388
  raise ::ArgumentError, "request must be provided" if request.nil?
1054
1389
 
@@ -1066,16 +1401,20 @@ module Google
1066
1401
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1067
1402
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1068
1403
 
1069
- header_params = {
1070
- "parent" => request.parent
1071
- }
1404
+ header_params = {}
1405
+ if request.parent
1406
+ header_params["parent"] = request.parent
1407
+ end
1408
+
1072
1409
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1073
1410
  metadata[:"x-goog-request-params"] ||= request_params_header
1074
1411
 
1075
1412
  options.apply_defaults timeout: @config.rpcs.list_transferable_offers.timeout,
1076
1413
  metadata: metadata,
1077
1414
  retry_policy: @config.rpcs.list_transferable_offers.retry_policy
1078
- options.apply_defaults metadata: @config.metadata,
1415
+
1416
+ options.apply_defaults timeout: @config.timeout,
1417
+ metadata: @config.metadata,
1079
1418
  retry_policy: @config.retry_policy
1080
1419
 
1081
1420
  @cloud_channel_service_stub.call_rpc :list_transferable_offers, request, options: options do |response, operation|
@@ -1127,6 +1466,21 @@ module Google
1127
1466
  #
1128
1467
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1129
1468
  #
1469
+ # @example Basic example
1470
+ # require "google/cloud/channel/v1"
1471
+ #
1472
+ # # Create a client object. The client can be reused for multiple calls.
1473
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1474
+ #
1475
+ # # Create a request. To set request fields, pass in keyword arguments.
1476
+ # request = Google::Cloud::Channel::V1::GetEntitlementRequest.new
1477
+ #
1478
+ # # Call the get_entitlement method.
1479
+ # result = client.get_entitlement request
1480
+ #
1481
+ # # The returned object is of type Google::Cloud::Channel::V1::Entitlement.
1482
+ # p result
1483
+ #
1130
1484
  def get_entitlement request, options = nil
1131
1485
  raise ::ArgumentError, "request must be provided" if request.nil?
1132
1486
 
@@ -1144,16 +1498,20 @@ module Google
1144
1498
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1145
1499
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1146
1500
 
1147
- header_params = {
1148
- "name" => request.name
1149
- }
1501
+ header_params = {}
1502
+ if request.name
1503
+ header_params["name"] = request.name
1504
+ end
1505
+
1150
1506
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1151
1507
  metadata[:"x-goog-request-params"] ||= request_params_header
1152
1508
 
1153
1509
  options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout,
1154
1510
  metadata: metadata,
1155
1511
  retry_policy: @config.rpcs.get_entitlement.retry_policy
1156
- options.apply_defaults metadata: @config.metadata,
1512
+
1513
+ options.apply_defaults timeout: @config.timeout,
1514
+ metadata: @config.metadata,
1157
1515
  retry_policy: @config.retry_policy
1158
1516
 
1159
1517
  @cloud_channel_service_stub.call_rpc :get_entitlement, request, options: options do |response, operation|
@@ -1244,6 +1602,28 @@ module Google
1244
1602
  #
1245
1603
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1246
1604
  #
1605
+ # @example Basic example
1606
+ # require "google/cloud/channel/v1"
1607
+ #
1608
+ # # Create a client object. The client can be reused for multiple calls.
1609
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1610
+ #
1611
+ # # Create a request. To set request fields, pass in keyword arguments.
1612
+ # request = Google::Cloud::Channel::V1::CreateEntitlementRequest.new
1613
+ #
1614
+ # # Call the create_entitlement method.
1615
+ # result = client.create_entitlement request
1616
+ #
1617
+ # # The returned object is of type Gapic::Operation. You can use this
1618
+ # # object to check the status of an operation, cancel it, or wait
1619
+ # # for results. Here is how to block until completion:
1620
+ # result.wait_until_done! timeout: 60
1621
+ # if result.response?
1622
+ # p result.response
1623
+ # else
1624
+ # puts "Error!"
1625
+ # end
1626
+ #
1247
1627
  def create_entitlement request, options = nil
1248
1628
  raise ::ArgumentError, "request must be provided" if request.nil?
1249
1629
 
@@ -1261,16 +1641,20 @@ module Google
1261
1641
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1262
1642
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1263
1643
 
1264
- header_params = {
1265
- "parent" => request.parent
1266
- }
1644
+ header_params = {}
1645
+ if request.parent
1646
+ header_params["parent"] = request.parent
1647
+ end
1648
+
1267
1649
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1268
1650
  metadata[:"x-goog-request-params"] ||= request_params_header
1269
1651
 
1270
1652
  options.apply_defaults timeout: @config.rpcs.create_entitlement.timeout,
1271
1653
  metadata: metadata,
1272
1654
  retry_policy: @config.rpcs.create_entitlement.retry_policy
1273
- options.apply_defaults metadata: @config.metadata,
1655
+
1656
+ options.apply_defaults timeout: @config.timeout,
1657
+ metadata: @config.metadata,
1274
1658
  retry_policy: @config.retry_policy
1275
1659
 
1276
1660
  @cloud_channel_service_stub.call_rpc :create_entitlement, request, options: options do |response, operation|
@@ -1328,6 +1712,9 @@ module Google
1328
1712
  # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
1329
1713
  # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>]
1330
1714
  # Required. Entitlement parameters to update. You can only change editable parameters.
1715
+ #
1716
+ # To view the available Parameters for a request, refer to the
1717
+ # {::Google::Cloud::Channel::V1::Offer#parameter_definitions Offer.parameter_definitions} from the desired offer.
1331
1718
  # @param request_id [::String]
1332
1719
  # Optional. You can specify an optional unique request ID, and if you need to retry
1333
1720
  # your request, the server will know to ignore the request if it's complete.
@@ -1351,6 +1738,28 @@ module Google
1351
1738
  #
1352
1739
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1353
1740
  #
1741
+ # @example Basic example
1742
+ # require "google/cloud/channel/v1"
1743
+ #
1744
+ # # Create a client object. The client can be reused for multiple calls.
1745
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1746
+ #
1747
+ # # Create a request. To set request fields, pass in keyword arguments.
1748
+ # request = Google::Cloud::Channel::V1::ChangeParametersRequest.new
1749
+ #
1750
+ # # Call the change_parameters method.
1751
+ # result = client.change_parameters request
1752
+ #
1753
+ # # The returned object is of type Gapic::Operation. You can use this
1754
+ # # object to check the status of an operation, cancel it, or wait
1755
+ # # for results. Here is how to block until completion:
1756
+ # result.wait_until_done! timeout: 60
1757
+ # if result.response?
1758
+ # p result.response
1759
+ # else
1760
+ # puts "Error!"
1761
+ # end
1762
+ #
1354
1763
  def change_parameters request, options = nil
1355
1764
  raise ::ArgumentError, "request must be provided" if request.nil?
1356
1765
 
@@ -1368,16 +1777,20 @@ module Google
1368
1777
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1369
1778
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1370
1779
 
1371
- header_params = {
1372
- "name" => request.name
1373
- }
1780
+ header_params = {}
1781
+ if request.name
1782
+ header_params["name"] = request.name
1783
+ end
1784
+
1374
1785
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1375
1786
  metadata[:"x-goog-request-params"] ||= request_params_header
1376
1787
 
1377
1788
  options.apply_defaults timeout: @config.rpcs.change_parameters.timeout,
1378
1789
  metadata: metadata,
1379
1790
  retry_policy: @config.rpcs.change_parameters.retry_policy
1380
- options.apply_defaults metadata: @config.metadata,
1791
+
1792
+ options.apply_defaults timeout: @config.timeout,
1793
+ metadata: @config.metadata,
1381
1794
  retry_policy: @config.retry_policy
1382
1795
 
1383
1796
  @cloud_channel_service_stub.call_rpc :change_parameters, request, options: options do |response, operation|
@@ -1456,6 +1869,28 @@ module Google
1456
1869
  #
1457
1870
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1458
1871
  #
1872
+ # @example Basic example
1873
+ # require "google/cloud/channel/v1"
1874
+ #
1875
+ # # Create a client object. The client can be reused for multiple calls.
1876
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
1877
+ #
1878
+ # # Create a request. To set request fields, pass in keyword arguments.
1879
+ # request = Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest.new
1880
+ #
1881
+ # # Call the change_renewal_settings method.
1882
+ # result = client.change_renewal_settings request
1883
+ #
1884
+ # # The returned object is of type Gapic::Operation. You can use this
1885
+ # # object to check the status of an operation, cancel it, or wait
1886
+ # # for results. Here is how to block until completion:
1887
+ # result.wait_until_done! timeout: 60
1888
+ # if result.response?
1889
+ # p result.response
1890
+ # else
1891
+ # puts "Error!"
1892
+ # end
1893
+ #
1459
1894
  def change_renewal_settings request, options = nil
1460
1895
  raise ::ArgumentError, "request must be provided" if request.nil?
1461
1896
 
@@ -1473,16 +1908,20 @@ module Google
1473
1908
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1474
1909
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1475
1910
 
1476
- header_params = {
1477
- "name" => request.name
1478
- }
1911
+ header_params = {}
1912
+ if request.name
1913
+ header_params["name"] = request.name
1914
+ end
1915
+
1479
1916
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1480
1917
  metadata[:"x-goog-request-params"] ||= request_params_header
1481
1918
 
1482
1919
  options.apply_defaults timeout: @config.rpcs.change_renewal_settings.timeout,
1483
1920
  metadata: metadata,
1484
1921
  retry_policy: @config.rpcs.change_renewal_settings.retry_policy
1485
- options.apply_defaults metadata: @config.metadata,
1922
+
1923
+ options.apply_defaults timeout: @config.timeout,
1924
+ metadata: @config.metadata,
1486
1925
  retry_policy: @config.retry_policy
1487
1926
 
1488
1927
  @cloud_channel_service_stub.call_rpc :change_renewal_settings, request, options: options do |response, operation|
@@ -1540,7 +1979,8 @@ module Google
1540
1979
  # Required. New Offer.
1541
1980
  # Format: accounts/\\{account_id}/offers/\\{offer_id}.
1542
1981
  # @param parameters [::Array<::Google::Cloud::Channel::V1::Parameter, ::Hash>]
1543
- # Optional. Parameters needed to purchase the Offer.
1982
+ # Optional. Parameters needed to purchase the Offer. To view the available Parameters
1983
+ # refer to the {::Google::Cloud::Channel::V1::Offer#parameter_definitions Offer.parameter_definitions} from the desired offer.
1544
1984
  # @param purchase_order_id [::String]
1545
1985
  # Optional. Purchase order id provided by the reseller.
1546
1986
  # @param request_id [::String]
@@ -1564,6 +2004,28 @@ module Google
1564
2004
  #
1565
2005
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1566
2006
  #
2007
+ # @example Basic example
2008
+ # require "google/cloud/channel/v1"
2009
+ #
2010
+ # # Create a client object. The client can be reused for multiple calls.
2011
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2012
+ #
2013
+ # # Create a request. To set request fields, pass in keyword arguments.
2014
+ # request = Google::Cloud::Channel::V1::ChangeOfferRequest.new
2015
+ #
2016
+ # # Call the change_offer method.
2017
+ # result = client.change_offer request
2018
+ #
2019
+ # # The returned object is of type Gapic::Operation. You can use this
2020
+ # # object to check the status of an operation, cancel it, or wait
2021
+ # # for results. Here is how to block until completion:
2022
+ # result.wait_until_done! timeout: 60
2023
+ # if result.response?
2024
+ # p result.response
2025
+ # else
2026
+ # puts "Error!"
2027
+ # end
2028
+ #
1567
2029
  def change_offer request, options = nil
1568
2030
  raise ::ArgumentError, "request must be provided" if request.nil?
1569
2031
 
@@ -1581,16 +2043,20 @@ module Google
1581
2043
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1582
2044
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1583
2045
 
1584
- header_params = {
1585
- "name" => request.name
1586
- }
2046
+ header_params = {}
2047
+ if request.name
2048
+ header_params["name"] = request.name
2049
+ end
2050
+
1587
2051
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1588
2052
  metadata[:"x-goog-request-params"] ||= request_params_header
1589
2053
 
1590
2054
  options.apply_defaults timeout: @config.rpcs.change_offer.timeout,
1591
2055
  metadata: metadata,
1592
2056
  retry_policy: @config.rpcs.change_offer.retry_policy
1593
- options.apply_defaults metadata: @config.metadata,
2057
+
2058
+ options.apply_defaults timeout: @config.timeout,
2059
+ metadata: @config.metadata,
1594
2060
  retry_policy: @config.retry_policy
1595
2061
 
1596
2062
  @cloud_channel_service_stub.call_rpc :change_offer, request, options: options do |response, operation|
@@ -1668,6 +2134,28 @@ module Google
1668
2134
  #
1669
2135
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1670
2136
  #
2137
+ # @example Basic example
2138
+ # require "google/cloud/channel/v1"
2139
+ #
2140
+ # # Create a client object. The client can be reused for multiple calls.
2141
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2142
+ #
2143
+ # # Create a request. To set request fields, pass in keyword arguments.
2144
+ # request = Google::Cloud::Channel::V1::StartPaidServiceRequest.new
2145
+ #
2146
+ # # Call the start_paid_service method.
2147
+ # result = client.start_paid_service request
2148
+ #
2149
+ # # The returned object is of type Gapic::Operation. You can use this
2150
+ # # object to check the status of an operation, cancel it, or wait
2151
+ # # for results. Here is how to block until completion:
2152
+ # result.wait_until_done! timeout: 60
2153
+ # if result.response?
2154
+ # p result.response
2155
+ # else
2156
+ # puts "Error!"
2157
+ # end
2158
+ #
1671
2159
  def start_paid_service request, options = nil
1672
2160
  raise ::ArgumentError, "request must be provided" if request.nil?
1673
2161
 
@@ -1685,16 +2173,20 @@ module Google
1685
2173
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1686
2174
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1687
2175
 
1688
- header_params = {
1689
- "name" => request.name
1690
- }
2176
+ header_params = {}
2177
+ if request.name
2178
+ header_params["name"] = request.name
2179
+ end
2180
+
1691
2181
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1692
2182
  metadata[:"x-goog-request-params"] ||= request_params_header
1693
2183
 
1694
2184
  options.apply_defaults timeout: @config.rpcs.start_paid_service.timeout,
1695
2185
  metadata: metadata,
1696
2186
  retry_policy: @config.rpcs.start_paid_service.retry_policy
1697
- options.apply_defaults metadata: @config.metadata,
2187
+
2188
+ options.apply_defaults timeout: @config.timeout,
2189
+ metadata: @config.metadata,
1698
2190
  retry_policy: @config.retry_policy
1699
2191
 
1700
2192
  @cloud_channel_service_stub.call_rpc :start_paid_service, request, options: options do |response, operation|
@@ -1769,6 +2261,28 @@ module Google
1769
2261
  #
1770
2262
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1771
2263
  #
2264
+ # @example Basic example
2265
+ # require "google/cloud/channel/v1"
2266
+ #
2267
+ # # Create a client object. The client can be reused for multiple calls.
2268
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2269
+ #
2270
+ # # Create a request. To set request fields, pass in keyword arguments.
2271
+ # request = Google::Cloud::Channel::V1::SuspendEntitlementRequest.new
2272
+ #
2273
+ # # Call the suspend_entitlement method.
2274
+ # result = client.suspend_entitlement request
2275
+ #
2276
+ # # The returned object is of type Gapic::Operation. You can use this
2277
+ # # object to check the status of an operation, cancel it, or wait
2278
+ # # for results. Here is how to block until completion:
2279
+ # result.wait_until_done! timeout: 60
2280
+ # if result.response?
2281
+ # p result.response
2282
+ # else
2283
+ # puts "Error!"
2284
+ # end
2285
+ #
1772
2286
  def suspend_entitlement request, options = nil
1773
2287
  raise ::ArgumentError, "request must be provided" if request.nil?
1774
2288
 
@@ -1786,16 +2300,20 @@ module Google
1786
2300
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1787
2301
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1788
2302
 
1789
- header_params = {
1790
- "name" => request.name
1791
- }
2303
+ header_params = {}
2304
+ if request.name
2305
+ header_params["name"] = request.name
2306
+ end
2307
+
1792
2308
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1793
2309
  metadata[:"x-goog-request-params"] ||= request_params_header
1794
2310
 
1795
2311
  options.apply_defaults timeout: @config.rpcs.suspend_entitlement.timeout,
1796
2312
  metadata: metadata,
1797
2313
  retry_policy: @config.rpcs.suspend_entitlement.retry_policy
1798
- options.apply_defaults metadata: @config.metadata,
2314
+
2315
+ options.apply_defaults timeout: @config.timeout,
2316
+ metadata: @config.metadata,
1799
2317
  retry_policy: @config.retry_policy
1800
2318
 
1801
2319
  @cloud_channel_service_stub.call_rpc :suspend_entitlement, request, options: options do |response, operation|
@@ -1875,6 +2393,28 @@ module Google
1875
2393
  #
1876
2394
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1877
2395
  #
2396
+ # @example Basic example
2397
+ # require "google/cloud/channel/v1"
2398
+ #
2399
+ # # Create a client object. The client can be reused for multiple calls.
2400
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2401
+ #
2402
+ # # Create a request. To set request fields, pass in keyword arguments.
2403
+ # request = Google::Cloud::Channel::V1::CancelEntitlementRequest.new
2404
+ #
2405
+ # # Call the cancel_entitlement method.
2406
+ # result = client.cancel_entitlement request
2407
+ #
2408
+ # # The returned object is of type Gapic::Operation. You can use this
2409
+ # # object to check the status of an operation, cancel it, or wait
2410
+ # # for results. Here is how to block until completion:
2411
+ # result.wait_until_done! timeout: 60
2412
+ # if result.response?
2413
+ # p result.response
2414
+ # else
2415
+ # puts "Error!"
2416
+ # end
2417
+ #
1878
2418
  def cancel_entitlement request, options = nil
1879
2419
  raise ::ArgumentError, "request must be provided" if request.nil?
1880
2420
 
@@ -1892,16 +2432,20 @@ module Google
1892
2432
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
1893
2433
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1894
2434
 
1895
- header_params = {
1896
- "name" => request.name
1897
- }
2435
+ header_params = {}
2436
+ if request.name
2437
+ header_params["name"] = request.name
2438
+ end
2439
+
1898
2440
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1899
2441
  metadata[:"x-goog-request-params"] ||= request_params_header
1900
2442
 
1901
2443
  options.apply_defaults timeout: @config.rpcs.cancel_entitlement.timeout,
1902
2444
  metadata: metadata,
1903
2445
  retry_policy: @config.rpcs.cancel_entitlement.retry_policy
1904
- options.apply_defaults metadata: @config.metadata,
2446
+
2447
+ options.apply_defaults timeout: @config.timeout,
2448
+ metadata: @config.metadata,
1905
2449
  retry_policy: @config.retry_policy
1906
2450
 
1907
2451
  @cloud_channel_service_stub.call_rpc :cancel_entitlement, request, options: options do |response, operation|
@@ -1982,6 +2526,28 @@ module Google
1982
2526
  #
1983
2527
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1984
2528
  #
2529
+ # @example Basic example
2530
+ # require "google/cloud/channel/v1"
2531
+ #
2532
+ # # Create a client object. The client can be reused for multiple calls.
2533
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2534
+ #
2535
+ # # Create a request. To set request fields, pass in keyword arguments.
2536
+ # request = Google::Cloud::Channel::V1::ActivateEntitlementRequest.new
2537
+ #
2538
+ # # Call the activate_entitlement method.
2539
+ # result = client.activate_entitlement request
2540
+ #
2541
+ # # The returned object is of type Gapic::Operation. You can use this
2542
+ # # object to check the status of an operation, cancel it, or wait
2543
+ # # for results. Here is how to block until completion:
2544
+ # result.wait_until_done! timeout: 60
2545
+ # if result.response?
2546
+ # p result.response
2547
+ # else
2548
+ # puts "Error!"
2549
+ # end
2550
+ #
1985
2551
  def activate_entitlement request, options = nil
1986
2552
  raise ::ArgumentError, "request must be provided" if request.nil?
1987
2553
 
@@ -1999,16 +2565,20 @@ module Google
1999
2565
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2000
2566
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2001
2567
 
2002
- header_params = {
2003
- "name" => request.name
2004
- }
2568
+ header_params = {}
2569
+ if request.name
2570
+ header_params["name"] = request.name
2571
+ end
2572
+
2005
2573
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2006
2574
  metadata[:"x-goog-request-params"] ||= request_params_header
2007
2575
 
2008
2576
  options.apply_defaults timeout: @config.rpcs.activate_entitlement.timeout,
2009
2577
  metadata: metadata,
2010
2578
  retry_policy: @config.rpcs.activate_entitlement.retry_policy
2011
- options.apply_defaults metadata: @config.metadata,
2579
+
2580
+ options.apply_defaults timeout: @config.timeout,
2581
+ metadata: @config.metadata,
2012
2582
  retry_policy: @config.retry_policy
2013
2583
 
2014
2584
  @cloud_channel_service_stub.call_rpc :activate_entitlement, request, options: options do |response, operation|
@@ -2098,6 +2668,28 @@ module Google
2098
2668
  #
2099
2669
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2100
2670
  #
2671
+ # @example Basic example
2672
+ # require "google/cloud/channel/v1"
2673
+ #
2674
+ # # Create a client object. The client can be reused for multiple calls.
2675
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2676
+ #
2677
+ # # Create a request. To set request fields, pass in keyword arguments.
2678
+ # request = Google::Cloud::Channel::V1::TransferEntitlementsRequest.new
2679
+ #
2680
+ # # Call the transfer_entitlements method.
2681
+ # result = client.transfer_entitlements request
2682
+ #
2683
+ # # The returned object is of type Gapic::Operation. You can use this
2684
+ # # object to check the status of an operation, cancel it, or wait
2685
+ # # for results. Here is how to block until completion:
2686
+ # result.wait_until_done! timeout: 60
2687
+ # if result.response?
2688
+ # p result.response
2689
+ # else
2690
+ # puts "Error!"
2691
+ # end
2692
+ #
2101
2693
  def transfer_entitlements request, options = nil
2102
2694
  raise ::ArgumentError, "request must be provided" if request.nil?
2103
2695
 
@@ -2115,16 +2707,20 @@ module Google
2115
2707
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2116
2708
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2117
2709
 
2118
- header_params = {
2119
- "parent" => request.parent
2120
- }
2710
+ header_params = {}
2711
+ if request.parent
2712
+ header_params["parent"] = request.parent
2713
+ end
2714
+
2121
2715
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2122
2716
  metadata[:"x-goog-request-params"] ||= request_params_header
2123
2717
 
2124
2718
  options.apply_defaults timeout: @config.rpcs.transfer_entitlements.timeout,
2125
2719
  metadata: metadata,
2126
2720
  retry_policy: @config.rpcs.transfer_entitlements.retry_policy
2127
- options.apply_defaults metadata: @config.metadata,
2721
+
2722
+ options.apply_defaults timeout: @config.timeout,
2723
+ metadata: @config.metadata,
2128
2724
  retry_policy: @config.retry_policy
2129
2725
 
2130
2726
  @cloud_channel_service_stub.call_rpc :transfer_entitlements, request, options: options do |response, operation|
@@ -2209,6 +2805,28 @@ module Google
2209
2805
  #
2210
2806
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2211
2807
  #
2808
+ # @example Basic example
2809
+ # require "google/cloud/channel/v1"
2810
+ #
2811
+ # # Create a client object. The client can be reused for multiple calls.
2812
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2813
+ #
2814
+ # # Create a request. To set request fields, pass in keyword arguments.
2815
+ # request = Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest.new
2816
+ #
2817
+ # # Call the transfer_entitlements_to_google method.
2818
+ # result = client.transfer_entitlements_to_google request
2819
+ #
2820
+ # # The returned object is of type Gapic::Operation. You can use this
2821
+ # # object to check the status of an operation, cancel it, or wait
2822
+ # # for results. Here is how to block until completion:
2823
+ # result.wait_until_done! timeout: 60
2824
+ # if result.response?
2825
+ # p result.response
2826
+ # else
2827
+ # puts "Error!"
2828
+ # end
2829
+ #
2212
2830
  def transfer_entitlements_to_google request, options = nil
2213
2831
  raise ::ArgumentError, "request must be provided" if request.nil?
2214
2832
 
@@ -2226,16 +2844,20 @@ module Google
2226
2844
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2227
2845
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2228
2846
 
2229
- header_params = {
2230
- "parent" => request.parent
2231
- }
2847
+ header_params = {}
2848
+ if request.parent
2849
+ header_params["parent"] = request.parent
2850
+ end
2851
+
2232
2852
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2233
2853
  metadata[:"x-goog-request-params"] ||= request_params_header
2234
2854
 
2235
2855
  options.apply_defaults timeout: @config.rpcs.transfer_entitlements_to_google.timeout,
2236
2856
  metadata: metadata,
2237
2857
  retry_policy: @config.rpcs.transfer_entitlements_to_google.retry_policy
2238
- options.apply_defaults metadata: @config.metadata,
2858
+
2859
+ options.apply_defaults timeout: @config.timeout,
2860
+ metadata: @config.metadata,
2239
2861
  retry_policy: @config.retry_policy
2240
2862
 
2241
2863
  @cloud_channel_service_stub.call_rpc :transfer_entitlements_to_google, request, options: options do |response, operation|
@@ -2299,6 +2921,27 @@ module Google
2299
2921
  #
2300
2922
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2301
2923
  #
2924
+ # @example Basic example
2925
+ # require "google/cloud/channel/v1"
2926
+ #
2927
+ # # Create a client object. The client can be reused for multiple calls.
2928
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
2929
+ #
2930
+ # # Create a request. To set request fields, pass in keyword arguments.
2931
+ # request = Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest.new
2932
+ #
2933
+ # # Call the list_channel_partner_links method.
2934
+ # result = client.list_channel_partner_links request
2935
+ #
2936
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2937
+ # # iterate over all elements by calling #each, and the enumerable
2938
+ # # will lazily make API calls to fetch subsequent pages. Other
2939
+ # # methods are also available for managing paging directly.
2940
+ # result.each do |response|
2941
+ # # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerLink.
2942
+ # p response
2943
+ # end
2944
+ #
2302
2945
  def list_channel_partner_links request, options = nil
2303
2946
  raise ::ArgumentError, "request must be provided" if request.nil?
2304
2947
 
@@ -2316,16 +2959,20 @@ module Google
2316
2959
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2317
2960
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2318
2961
 
2319
- header_params = {
2320
- "parent" => request.parent
2321
- }
2962
+ header_params = {}
2963
+ if request.parent
2964
+ header_params["parent"] = request.parent
2965
+ end
2966
+
2322
2967
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2323
2968
  metadata[:"x-goog-request-params"] ||= request_params_header
2324
2969
 
2325
2970
  options.apply_defaults timeout: @config.rpcs.list_channel_partner_links.timeout,
2326
2971
  metadata: metadata,
2327
2972
  retry_policy: @config.rpcs.list_channel_partner_links.retry_policy
2328
- options.apply_defaults metadata: @config.metadata,
2973
+
2974
+ options.apply_defaults timeout: @config.timeout,
2975
+ metadata: @config.metadata,
2329
2976
  retry_policy: @config.retry_policy
2330
2977
 
2331
2978
  @cloud_channel_service_stub.call_rpc :list_channel_partner_links, request, options: options do |response, operation|
@@ -2382,6 +3029,21 @@ module Google
2382
3029
  #
2383
3030
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2384
3031
  #
3032
+ # @example Basic example
3033
+ # require "google/cloud/channel/v1"
3034
+ #
3035
+ # # Create a client object. The client can be reused for multiple calls.
3036
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3037
+ #
3038
+ # # Create a request. To set request fields, pass in keyword arguments.
3039
+ # request = Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest.new
3040
+ #
3041
+ # # Call the get_channel_partner_link method.
3042
+ # result = client.get_channel_partner_link request
3043
+ #
3044
+ # # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
3045
+ # p result
3046
+ #
2385
3047
  def get_channel_partner_link request, options = nil
2386
3048
  raise ::ArgumentError, "request must be provided" if request.nil?
2387
3049
 
@@ -2399,16 +3061,20 @@ module Google
2399
3061
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2400
3062
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2401
3063
 
2402
- header_params = {
2403
- "name" => request.name
2404
- }
3064
+ header_params = {}
3065
+ if request.name
3066
+ header_params["name"] = request.name
3067
+ end
3068
+
2405
3069
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2406
3070
  metadata[:"x-goog-request-params"] ||= request_params_header
2407
3071
 
2408
3072
  options.apply_defaults timeout: @config.rpcs.get_channel_partner_link.timeout,
2409
3073
  metadata: metadata,
2410
3074
  retry_policy: @config.rpcs.get_channel_partner_link.retry_policy
2411
- options.apply_defaults metadata: @config.metadata,
3075
+
3076
+ options.apply_defaults timeout: @config.timeout,
3077
+ metadata: @config.metadata,
2412
3078
  retry_policy: @config.retry_policy
2413
3079
 
2414
3080
  @cloud_channel_service_stub.call_rpc :get_channel_partner_link, request, options: options do |response, operation|
@@ -2475,6 +3141,21 @@ module Google
2475
3141
  #
2476
3142
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2477
3143
  #
3144
+ # @example Basic example
3145
+ # require "google/cloud/channel/v1"
3146
+ #
3147
+ # # Create a client object. The client can be reused for multiple calls.
3148
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3149
+ #
3150
+ # # Create a request. To set request fields, pass in keyword arguments.
3151
+ # request = Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest.new
3152
+ #
3153
+ # # Call the create_channel_partner_link method.
3154
+ # result = client.create_channel_partner_link request
3155
+ #
3156
+ # # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
3157
+ # p result
3158
+ #
2478
3159
  def create_channel_partner_link request, options = nil
2479
3160
  raise ::ArgumentError, "request must be provided" if request.nil?
2480
3161
 
@@ -2492,16 +3173,20 @@ module Google
2492
3173
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2493
3174
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2494
3175
 
2495
- header_params = {
2496
- "parent" => request.parent
2497
- }
3176
+ header_params = {}
3177
+ if request.parent
3178
+ header_params["parent"] = request.parent
3179
+ end
3180
+
2498
3181
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2499
3182
  metadata[:"x-goog-request-params"] ||= request_params_header
2500
3183
 
2501
3184
  options.apply_defaults timeout: @config.rpcs.create_channel_partner_link.timeout,
2502
3185
  metadata: metadata,
2503
3186
  retry_policy: @config.rpcs.create_channel_partner_link.retry_policy
2504
- options.apply_defaults metadata: @config.metadata,
3187
+
3188
+ options.apply_defaults timeout: @config.timeout,
3189
+ metadata: @config.metadata,
2505
3190
  retry_policy: @config.retry_policy
2506
3191
 
2507
3192
  @cloud_channel_service_stub.call_rpc :create_channel_partner_link, request, options: options do |response, operation|
@@ -2570,6 +3255,21 @@ module Google
2570
3255
  #
2571
3256
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2572
3257
  #
3258
+ # @example Basic example
3259
+ # require "google/cloud/channel/v1"
3260
+ #
3261
+ # # Create a client object. The client can be reused for multiple calls.
3262
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3263
+ #
3264
+ # # Create a request. To set request fields, pass in keyword arguments.
3265
+ # request = Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest.new
3266
+ #
3267
+ # # Call the update_channel_partner_link method.
3268
+ # result = client.update_channel_partner_link request
3269
+ #
3270
+ # # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink.
3271
+ # p result
3272
+ #
2573
3273
  def update_channel_partner_link request, options = nil
2574
3274
  raise ::ArgumentError, "request must be provided" if request.nil?
2575
3275
 
@@ -2587,16 +3287,20 @@ module Google
2587
3287
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2588
3288
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2589
3289
 
2590
- header_params = {
2591
- "name" => request.name
2592
- }
3290
+ header_params = {}
3291
+ if request.name
3292
+ header_params["name"] = request.name
3293
+ end
3294
+
2593
3295
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2594
3296
  metadata[:"x-goog-request-params"] ||= request_params_header
2595
3297
 
2596
3298
  options.apply_defaults timeout: @config.rpcs.update_channel_partner_link.timeout,
2597
3299
  metadata: metadata,
2598
3300
  retry_policy: @config.rpcs.update_channel_partner_link.retry_policy
2599
- options.apply_defaults metadata: @config.metadata,
3301
+
3302
+ options.apply_defaults timeout: @config.timeout,
3303
+ metadata: @config.metadata,
2600
3304
  retry_policy: @config.retry_policy
2601
3305
 
2602
3306
  @cloud_channel_service_stub.call_rpc :update_channel_partner_link, request, options: options do |response, operation|
@@ -2647,6 +3351,21 @@ module Google
2647
3351
  #
2648
3352
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2649
3353
  #
3354
+ # @example Basic example
3355
+ # require "google/cloud/channel/v1"
3356
+ #
3357
+ # # Create a client object. The client can be reused for multiple calls.
3358
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3359
+ #
3360
+ # # Create a request. To set request fields, pass in keyword arguments.
3361
+ # request = Google::Cloud::Channel::V1::LookupOfferRequest.new
3362
+ #
3363
+ # # Call the lookup_offer method.
3364
+ # result = client.lookup_offer request
3365
+ #
3366
+ # # The returned object is of type Google::Cloud::Channel::V1::Offer.
3367
+ # p result
3368
+ #
2650
3369
  def lookup_offer request, options = nil
2651
3370
  raise ::ArgumentError, "request must be provided" if request.nil?
2652
3371
 
@@ -2664,16 +3383,20 @@ module Google
2664
3383
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2665
3384
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2666
3385
 
2667
- header_params = {
2668
- "entitlement" => request.entitlement
2669
- }
3386
+ header_params = {}
3387
+ if request.entitlement
3388
+ header_params["entitlement"] = request.entitlement
3389
+ end
3390
+
2670
3391
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2671
3392
  metadata[:"x-goog-request-params"] ||= request_params_header
2672
3393
 
2673
3394
  options.apply_defaults timeout: @config.rpcs.lookup_offer.timeout,
2674
3395
  metadata: metadata,
2675
3396
  retry_policy: @config.rpcs.lookup_offer.retry_policy
2676
- options.apply_defaults metadata: @config.metadata,
3397
+
3398
+ options.apply_defaults timeout: @config.timeout,
3399
+ metadata: @config.metadata,
2677
3400
  retry_policy: @config.retry_policy
2678
3401
 
2679
3402
  @cloud_channel_service_stub.call_rpc :lookup_offer, request, options: options do |response, operation|
@@ -2728,6 +3451,27 @@ module Google
2728
3451
  #
2729
3452
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2730
3453
  #
3454
+ # @example Basic example
3455
+ # require "google/cloud/channel/v1"
3456
+ #
3457
+ # # Create a client object. The client can be reused for multiple calls.
3458
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3459
+ #
3460
+ # # Create a request. To set request fields, pass in keyword arguments.
3461
+ # request = Google::Cloud::Channel::V1::ListProductsRequest.new
3462
+ #
3463
+ # # Call the list_products method.
3464
+ # result = client.list_products request
3465
+ #
3466
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3467
+ # # iterate over all elements by calling #each, and the enumerable
3468
+ # # will lazily make API calls to fetch subsequent pages. Other
3469
+ # # methods are also available for managing paging directly.
3470
+ # result.each do |response|
3471
+ # # Each element is of type ::Google::Cloud::Channel::V1::Product.
3472
+ # p response
3473
+ # end
3474
+ #
2731
3475
  def list_products request, options = nil
2732
3476
  raise ::ArgumentError, "request must be provided" if request.nil?
2733
3477
 
@@ -2748,7 +3492,9 @@ module Google
2748
3492
  options.apply_defaults timeout: @config.rpcs.list_products.timeout,
2749
3493
  metadata: metadata,
2750
3494
  retry_policy: @config.rpcs.list_products.retry_policy
2751
- options.apply_defaults metadata: @config.metadata,
3495
+
3496
+ options.apply_defaults timeout: @config.timeout,
3497
+ metadata: @config.metadata,
2752
3498
  retry_policy: @config.retry_policy
2753
3499
 
2754
3500
  @cloud_channel_service_stub.call_rpc :list_products, request, options: options do |response, operation|
@@ -2809,6 +3555,27 @@ module Google
2809
3555
  #
2810
3556
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2811
3557
  #
3558
+ # @example Basic example
3559
+ # require "google/cloud/channel/v1"
3560
+ #
3561
+ # # Create a client object. The client can be reused for multiple calls.
3562
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3563
+ #
3564
+ # # Create a request. To set request fields, pass in keyword arguments.
3565
+ # request = Google::Cloud::Channel::V1::ListSkusRequest.new
3566
+ #
3567
+ # # Call the list_skus method.
3568
+ # result = client.list_skus request
3569
+ #
3570
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3571
+ # # iterate over all elements by calling #each, and the enumerable
3572
+ # # will lazily make API calls to fetch subsequent pages. Other
3573
+ # # methods are also available for managing paging directly.
3574
+ # result.each do |response|
3575
+ # # Each element is of type ::Google::Cloud::Channel::V1::Sku.
3576
+ # p response
3577
+ # end
3578
+ #
2812
3579
  def list_skus request, options = nil
2813
3580
  raise ::ArgumentError, "request must be provided" if request.nil?
2814
3581
 
@@ -2826,16 +3593,20 @@ module Google
2826
3593
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2827
3594
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2828
3595
 
2829
- header_params = {
2830
- "parent" => request.parent
2831
- }
3596
+ header_params = {}
3597
+ if request.parent
3598
+ header_params["parent"] = request.parent
3599
+ end
3600
+
2832
3601
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2833
3602
  metadata[:"x-goog-request-params"] ||= request_params_header
2834
3603
 
2835
3604
  options.apply_defaults timeout: @config.rpcs.list_skus.timeout,
2836
3605
  metadata: metadata,
2837
3606
  retry_policy: @config.rpcs.list_skus.retry_policy
2838
- options.apply_defaults metadata: @config.metadata,
3607
+
3608
+ options.apply_defaults timeout: @config.timeout,
3609
+ metadata: @config.metadata,
2839
3610
  retry_policy: @config.retry_policy
2840
3611
 
2841
3612
  @cloud_channel_service_stub.call_rpc :list_skus, request, options: options do |response, operation|
@@ -2897,6 +3668,27 @@ module Google
2897
3668
  #
2898
3669
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2899
3670
  #
3671
+ # @example Basic example
3672
+ # require "google/cloud/channel/v1"
3673
+ #
3674
+ # # Create a client object. The client can be reused for multiple calls.
3675
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3676
+ #
3677
+ # # Create a request. To set request fields, pass in keyword arguments.
3678
+ # request = Google::Cloud::Channel::V1::ListOffersRequest.new
3679
+ #
3680
+ # # Call the list_offers method.
3681
+ # result = client.list_offers request
3682
+ #
3683
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3684
+ # # iterate over all elements by calling #each, and the enumerable
3685
+ # # will lazily make API calls to fetch subsequent pages. Other
3686
+ # # methods are also available for managing paging directly.
3687
+ # result.each do |response|
3688
+ # # Each element is of type ::Google::Cloud::Channel::V1::Offer.
3689
+ # p response
3690
+ # end
3691
+ #
2900
3692
  def list_offers request, options = nil
2901
3693
  raise ::ArgumentError, "request must be provided" if request.nil?
2902
3694
 
@@ -2914,16 +3706,20 @@ module Google
2914
3706
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
2915
3707
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2916
3708
 
2917
- header_params = {
2918
- "parent" => request.parent
2919
- }
3709
+ header_params = {}
3710
+ if request.parent
3711
+ header_params["parent"] = request.parent
3712
+ end
3713
+
2920
3714
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2921
3715
  metadata[:"x-goog-request-params"] ||= request_params_header
2922
3716
 
2923
3717
  options.apply_defaults timeout: @config.rpcs.list_offers.timeout,
2924
3718
  metadata: metadata,
2925
3719
  retry_policy: @config.rpcs.list_offers.retry_policy
2926
- options.apply_defaults metadata: @config.metadata,
3720
+
3721
+ options.apply_defaults timeout: @config.timeout,
3722
+ metadata: @config.metadata,
2927
3723
  retry_policy: @config.retry_policy
2928
3724
 
2929
3725
  @cloud_channel_service_stub.call_rpc :list_offers, request, options: options do |response, operation|
@@ -2987,6 +3783,27 @@ module Google
2987
3783
  #
2988
3784
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2989
3785
  #
3786
+ # @example Basic example
3787
+ # require "google/cloud/channel/v1"
3788
+ #
3789
+ # # Create a client object. The client can be reused for multiple calls.
3790
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3791
+ #
3792
+ # # Create a request. To set request fields, pass in keyword arguments.
3793
+ # request = Google::Cloud::Channel::V1::ListPurchasableSkusRequest.new
3794
+ #
3795
+ # # Call the list_purchasable_skus method.
3796
+ # result = client.list_purchasable_skus request
3797
+ #
3798
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3799
+ # # iterate over all elements by calling #each, and the enumerable
3800
+ # # will lazily make API calls to fetch subsequent pages. Other
3801
+ # # methods are also available for managing paging directly.
3802
+ # result.each do |response|
3803
+ # # Each element is of type ::Google::Cloud::Channel::V1::PurchasableSku.
3804
+ # p response
3805
+ # end
3806
+ #
2990
3807
  def list_purchasable_skus request, options = nil
2991
3808
  raise ::ArgumentError, "request must be provided" if request.nil?
2992
3809
 
@@ -3004,16 +3821,20 @@ module Google
3004
3821
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
3005
3822
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3006
3823
 
3007
- header_params = {
3008
- "customer" => request.customer
3009
- }
3824
+ header_params = {}
3825
+ if request.customer
3826
+ header_params["customer"] = request.customer
3827
+ end
3828
+
3010
3829
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3011
3830
  metadata[:"x-goog-request-params"] ||= request_params_header
3012
3831
 
3013
3832
  options.apply_defaults timeout: @config.rpcs.list_purchasable_skus.timeout,
3014
3833
  metadata: metadata,
3015
3834
  retry_policy: @config.rpcs.list_purchasable_skus.retry_policy
3016
- options.apply_defaults metadata: @config.metadata,
3835
+
3836
+ options.apply_defaults timeout: @config.timeout,
3837
+ metadata: @config.metadata,
3017
3838
  retry_policy: @config.retry_policy
3018
3839
 
3019
3840
  @cloud_channel_service_stub.call_rpc :list_purchasable_skus, request, options: options do |response, operation|
@@ -3077,6 +3898,27 @@ module Google
3077
3898
  #
3078
3899
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3079
3900
  #
3901
+ # @example Basic example
3902
+ # require "google/cloud/channel/v1"
3903
+ #
3904
+ # # Create a client object. The client can be reused for multiple calls.
3905
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
3906
+ #
3907
+ # # Create a request. To set request fields, pass in keyword arguments.
3908
+ # request = Google::Cloud::Channel::V1::ListPurchasableOffersRequest.new
3909
+ #
3910
+ # # Call the list_purchasable_offers method.
3911
+ # result = client.list_purchasable_offers request
3912
+ #
3913
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3914
+ # # iterate over all elements by calling #each, and the enumerable
3915
+ # # will lazily make API calls to fetch subsequent pages. Other
3916
+ # # methods are also available for managing paging directly.
3917
+ # result.each do |response|
3918
+ # # Each element is of type ::Google::Cloud::Channel::V1::PurchasableOffer.
3919
+ # p response
3920
+ # end
3921
+ #
3080
3922
  def list_purchasable_offers request, options = nil
3081
3923
  raise ::ArgumentError, "request must be provided" if request.nil?
3082
3924
 
@@ -3094,16 +3936,20 @@ module Google
3094
3936
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
3095
3937
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3096
3938
 
3097
- header_params = {
3098
- "customer" => request.customer
3099
- }
3939
+ header_params = {}
3940
+ if request.customer
3941
+ header_params["customer"] = request.customer
3942
+ end
3943
+
3100
3944
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3101
3945
  metadata[:"x-goog-request-params"] ||= request_params_header
3102
3946
 
3103
3947
  options.apply_defaults timeout: @config.rpcs.list_purchasable_offers.timeout,
3104
3948
  metadata: metadata,
3105
3949
  retry_policy: @config.rpcs.list_purchasable_offers.retry_policy
3106
- options.apply_defaults metadata: @config.metadata,
3950
+
3951
+ options.apply_defaults timeout: @config.timeout,
3952
+ metadata: @config.metadata,
3107
3953
  retry_policy: @config.retry_policy
3108
3954
 
3109
3955
  @cloud_channel_service_stub.call_rpc :list_purchasable_offers, request, options: options do |response, operation|
@@ -3162,6 +4008,21 @@ module Google
3162
4008
  #
3163
4009
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3164
4010
  #
4011
+ # @example Basic example
4012
+ # require "google/cloud/channel/v1"
4013
+ #
4014
+ # # Create a client object. The client can be reused for multiple calls.
4015
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
4016
+ #
4017
+ # # Create a request. To set request fields, pass in keyword arguments.
4018
+ # request = Google::Cloud::Channel::V1::RegisterSubscriberRequest.new
4019
+ #
4020
+ # # Call the register_subscriber method.
4021
+ # result = client.register_subscriber request
4022
+ #
4023
+ # # The returned object is of type Google::Cloud::Channel::V1::RegisterSubscriberResponse.
4024
+ # p result
4025
+ #
3165
4026
  def register_subscriber request, options = nil
3166
4027
  raise ::ArgumentError, "request must be provided" if request.nil?
3167
4028
 
@@ -3179,16 +4040,20 @@ module Google
3179
4040
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
3180
4041
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3181
4042
 
3182
- header_params = {
3183
- "account" => request.account
3184
- }
4043
+ header_params = {}
4044
+ if request.account
4045
+ header_params["account"] = request.account
4046
+ end
4047
+
3185
4048
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3186
4049
  metadata[:"x-goog-request-params"] ||= request_params_header
3187
4050
 
3188
4051
  options.apply_defaults timeout: @config.rpcs.register_subscriber.timeout,
3189
4052
  metadata: metadata,
3190
4053
  retry_policy: @config.rpcs.register_subscriber.retry_policy
3191
- options.apply_defaults metadata: @config.metadata,
4054
+
4055
+ options.apply_defaults timeout: @config.timeout,
4056
+ metadata: @config.metadata,
3192
4057
  retry_policy: @config.retry_policy
3193
4058
 
3194
4059
  @cloud_channel_service_stub.call_rpc :register_subscriber, request, options: options do |response, operation|
@@ -3250,6 +4115,21 @@ module Google
3250
4115
  #
3251
4116
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3252
4117
  #
4118
+ # @example Basic example
4119
+ # require "google/cloud/channel/v1"
4120
+ #
4121
+ # # Create a client object. The client can be reused for multiple calls.
4122
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
4123
+ #
4124
+ # # Create a request. To set request fields, pass in keyword arguments.
4125
+ # request = Google::Cloud::Channel::V1::UnregisterSubscriberRequest.new
4126
+ #
4127
+ # # Call the unregister_subscriber method.
4128
+ # result = client.unregister_subscriber request
4129
+ #
4130
+ # # The returned object is of type Google::Cloud::Channel::V1::UnregisterSubscriberResponse.
4131
+ # p result
4132
+ #
3253
4133
  def unregister_subscriber request, options = nil
3254
4134
  raise ::ArgumentError, "request must be provided" if request.nil?
3255
4135
 
@@ -3267,16 +4147,20 @@ module Google
3267
4147
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
3268
4148
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3269
4149
 
3270
- header_params = {
3271
- "account" => request.account
3272
- }
4150
+ header_params = {}
4151
+ if request.account
4152
+ header_params["account"] = request.account
4153
+ end
4154
+
3273
4155
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3274
4156
  metadata[:"x-goog-request-params"] ||= request_params_header
3275
4157
 
3276
4158
  options.apply_defaults timeout: @config.rpcs.unregister_subscriber.timeout,
3277
4159
  metadata: metadata,
3278
4160
  retry_policy: @config.rpcs.unregister_subscriber.retry_policy
3279
- options.apply_defaults metadata: @config.metadata,
4161
+
4162
+ options.apply_defaults timeout: @config.timeout,
4163
+ metadata: @config.metadata,
3280
4164
  retry_policy: @config.retry_policy
3281
4165
 
3282
4166
  @cloud_channel_service_stub.call_rpc :unregister_subscriber, request, options: options do |response, operation|
@@ -3343,6 +4227,21 @@ module Google
3343
4227
  #
3344
4228
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3345
4229
  #
4230
+ # @example Basic example
4231
+ # require "google/cloud/channel/v1"
4232
+ #
4233
+ # # Create a client object. The client can be reused for multiple calls.
4234
+ # client = Google::Cloud::Channel::V1::CloudChannelService::Client.new
4235
+ #
4236
+ # # Create a request. To set request fields, pass in keyword arguments.
4237
+ # request = Google::Cloud::Channel::V1::ListSubscribersRequest.new
4238
+ #
4239
+ # # Call the list_subscribers method.
4240
+ # result = client.list_subscribers request
4241
+ #
4242
+ # # The returned object is of type Google::Cloud::Channel::V1::ListSubscribersResponse.
4243
+ # p result
4244
+ #
3346
4245
  def list_subscribers request, options = nil
3347
4246
  raise ::ArgumentError, "request must be provided" if request.nil?
3348
4247
 
@@ -3360,16 +4259,20 @@ module Google
3360
4259
  gapic_version: ::Google::Cloud::Channel::V1::VERSION
3361
4260
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3362
4261
 
3363
- header_params = {
3364
- "account" => request.account
3365
- }
4262
+ header_params = {}
4263
+ if request.account
4264
+ header_params["account"] = request.account
4265
+ end
4266
+
3366
4267
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3367
4268
  metadata[:"x-goog-request-params"] ||= request_params_header
3368
4269
 
3369
4270
  options.apply_defaults timeout: @config.rpcs.list_subscribers.timeout,
3370
4271
  metadata: metadata,
3371
4272
  retry_policy: @config.rpcs.list_subscribers.retry_policy
3372
- options.apply_defaults metadata: @config.metadata,
4273
+
4274
+ options.apply_defaults timeout: @config.timeout,
4275
+ metadata: @config.metadata,
3373
4276
  retry_policy: @config.retry_policy
3374
4277
 
3375
4278
  @cloud_channel_service_stub.call_rpc :list_subscribers, request, options: options do |response, operation|
@@ -3393,22 +4296,21 @@ module Google
3393
4296
  # Configuration can be applied globally to all clients, or to a single client
3394
4297
  # on construction.
3395
4298
  #
3396
- # # Examples
4299
+ # @example
3397
4300
  #
3398
- # To modify the global config, setting the timeout for list_customers
3399
- # to 20 seconds, and all remaining timeouts to 10 seconds:
4301
+ # # Modify the global config, setting the timeout for
4302
+ # # list_customers to 20 seconds,
4303
+ # # and all remaining timeouts to 10 seconds.
4304
+ # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
4305
+ # config.timeout = 10.0
4306
+ # config.rpcs.list_customers.timeout = 20.0
4307
+ # end
3400
4308
  #
3401
- # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
3402
- # config.timeout = 10.0
3403
- # config.rpcs.list_customers.timeout = 20.0
3404
- # end
3405
- #
3406
- # To apply the above configuration only to a new client:
3407
- #
3408
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
3409
- # config.timeout = 10.0
3410
- # config.rpcs.list_customers.timeout = 20.0
3411
- # end
4309
+ # # Apply the above configuration only to a new client.
4310
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
4311
+ # config.timeout = 10.0
4312
+ # config.rpcs.list_customers.timeout = 20.0
4313
+ # end
3412
4314
  #
3413
4315
  # @!attribute [rw] endpoint
3414
4316
  # The hostname or hostname:port of the service endpoint.
@@ -3547,6 +4449,11 @@ module Google
3547
4449
  #
3548
4450
  attr_reader :delete_customer
3549
4451
  ##
4452
+ # RPC-specific configuration for `import_customer`
4453
+ # @return [::Gapic::Config::Method]
4454
+ #
4455
+ attr_reader :import_customer
4456
+ ##
3550
4457
  # RPC-specific configuration for `provision_cloud_identity`
3551
4458
  # @return [::Gapic::Config::Method]
3552
4459
  #
@@ -3701,6 +4608,8 @@ module Google
3701
4608
  @update_customer = ::Gapic::Config::Method.new update_customer_config
3702
4609
  delete_customer_config = parent_rpcs.delete_customer if parent_rpcs.respond_to? :delete_customer
3703
4610
  @delete_customer = ::Gapic::Config::Method.new delete_customer_config
4611
+ import_customer_config = parent_rpcs.import_customer if parent_rpcs.respond_to? :import_customer
4612
+ @import_customer = ::Gapic::Config::Method.new import_customer_config
3704
4613
  provision_cloud_identity_config = parent_rpcs.provision_cloud_identity if parent_rpcs.respond_to? :provision_cloud_identity
3705
4614
  @provision_cloud_identity = ::Gapic::Config::Method.new provision_cloud_identity_config
3706
4615
  list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements