google-cloud-cloud_controls_partner-v1beta 0.a → 0.1.0

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