google-cloud-channel-v1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1920f9872e068419e07b8e12f7e89da67827e4fd599c6d9b3f61488b8e98f374
4
- data.tar.gz: e0606dd541251e3ef1eeb4241eff2a2f87dd8b9235e2e87625d27f97dfed065e
3
+ metadata.gz: 5566da74a754c65656f754a01c8f1b0bc897b7ecb9c9391a4079111367e1fd27
4
+ data.tar.gz: ca025b2e1ea002ad41309bf689edef56009942842532a838a046f7922888313e
5
5
  SHA512:
6
- metadata.gz: a30e188b05f7a61707306df4c53a79bfea5d815cadb71778f0d10104fba2a3e80b0bd447fe40b2e6af2999da505800ce0a4a617f0e38362eadfe5f5258e73416
7
- data.tar.gz: b82010ddebc0d89beef5b81fa60c25ff5202867833a1caaa13c5566aed7dd3258fa7f42ee5cb6ae5571f1f201ad3dcc82e015d974e83bafada48f4c27c16728f
6
+ metadata.gz: ecb279fbcec3ac0e83afe89a83a0f2dfc9af4774c99659af9597192df13fb1f3b661290c018ad8fd80a84ff6a2855ab363af2c50e4f170a354b91727187d924b
7
+ data.tar.gz: 463cf47b6dd9f1ee46d7f7b4c71afc14c742deb1a38fb7d983580111c13f1ab0ca5227893e051c6c936d2acbab173ff7cff3c84542ab72440bb5a08c0ebc872a
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-channel-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Channel::V1::CloudChannelService::Credentials}):
68
68
 
69
- 1. `CHANNEL_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `CHANNEL_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `CHANNEL_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `CHANNEL_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/channel/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/channel/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |confi
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/channel/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/channel/v1"
34
34
 
35
35
  client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Channel::V1::ListCustomersRequest.new # (request fields as keyword arguments...)
37
37
  response = client.list_customers request
38
38
  ```
39
39
 
@@ -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]
@@ -85,10 +84,7 @@ module Google
85
84
 
86
85
  default_config.timeout = 60.0
87
86
  default_config.retry_policy = {
88
- initial_delay: 1.0,
89
- max_delay: 10.0,
90
- multiplier: 1.3,
91
- retry_codes: [14]
87
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
92
88
  }
93
89
 
94
90
  default_config.rpcs.provision_cloud_identity.timeout = 60.0
@@ -142,19 +138,15 @@ module Google
142
138
  ##
143
139
  # Create a new CloudChannelService client object.
144
140
  #
145
- # ## Examples
146
- #
147
- # To create a new CloudChannelService client with the default
148
- # configuration:
149
- #
150
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
141
+ # @example
151
142
  #
152
- # To create a new CloudChannelService client with a custom
153
- # configuration:
143
+ # # Create a client using the default configuration
144
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new
154
145
  #
155
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
156
- # config.timeout = 10.0
157
- # 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
158
150
  #
159
151
  # @yield [config] Configure the CloudChannelService client.
160
152
  # @yieldparam config [Client::Configuration]
@@ -174,14 +166,13 @@ module Google
174
166
 
175
167
  # Create credentials
176
168
  credentials = @config.credentials
177
- # 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,
178
170
  # but only if the default endpoint does not have a region prefix.
179
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
180
- @config.endpoint == Client.configure.endpoint &&
171
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
181
172
  !@config.endpoint.split(".").first.include?("-")
182
173
  credentials ||= Credentials.default scope: @config.scope,
183
174
  enable_self_signed_jwt: enable_self_signed_jwt
184
- if credentials.is_a?(String) || credentials.is_a?(Hash)
175
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
185
176
  credentials = Credentials.new credentials, scope: @config.scope
186
177
  end
187
178
  @quota_project_id = @config.quota_project
@@ -284,7 +275,9 @@ module Google
284
275
  options.apply_defaults timeout: @config.rpcs.list_customers.timeout,
285
276
  metadata: metadata,
286
277
  retry_policy: @config.rpcs.list_customers.retry_policy
287
- options.apply_defaults metadata: @config.metadata,
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
288
281
  retry_policy: @config.retry_policy
289
282
 
290
283
  @cloud_channel_service_stub.call_rpc :list_customers, request, options: options do |response, operation|
@@ -297,7 +290,7 @@ module Google
297
290
  end
298
291
 
299
292
  ##
300
- # Returns a requested {::Google::Cloud::Channel::V1::Customer Customer} resource.
293
+ # Returns the requested {::Google::Cloud::Channel::V1::Customer Customer} resource.
301
294
  #
302
295
  # Possible error codes:
303
296
  #
@@ -363,7 +356,9 @@ module Google
363
356
  options.apply_defaults timeout: @config.rpcs.get_customer.timeout,
364
357
  metadata: metadata,
365
358
  retry_policy: @config.rpcs.get_customer.retry_policy
366
- options.apply_defaults metadata: @config.metadata,
359
+
360
+ options.apply_defaults timeout: @config.timeout,
361
+ metadata: @config.metadata,
367
362
  retry_policy: @config.retry_policy
368
363
 
369
364
  @cloud_channel_service_stub.call_rpc :get_customer, request, options: options do |response, operation|
@@ -447,7 +442,9 @@ module Google
447
442
  options.apply_defaults timeout: @config.rpcs.check_cloud_identity_accounts_exist.timeout,
448
443
  metadata: metadata,
449
444
  retry_policy: @config.rpcs.check_cloud_identity_accounts_exist.retry_policy
450
- options.apply_defaults metadata: @config.metadata,
445
+
446
+ options.apply_defaults timeout: @config.timeout,
447
+ metadata: @config.metadata,
451
448
  retry_policy: @config.retry_policy
452
449
 
453
450
  @cloud_channel_service_stub.call_rpc :check_cloud_identity_accounts_exist, request, options: options do |response, operation|
@@ -528,7 +525,9 @@ module Google
528
525
  options.apply_defaults timeout: @config.rpcs.create_customer.timeout,
529
526
  metadata: metadata,
530
527
  retry_policy: @config.rpcs.create_customer.retry_policy
531
- options.apply_defaults metadata: @config.metadata,
528
+
529
+ options.apply_defaults timeout: @config.timeout,
530
+ metadata: @config.metadata,
532
531
  retry_policy: @config.retry_policy
533
532
 
534
533
  @cloud_channel_service_stub.call_rpc :create_customer, request, options: options do |response, operation|
@@ -608,7 +607,9 @@ module Google
608
607
  options.apply_defaults timeout: @config.rpcs.update_customer.timeout,
609
608
  metadata: metadata,
610
609
  retry_policy: @config.rpcs.update_customer.retry_policy
611
- options.apply_defaults metadata: @config.metadata,
610
+
611
+ options.apply_defaults timeout: @config.timeout,
612
+ metadata: @config.metadata,
612
613
  retry_policy: @config.retry_policy
613
614
 
614
615
  @cloud_channel_service_stub.call_rpc :update_customer, request, options: options do |response, operation|
@@ -620,7 +621,7 @@ module Google
620
621
  end
621
622
 
622
623
  ##
623
- # Deletes the given {::Google::Cloud::Channel::V1::Customer Customer} permanently and irreversibly.
624
+ # Deletes the given {::Google::Cloud::Channel::V1::Customer Customer} permanently.
624
625
  #
625
626
  # Possible error codes:
626
627
  #
@@ -682,7 +683,9 @@ module Google
682
683
  options.apply_defaults timeout: @config.rpcs.delete_customer.timeout,
683
684
  metadata: metadata,
684
685
  retry_policy: @config.rpcs.delete_customer.retry_policy
685
- options.apply_defaults metadata: @config.metadata,
686
+
687
+ options.apply_defaults timeout: @config.timeout,
688
+ metadata: @config.metadata,
686
689
  retry_policy: @config.retry_policy
687
690
 
688
691
  @cloud_channel_service_stub.call_rpc :delete_customer, request, options: options do |response, operation|
@@ -693,6 +696,113 @@ module Google
693
696
  raise ::Google::Cloud::Error.from_error(e)
694
697
  end
695
698
 
699
+ ##
700
+ # Imports a {::Google::Cloud::Channel::V1::Customer Customer} from the Cloud Identity associated with the provided
701
+ # Cloud Identity ID or domain before a TransferEntitlements call. If a
702
+ # linked Customer already exists and overwrite_if_exists is true, it will
703
+ # update that Customer's data.
704
+ #
705
+ # Possible error codes:
706
+ #
707
+ # * PERMISSION_DENIED: The reseller account making the request is different
708
+ # from the reseller account in the API request.
709
+ # * NOT_FOUND: Cloud Identity doesn't exist or was deleted.
710
+ # * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is
711
+ # expired or invalid.
712
+ # * ALREADY_EXISTS: A customer already exists and has conflicting critical
713
+ # fields. Requires an overwrite.
714
+ #
715
+ # Return value:
716
+ # The {::Google::Cloud::Channel::V1::Customer Customer}.
717
+ #
718
+ # @overload import_customer(request, options = nil)
719
+ # Pass arguments to `import_customer` via a request object, either of type
720
+ # {::Google::Cloud::Channel::V1::ImportCustomerRequest} or an equivalent Hash.
721
+ #
722
+ # @param request [::Google::Cloud::Channel::V1::ImportCustomerRequest, ::Hash]
723
+ # A request object representing the call parameters. Required. To specify no
724
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
725
+ # @param options [::Gapic::CallOptions, ::Hash]
726
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
727
+ #
728
+ # @overload import_customer(domain: nil, cloud_identity_id: nil, parent: nil, auth_token: nil, overwrite_if_exists: nil, channel_partner_id: nil, customer: nil)
729
+ # Pass arguments to `import_customer` via keyword arguments. Note that at
730
+ # least one keyword argument is required. To specify no parameters, or to keep all
731
+ # the default parameter values, pass an empty Hash as a request object (see above).
732
+ #
733
+ # @param domain [::String]
734
+ # Required. Customer domain.
735
+ # @param cloud_identity_id [::String]
736
+ # Required. Customer's Cloud Identity ID
737
+ # @param parent [::String]
738
+ # Required. The resource name of the reseller's account.
739
+ # Parent takes the format: accounts/\\{account_id} or
740
+ # accounts/\\{account_id}/channelPartnerLinks/\\{channel_partner_id}
741
+ # @param auth_token [::String]
742
+ # Optional. The super admin of the resold customer generates this token to
743
+ # authorize a reseller to access their Cloud Identity and purchase
744
+ # entitlements on their behalf. You can omit this token after authorization.
745
+ # See https://support.google.com/a/answer/7643790 for more details.
746
+ # @param overwrite_if_exists [::Boolean]
747
+ # Required. Choose to overwrite an existing customer if found.
748
+ # This must be set to true if there is an existing customer with a
749
+ # conflicting region code or domain.
750
+ # @param channel_partner_id [::String]
751
+ # Optional. Cloud Identity ID of a channel partner who will be the direct reseller for
752
+ # the customer's order. This field is required for 2-tier transfer scenarios
753
+ # and can be provided via the request Parent binding as well.
754
+ # @param customer [::String]
755
+ # Optional. Specifies the customer that will receive imported Cloud Identity
756
+ # information.
757
+ # Format: accounts/\\{account_id}/customers/\\{customer_id}
758
+ #
759
+ # @yield [response, operation] Access the result along with the RPC operation
760
+ # @yieldparam response [::Google::Cloud::Channel::V1::Customer]
761
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
762
+ #
763
+ # @return [::Google::Cloud::Channel::V1::Customer]
764
+ #
765
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
766
+ #
767
+ def import_customer request, options = nil
768
+ raise ::ArgumentError, "request must be provided" if request.nil?
769
+
770
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::ImportCustomerRequest
771
+
772
+ # Converts hash and nil to an options object
773
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
774
+
775
+ # Customize the options with defaults
776
+ metadata = @config.rpcs.import_customer.metadata.to_h
777
+
778
+ # Set x-goog-api-client and x-goog-user-project headers
779
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
780
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
781
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
782
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
783
+
784
+ header_params = {
785
+ "parent" => request.parent
786
+ }
787
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
788
+ metadata[:"x-goog-request-params"] ||= request_params_header
789
+
790
+ options.apply_defaults timeout: @config.rpcs.import_customer.timeout,
791
+ metadata: metadata,
792
+ retry_policy: @config.rpcs.import_customer.retry_policy
793
+
794
+ options.apply_defaults timeout: @config.timeout,
795
+ metadata: @config.metadata,
796
+ retry_policy: @config.retry_policy
797
+
798
+ @cloud_channel_service_stub.call_rpc :import_customer, request, options: options do |response, operation|
799
+ yield response, operation if block_given?
800
+ return response
801
+ end
802
+ rescue ::GRPC::BadStatus => e
803
+ raise ::Google::Cloud::Error.from_error(e)
804
+ end
805
+
696
806
  ##
697
807
  # Creates a Cloud Identity for the given customer using the customer's
698
808
  # information, or the information provided here.
@@ -775,7 +885,9 @@ module Google
775
885
  options.apply_defaults timeout: @config.rpcs.provision_cloud_identity.timeout,
776
886
  metadata: metadata,
777
887
  retry_policy: @config.rpcs.provision_cloud_identity.retry_policy
778
- options.apply_defaults metadata: @config.metadata,
888
+
889
+ options.apply_defaults timeout: @config.timeout,
890
+ metadata: @config.metadata,
779
891
  retry_policy: @config.retry_policy
780
892
 
781
893
  @cloud_channel_service_stub.call_rpc :provision_cloud_identity, request, options: options do |response, operation|
@@ -861,7 +973,9 @@ module Google
861
973
  options.apply_defaults timeout: @config.rpcs.list_entitlements.timeout,
862
974
  metadata: metadata,
863
975
  retry_policy: @config.rpcs.list_entitlements.retry_policy
864
- options.apply_defaults metadata: @config.metadata,
976
+
977
+ options.apply_defaults timeout: @config.timeout,
978
+ metadata: @config.metadata,
865
979
  retry_policy: @config.retry_policy
866
980
 
867
981
  @cloud_channel_service_stub.call_rpc :list_entitlements, request, options: options do |response, operation|
@@ -974,7 +1088,9 @@ module Google
974
1088
  options.apply_defaults timeout: @config.rpcs.list_transferable_skus.timeout,
975
1089
  metadata: metadata,
976
1090
  retry_policy: @config.rpcs.list_transferable_skus.retry_policy
977
- options.apply_defaults metadata: @config.metadata,
1091
+
1092
+ options.apply_defaults timeout: @config.timeout,
1093
+ metadata: @config.metadata,
978
1094
  retry_policy: @config.retry_policy
979
1095
 
980
1096
  @cloud_channel_service_stub.call_rpc :list_transferable_skus, request, options: options do |response, operation|
@@ -1078,7 +1194,9 @@ module Google
1078
1194
  options.apply_defaults timeout: @config.rpcs.list_transferable_offers.timeout,
1079
1195
  metadata: metadata,
1080
1196
  retry_policy: @config.rpcs.list_transferable_offers.retry_policy
1081
- options.apply_defaults metadata: @config.metadata,
1197
+
1198
+ options.apply_defaults timeout: @config.timeout,
1199
+ metadata: @config.metadata,
1082
1200
  retry_policy: @config.retry_policy
1083
1201
 
1084
1202
  @cloud_channel_service_stub.call_rpc :list_transferable_offers, request, options: options do |response, operation|
@@ -1091,7 +1209,7 @@ module Google
1091
1209
  end
1092
1210
 
1093
1211
  ##
1094
- # Returns a requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource.
1212
+ # Returns the requested {::Google::Cloud::Channel::V1::Entitlement Entitlement} resource.
1095
1213
  #
1096
1214
  # Possible error codes:
1097
1215
  #
@@ -1156,7 +1274,9 @@ module Google
1156
1274
  options.apply_defaults timeout: @config.rpcs.get_entitlement.timeout,
1157
1275
  metadata: metadata,
1158
1276
  retry_policy: @config.rpcs.get_entitlement.retry_policy
1159
- options.apply_defaults metadata: @config.metadata,
1277
+
1278
+ options.apply_defaults timeout: @config.timeout,
1279
+ metadata: @config.metadata,
1160
1280
  retry_policy: @config.retry_policy
1161
1281
 
1162
1282
  @cloud_channel_service_stub.call_rpc :get_entitlement, request, options: options do |response, operation|
@@ -1273,7 +1393,9 @@ module Google
1273
1393
  options.apply_defaults timeout: @config.rpcs.create_entitlement.timeout,
1274
1394
  metadata: metadata,
1275
1395
  retry_policy: @config.rpcs.create_entitlement.retry_policy
1276
- options.apply_defaults metadata: @config.metadata,
1396
+
1397
+ options.apply_defaults timeout: @config.timeout,
1398
+ metadata: @config.metadata,
1277
1399
  retry_policy: @config.retry_policy
1278
1400
 
1279
1401
  @cloud_channel_service_stub.call_rpc :create_entitlement, request, options: options do |response, operation|
@@ -1380,7 +1502,9 @@ module Google
1380
1502
  options.apply_defaults timeout: @config.rpcs.change_parameters.timeout,
1381
1503
  metadata: metadata,
1382
1504
  retry_policy: @config.rpcs.change_parameters.retry_policy
1383
- options.apply_defaults metadata: @config.metadata,
1505
+
1506
+ options.apply_defaults timeout: @config.timeout,
1507
+ metadata: @config.metadata,
1384
1508
  retry_policy: @config.retry_policy
1385
1509
 
1386
1510
  @cloud_channel_service_stub.call_rpc :change_parameters, request, options: options do |response, operation|
@@ -1485,7 +1609,9 @@ module Google
1485
1609
  options.apply_defaults timeout: @config.rpcs.change_renewal_settings.timeout,
1486
1610
  metadata: metadata,
1487
1611
  retry_policy: @config.rpcs.change_renewal_settings.retry_policy
1488
- options.apply_defaults metadata: @config.metadata,
1612
+
1613
+ options.apply_defaults timeout: @config.timeout,
1614
+ metadata: @config.metadata,
1489
1615
  retry_policy: @config.retry_policy
1490
1616
 
1491
1617
  @cloud_channel_service_stub.call_rpc :change_renewal_settings, request, options: options do |response, operation|
@@ -1593,7 +1719,9 @@ module Google
1593
1719
  options.apply_defaults timeout: @config.rpcs.change_offer.timeout,
1594
1720
  metadata: metadata,
1595
1721
  retry_policy: @config.rpcs.change_offer.retry_policy
1596
- options.apply_defaults metadata: @config.metadata,
1722
+
1723
+ options.apply_defaults timeout: @config.timeout,
1724
+ metadata: @config.metadata,
1597
1725
  retry_policy: @config.retry_policy
1598
1726
 
1599
1727
  @cloud_channel_service_stub.call_rpc :change_offer, request, options: options do |response, operation|
@@ -1697,7 +1825,9 @@ module Google
1697
1825
  options.apply_defaults timeout: @config.rpcs.start_paid_service.timeout,
1698
1826
  metadata: metadata,
1699
1827
  retry_policy: @config.rpcs.start_paid_service.retry_policy
1700
- options.apply_defaults metadata: @config.metadata,
1828
+
1829
+ options.apply_defaults timeout: @config.timeout,
1830
+ metadata: @config.metadata,
1701
1831
  retry_policy: @config.retry_policy
1702
1832
 
1703
1833
  @cloud_channel_service_stub.call_rpc :start_paid_service, request, options: options do |response, operation|
@@ -1798,7 +1928,9 @@ module Google
1798
1928
  options.apply_defaults timeout: @config.rpcs.suspend_entitlement.timeout,
1799
1929
  metadata: metadata,
1800
1930
  retry_policy: @config.rpcs.suspend_entitlement.retry_policy
1801
- options.apply_defaults metadata: @config.metadata,
1931
+
1932
+ options.apply_defaults timeout: @config.timeout,
1933
+ metadata: @config.metadata,
1802
1934
  retry_policy: @config.retry_policy
1803
1935
 
1804
1936
  @cloud_channel_service_stub.call_rpc :suspend_entitlement, request, options: options do |response, operation|
@@ -1904,7 +2036,9 @@ module Google
1904
2036
  options.apply_defaults timeout: @config.rpcs.cancel_entitlement.timeout,
1905
2037
  metadata: metadata,
1906
2038
  retry_policy: @config.rpcs.cancel_entitlement.retry_policy
1907
- options.apply_defaults metadata: @config.metadata,
2039
+
2040
+ options.apply_defaults timeout: @config.timeout,
2041
+ metadata: @config.metadata,
1908
2042
  retry_policy: @config.retry_policy
1909
2043
 
1910
2044
  @cloud_channel_service_stub.call_rpc :cancel_entitlement, request, options: options do |response, operation|
@@ -2011,7 +2145,9 @@ module Google
2011
2145
  options.apply_defaults timeout: @config.rpcs.activate_entitlement.timeout,
2012
2146
  metadata: metadata,
2013
2147
  retry_policy: @config.rpcs.activate_entitlement.retry_policy
2014
- options.apply_defaults metadata: @config.metadata,
2148
+
2149
+ options.apply_defaults timeout: @config.timeout,
2150
+ metadata: @config.metadata,
2015
2151
  retry_policy: @config.retry_policy
2016
2152
 
2017
2153
  @cloud_channel_service_stub.call_rpc :activate_entitlement, request, options: options do |response, operation|
@@ -2127,7 +2263,9 @@ module Google
2127
2263
  options.apply_defaults timeout: @config.rpcs.transfer_entitlements.timeout,
2128
2264
  metadata: metadata,
2129
2265
  retry_policy: @config.rpcs.transfer_entitlements.retry_policy
2130
- options.apply_defaults metadata: @config.metadata,
2266
+
2267
+ options.apply_defaults timeout: @config.timeout,
2268
+ metadata: @config.metadata,
2131
2269
  retry_policy: @config.retry_policy
2132
2270
 
2133
2271
  @cloud_channel_service_stub.call_rpc :transfer_entitlements, request, options: options do |response, operation|
@@ -2238,7 +2376,9 @@ module Google
2238
2376
  options.apply_defaults timeout: @config.rpcs.transfer_entitlements_to_google.timeout,
2239
2377
  metadata: metadata,
2240
2378
  retry_policy: @config.rpcs.transfer_entitlements_to_google.retry_policy
2241
- options.apply_defaults metadata: @config.metadata,
2379
+
2380
+ options.apply_defaults timeout: @config.timeout,
2381
+ metadata: @config.metadata,
2242
2382
  retry_policy: @config.retry_policy
2243
2383
 
2244
2384
  @cloud_channel_service_stub.call_rpc :transfer_entitlements_to_google, request, options: options do |response, operation|
@@ -2328,7 +2468,9 @@ module Google
2328
2468
  options.apply_defaults timeout: @config.rpcs.list_channel_partner_links.timeout,
2329
2469
  metadata: metadata,
2330
2470
  retry_policy: @config.rpcs.list_channel_partner_links.retry_policy
2331
- options.apply_defaults metadata: @config.metadata,
2471
+
2472
+ options.apply_defaults timeout: @config.timeout,
2473
+ metadata: @config.metadata,
2332
2474
  retry_policy: @config.retry_policy
2333
2475
 
2334
2476
  @cloud_channel_service_stub.call_rpc :list_channel_partner_links, request, options: options do |response, operation|
@@ -2341,7 +2483,7 @@ module Google
2341
2483
  end
2342
2484
 
2343
2485
  ##
2344
- # Returns a requested {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource.
2486
+ # Returns the requested {::Google::Cloud::Channel::V1::ChannelPartnerLink ChannelPartnerLink} resource.
2345
2487
  # You must be a distributor to call this method.
2346
2488
  #
2347
2489
  # Possible error codes:
@@ -2411,7 +2553,9 @@ module Google
2411
2553
  options.apply_defaults timeout: @config.rpcs.get_channel_partner_link.timeout,
2412
2554
  metadata: metadata,
2413
2555
  retry_policy: @config.rpcs.get_channel_partner_link.retry_policy
2414
- options.apply_defaults metadata: @config.metadata,
2556
+
2557
+ options.apply_defaults timeout: @config.timeout,
2558
+ metadata: @config.metadata,
2415
2559
  retry_policy: @config.retry_policy
2416
2560
 
2417
2561
  @cloud_channel_service_stub.call_rpc :get_channel_partner_link, request, options: options do |response, operation|
@@ -2504,7 +2648,9 @@ module Google
2504
2648
  options.apply_defaults timeout: @config.rpcs.create_channel_partner_link.timeout,
2505
2649
  metadata: metadata,
2506
2650
  retry_policy: @config.rpcs.create_channel_partner_link.retry_policy
2507
- options.apply_defaults metadata: @config.metadata,
2651
+
2652
+ options.apply_defaults timeout: @config.timeout,
2653
+ metadata: @config.metadata,
2508
2654
  retry_policy: @config.retry_policy
2509
2655
 
2510
2656
  @cloud_channel_service_stub.call_rpc :create_channel_partner_link, request, options: options do |response, operation|
@@ -2599,7 +2745,9 @@ module Google
2599
2745
  options.apply_defaults timeout: @config.rpcs.update_channel_partner_link.timeout,
2600
2746
  metadata: metadata,
2601
2747
  retry_policy: @config.rpcs.update_channel_partner_link.retry_policy
2602
- options.apply_defaults metadata: @config.metadata,
2748
+
2749
+ options.apply_defaults timeout: @config.timeout,
2750
+ metadata: @config.metadata,
2603
2751
  retry_policy: @config.retry_policy
2604
2752
 
2605
2753
  @cloud_channel_service_stub.call_rpc :update_channel_partner_link, request, options: options do |response, operation|
@@ -2610,6 +2758,85 @@ module Google
2610
2758
  raise ::Google::Cloud::Error.from_error(e)
2611
2759
  end
2612
2760
 
2761
+ ##
2762
+ # Returns the requested {::Google::Cloud::Channel::V1::Offer Offer} resource.
2763
+ #
2764
+ # Possible error codes:
2765
+ #
2766
+ # * PERMISSION_DENIED: The entitlement doesn't belong to the reseller.
2767
+ # * INVALID_ARGUMENT: Required request parameters are missing or invalid.
2768
+ # * NOT_FOUND: Entitlement or offer was not found.
2769
+ #
2770
+ # Return value:
2771
+ # The {::Google::Cloud::Channel::V1::Offer Offer} resource.
2772
+ #
2773
+ # @overload lookup_offer(request, options = nil)
2774
+ # Pass arguments to `lookup_offer` via a request object, either of type
2775
+ # {::Google::Cloud::Channel::V1::LookupOfferRequest} or an equivalent Hash.
2776
+ #
2777
+ # @param request [::Google::Cloud::Channel::V1::LookupOfferRequest, ::Hash]
2778
+ # A request object representing the call parameters. Required. To specify no
2779
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2780
+ # @param options [::Gapic::CallOptions, ::Hash]
2781
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2782
+ #
2783
+ # @overload lookup_offer(entitlement: nil)
2784
+ # Pass arguments to `lookup_offer` via keyword arguments. Note that at
2785
+ # least one keyword argument is required. To specify no parameters, or to keep all
2786
+ # the default parameter values, pass an empty Hash as a request object (see above).
2787
+ #
2788
+ # @param entitlement [::String]
2789
+ # Required. The resource name of the entitlement to retrieve the Offer.
2790
+ # Entitlement uses the format:
2791
+ # accounts/\\{account_id}/customers/\\{customer_id}/entitlements/\\{entitlement_id}
2792
+ #
2793
+ # @yield [response, operation] Access the result along with the RPC operation
2794
+ # @yieldparam response [::Google::Cloud::Channel::V1::Offer]
2795
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2796
+ #
2797
+ # @return [::Google::Cloud::Channel::V1::Offer]
2798
+ #
2799
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2800
+ #
2801
+ def lookup_offer request, options = nil
2802
+ raise ::ArgumentError, "request must be provided" if request.nil?
2803
+
2804
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Channel::V1::LookupOfferRequest
2805
+
2806
+ # Converts hash and nil to an options object
2807
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2808
+
2809
+ # Customize the options with defaults
2810
+ metadata = @config.rpcs.lookup_offer.metadata.to_h
2811
+
2812
+ # Set x-goog-api-client and x-goog-user-project headers
2813
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2814
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2815
+ gapic_version: ::Google::Cloud::Channel::V1::VERSION
2816
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2817
+
2818
+ header_params = {
2819
+ "entitlement" => request.entitlement
2820
+ }
2821
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2822
+ metadata[:"x-goog-request-params"] ||= request_params_header
2823
+
2824
+ options.apply_defaults timeout: @config.rpcs.lookup_offer.timeout,
2825
+ metadata: metadata,
2826
+ retry_policy: @config.rpcs.lookup_offer.retry_policy
2827
+
2828
+ options.apply_defaults timeout: @config.timeout,
2829
+ metadata: @config.metadata,
2830
+ retry_policy: @config.retry_policy
2831
+
2832
+ @cloud_channel_service_stub.call_rpc :lookup_offer, request, options: options do |response, operation|
2833
+ yield response, operation if block_given?
2834
+ return response
2835
+ end
2836
+ rescue ::GRPC::BadStatus => e
2837
+ raise ::Google::Cloud::Error.from_error(e)
2838
+ end
2839
+
2613
2840
  ##
2614
2841
  # Lists the Products the reseller is authorized to sell.
2615
2842
  #
@@ -2674,7 +2901,9 @@ module Google
2674
2901
  options.apply_defaults timeout: @config.rpcs.list_products.timeout,
2675
2902
  metadata: metadata,
2676
2903
  retry_policy: @config.rpcs.list_products.retry_policy
2677
- options.apply_defaults metadata: @config.metadata,
2904
+
2905
+ options.apply_defaults timeout: @config.timeout,
2906
+ metadata: @config.metadata,
2678
2907
  retry_policy: @config.retry_policy
2679
2908
 
2680
2909
  @cloud_channel_service_stub.call_rpc :list_products, request, options: options do |response, operation|
@@ -2761,7 +2990,9 @@ module Google
2761
2990
  options.apply_defaults timeout: @config.rpcs.list_skus.timeout,
2762
2991
  metadata: metadata,
2763
2992
  retry_policy: @config.rpcs.list_skus.retry_policy
2764
- options.apply_defaults metadata: @config.metadata,
2993
+
2994
+ options.apply_defaults timeout: @config.timeout,
2995
+ metadata: @config.metadata,
2765
2996
  retry_policy: @config.retry_policy
2766
2997
 
2767
2998
  @cloud_channel_service_stub.call_rpc :list_skus, request, options: options do |response, operation|
@@ -2849,7 +3080,9 @@ module Google
2849
3080
  options.apply_defaults timeout: @config.rpcs.list_offers.timeout,
2850
3081
  metadata: metadata,
2851
3082
  retry_policy: @config.rpcs.list_offers.retry_policy
2852
- options.apply_defaults metadata: @config.metadata,
3083
+
3084
+ options.apply_defaults timeout: @config.timeout,
3085
+ metadata: @config.metadata,
2853
3086
  retry_policy: @config.retry_policy
2854
3087
 
2855
3088
  @cloud_channel_service_stub.call_rpc :list_offers, request, options: options do |response, operation|
@@ -2939,7 +3172,9 @@ module Google
2939
3172
  options.apply_defaults timeout: @config.rpcs.list_purchasable_skus.timeout,
2940
3173
  metadata: metadata,
2941
3174
  retry_policy: @config.rpcs.list_purchasable_skus.retry_policy
2942
- options.apply_defaults metadata: @config.metadata,
3175
+
3176
+ options.apply_defaults timeout: @config.timeout,
3177
+ metadata: @config.metadata,
2943
3178
  retry_policy: @config.retry_policy
2944
3179
 
2945
3180
  @cloud_channel_service_stub.call_rpc :list_purchasable_skus, request, options: options do |response, operation|
@@ -3029,7 +3264,9 @@ module Google
3029
3264
  options.apply_defaults timeout: @config.rpcs.list_purchasable_offers.timeout,
3030
3265
  metadata: metadata,
3031
3266
  retry_policy: @config.rpcs.list_purchasable_offers.retry_policy
3032
- options.apply_defaults metadata: @config.metadata,
3267
+
3268
+ options.apply_defaults timeout: @config.timeout,
3269
+ metadata: @config.metadata,
3033
3270
  retry_policy: @config.retry_policy
3034
3271
 
3035
3272
  @cloud_channel_service_stub.call_rpc :list_purchasable_offers, request, options: options do |response, operation|
@@ -3114,7 +3351,9 @@ module Google
3114
3351
  options.apply_defaults timeout: @config.rpcs.register_subscriber.timeout,
3115
3352
  metadata: metadata,
3116
3353
  retry_policy: @config.rpcs.register_subscriber.retry_policy
3117
- options.apply_defaults metadata: @config.metadata,
3354
+
3355
+ options.apply_defaults timeout: @config.timeout,
3356
+ metadata: @config.metadata,
3118
3357
  retry_policy: @config.retry_policy
3119
3358
 
3120
3359
  @cloud_channel_service_stub.call_rpc :register_subscriber, request, options: options do |response, operation|
@@ -3202,7 +3441,9 @@ module Google
3202
3441
  options.apply_defaults timeout: @config.rpcs.unregister_subscriber.timeout,
3203
3442
  metadata: metadata,
3204
3443
  retry_policy: @config.rpcs.unregister_subscriber.retry_policy
3205
- options.apply_defaults metadata: @config.metadata,
3444
+
3445
+ options.apply_defaults timeout: @config.timeout,
3446
+ metadata: @config.metadata,
3206
3447
  retry_policy: @config.retry_policy
3207
3448
 
3208
3449
  @cloud_channel_service_stub.call_rpc :unregister_subscriber, request, options: options do |response, operation|
@@ -3295,7 +3536,9 @@ module Google
3295
3536
  options.apply_defaults timeout: @config.rpcs.list_subscribers.timeout,
3296
3537
  metadata: metadata,
3297
3538
  retry_policy: @config.rpcs.list_subscribers.retry_policy
3298
- options.apply_defaults metadata: @config.metadata,
3539
+
3540
+ options.apply_defaults timeout: @config.timeout,
3541
+ metadata: @config.metadata,
3299
3542
  retry_policy: @config.retry_policy
3300
3543
 
3301
3544
  @cloud_channel_service_stub.call_rpc :list_subscribers, request, options: options do |response, operation|
@@ -3319,22 +3562,21 @@ module Google
3319
3562
  # Configuration can be applied globally to all clients, or to a single client
3320
3563
  # on construction.
3321
3564
  #
3322
- # # Examples
3323
- #
3324
- # To modify the global config, setting the timeout for list_customers
3325
- # to 20 seconds, and all remaining timeouts to 10 seconds:
3565
+ # @example
3326
3566
  #
3327
- # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
3328
- # config.timeout = 10.0
3329
- # config.rpcs.list_customers.timeout = 20.0
3330
- # end
3567
+ # # Modify the global config, setting the timeout for
3568
+ # # list_customers to 20 seconds,
3569
+ # # and all remaining timeouts to 10 seconds.
3570
+ # ::Google::Cloud::Channel::V1::CloudChannelService::Client.configure do |config|
3571
+ # config.timeout = 10.0
3572
+ # config.rpcs.list_customers.timeout = 20.0
3573
+ # end
3331
3574
  #
3332
- # To apply the above configuration only to a new client:
3333
- #
3334
- # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
3335
- # config.timeout = 10.0
3336
- # config.rpcs.list_customers.timeout = 20.0
3337
- # end
3575
+ # # Apply the above configuration only to a new client.
3576
+ # client = ::Google::Cloud::Channel::V1::CloudChannelService::Client.new do |config|
3577
+ # config.timeout = 10.0
3578
+ # config.rpcs.list_customers.timeout = 20.0
3579
+ # end
3338
3580
  #
3339
3581
  # @!attribute [rw] endpoint
3340
3582
  # The hostname or hostname:port of the service endpoint.
@@ -3473,6 +3715,11 @@ module Google
3473
3715
  #
3474
3716
  attr_reader :delete_customer
3475
3717
  ##
3718
+ # RPC-specific configuration for `import_customer`
3719
+ # @return [::Gapic::Config::Method]
3720
+ #
3721
+ attr_reader :import_customer
3722
+ ##
3476
3723
  # RPC-specific configuration for `provision_cloud_identity`
3477
3724
  # @return [::Gapic::Config::Method]
3478
3725
  #
@@ -3568,6 +3815,11 @@ module Google
3568
3815
  #
3569
3816
  attr_reader :update_channel_partner_link
3570
3817
  ##
3818
+ # RPC-specific configuration for `lookup_offer`
3819
+ # @return [::Gapic::Config::Method]
3820
+ #
3821
+ attr_reader :lookup_offer
3822
+ ##
3571
3823
  # RPC-specific configuration for `list_products`
3572
3824
  # @return [::Gapic::Config::Method]
3573
3825
  #
@@ -3622,6 +3874,8 @@ module Google
3622
3874
  @update_customer = ::Gapic::Config::Method.new update_customer_config
3623
3875
  delete_customer_config = parent_rpcs.delete_customer if parent_rpcs.respond_to? :delete_customer
3624
3876
  @delete_customer = ::Gapic::Config::Method.new delete_customer_config
3877
+ import_customer_config = parent_rpcs.import_customer if parent_rpcs.respond_to? :import_customer
3878
+ @import_customer = ::Gapic::Config::Method.new import_customer_config
3625
3879
  provision_cloud_identity_config = parent_rpcs.provision_cloud_identity if parent_rpcs.respond_to? :provision_cloud_identity
3626
3880
  @provision_cloud_identity = ::Gapic::Config::Method.new provision_cloud_identity_config
3627
3881
  list_entitlements_config = parent_rpcs.list_entitlements if parent_rpcs.respond_to? :list_entitlements
@@ -3660,6 +3914,8 @@ module Google
3660
3914
  @create_channel_partner_link = ::Gapic::Config::Method.new create_channel_partner_link_config
3661
3915
  update_channel_partner_link_config = parent_rpcs.update_channel_partner_link if parent_rpcs.respond_to? :update_channel_partner_link
3662
3916
  @update_channel_partner_link = ::Gapic::Config::Method.new update_channel_partner_link_config
3917
+ lookup_offer_config = parent_rpcs.lookup_offer if parent_rpcs.respond_to? :lookup_offer
3918
+ @lookup_offer = ::Gapic::Config::Method.new lookup_offer_config
3663
3919
  list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products
3664
3920
  @list_products = ::Gapic::Config::Method.new list_products_config
3665
3921
  list_skus_config = parent_rpcs.list_skus if parent_rpcs.respond_to? :list_skus