google-cloud-cloud_controls_partner-v1 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/v1/cloud_controls_partner_core/client.rb +1157 -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 +1072 -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 +551 -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 +510 -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 +59 -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,1072 @@
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
+ 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::V1::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::V1::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", "V1"]
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::V1::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::V1::CloudControlsPartnerCore::Rest::Client.new
149
+ #
150
+ # # Create a client using a custom configuration
151
+ # client = ::Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::GetWorkloadRequest} or an equivalent Hash.
197
+ #
198
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::Workload]
214
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
215
+ #
216
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::ListWorkloadsRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::ListWorkloadsResponse]
304
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
305
+ #
306
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
312
+ #
313
+ # # Create a client object. The client can be reused for multiple calls.
314
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
315
+ #
316
+ # # Create a request. To set request fields, pass in keyword arguments.
317
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::GetCustomerRequest} or an equivalent Hash.
370
+ #
371
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::Customer]
387
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
388
+ #
389
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
395
+ #
396
+ # # Create a client object. The client can be reused for multiple calls.
397
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
398
+ #
399
+ # # Create a request. To set request fields, pass in keyword arguments.
400
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::ListCustomersRequest} or an equivalent Hash.
449
+ #
450
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::ListCustomersResponse]
476
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
477
+ #
478
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
484
+ #
485
+ # # Create a client object. The client can be reused for multiple calls.
486
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
487
+ #
488
+ # # Create a request. To set request fields, pass in keyword arguments.
489
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::GetEkmConnectionsRequest} or an equivalent Hash.
542
+ #
543
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::EkmConnections]
559
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
560
+ #
561
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
567
+ #
568
+ # # Create a client object. The client can be reused for multiple calls.
569
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
570
+ #
571
+ # # Create a request. To set request fields, pass in keyword arguments.
572
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::GetPartnerPermissionsRequest} or an equivalent Hash.
621
+ #
622
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::PartnerPermissions]
638
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
639
+ #
640
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
646
+ #
647
+ # # Create a client object. The client can be reused for multiple calls.
648
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
649
+ #
650
+ # # Create a request. To set request fields, pass in keyword arguments.
651
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::ListAccessApprovalRequestsRequest} or an equivalent Hash.
700
+ #
701
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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::V1::ListAccessApprovalRequestsResponse]
730
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
731
+ #
732
+ # @return [::Google::Cloud::CloudControlsPartner::V1::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/v1"
738
+ #
739
+ # # Create a client object. The client can be reused for multiple calls.
740
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
741
+ #
742
+ # # Create a request. To set request fields, pass in keyword arguments.
743
+ # request = Google::Cloud::CloudControlsPartner::V1::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::V1::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::V1::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::V1::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::V1::GetPartnerRequest} or an equivalent Hash.
796
+ #
797
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::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:
810
+ # `organizations/{organization}/locations/{location}/partner`
811
+ # @yield [result, operation] Access the result along with the TransportOperation object
812
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Partner]
813
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
814
+ #
815
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Partner]
816
+ #
817
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
818
+ #
819
+ # @example Basic example
820
+ # require "google/cloud/cloud_controls_partner/v1"
821
+ #
822
+ # # Create a client object. The client can be reused for multiple calls.
823
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
824
+ #
825
+ # # Create a request. To set request fields, pass in keyword arguments.
826
+ # request = Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest.new
827
+ #
828
+ # # Call the get_partner method.
829
+ # result = client.get_partner request
830
+ #
831
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Partner.
832
+ # p result
833
+ #
834
+ def get_partner request, options = nil
835
+ raise ::ArgumentError, "request must be provided" if request.nil?
836
+
837
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::GetPartnerRequest
838
+
839
+ # Converts hash and nil to an options object
840
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
841
+
842
+ # Customize the options with defaults
843
+ call_metadata = @config.rpcs.get_partner.metadata.to_h
844
+
845
+ # Set x-goog-api-client and x-goog-user-project headers
846
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
847
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
848
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
849
+ transports_version_send: [:rest]
850
+
851
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
852
+
853
+ options.apply_defaults timeout: @config.rpcs.get_partner.timeout,
854
+ metadata: call_metadata,
855
+ retry_policy: @config.rpcs.get_partner.retry_policy
856
+
857
+ options.apply_defaults timeout: @config.timeout,
858
+ metadata: @config.metadata,
859
+ retry_policy: @config.retry_policy
860
+
861
+ @cloud_controls_partner_core_stub.get_partner request, options do |result, operation|
862
+ yield result, operation if block_given?
863
+ return result
864
+ end
865
+ rescue ::Gapic::Rest::Error => e
866
+ raise ::Google::Cloud::Error.from_error(e)
867
+ end
868
+
869
+ ##
870
+ # Configuration class for the CloudControlsPartnerCore REST API.
871
+ #
872
+ # This class represents the configuration for CloudControlsPartnerCore REST,
873
+ # providing control over timeouts, retry behavior, logging, transport
874
+ # parameters, and other low-level controls. Certain parameters can also be
875
+ # applied individually to specific RPCs. See
876
+ # {::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client::Configuration::Rpcs}
877
+ # for a list of RPCs that can be configured independently.
878
+ #
879
+ # Configuration can be applied globally to all clients, or to a single client
880
+ # on construction.
881
+ #
882
+ # @example
883
+ #
884
+ # # Modify the global config, setting the timeout for
885
+ # # get_workload to 20 seconds,
886
+ # # and all remaining timeouts to 10 seconds.
887
+ # ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.configure do |config|
888
+ # config.timeout = 10.0
889
+ # config.rpcs.get_workload.timeout = 20.0
890
+ # end
891
+ #
892
+ # # Apply the above configuration only to a new client.
893
+ # client = ::Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new do |config|
894
+ # config.timeout = 10.0
895
+ # config.rpcs.get_workload.timeout = 20.0
896
+ # end
897
+ #
898
+ # @!attribute [rw] endpoint
899
+ # A custom service endpoint, as a hostname or hostname:port. The default is
900
+ # nil, indicating to use the default endpoint in the current universe domain.
901
+ # @return [::String,nil]
902
+ # @!attribute [rw] credentials
903
+ # Credentials to send with calls. You may provide any of the following types:
904
+ # * (`String`) The path to a service account key file in JSON format
905
+ # * (`Hash`) A service account key as a Hash
906
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
907
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
908
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
909
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
910
+ # * (`nil`) indicating no credentials
911
+ # @return [::Object]
912
+ # @!attribute [rw] scope
913
+ # The OAuth scopes
914
+ # @return [::Array<::String>]
915
+ # @!attribute [rw] lib_name
916
+ # The library name as recorded in instrumentation and logging
917
+ # @return [::String]
918
+ # @!attribute [rw] lib_version
919
+ # The library version as recorded in instrumentation and logging
920
+ # @return [::String]
921
+ # @!attribute [rw] timeout
922
+ # The call timeout in seconds.
923
+ # @return [::Numeric]
924
+ # @!attribute [rw] metadata
925
+ # Additional headers to be sent with the call.
926
+ # @return [::Hash{::Symbol=>::String}]
927
+ # @!attribute [rw] retry_policy
928
+ # The retry policy. The value is a hash with the following keys:
929
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
930
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
931
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
932
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
933
+ # trigger a retry.
934
+ # @return [::Hash]
935
+ # @!attribute [rw] quota_project
936
+ # A separate project against which to charge quota.
937
+ # @return [::String]
938
+ # @!attribute [rw] universe_domain
939
+ # The universe domain within which to make requests. This determines the
940
+ # default endpoint URL. The default value of nil uses the environment
941
+ # universe (usually the default "googleapis.com" universe).
942
+ # @return [::String,nil]
943
+ #
944
+ class Configuration
945
+ extend ::Gapic::Config
946
+
947
+ # @private
948
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
949
+ DEFAULT_ENDPOINT = "cloudcontrolspartner.googleapis.com"
950
+
951
+ config_attr :endpoint, nil, ::String, nil
952
+ config_attr :credentials, nil do |value|
953
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
954
+ allowed.any? { |klass| klass === value }
955
+ end
956
+ config_attr :scope, nil, ::String, ::Array, nil
957
+ config_attr :lib_name, nil, ::String, nil
958
+ config_attr :lib_version, nil, ::String, nil
959
+ config_attr :timeout, nil, ::Numeric, nil
960
+ config_attr :metadata, nil, ::Hash, nil
961
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
962
+ config_attr :quota_project, nil, ::String, nil
963
+ config_attr :universe_domain, nil, ::String, nil
964
+
965
+ # @private
966
+ def initialize parent_config = nil
967
+ @parent_config = parent_config unless parent_config.nil?
968
+
969
+ yield self if block_given?
970
+ end
971
+
972
+ ##
973
+ # Configurations for individual RPCs
974
+ # @return [Rpcs]
975
+ #
976
+ def rpcs
977
+ @rpcs ||= begin
978
+ parent_rpcs = nil
979
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
980
+ Rpcs.new parent_rpcs
981
+ end
982
+ end
983
+
984
+ ##
985
+ # Configuration RPC class for the CloudControlsPartnerCore API.
986
+ #
987
+ # Includes fields providing the configuration for each RPC in this service.
988
+ # Each configuration object is of type `Gapic::Config::Method` and includes
989
+ # the following configuration fields:
990
+ #
991
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
992
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
993
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
994
+ # include the following keys:
995
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
996
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
997
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
998
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
999
+ # trigger a retry.
1000
+ #
1001
+ class Rpcs
1002
+ ##
1003
+ # RPC-specific configuration for `get_workload`
1004
+ # @return [::Gapic::Config::Method]
1005
+ #
1006
+ attr_reader :get_workload
1007
+ ##
1008
+ # RPC-specific configuration for `list_workloads`
1009
+ # @return [::Gapic::Config::Method]
1010
+ #
1011
+ attr_reader :list_workloads
1012
+ ##
1013
+ # RPC-specific configuration for `get_customer`
1014
+ # @return [::Gapic::Config::Method]
1015
+ #
1016
+ attr_reader :get_customer
1017
+ ##
1018
+ # RPC-specific configuration for `list_customers`
1019
+ # @return [::Gapic::Config::Method]
1020
+ #
1021
+ attr_reader :list_customers
1022
+ ##
1023
+ # RPC-specific configuration for `get_ekm_connections`
1024
+ # @return [::Gapic::Config::Method]
1025
+ #
1026
+ attr_reader :get_ekm_connections
1027
+ ##
1028
+ # RPC-specific configuration for `get_partner_permissions`
1029
+ # @return [::Gapic::Config::Method]
1030
+ #
1031
+ attr_reader :get_partner_permissions
1032
+ ##
1033
+ # RPC-specific configuration for `list_access_approval_requests`
1034
+ # @return [::Gapic::Config::Method]
1035
+ #
1036
+ attr_reader :list_access_approval_requests
1037
+ ##
1038
+ # RPC-specific configuration for `get_partner`
1039
+ # @return [::Gapic::Config::Method]
1040
+ #
1041
+ attr_reader :get_partner
1042
+
1043
+ # @private
1044
+ def initialize parent_rpcs = nil
1045
+ get_workload_config = parent_rpcs.get_workload if parent_rpcs.respond_to? :get_workload
1046
+ @get_workload = ::Gapic::Config::Method.new get_workload_config
1047
+ list_workloads_config = parent_rpcs.list_workloads if parent_rpcs.respond_to? :list_workloads
1048
+ @list_workloads = ::Gapic::Config::Method.new list_workloads_config
1049
+ get_customer_config = parent_rpcs.get_customer if parent_rpcs.respond_to? :get_customer
1050
+ @get_customer = ::Gapic::Config::Method.new get_customer_config
1051
+ list_customers_config = parent_rpcs.list_customers if parent_rpcs.respond_to? :list_customers
1052
+ @list_customers = ::Gapic::Config::Method.new list_customers_config
1053
+ get_ekm_connections_config = parent_rpcs.get_ekm_connections if parent_rpcs.respond_to? :get_ekm_connections
1054
+ @get_ekm_connections = ::Gapic::Config::Method.new get_ekm_connections_config
1055
+ get_partner_permissions_config = parent_rpcs.get_partner_permissions if parent_rpcs.respond_to? :get_partner_permissions
1056
+ @get_partner_permissions = ::Gapic::Config::Method.new get_partner_permissions_config
1057
+ list_access_approval_requests_config = parent_rpcs.list_access_approval_requests if parent_rpcs.respond_to? :list_access_approval_requests
1058
+ @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1059
+ get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1060
+ @get_partner = ::Gapic::Config::Method.new get_partner_config
1061
+
1062
+ yield self if block_given?
1063
+ end
1064
+ end
1065
+ end
1066
+ end
1067
+ end
1068
+ end
1069
+ end
1070
+ end
1071
+ end
1072
+ end