google-cloud-cloud_controls_partner-v1 0.a → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/client.rb +1171 -0
  6. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/credentials.rb +47 -0
  7. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/paths.rb +149 -0
  8. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/rest/client.rb +1084 -0
  9. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/rest/service_stub.rb +541 -0
  10. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/rest.rb +52 -0
  11. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core.rb +55 -0
  12. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/client.rb +556 -0
  13. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/credentials.rb +47 -0
  14. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/paths.rb +77 -0
  15. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/rest/client.rb +515 -0
  16. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/rest/service_stub.rb +187 -0
  17. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/rest.rb +52 -0
  18. data/lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring.rb +55 -0
  19. data/lib/google/cloud/cloud_controls_partner/v1/rest.rb +38 -0
  20. data/lib/google/cloud/cloud_controls_partner/v1/version.rb +7 -2
  21. data/lib/google/cloud/cloud_controls_partner/v1.rb +46 -0
  22. data/lib/google/cloud/cloudcontrolspartner/v1/access_approval_requests_pb.rb +51 -0
  23. data/lib/google/cloud/cloudcontrolspartner/v1/completion_state_pb.rb +42 -0
  24. data/lib/google/cloud/cloudcontrolspartner/v1/core_pb.rb +55 -0
  25. data/lib/google/cloud/cloudcontrolspartner/v1/core_services_pb.rb +60 -0
  26. data/lib/google/cloud/cloudcontrolspartner/v1/customer_workloads_pb.rb +55 -0
  27. data/lib/google/cloud/cloudcontrolspartner/v1/customers_pb.rb +54 -0
  28. data/lib/google/cloud/cloudcontrolspartner/v1/ekm_connections_pb.rb +49 -0
  29. data/lib/google/cloud/cloudcontrolspartner/v1/monitoring_pb.rb +45 -0
  30. data/lib/google/cloud/cloudcontrolspartner/v1/monitoring_services_pb.rb +53 -0
  31. data/lib/google/cloud/cloudcontrolspartner/v1/partner_permissions_pb.rb +47 -0
  32. data/lib/google/cloud/cloudcontrolspartner/v1/partners_pb.rb +51 -0
  33. data/lib/google/cloud/cloudcontrolspartner/v1/violations_pb.rb +58 -0
  34. data/lib/google-cloud-cloud_controls_partner-v1.rb +21 -0
  35. data/proto_docs/README.md +4 -0
  36. data/proto_docs/google/api/client.rb +399 -0
  37. data/proto_docs/google/api/field_behavior.rb +85 -0
  38. data/proto_docs/google/api/launch_stage.rb +71 -0
  39. data/proto_docs/google/api/resource.rb +222 -0
  40. data/proto_docs/google/cloud/cloudcontrolspartner/v1/access_approval_requests.rb +143 -0
  41. data/proto_docs/google/cloud/cloudcontrolspartner/v1/completion_state.rb +44 -0
  42. data/proto_docs/google/cloud/cloudcontrolspartner/v1/core.rb +57 -0
  43. data/proto_docs/google/cloud/cloudcontrolspartner/v1/customer_workloads.rb +177 -0
  44. data/proto_docs/google/cloud/cloudcontrolspartner/v1/customers.rb +134 -0
  45. data/proto_docs/google/cloud/cloudcontrolspartner/v1/ekm_connections.rb +96 -0
  46. data/proto_docs/google/cloud/cloudcontrolspartner/v1/partner_permissions.rb +66 -0
  47. data/proto_docs/google/cloud/cloudcontrolspartner/v1/partners.rb +117 -0
  48. data/proto_docs/google/cloud/cloudcontrolspartner/v1/violations.rb +229 -0
  49. data/proto_docs/google/protobuf/duration.rb +98 -0
  50. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  51. data/proto_docs/google/type/interval.rb +45 -0
  52. metadata +93 -10
@@ -0,0 +1,1084 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/cloudcontrolspartner/v1/core_pb"
21
+ require "google/cloud/cloud_controls_partner/v1/cloud_controls_partner_core/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module CloudControlsPartner
26
+ module V1
27
+ module CloudControlsPartnerCore
28
+ module Rest
29
+ ##
30
+ # REST client for the CloudControlsPartnerCore service.
31
+ #
32
+ # Service describing handlers for resources
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudcontrolspartner.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :cloud_controls_partner_core_stub
45
+
46
+ ##
47
+ # Configure the CloudControlsPartnerCore Client class.
48
+ #
49
+ # See {::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all CloudControlsPartnerCore clients
55
+ # ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "CloudControlsPartner", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.get_workload.timeout = 60.0
76
+ default_config.rpcs.get_workload.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.list_workloads.timeout = 60.0
81
+ default_config.rpcs.list_workloads.retry_policy = {
82
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
83
+ }
84
+
85
+ default_config.rpcs.get_customer.timeout = 60.0
86
+ default_config.rpcs.get_customer.retry_policy = {
87
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
88
+ }
89
+
90
+ default_config.rpcs.list_customers.timeout = 60.0
91
+ default_config.rpcs.list_customers.retry_policy = {
92
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
93
+ }
94
+
95
+ default_config.rpcs.get_ekm_connections.timeout = 60.0
96
+ default_config.rpcs.get_ekm_connections.retry_policy = {
97
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
98
+ }
99
+
100
+ default_config.rpcs.get_partner_permissions.timeout = 60.0
101
+ default_config.rpcs.get_partner_permissions.retry_policy = {
102
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.list_access_approval_requests.timeout = 60.0
106
+ default_config.rpcs.list_access_approval_requests.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config
111
+ end
112
+ yield @configure if block_given?
113
+ @configure
114
+ end
115
+
116
+ ##
117
+ # Configure the CloudControlsPartnerCore Client instance.
118
+ #
119
+ # The configuration is set to the derived mode, meaning that values can be changed,
120
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
121
+ # should be made on {Client.configure}.
122
+ #
123
+ # See {::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client::Configuration}
124
+ # for a description of the configuration fields.
125
+ #
126
+ # @yield [config] Configure the Client client.
127
+ # @yieldparam config [Client::Configuration]
128
+ #
129
+ # @return [Client::Configuration]
130
+ #
131
+ def configure
132
+ yield @config if block_given?
133
+ @config
134
+ end
135
+
136
+ ##
137
+ # The effective universe domain
138
+ #
139
+ # @return [String]
140
+ #
141
+ def universe_domain
142
+ @cloud_controls_partner_core_stub.universe_domain
143
+ end
144
+
145
+ ##
146
+ # Create a new CloudControlsPartnerCore REST client object.
147
+ #
148
+ # @example
149
+ #
150
+ # # Create a client using the default configuration
151
+ # client = ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
152
+ #
153
+ # # Create a client using a custom configuration
154
+ # client = ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new do |config|
155
+ # config.timeout = 10.0
156
+ # end
157
+ #
158
+ # @yield [config] Configure the CloudControlsPartnerCore client.
159
+ # @yieldparam config [Client::Configuration]
160
+ #
161
+ def initialize
162
+ # Create the configuration object
163
+ @config = Configuration.new Client.configure
164
+
165
+ # Yield the configuration if needed
166
+ yield @config if block_given?
167
+
168
+ # Create credentials
169
+ credentials = @config.credentials
170
+ # Use self-signed JWT if the endpoint is unchanged from default,
171
+ # but only if the default endpoint does not have a region prefix.
172
+ enable_self_signed_jwt = @config.endpoint.nil? ||
173
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
174
+ !@config.endpoint.split(".").first.include?("-"))
175
+ credentials ||= Credentials.default scope: @config.scope,
176
+ enable_self_signed_jwt: enable_self_signed_jwt
177
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
178
+ credentials = Credentials.new credentials, scope: @config.scope
179
+ end
180
+
181
+ @quota_project_id = @config.quota_project
182
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
183
+
184
+ @cloud_controls_partner_core_stub = ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::ServiceStub.new(
185
+ endpoint: @config.endpoint,
186
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
187
+ universe_domain: @config.universe_domain,
188
+ credentials: credentials
189
+ )
190
+ end
191
+
192
+ # Service calls
193
+
194
+ ##
195
+ # Gets details of a single workload
196
+ #
197
+ # @overload get_workload(request, options = nil)
198
+ # Pass arguments to `get_workload` via a request object, either of type
199
+ # {::Google::Cloud::CloudControlsPartner::V1::GetWorkloadRequest} or an equivalent Hash.
200
+ #
201
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::GetWorkloadRequest, ::Hash]
202
+ # A request object representing the call parameters. Required. To specify no
203
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
204
+ # @param options [::Gapic::CallOptions, ::Hash]
205
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
206
+ #
207
+ # @overload get_workload(name: nil)
208
+ # Pass arguments to `get_workload` via keyword arguments. Note that at
209
+ # least one keyword argument is required. To specify no parameters, or to keep all
210
+ # the default parameter values, pass an empty Hash as a request object (see above).
211
+ #
212
+ # @param name [::String]
213
+ # Required. Format:
214
+ # `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
215
+ # @yield [result, operation] Access the result along with the TransportOperation object
216
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Workload]
217
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
218
+ #
219
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Workload]
220
+ #
221
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
222
+ #
223
+ # @example Basic example
224
+ # require "google/cloud/cloud_controls_partner/v1"
225
+ #
226
+ # # Create a client object. The client can be reused for multiple calls.
227
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
228
+ #
229
+ # # Create a request. To set request fields, pass in keyword arguments.
230
+ # request = Google::Cloud::CloudControlsPartner::V1::GetWorkloadRequest.new
231
+ #
232
+ # # Call the get_workload method.
233
+ # result = client.get_workload request
234
+ #
235
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Workload.
236
+ # p result
237
+ #
238
+ def get_workload request, options = nil
239
+ raise ::ArgumentError, "request must be provided" if request.nil?
240
+
241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetWorkloadRequest
242
+
243
+ # Converts hash and nil to an options object
244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
245
+
246
+ # Customize the options with defaults
247
+ call_metadata = @config.rpcs.get_workload.metadata.to_h
248
+
249
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
252
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
253
+ transports_version_send: [:rest]
254
+
255
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ options.apply_defaults timeout: @config.rpcs.get_workload.timeout,
259
+ metadata: call_metadata,
260
+ retry_policy: @config.rpcs.get_workload.retry_policy
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
264
+ retry_policy: @config.retry_policy
265
+
266
+ @cloud_controls_partner_core_stub.get_workload request, options do |result, operation|
267
+ yield result, operation if block_given?
268
+ return result
269
+ end
270
+ rescue ::Gapic::Rest::Error => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # Lists customer workloads for a given customer org id
276
+ #
277
+ # @overload list_workloads(request, options = nil)
278
+ # Pass arguments to `list_workloads` via a request object, either of type
279
+ # {::Google::Cloud::CloudControlsPartner::V1::ListWorkloadsRequest} or an equivalent Hash.
280
+ #
281
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::ListWorkloadsRequest, ::Hash]
282
+ # A request object representing the call parameters. Required. To specify no
283
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
284
+ # @param options [::Gapic::CallOptions, ::Hash]
285
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
286
+ #
287
+ # @overload list_workloads(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
288
+ # Pass arguments to `list_workloads` via keyword arguments. Note that at
289
+ # least one keyword argument is required. To specify no parameters, or to keep all
290
+ # the default parameter values, pass an empty Hash as a request object (see above).
291
+ #
292
+ # @param parent [::String]
293
+ # Required. Parent resource
294
+ # Format:
295
+ # `organizations/{organization}/locations/{location}/customers/{customer}`
296
+ # @param page_size [::Integer]
297
+ # The maximum number of workloads to return. The service may return fewer
298
+ # than this value. If unspecified, at most 500 workloads will be returned.
299
+ # @param page_token [::String]
300
+ # A page token, received from a previous `ListWorkloads` call.
301
+ # Provide this to retrieve the subsequent page.
302
+ # @param filter [::String]
303
+ # Optional. Filtering results.
304
+ # @param order_by [::String]
305
+ # Optional. Hint for how to order the results.
306
+ # @yield [result, operation] Access the result along with the TransportOperation object
307
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::ListWorkloadsResponse]
308
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
309
+ #
310
+ # @return [::Google::Cloud::CloudControlsPartner::V1::ListWorkloadsResponse]
311
+ #
312
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ #
314
+ # @example Basic example
315
+ # require "google/cloud/cloud_controls_partner/v1"
316
+ #
317
+ # # Create a client object. The client can be reused for multiple calls.
318
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
319
+ #
320
+ # # Create a request. To set request fields, pass in keyword arguments.
321
+ # request = Google::Cloud::CloudControlsPartner::V1::ListWorkloadsRequest.new
322
+ #
323
+ # # Call the list_workloads method.
324
+ # result = client.list_workloads request
325
+ #
326
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
327
+ # # over elements, and API calls will be issued to fetch pages as needed.
328
+ # result.each do |item|
329
+ # # Each element is of type ::Google::Cloud::CloudControlsPartner::V1::Workload.
330
+ # p item
331
+ # end
332
+ #
333
+ def list_workloads request, options = nil
334
+ raise ::ArgumentError, "request must be provided" if request.nil?
335
+
336
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::ListWorkloadsRequest
337
+
338
+ # Converts hash and nil to an options object
339
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
340
+
341
+ # Customize the options with defaults
342
+ call_metadata = @config.rpcs.list_workloads.metadata.to_h
343
+
344
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
345
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
346
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
347
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
348
+ transports_version_send: [:rest]
349
+
350
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
351
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ options.apply_defaults timeout: @config.rpcs.list_workloads.timeout,
354
+ metadata: call_metadata,
355
+ retry_policy: @config.rpcs.list_workloads.retry_policy
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: @config.metadata,
359
+ retry_policy: @config.retry_policy
360
+
361
+ @cloud_controls_partner_core_stub.list_workloads request, options do |result, operation|
362
+ yield result, operation if block_given?
363
+ return result
364
+ end
365
+ rescue ::Gapic::Rest::Error => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # Gets details of a single customer
371
+ #
372
+ # @overload get_customer(request, options = nil)
373
+ # Pass arguments to `get_customer` via a request object, either of type
374
+ # {::Google::Cloud::CloudControlsPartner::V1::GetCustomerRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::GetCustomerRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
381
+ #
382
+ # @overload get_customer(name: nil)
383
+ # Pass arguments to `get_customer` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param name [::String]
388
+ # Required. Format:
389
+ # `organizations/{organization}/locations/{location}/customers/{customer}`
390
+ # @yield [result, operation] Access the result along with the TransportOperation object
391
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Customer]
392
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
393
+ #
394
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Customer]
395
+ #
396
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
397
+ #
398
+ # @example Basic example
399
+ # require "google/cloud/cloud_controls_partner/v1"
400
+ #
401
+ # # Create a client object. The client can be reused for multiple calls.
402
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
403
+ #
404
+ # # Create a request. To set request fields, pass in keyword arguments.
405
+ # request = Google::Cloud::CloudControlsPartner::V1::GetCustomerRequest.new
406
+ #
407
+ # # Call the get_customer method.
408
+ # result = client.get_customer request
409
+ #
410
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Customer.
411
+ # p result
412
+ #
413
+ def get_customer request, options = nil
414
+ raise ::ArgumentError, "request must be provided" if request.nil?
415
+
416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetCustomerRequest
417
+
418
+ # Converts hash and nil to an options object
419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
420
+
421
+ # Customize the options with defaults
422
+ call_metadata = @config.rpcs.get_customer.metadata.to_h
423
+
424
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
425
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
426
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
427
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
428
+ transports_version_send: [:rest]
429
+
430
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
431
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
432
+
433
+ options.apply_defaults timeout: @config.rpcs.get_customer.timeout,
434
+ metadata: call_metadata,
435
+ retry_policy: @config.rpcs.get_customer.retry_policy
436
+
437
+ options.apply_defaults timeout: @config.timeout,
438
+ metadata: @config.metadata,
439
+ retry_policy: @config.retry_policy
440
+
441
+ @cloud_controls_partner_core_stub.get_customer request, options do |result, operation|
442
+ yield result, operation if block_given?
443
+ return result
444
+ end
445
+ rescue ::Gapic::Rest::Error => e
446
+ raise ::Google::Cloud::Error.from_error(e)
447
+ end
448
+
449
+ ##
450
+ # Lists customers of a partner identified by its Google Cloud organization ID
451
+ #
452
+ # @overload list_customers(request, options = nil)
453
+ # Pass arguments to `list_customers` via a request object, either of type
454
+ # {::Google::Cloud::CloudControlsPartner::V1::ListCustomersRequest} or an equivalent Hash.
455
+ #
456
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::ListCustomersRequest, ::Hash]
457
+ # A request object representing the call parameters. Required. To specify no
458
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
459
+ # @param options [::Gapic::CallOptions, ::Hash]
460
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
461
+ #
462
+ # @overload list_customers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
463
+ # Pass arguments to `list_customers` via keyword arguments. Note that at
464
+ # least one keyword argument is required. To specify no parameters, or to keep all
465
+ # the default parameter values, pass an empty Hash as a request object (see above).
466
+ #
467
+ # @param parent [::String]
468
+ # Required. Parent resource
469
+ # Format: `organizations/{organization}/locations/{location}`
470
+ # @param page_size [::Integer]
471
+ # The maximum number of Customers to return. The service may return fewer
472
+ # than this value. If unspecified, at most 500 Customers will be returned.
473
+ # @param page_token [::String]
474
+ # A page token, received from a previous `ListCustomers` call.
475
+ # Provide this to retrieve the subsequent page.
476
+ # @param filter [::String]
477
+ # Optional. Filtering results
478
+ # @param order_by [::String]
479
+ # Optional. Hint for how to order the results
480
+ # @yield [result, operation] Access the result along with the TransportOperation object
481
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::ListCustomersResponse]
482
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
483
+ #
484
+ # @return [::Google::Cloud::CloudControlsPartner::V1::ListCustomersResponse]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
487
+ #
488
+ # @example Basic example
489
+ # require "google/cloud/cloud_controls_partner/v1"
490
+ #
491
+ # # Create a client object. The client can be reused for multiple calls.
492
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
493
+ #
494
+ # # Create a request. To set request fields, pass in keyword arguments.
495
+ # request = Google::Cloud::CloudControlsPartner::V1::ListCustomersRequest.new
496
+ #
497
+ # # Call the list_customers method.
498
+ # result = client.list_customers request
499
+ #
500
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
501
+ # # over elements, and API calls will be issued to fetch pages as needed.
502
+ # result.each do |item|
503
+ # # Each element is of type ::Google::Cloud::CloudControlsPartner::V1::Customer.
504
+ # p item
505
+ # end
506
+ #
507
+ def list_customers request, options = nil
508
+ raise ::ArgumentError, "request must be provided" if request.nil?
509
+
510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::ListCustomersRequest
511
+
512
+ # Converts hash and nil to an options object
513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
514
+
515
+ # Customize the options with defaults
516
+ call_metadata = @config.rpcs.list_customers.metadata.to_h
517
+
518
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
519
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
521
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
522
+ transports_version_send: [:rest]
523
+
524
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
525
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ options.apply_defaults timeout: @config.rpcs.list_customers.timeout,
528
+ metadata: call_metadata,
529
+ retry_policy: @config.rpcs.list_customers.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @cloud_controls_partner_core_stub.list_customers request, options do |result, operation|
536
+ yield result, operation if block_given?
537
+ return result
538
+ end
539
+ rescue ::Gapic::Rest::Error => e
540
+ raise ::Google::Cloud::Error.from_error(e)
541
+ end
542
+
543
+ ##
544
+ # Gets the EKM connections associated with a workload
545
+ #
546
+ # @overload get_ekm_connections(request, options = nil)
547
+ # Pass arguments to `get_ekm_connections` via a request object, either of type
548
+ # {::Google::Cloud::CloudControlsPartner::V1::GetEkmConnectionsRequest} or an equivalent Hash.
549
+ #
550
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::GetEkmConnectionsRequest, ::Hash]
551
+ # A request object representing the call parameters. Required. To specify no
552
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
553
+ # @param options [::Gapic::CallOptions, ::Hash]
554
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
555
+ #
556
+ # @overload get_ekm_connections(name: nil)
557
+ # Pass arguments to `get_ekm_connections` via keyword arguments. Note that at
558
+ # least one keyword argument is required. To specify no parameters, or to keep all
559
+ # the default parameter values, pass an empty Hash as a request object (see above).
560
+ #
561
+ # @param name [::String]
562
+ # Required. Format:
563
+ # `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
564
+ # @yield [result, operation] Access the result along with the TransportOperation object
565
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::EkmConnections]
566
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
567
+ #
568
+ # @return [::Google::Cloud::CloudControlsPartner::V1::EkmConnections]
569
+ #
570
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
571
+ #
572
+ # @example Basic example
573
+ # require "google/cloud/cloud_controls_partner/v1"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Google::Cloud::CloudControlsPartner::V1::GetEkmConnectionsRequest.new
580
+ #
581
+ # # Call the get_ekm_connections method.
582
+ # result = client.get_ekm_connections request
583
+ #
584
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::EkmConnections.
585
+ # p result
586
+ #
587
+ def get_ekm_connections request, options = nil
588
+ raise ::ArgumentError, "request must be provided" if request.nil?
589
+
590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetEkmConnectionsRequest
591
+
592
+ # Converts hash and nil to an options object
593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
594
+
595
+ # Customize the options with defaults
596
+ call_metadata = @config.rpcs.get_ekm_connections.metadata.to_h
597
+
598
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
601
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
602
+ transports_version_send: [:rest]
603
+
604
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
605
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
606
+
607
+ options.apply_defaults timeout: @config.rpcs.get_ekm_connections.timeout,
608
+ metadata: call_metadata,
609
+ retry_policy: @config.rpcs.get_ekm_connections.retry_policy
610
+
611
+ options.apply_defaults timeout: @config.timeout,
612
+ metadata: @config.metadata,
613
+ retry_policy: @config.retry_policy
614
+
615
+ @cloud_controls_partner_core_stub.get_ekm_connections request, options do |result, operation|
616
+ yield result, operation if block_given?
617
+ return result
618
+ end
619
+ rescue ::Gapic::Rest::Error => e
620
+ raise ::Google::Cloud::Error.from_error(e)
621
+ end
622
+
623
+ ##
624
+ # Gets the partner permissions granted for a workload
625
+ #
626
+ # @overload get_partner_permissions(request, options = nil)
627
+ # Pass arguments to `get_partner_permissions` via a request object, either of type
628
+ # {::Google::Cloud::CloudControlsPartner::V1::GetPartnerPermissionsRequest} or an equivalent Hash.
629
+ #
630
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::GetPartnerPermissionsRequest, ::Hash]
631
+ # A request object representing the call parameters. Required. To specify no
632
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
633
+ # @param options [::Gapic::CallOptions, ::Hash]
634
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
635
+ #
636
+ # @overload get_partner_permissions(name: nil)
637
+ # Pass arguments to `get_partner_permissions` via keyword arguments. Note that at
638
+ # least one keyword argument is required. To specify no parameters, or to keep all
639
+ # the default parameter values, pass an empty Hash as a request object (see above).
640
+ #
641
+ # @param name [::String]
642
+ # Required. Name of the resource to get in the format:
643
+ # `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
644
+ # @yield [result, operation] Access the result along with the TransportOperation object
645
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::PartnerPermissions]
646
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
647
+ #
648
+ # @return [::Google::Cloud::CloudControlsPartner::V1::PartnerPermissions]
649
+ #
650
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
651
+ #
652
+ # @example Basic example
653
+ # require "google/cloud/cloud_controls_partner/v1"
654
+ #
655
+ # # Create a client object. The client can be reused for multiple calls.
656
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
657
+ #
658
+ # # Create a request. To set request fields, pass in keyword arguments.
659
+ # request = Google::Cloud::CloudControlsPartner::V1::GetPartnerPermissionsRequest.new
660
+ #
661
+ # # Call the get_partner_permissions method.
662
+ # result = client.get_partner_permissions request
663
+ #
664
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::PartnerPermissions.
665
+ # p result
666
+ #
667
+ def get_partner_permissions request, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request.nil?
669
+
670
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetPartnerPermissionsRequest
671
+
672
+ # Converts hash and nil to an options object
673
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
674
+
675
+ # Customize the options with defaults
676
+ call_metadata = @config.rpcs.get_partner_permissions.metadata.to_h
677
+
678
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
679
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
680
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
681
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
682
+ transports_version_send: [:rest]
683
+
684
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
685
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
686
+
687
+ options.apply_defaults timeout: @config.rpcs.get_partner_permissions.timeout,
688
+ metadata: call_metadata,
689
+ retry_policy: @config.rpcs.get_partner_permissions.retry_policy
690
+
691
+ options.apply_defaults timeout: @config.timeout,
692
+ metadata: @config.metadata,
693
+ retry_policy: @config.retry_policy
694
+
695
+ @cloud_controls_partner_core_stub.get_partner_permissions request, options do |result, operation|
696
+ yield result, operation if block_given?
697
+ return result
698
+ end
699
+ rescue ::Gapic::Rest::Error => e
700
+ raise ::Google::Cloud::Error.from_error(e)
701
+ end
702
+
703
+ ##
704
+ # Deprecated: Only returns access approval requests directly associated with
705
+ # an assured workload folder.
706
+ #
707
+ # @overload list_access_approval_requests(request, options = nil)
708
+ # Pass arguments to `list_access_approval_requests` via a request object, either of type
709
+ # {::Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsRequest} or an equivalent Hash.
710
+ #
711
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsRequest, ::Hash]
712
+ # A request object representing the call parameters. Required. To specify no
713
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
714
+ # @param options [::Gapic::CallOptions, ::Hash]
715
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
716
+ #
717
+ # @overload list_access_approval_requests(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
718
+ # Pass arguments to `list_access_approval_requests` via keyword arguments. Note that at
719
+ # least one keyword argument is required. To specify no parameters, or to keep all
720
+ # the default parameter values, pass an empty Hash as a request object (see above).
721
+ #
722
+ # @param parent [::String]
723
+ # Required. Parent resource
724
+ # Format:
725
+ # `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
726
+ # @param page_size [::Integer]
727
+ # Optional. The maximum number of access requests to return. The service may
728
+ # return fewer than this value. If unspecified, at most 500 access requests
729
+ # will be returned.
730
+ # @param page_token [::String]
731
+ # Optional. A page token, received from a previous
732
+ # `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
733
+ # page.
734
+ # @param filter [::String]
735
+ # Optional. Filtering results.
736
+ # @param order_by [::String]
737
+ # Optional. Hint for how to order the results.
738
+ # @yield [result, operation] Access the result along with the TransportOperation object
739
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsResponse]
740
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
741
+ #
742
+ # @return [::Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsResponse]
743
+ #
744
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
745
+ #
746
+ # @example Basic example
747
+ # require "google/cloud/cloud_controls_partner/v1"
748
+ #
749
+ # # Create a client object. The client can be reused for multiple calls.
750
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
751
+ #
752
+ # # Create a request. To set request fields, pass in keyword arguments.
753
+ # request = Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsRequest.new
754
+ #
755
+ # # Call the list_access_approval_requests method.
756
+ # result = client.list_access_approval_requests request
757
+ #
758
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
759
+ # # over elements, and API calls will be issued to fetch pages as needed.
760
+ # result.each do |item|
761
+ # # Each element is of type ::Google::Cloud::CloudControlsPartner::V1::AccessApprovalRequest.
762
+ # p item
763
+ # end
764
+ #
765
+ def list_access_approval_requests request, options = nil
766
+ raise ::ArgumentError, "request must be provided" if request.nil?
767
+
768
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::ListAccessApprovalRequestsRequest
769
+
770
+ # Converts hash and nil to an options object
771
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
772
+
773
+ # Customize the options with defaults
774
+ call_metadata = @config.rpcs.list_access_approval_requests.metadata.to_h
775
+
776
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
777
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
778
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
779
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
780
+ transports_version_send: [:rest]
781
+
782
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
783
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
784
+
785
+ options.apply_defaults timeout: @config.rpcs.list_access_approval_requests.timeout,
786
+ metadata: call_metadata,
787
+ retry_policy: @config.rpcs.list_access_approval_requests.retry_policy
788
+
789
+ options.apply_defaults timeout: @config.timeout,
790
+ metadata: @config.metadata,
791
+ retry_policy: @config.retry_policy
792
+
793
+ @cloud_controls_partner_core_stub.list_access_approval_requests request, options do |result, operation|
794
+ yield result, operation if block_given?
795
+ return result
796
+ end
797
+ rescue ::Gapic::Rest::Error => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
801
+ ##
802
+ # Get details of a Partner.
803
+ #
804
+ # @overload get_partner(request, options = nil)
805
+ # Pass arguments to `get_partner` via a request object, either of type
806
+ # {::Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest} or an equivalent Hash.
807
+ #
808
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest, ::Hash]
809
+ # A request object representing the call parameters. Required. To specify no
810
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
811
+ # @param options [::Gapic::CallOptions, ::Hash]
812
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
813
+ #
814
+ # @overload get_partner(name: nil)
815
+ # Pass arguments to `get_partner` via keyword arguments. Note that at
816
+ # least one keyword argument is required. To specify no parameters, or to keep all
817
+ # the default parameter values, pass an empty Hash as a request object (see above).
818
+ #
819
+ # @param name [::String]
820
+ # Required. Format:
821
+ # `organizations/{organization}/locations/{location}/partner`
822
+ # @yield [result, operation] Access the result along with the TransportOperation object
823
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Partner]
824
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
825
+ #
826
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Partner]
827
+ #
828
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
829
+ #
830
+ # @example Basic example
831
+ # require "google/cloud/cloud_controls_partner/v1"
832
+ #
833
+ # # Create a client object. The client can be reused for multiple calls.
834
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
835
+ #
836
+ # # Create a request. To set request fields, pass in keyword arguments.
837
+ # request = Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest.new
838
+ #
839
+ # # Call the get_partner method.
840
+ # result = client.get_partner request
841
+ #
842
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Partner.
843
+ # p result
844
+ #
845
+ def get_partner request, options = nil
846
+ raise ::ArgumentError, "request must be provided" if request.nil?
847
+
848
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest
849
+
850
+ # Converts hash and nil to an options object
851
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
852
+
853
+ # Customize the options with defaults
854
+ call_metadata = @config.rpcs.get_partner.metadata.to_h
855
+
856
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
857
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
858
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
859
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
860
+ transports_version_send: [:rest]
861
+
862
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
863
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
864
+
865
+ options.apply_defaults timeout: @config.rpcs.get_partner.timeout,
866
+ metadata: call_metadata,
867
+ retry_policy: @config.rpcs.get_partner.retry_policy
868
+
869
+ options.apply_defaults timeout: @config.timeout,
870
+ metadata: @config.metadata,
871
+ retry_policy: @config.retry_policy
872
+
873
+ @cloud_controls_partner_core_stub.get_partner request, options do |result, operation|
874
+ yield result, operation if block_given?
875
+ return result
876
+ end
877
+ rescue ::Gapic::Rest::Error => e
878
+ raise ::Google::Cloud::Error.from_error(e)
879
+ end
880
+
881
+ ##
882
+ # Configuration class for the CloudControlsPartnerCore REST API.
883
+ #
884
+ # This class represents the configuration for CloudControlsPartnerCore REST,
885
+ # providing control over timeouts, retry behavior, logging, transport
886
+ # parameters, and other low-level controls. Certain parameters can also be
887
+ # applied individually to specific RPCs. See
888
+ # {::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client::Configuration::Rpcs}
889
+ # for a list of RPCs that can be configured independently.
890
+ #
891
+ # Configuration can be applied globally to all clients, or to a single client
892
+ # on construction.
893
+ #
894
+ # @example
895
+ #
896
+ # # Modify the global config, setting the timeout for
897
+ # # get_workload to 20 seconds,
898
+ # # and all remaining timeouts to 10 seconds.
899
+ # ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.configure do |config|
900
+ # config.timeout = 10.0
901
+ # config.rpcs.get_workload.timeout = 20.0
902
+ # end
903
+ #
904
+ # # Apply the above configuration only to a new client.
905
+ # client = ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new do |config|
906
+ # config.timeout = 10.0
907
+ # config.rpcs.get_workload.timeout = 20.0
908
+ # end
909
+ #
910
+ # @!attribute [rw] endpoint
911
+ # A custom service endpoint, as a hostname or hostname:port. The default is
912
+ # nil, indicating to use the default endpoint in the current universe domain.
913
+ # @return [::String,nil]
914
+ # @!attribute [rw] credentials
915
+ # Credentials to send with calls. You may provide any of the following types:
916
+ # * (`String`) The path to a service account key file in JSON format
917
+ # * (`Hash`) A service account key as a Hash
918
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
919
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
920
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
921
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
922
+ # * (`nil`) indicating no credentials
923
+ # @return [::Object]
924
+ # @!attribute [rw] scope
925
+ # The OAuth scopes
926
+ # @return [::Array<::String>]
927
+ # @!attribute [rw] lib_name
928
+ # The library name as recorded in instrumentation and logging
929
+ # @return [::String]
930
+ # @!attribute [rw] lib_version
931
+ # The library version as recorded in instrumentation and logging
932
+ # @return [::String]
933
+ # @!attribute [rw] timeout
934
+ # The call timeout in seconds.
935
+ # @return [::Numeric]
936
+ # @!attribute [rw] metadata
937
+ # Additional headers to be sent with the call.
938
+ # @return [::Hash{::Symbol=>::String}]
939
+ # @!attribute [rw] retry_policy
940
+ # The retry policy. The value is a hash with the following keys:
941
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
942
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
943
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
944
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
945
+ # trigger a retry.
946
+ # @return [::Hash]
947
+ # @!attribute [rw] quota_project
948
+ # A separate project against which to charge quota.
949
+ # @return [::String]
950
+ # @!attribute [rw] universe_domain
951
+ # The universe domain within which to make requests. This determines the
952
+ # default endpoint URL. The default value of nil uses the environment
953
+ # universe (usually the default "googleapis.com" universe).
954
+ # @return [::String,nil]
955
+ #
956
+ class Configuration
957
+ extend ::Gapic::Config
958
+
959
+ # @private
960
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
961
+ DEFAULT_ENDPOINT = "cloudcontrolspartner.googleapis.com"
962
+
963
+ config_attr :endpoint, nil, ::String, nil
964
+ config_attr :credentials, nil do |value|
965
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
966
+ allowed.any? { |klass| klass === value }
967
+ end
968
+ config_attr :scope, nil, ::String, ::Array, nil
969
+ config_attr :lib_name, nil, ::String, nil
970
+ config_attr :lib_version, nil, ::String, nil
971
+ config_attr :timeout, nil, ::Numeric, nil
972
+ config_attr :metadata, nil, ::Hash, nil
973
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
974
+ config_attr :quota_project, nil, ::String, nil
975
+ config_attr :universe_domain, nil, ::String, nil
976
+
977
+ # @private
978
+ def initialize parent_config = nil
979
+ @parent_config = parent_config unless parent_config.nil?
980
+
981
+ yield self if block_given?
982
+ end
983
+
984
+ ##
985
+ # Configurations for individual RPCs
986
+ # @return [Rpcs]
987
+ #
988
+ def rpcs
989
+ @rpcs ||= begin
990
+ parent_rpcs = nil
991
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
992
+ Rpcs.new parent_rpcs
993
+ end
994
+ end
995
+
996
+ ##
997
+ # Configuration RPC class for the CloudControlsPartnerCore API.
998
+ #
999
+ # Includes fields providing the configuration for each RPC in this service.
1000
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1001
+ # the following configuration fields:
1002
+ #
1003
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1004
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1005
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1006
+ # include the following keys:
1007
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1008
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1009
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1010
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1011
+ # trigger a retry.
1012
+ #
1013
+ class Rpcs
1014
+ ##
1015
+ # RPC-specific configuration for `get_workload`
1016
+ # @return [::Gapic::Config::Method]
1017
+ #
1018
+ attr_reader :get_workload
1019
+ ##
1020
+ # RPC-specific configuration for `list_workloads`
1021
+ # @return [::Gapic::Config::Method]
1022
+ #
1023
+ attr_reader :list_workloads
1024
+ ##
1025
+ # RPC-specific configuration for `get_customer`
1026
+ # @return [::Gapic::Config::Method]
1027
+ #
1028
+ attr_reader :get_customer
1029
+ ##
1030
+ # RPC-specific configuration for `list_customers`
1031
+ # @return [::Gapic::Config::Method]
1032
+ #
1033
+ attr_reader :list_customers
1034
+ ##
1035
+ # RPC-specific configuration for `get_ekm_connections`
1036
+ # @return [::Gapic::Config::Method]
1037
+ #
1038
+ attr_reader :get_ekm_connections
1039
+ ##
1040
+ # RPC-specific configuration for `get_partner_permissions`
1041
+ # @return [::Gapic::Config::Method]
1042
+ #
1043
+ attr_reader :get_partner_permissions
1044
+ ##
1045
+ # RPC-specific configuration for `list_access_approval_requests`
1046
+ # @return [::Gapic::Config::Method]
1047
+ #
1048
+ attr_reader :list_access_approval_requests
1049
+ ##
1050
+ # RPC-specific configuration for `get_partner`
1051
+ # @return [::Gapic::Config::Method]
1052
+ #
1053
+ attr_reader :get_partner
1054
+
1055
+ # @private
1056
+ def initialize parent_rpcs = nil
1057
+ get_workload_config = parent_rpcs.get_workload if parent_rpcs.respond_to? :get_workload
1058
+ @get_workload = ::Gapic::Config::Method.new get_workload_config
1059
+ list_workloads_config = parent_rpcs.list_workloads if parent_rpcs.respond_to? :list_workloads
1060
+ @list_workloads = ::Gapic::Config::Method.new list_workloads_config
1061
+ get_customer_config = parent_rpcs.get_customer if parent_rpcs.respond_to? :get_customer
1062
+ @get_customer = ::Gapic::Config::Method.new get_customer_config
1063
+ list_customers_config = parent_rpcs.list_customers if parent_rpcs.respond_to? :list_customers
1064
+ @list_customers = ::Gapic::Config::Method.new list_customers_config
1065
+ get_ekm_connections_config = parent_rpcs.get_ekm_connections if parent_rpcs.respond_to? :get_ekm_connections
1066
+ @get_ekm_connections = ::Gapic::Config::Method.new get_ekm_connections_config
1067
+ get_partner_permissions_config = parent_rpcs.get_partner_permissions if parent_rpcs.respond_to? :get_partner_permissions
1068
+ @get_partner_permissions = ::Gapic::Config::Method.new get_partner_permissions_config
1069
+ list_access_approval_requests_config = parent_rpcs.list_access_approval_requests if parent_rpcs.respond_to? :list_access_approval_requests
1070
+ @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1071
+ get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1072
+ @get_partner = ::Gapic::Config::Method.new get_partner_config
1073
+
1074
+ yield self if block_given?
1075
+ end
1076
+ end
1077
+ end
1078
+ end
1079
+ end
1080
+ end
1081
+ end
1082
+ end
1083
+ end
1084
+ end