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