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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/client.rb +1156 -0
  6. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/credentials.rb +47 -0
  7. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/paths.rb +149 -0
  8. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest/client.rb +1071 -0
  9. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest/service_stub.rb +541 -0
  10. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest.rb +52 -0
  11. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core.rb +55 -0
  12. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/client.rb +551 -0
  13. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/credentials.rb +47 -0
  14. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/paths.rb +77 -0
  15. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest/client.rb +510 -0
  16. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest/service_stub.rb +187 -0
  17. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest.rb +52 -0
  18. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring.rb +55 -0
  19. data/lib/google/cloud/cloud_controls_partner/v1beta/rest.rb +38 -0
  20. data/lib/google/cloud/cloud_controls_partner/v1beta/version.rb +7 -2
  21. data/lib/google/cloud/cloud_controls_partner/v1beta.rb +46 -0
  22. data/lib/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests_pb.rb +51 -0
  23. data/lib/google/cloud/cloudcontrolspartner/v1beta/completion_state_pb.rb +42 -0
  24. data/lib/google/cloud/cloudcontrolspartner/v1beta/core_pb.rb +55 -0
  25. data/lib/google/cloud/cloudcontrolspartner/v1beta/core_services_pb.rb +59 -0
  26. data/lib/google/cloud/cloudcontrolspartner/v1beta/customer_workloads_pb.rb +55 -0
  27. data/lib/google/cloud/cloudcontrolspartner/v1beta/customers_pb.rb +54 -0
  28. data/lib/google/cloud/cloudcontrolspartner/v1beta/ekm_connections_pb.rb +49 -0
  29. data/lib/google/cloud/cloudcontrolspartner/v1beta/monitoring_pb.rb +45 -0
  30. data/lib/google/cloud/cloudcontrolspartner/v1beta/monitoring_services_pb.rb +53 -0
  31. data/lib/google/cloud/cloudcontrolspartner/v1beta/partner_permissions_pb.rb +47 -0
  32. data/lib/google/cloud/cloudcontrolspartner/v1beta/partners_pb.rb +51 -0
  33. data/lib/google/cloud/cloudcontrolspartner/v1beta/violations_pb.rb +58 -0
  34. data/lib/google-cloud-cloud_controls_partner-v1beta.rb +21 -0
  35. data/proto_docs/README.md +4 -0
  36. data/proto_docs/google/api/client.rb +399 -0
  37. data/proto_docs/google/api/field_behavior.rb +85 -0
  38. data/proto_docs/google/api/launch_stage.rb +71 -0
  39. data/proto_docs/google/api/resource.rb +222 -0
  40. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.rb +143 -0
  41. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/completion_state.rb +44 -0
  42. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/core.rb +57 -0
  43. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.rb +177 -0
  44. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/customers.rb +134 -0
  45. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.rb +96 -0
  46. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.rb +66 -0
  47. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/partners.rb +116 -0
  48. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/violations.rb +229 -0
  49. data/proto_docs/google/protobuf/duration.rb +98 -0
  50. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  51. data/proto_docs/google/type/interval.rb +45 -0
  52. metadata +94 -11
@@ -0,0 +1,1156 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/cloudcontrolspartner/v1beta/core_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module CloudControlsPartner
25
+ module V1beta
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::V1beta::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::V1beta::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", "V1beta"]
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::V1beta::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::V1beta::CloudControlsPartnerCore::Client.new
147
+ #
148
+ # # Create a client using a custom configuration
149
+ # client = ::Google::Cloud::CloudControlsPartner::V1beta::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/v1beta/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::V1beta::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::V1beta::GetWorkloadRequest} or an equivalent Hash.
204
+ #
205
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::Workload]
222
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
223
+ #
224
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Workload]
225
+ #
226
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
+ #
228
+ # @example Basic example
229
+ # require "google/cloud/cloud_controls_partner/v1beta"
230
+ #
231
+ # # Create a client object. The client can be reused for multiple calls.
232
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
233
+ #
234
+ # # Create a request. To set request fields, pass in keyword arguments.
235
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::ListWorkloadsRequest} or an equivalent Hash.
290
+ #
291
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::Workload>]
319
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
320
+ #
321
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudControlsPartner::V1beta::Workload>]
322
+ #
323
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
324
+ #
325
+ # @example Basic example
326
+ # require "google/cloud/cloud_controls_partner/v1beta"
327
+ #
328
+ # # Create a client object. The client can be reused for multiple calls.
329
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
330
+ #
331
+ # # Create a request. To set request fields, pass in keyword arguments.
332
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::GetCustomerRequest} or an equivalent Hash.
392
+ #
393
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::Customer]
410
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
411
+ #
412
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Customer]
413
+ #
414
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
415
+ #
416
+ # @example Basic example
417
+ # require "google/cloud/cloud_controls_partner/v1beta"
418
+ #
419
+ # # Create a client object. The client can be reused for multiple calls.
420
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
421
+ #
422
+ # # Create a request. To set request fields, pass in keyword arguments.
423
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::ListCustomersRequest} or an equivalent Hash.
478
+ #
479
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::Customer>]
506
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
507
+ #
508
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudControlsPartner::V1beta::Customer>]
509
+ #
510
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
511
+ #
512
+ # @example Basic example
513
+ # require "google/cloud/cloud_controls_partner/v1beta"
514
+ #
515
+ # # Create a client object. The client can be reused for multiple calls.
516
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
517
+ #
518
+ # # Create a request. To set request fields, pass in keyword arguments.
519
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::GetEkmConnectionsRequest} or an equivalent Hash.
579
+ #
580
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::EkmConnections]
597
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
598
+ #
599
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::EkmConnections]
600
+ #
601
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
602
+ #
603
+ # @example Basic example
604
+ # require "google/cloud/cloud_controls_partner/v1beta"
605
+ #
606
+ # # Create a client object. The client can be reused for multiple calls.
607
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
608
+ #
609
+ # # Create a request. To set request fields, pass in keyword arguments.
610
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::GetPartnerPermissionsRequest} or an equivalent Hash.
665
+ #
666
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::PartnerPermissions]
683
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
684
+ #
685
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::PartnerPermissions]
686
+ #
687
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
688
+ #
689
+ # @example Basic example
690
+ # require "google/cloud/cloud_controls_partner/v1beta"
691
+ #
692
+ # # Create a client object. The client can be reused for multiple calls.
693
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
694
+ #
695
+ # # Create a request. To set request fields, pass in keyword arguments.
696
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::ListAccessApprovalRequestsRequest} or an equivalent Hash.
751
+ #
752
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::AccessApprovalRequest>]
782
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
783
+ #
784
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudControlsPartner::V1beta::AccessApprovalRequest>]
785
+ #
786
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
787
+ #
788
+ # @example Basic example
789
+ # require "google/cloud/cloud_controls_partner/v1beta"
790
+ #
791
+ # # Create a client object. The client can be reused for multiple calls.
792
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
793
+ #
794
+ # # Create a request. To set request fields, pass in keyword arguments.
795
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::GetPartnerRequest} or an equivalent Hash.
855
+ #
856
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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: organizations/\\{organization}/locations/\\{location}/partner
869
+ #
870
+ # @yield [response, operation] Access the result along with the RPC operation
871
+ # @yieldparam response [::Google::Cloud::CloudControlsPartner::V1beta::Partner]
872
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
873
+ #
874
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Partner]
875
+ #
876
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
877
+ #
878
+ # @example Basic example
879
+ # require "google/cloud/cloud_controls_partner/v1beta"
880
+ #
881
+ # # Create a client object. The client can be reused for multiple calls.
882
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
883
+ #
884
+ # # Create a request. To set request fields, pass in keyword arguments.
885
+ # request = Google::Cloud::CloudControlsPartner::V1beta::GetPartnerRequest.new
886
+ #
887
+ # # Call the get_partner method.
888
+ # result = client.get_partner request
889
+ #
890
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1beta::Partner.
891
+ # p result
892
+ #
893
+ def get_partner request, options = nil
894
+ raise ::ArgumentError, "request must be provided" if request.nil?
895
+
896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1beta::GetPartnerRequest
897
+
898
+ # Converts hash and nil to an options object
899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
900
+
901
+ # Customize the options with defaults
902
+ metadata = @config.rpcs.get_partner.metadata.to_h
903
+
904
+ # Set x-goog-api-client and x-goog-user-project headers
905
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
907
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1beta::VERSION
908
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
909
+
910
+ header_params = {}
911
+ if request.name
912
+ header_params["name"] = request.name
913
+ end
914
+
915
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
916
+ metadata[:"x-goog-request-params"] ||= request_params_header
917
+
918
+ options.apply_defaults timeout: @config.rpcs.get_partner.timeout,
919
+ metadata: metadata,
920
+ retry_policy: @config.rpcs.get_partner.retry_policy
921
+
922
+ options.apply_defaults timeout: @config.timeout,
923
+ metadata: @config.metadata,
924
+ retry_policy: @config.retry_policy
925
+
926
+ @cloud_controls_partner_core_stub.call_rpc :get_partner, request, options: options do |response, operation|
927
+ yield response, operation if block_given?
928
+ return response
929
+ end
930
+ rescue ::GRPC::BadStatus => e
931
+ raise ::Google::Cloud::Error.from_error(e)
932
+ end
933
+
934
+ ##
935
+ # Configuration class for the CloudControlsPartnerCore API.
936
+ #
937
+ # This class represents the configuration for CloudControlsPartnerCore,
938
+ # providing control over timeouts, retry behavior, logging, transport
939
+ # parameters, and other low-level controls. Certain parameters can also be
940
+ # applied individually to specific RPCs. See
941
+ # {::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client::Configuration::Rpcs}
942
+ # for a list of RPCs that can be configured independently.
943
+ #
944
+ # Configuration can be applied globally to all clients, or to a single client
945
+ # on construction.
946
+ #
947
+ # @example
948
+ #
949
+ # # Modify the global config, setting the timeout for
950
+ # # get_workload to 20 seconds,
951
+ # # and all remaining timeouts to 10 seconds.
952
+ # ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.configure do |config|
953
+ # config.timeout = 10.0
954
+ # config.rpcs.get_workload.timeout = 20.0
955
+ # end
956
+ #
957
+ # # Apply the above configuration only to a new client.
958
+ # client = ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new do |config|
959
+ # config.timeout = 10.0
960
+ # config.rpcs.get_workload.timeout = 20.0
961
+ # end
962
+ #
963
+ # @!attribute [rw] endpoint
964
+ # A custom service endpoint, as a hostname or hostname:port. The default is
965
+ # nil, indicating to use the default endpoint in the current universe domain.
966
+ # @return [::String,nil]
967
+ # @!attribute [rw] credentials
968
+ # Credentials to send with calls. You may provide any of the following types:
969
+ # * (`String`) The path to a service account key file in JSON format
970
+ # * (`Hash`) A service account key as a Hash
971
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
972
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
973
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
974
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
975
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
976
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
977
+ # * (`nil`) indicating no credentials
978
+ # @return [::Object]
979
+ # @!attribute [rw] scope
980
+ # The OAuth scopes
981
+ # @return [::Array<::String>]
982
+ # @!attribute [rw] lib_name
983
+ # The library name as recorded in instrumentation and logging
984
+ # @return [::String]
985
+ # @!attribute [rw] lib_version
986
+ # The library version as recorded in instrumentation and logging
987
+ # @return [::String]
988
+ # @!attribute [rw] channel_args
989
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
990
+ # `GRPC::Core::Channel` object is provided as the credential.
991
+ # @return [::Hash]
992
+ # @!attribute [rw] interceptors
993
+ # An array of interceptors that are run before calls are executed.
994
+ # @return [::Array<::GRPC::ClientInterceptor>]
995
+ # @!attribute [rw] timeout
996
+ # The call timeout in seconds.
997
+ # @return [::Numeric]
998
+ # @!attribute [rw] metadata
999
+ # Additional gRPC headers to be sent with the call.
1000
+ # @return [::Hash{::Symbol=>::String}]
1001
+ # @!attribute [rw] retry_policy
1002
+ # The retry policy. The value is a hash with the following keys:
1003
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1004
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1005
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1006
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1007
+ # trigger a retry.
1008
+ # @return [::Hash]
1009
+ # @!attribute [rw] quota_project
1010
+ # A separate project against which to charge quota.
1011
+ # @return [::String]
1012
+ # @!attribute [rw] universe_domain
1013
+ # The universe domain within which to make requests. This determines the
1014
+ # default endpoint URL. The default value of nil uses the environment
1015
+ # universe (usually the default "googleapis.com" universe).
1016
+ # @return [::String,nil]
1017
+ #
1018
+ class Configuration
1019
+ extend ::Gapic::Config
1020
+
1021
+ # @private
1022
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1023
+ DEFAULT_ENDPOINT = "cloudcontrolspartner.googleapis.com"
1024
+
1025
+ config_attr :endpoint, nil, ::String, nil
1026
+ config_attr :credentials, nil do |value|
1027
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1028
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1029
+ allowed.any? { |klass| klass === value }
1030
+ end
1031
+ config_attr :scope, nil, ::String, ::Array, nil
1032
+ config_attr :lib_name, nil, ::String, nil
1033
+ config_attr :lib_version, nil, ::String, nil
1034
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1035
+ config_attr :interceptors, nil, ::Array, nil
1036
+ config_attr :timeout, nil, ::Numeric, nil
1037
+ config_attr :metadata, nil, ::Hash, nil
1038
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1039
+ config_attr :quota_project, nil, ::String, nil
1040
+ config_attr :universe_domain, nil, ::String, nil
1041
+
1042
+ # @private
1043
+ def initialize parent_config = nil
1044
+ @parent_config = parent_config unless parent_config.nil?
1045
+
1046
+ yield self if block_given?
1047
+ end
1048
+
1049
+ ##
1050
+ # Configurations for individual RPCs
1051
+ # @return [Rpcs]
1052
+ #
1053
+ def rpcs
1054
+ @rpcs ||= begin
1055
+ parent_rpcs = nil
1056
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1057
+ Rpcs.new parent_rpcs
1058
+ end
1059
+ end
1060
+
1061
+ ##
1062
+ # Configuration for the channel pool
1063
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1064
+ #
1065
+ def channel_pool
1066
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1067
+ end
1068
+
1069
+ ##
1070
+ # Configuration RPC class for the CloudControlsPartnerCore API.
1071
+ #
1072
+ # Includes fields providing the configuration for each RPC in this service.
1073
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1074
+ # the following configuration fields:
1075
+ #
1076
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1077
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1078
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1079
+ # include the following keys:
1080
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1081
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1082
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1083
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1084
+ # trigger a retry.
1085
+ #
1086
+ class Rpcs
1087
+ ##
1088
+ # RPC-specific configuration for `get_workload`
1089
+ # @return [::Gapic::Config::Method]
1090
+ #
1091
+ attr_reader :get_workload
1092
+ ##
1093
+ # RPC-specific configuration for `list_workloads`
1094
+ # @return [::Gapic::Config::Method]
1095
+ #
1096
+ attr_reader :list_workloads
1097
+ ##
1098
+ # RPC-specific configuration for `get_customer`
1099
+ # @return [::Gapic::Config::Method]
1100
+ #
1101
+ attr_reader :get_customer
1102
+ ##
1103
+ # RPC-specific configuration for `list_customers`
1104
+ # @return [::Gapic::Config::Method]
1105
+ #
1106
+ attr_reader :list_customers
1107
+ ##
1108
+ # RPC-specific configuration for `get_ekm_connections`
1109
+ # @return [::Gapic::Config::Method]
1110
+ #
1111
+ attr_reader :get_ekm_connections
1112
+ ##
1113
+ # RPC-specific configuration for `get_partner_permissions`
1114
+ # @return [::Gapic::Config::Method]
1115
+ #
1116
+ attr_reader :get_partner_permissions
1117
+ ##
1118
+ # RPC-specific configuration for `list_access_approval_requests`
1119
+ # @return [::Gapic::Config::Method]
1120
+ #
1121
+ attr_reader :list_access_approval_requests
1122
+ ##
1123
+ # RPC-specific configuration for `get_partner`
1124
+ # @return [::Gapic::Config::Method]
1125
+ #
1126
+ attr_reader :get_partner
1127
+
1128
+ # @private
1129
+ def initialize parent_rpcs = nil
1130
+ get_workload_config = parent_rpcs.get_workload if parent_rpcs.respond_to? :get_workload
1131
+ @get_workload = ::Gapic::Config::Method.new get_workload_config
1132
+ list_workloads_config = parent_rpcs.list_workloads if parent_rpcs.respond_to? :list_workloads
1133
+ @list_workloads = ::Gapic::Config::Method.new list_workloads_config
1134
+ get_customer_config = parent_rpcs.get_customer if parent_rpcs.respond_to? :get_customer
1135
+ @get_customer = ::Gapic::Config::Method.new get_customer_config
1136
+ list_customers_config = parent_rpcs.list_customers if parent_rpcs.respond_to? :list_customers
1137
+ @list_customers = ::Gapic::Config::Method.new list_customers_config
1138
+ get_ekm_connections_config = parent_rpcs.get_ekm_connections if parent_rpcs.respond_to? :get_ekm_connections
1139
+ @get_ekm_connections = ::Gapic::Config::Method.new get_ekm_connections_config
1140
+ get_partner_permissions_config = parent_rpcs.get_partner_permissions if parent_rpcs.respond_to? :get_partner_permissions
1141
+ @get_partner_permissions = ::Gapic::Config::Method.new get_partner_permissions_config
1142
+ list_access_approval_requests_config = parent_rpcs.list_access_approval_requests if parent_rpcs.respond_to? :list_access_approval_requests
1143
+ @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1144
+ get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1145
+ @get_partner = ::Gapic::Config::Method.new get_partner_config
1146
+
1147
+ yield self if block_given?
1148
+ end
1149
+ end
1150
+ end
1151
+ end
1152
+ end
1153
+ end
1154
+ end
1155
+ end
1156
+ end