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

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