google-identity-access_context_manager-v1 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2467 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/identity/accesscontextmanager/v1/access_context_manager_pb"
21
+ require "google/identity/access_context_manager/v1/access_context_manager/rest/service_stub"
22
+
23
+ module Google
24
+ module Identity
25
+ module AccessContextManager
26
+ module V1
27
+ module AccessContextManager
28
+ module Rest
29
+ ##
30
+ # REST client for the AccessContextManager service.
31
+ #
32
+ # API for setting [access levels]
33
+ # [google.identity.accesscontextmanager.v1.AccessLevel] and [service
34
+ # perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter]
35
+ # for Google Cloud projects. Each organization has one [access policy]
36
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the
37
+ # [access levels] [google.identity.accesscontextmanager.v1.AccessLevel]
38
+ # and [service perimeters]
39
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter]. This
40
+ # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is
41
+ # applicable to all resources in the organization.
42
+ # AccessPolicies
43
+ #
44
+ class Client
45
+ include Paths
46
+
47
+ # @private
48
+ attr_reader :access_context_manager_stub
49
+
50
+ ##
51
+ # Configure the AccessContextManager Client class.
52
+ #
53
+ # See {::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client::Configuration}
54
+ # for a description of the configuration fields.
55
+ #
56
+ # @example
57
+ #
58
+ # # Modify the configuration for all AccessContextManager clients
59
+ # ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.configure do |config|
60
+ # config.timeout = 10.0
61
+ # end
62
+ #
63
+ # @yield [config] Configure the Client client.
64
+ # @yieldparam config [Client::Configuration]
65
+ #
66
+ # @return [Client::Configuration]
67
+ #
68
+ def self.configure
69
+ @configure ||= begin
70
+ namespace = ["Google", "Identity", "AccessContextManager", "V1"]
71
+ parent_config = while namespace.any?
72
+ parent_name = namespace.join "::"
73
+ parent_const = const_get parent_name
74
+ break parent_const.configure if parent_const.respond_to? :configure
75
+ namespace.pop
76
+ end
77
+ default_config = Client::Configuration.new parent_config
78
+
79
+ default_config.timeout = 60.0
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the AccessContextManager Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # Create a new AccessContextManager REST client object.
109
+ #
110
+ # @example
111
+ #
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.new
114
+ #
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
119
+ #
120
+ # @yield [config] Configure the AccessContextManager client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ def initialize
124
+ # Create the configuration object
125
+ @config = Configuration.new Client.configure
126
+
127
+ # Yield the configuration if needed
128
+ yield @config if block_given?
129
+
130
+ # Create credentials
131
+ credentials = @config.credentials
132
+ # Use self-signed JWT if the endpoint is unchanged from default,
133
+ # but only if the default endpoint does not have a region prefix.
134
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
135
+ !@config.endpoint.split(".").first.include?("-")
136
+ credentials ||= Credentials.default scope: @config.scope,
137
+ enable_self_signed_jwt: enable_self_signed_jwt
138
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
139
+ credentials = Credentials.new credentials, scope: @config.scope
140
+ end
141
+
142
+ @quota_project_id = @config.quota_project
143
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
144
+
145
+ @operations_client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Operations.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
151
+ @access_context_manager_stub = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
152
+ end
153
+
154
+ ##
155
+ # Get the associated client for long-running operations.
156
+ #
157
+ # @return [::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Operations]
158
+ #
159
+ attr_reader :operations_client
160
+
161
+ # Service calls
162
+
163
+ ##
164
+ # Lists all [access policies]
165
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] in an
166
+ # organization.
167
+ #
168
+ # @overload list_access_policies(request, options = nil)
169
+ # Pass arguments to `list_access_policies` via a request object, either of type
170
+ # {::Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest} or an equivalent Hash.
171
+ #
172
+ # @param request [::Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest, ::Hash]
173
+ # A request object representing the call parameters. Required. To specify no
174
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
175
+ # @param options [::Gapic::CallOptions, ::Hash]
176
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
177
+ #
178
+ # @overload list_access_policies(parent: nil, page_size: nil, page_token: nil)
179
+ # Pass arguments to `list_access_policies` via keyword arguments. Note that at
180
+ # least one keyword argument is required. To specify no parameters, or to keep all
181
+ # the default parameter values, pass an empty Hash as a request object (see above).
182
+ #
183
+ # @param parent [::String]
184
+ # Required. Resource name for the container to list AccessPolicy instances
185
+ # from.
186
+ #
187
+ # Format:
188
+ # `organizations/{org_id}`
189
+ # @param page_size [::Integer]
190
+ # Number of AccessPolicy instances to include in the list. Default 100.
191
+ # @param page_token [::String]
192
+ # Next page token for the next batch of AccessPolicy instances. Defaults to
193
+ # the first page of results.
194
+ # @yield [result, operation] Access the result along with the TransportOperation object
195
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::AccessPolicy>]
196
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
197
+ #
198
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::AccessPolicy>]
199
+ #
200
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
201
+ def list_access_policies request, options = nil
202
+ raise ::ArgumentError, "request must be provided" if request.nil?
203
+
204
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest
205
+
206
+ # Converts hash and nil to an options object
207
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
208
+
209
+ # Customize the options with defaults
210
+ call_metadata = @config.rpcs.list_access_policies.metadata.to_h
211
+
212
+ # Set x-goog-api-client and x-goog-user-project headers
213
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
214
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
215
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
216
+ transports_version_send: [:rest]
217
+
218
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
219
+
220
+ options.apply_defaults timeout: @config.rpcs.list_access_policies.timeout,
221
+ metadata: call_metadata,
222
+ retry_policy: @config.rpcs.list_access_policies.retry_policy
223
+
224
+ options.apply_defaults timeout: @config.timeout,
225
+ metadata: @config.metadata,
226
+ retry_policy: @config.retry_policy
227
+
228
+ @access_context_manager_stub.list_access_policies request, options do |result, operation|
229
+ result = ::Gapic::Rest::PagedEnumerable.new @access_context_manager_stub, :list_access_policies, "access_policies", request, result, options
230
+ yield result, operation if block_given?
231
+ return result
232
+ end
233
+ rescue ::Gapic::Rest::Error => e
234
+ raise ::Google::Cloud::Error.from_error(e)
235
+ end
236
+
237
+ ##
238
+ # Returns an [access policy]
239
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name.
240
+ #
241
+ # @overload get_access_policy(request, options = nil)
242
+ # Pass arguments to `get_access_policy` via a request object, either of type
243
+ # {::Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest} or an equivalent Hash.
244
+ #
245
+ # @param request [::Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest, ::Hash]
246
+ # A request object representing the call parameters. Required. To specify no
247
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
248
+ # @param options [::Gapic::CallOptions, ::Hash]
249
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
250
+ #
251
+ # @overload get_access_policy(name: nil)
252
+ # Pass arguments to `get_access_policy` via keyword arguments. Note that at
253
+ # least one keyword argument is required. To specify no parameters, or to keep all
254
+ # the default parameter values, pass an empty Hash as a request object (see above).
255
+ #
256
+ # @param name [::String]
257
+ # Required. Resource name for the access policy to get.
258
+ #
259
+ # Format `accessPolicies/{policy_id}`
260
+ # @yield [result, operation] Access the result along with the TransportOperation object
261
+ # @yieldparam result [::Google::Identity::AccessContextManager::V1::AccessPolicy]
262
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
263
+ #
264
+ # @return [::Google::Identity::AccessContextManager::V1::AccessPolicy]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
267
+ def get_access_policy request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ call_metadata = @config.rpcs.get_access_policy.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
282
+ transports_version_send: [:rest]
283
+
284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ options.apply_defaults timeout: @config.rpcs.get_access_policy.timeout,
287
+ metadata: call_metadata,
288
+ retry_policy: @config.rpcs.get_access_policy.retry_policy
289
+
290
+ options.apply_defaults timeout: @config.timeout,
291
+ metadata: @config.metadata,
292
+ retry_policy: @config.retry_policy
293
+
294
+ @access_context_manager_stub.get_access_policy request, options do |result, operation|
295
+ yield result, operation if block_given?
296
+ return result
297
+ end
298
+ rescue ::Gapic::Rest::Error => e
299
+ raise ::Google::Cloud::Error.from_error(e)
300
+ end
301
+
302
+ ##
303
+ # Creates an access policy. This method fails if the organization already has
304
+ # an access policy. The long-running operation has a successful status
305
+ # after the access policy propagates to long-lasting storage.
306
+ # Syntactic and basic semantic errors are returned in `metadata` as a
307
+ # BadRequest proto.
308
+ #
309
+ # @overload create_access_policy(request, options = nil)
310
+ # Pass arguments to `create_access_policy` via a request object, either of type
311
+ # {::Google::Identity::AccessContextManager::V1::AccessPolicy} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Identity::AccessContextManager::V1::AccessPolicy, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
318
+ #
319
+ # @overload create_access_policy(name: nil, parent: nil, title: nil, scopes: nil, create_time: nil, update_time: nil, etag: nil)
320
+ # Pass arguments to `create_access_policy` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param name [::String]
325
+ # Output only. Resource name of the `AccessPolicy`. Format:
326
+ # `accessPolicies/{access_policy}`
327
+ # @param parent [::String]
328
+ # Required. The parent of this `AccessPolicy` in the Cloud Resource
329
+ # Hierarchy. Currently immutable once created. Format:
330
+ # `organizations/{organization_id}`
331
+ # @param title [::String]
332
+ # Required. Human readable title. Does not affect behavior.
333
+ # @param scopes [::Array<::String>]
334
+ # The scopes of a policy define which resources an ACM policy can restrict,
335
+ # and where ACM resources can be referenced.
336
+ # For example, a policy with scopes=["folders/123"] has the following
337
+ # behavior:
338
+ # - vpcsc perimeters can only restrict projects within folders/123
339
+ # - access levels can only be referenced by resources within folders/123.
340
+ # If empty, there are no limitations on which resources can be restricted by
341
+ # an ACM policy, and there are no limitations on where ACM resources can be
342
+ # referenced.
343
+ # Only one policy can include a given scope (attempting to create a second
344
+ # policy which includes "folders/123" will result in an error).
345
+ # Currently, scopes cannot be modified after a policy is created.
346
+ # Currently, policies can only have a single scope.
347
+ # Format: list of `folders/{folder_number}` or `projects/{project_number}`
348
+ # @param create_time [::Google::Protobuf::Timestamp, ::Hash]
349
+ # Output only. Time the `AccessPolicy` was created in UTC.
350
+ # @param update_time [::Google::Protobuf::Timestamp, ::Hash]
351
+ # Output only. Time the `AccessPolicy` was updated in UTC.
352
+ # @param etag [::String]
353
+ # Output only. An opaque identifier for the current version of the
354
+ # `AccessPolicy`. This will always be a strongly validated etag, meaning that
355
+ # two Access Polices will be identical if and only if their etags are
356
+ # identical. Clients should not expect this to be in any specific format.
357
+ # @yield [result, operation] Access the result along with the TransportOperation object
358
+ # @yieldparam result [::Gapic::Operation]
359
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
360
+ #
361
+ # @return [::Gapic::Operation]
362
+ #
363
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
364
+ def create_access_policy request, options = nil
365
+ raise ::ArgumentError, "request must be provided" if request.nil?
366
+
367
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::AccessPolicy
368
+
369
+ # Converts hash and nil to an options object
370
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
371
+
372
+ # Customize the options with defaults
373
+ call_metadata = @config.rpcs.create_access_policy.metadata.to_h
374
+
375
+ # Set x-goog-api-client and x-goog-user-project headers
376
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
377
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
378
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
379
+ transports_version_send: [:rest]
380
+
381
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
+
383
+ options.apply_defaults timeout: @config.rpcs.create_access_policy.timeout,
384
+ metadata: call_metadata,
385
+ retry_policy: @config.rpcs.create_access_policy.retry_policy
386
+
387
+ options.apply_defaults timeout: @config.timeout,
388
+ metadata: @config.metadata,
389
+ retry_policy: @config.retry_policy
390
+
391
+ @access_context_manager_stub.create_access_policy request, options do |result, operation|
392
+ result = ::Gapic::Operation.new result, @operations_client, options: options
393
+ yield result, operation if block_given?
394
+ return result
395
+ end
396
+ rescue ::Gapic::Rest::Error => e
397
+ raise ::Google::Cloud::Error.from_error(e)
398
+ end
399
+
400
+ ##
401
+ # Updates an [access policy]
402
+ # [google.identity.accesscontextmanager.v1.AccessPolicy]. The
403
+ # long-running operation from this RPC has a successful status after the
404
+ # changes to the [access policy]
405
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] propagate
406
+ # to long-lasting storage.
407
+ #
408
+ # @overload update_access_policy(request, options = nil)
409
+ # Pass arguments to `update_access_policy` via a request object, either of type
410
+ # {::Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest} or an equivalent Hash.
411
+ #
412
+ # @param request [::Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest, ::Hash]
413
+ # A request object representing the call parameters. Required. To specify no
414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
415
+ # @param options [::Gapic::CallOptions, ::Hash]
416
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
417
+ #
418
+ # @overload update_access_policy(policy: nil, update_mask: nil)
419
+ # Pass arguments to `update_access_policy` via keyword arguments. Note that at
420
+ # least one keyword argument is required. To specify no parameters, or to keep all
421
+ # the default parameter values, pass an empty Hash as a request object (see above).
422
+ #
423
+ # @param policy [::Google::Identity::AccessContextManager::V1::AccessPolicy, ::Hash]
424
+ # Required. The updated AccessPolicy.
425
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
426
+ # Required. Mask to control which fields get updated. Must be non-empty.
427
+ # @yield [result, operation] Access the result along with the TransportOperation object
428
+ # @yieldparam result [::Gapic::Operation]
429
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
430
+ #
431
+ # @return [::Gapic::Operation]
432
+ #
433
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
434
+ def update_access_policy request, options = nil
435
+ raise ::ArgumentError, "request must be provided" if request.nil?
436
+
437
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest
438
+
439
+ # Converts hash and nil to an options object
440
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
441
+
442
+ # Customize the options with defaults
443
+ call_metadata = @config.rpcs.update_access_policy.metadata.to_h
444
+
445
+ # Set x-goog-api-client and x-goog-user-project headers
446
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
447
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
448
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
449
+ transports_version_send: [:rest]
450
+
451
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
452
+
453
+ options.apply_defaults timeout: @config.rpcs.update_access_policy.timeout,
454
+ metadata: call_metadata,
455
+ retry_policy: @config.rpcs.update_access_policy.retry_policy
456
+
457
+ options.apply_defaults timeout: @config.timeout,
458
+ metadata: @config.metadata,
459
+ retry_policy: @config.retry_policy
460
+
461
+ @access_context_manager_stub.update_access_policy request, options do |result, operation|
462
+ result = ::Gapic::Operation.new result, @operations_client, options: options
463
+ yield result, operation if block_given?
464
+ return result
465
+ end
466
+ rescue ::Gapic::Rest::Error => e
467
+ raise ::Google::Cloud::Error.from_error(e)
468
+ end
469
+
470
+ ##
471
+ # Deletes an [access policy]
472
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the
473
+ # resource name. The long-running operation has a successful status after the
474
+ # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy]
475
+ # is removed from long-lasting storage.
476
+ #
477
+ # @overload delete_access_policy(request, options = nil)
478
+ # Pass arguments to `delete_access_policy` via a request object, either of type
479
+ # {::Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest} or an equivalent Hash.
480
+ #
481
+ # @param request [::Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest, ::Hash]
482
+ # A request object representing the call parameters. Required. To specify no
483
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
484
+ # @param options [::Gapic::CallOptions, ::Hash]
485
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
486
+ #
487
+ # @overload delete_access_policy(name: nil)
488
+ # Pass arguments to `delete_access_policy` via keyword arguments. Note that at
489
+ # least one keyword argument is required. To specify no parameters, or to keep all
490
+ # the default parameter values, pass an empty Hash as a request object (see above).
491
+ #
492
+ # @param name [::String]
493
+ # Required. Resource name for the access policy to delete.
494
+ #
495
+ # Format `accessPolicies/{policy_id}`
496
+ # @yield [result, operation] Access the result along with the TransportOperation object
497
+ # @yieldparam result [::Gapic::Operation]
498
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
499
+ #
500
+ # @return [::Gapic::Operation]
501
+ #
502
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
503
+ def delete_access_policy request, options = nil
504
+ raise ::ArgumentError, "request must be provided" if request.nil?
505
+
506
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest
507
+
508
+ # Converts hash and nil to an options object
509
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
510
+
511
+ # Customize the options with defaults
512
+ call_metadata = @config.rpcs.delete_access_policy.metadata.to_h
513
+
514
+ # Set x-goog-api-client and x-goog-user-project headers
515
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
516
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
517
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
518
+ transports_version_send: [:rest]
519
+
520
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
521
+
522
+ options.apply_defaults timeout: @config.rpcs.delete_access_policy.timeout,
523
+ metadata: call_metadata,
524
+ retry_policy: @config.rpcs.delete_access_policy.retry_policy
525
+
526
+ options.apply_defaults timeout: @config.timeout,
527
+ metadata: @config.metadata,
528
+ retry_policy: @config.retry_policy
529
+
530
+ @access_context_manager_stub.delete_access_policy request, options do |result, operation|
531
+ result = ::Gapic::Operation.new result, @operations_client, options: options
532
+ yield result, operation if block_given?
533
+ return result
534
+ end
535
+ rescue ::Gapic::Rest::Error => e
536
+ raise ::Google::Cloud::Error.from_error(e)
537
+ end
538
+
539
+ ##
540
+ # Lists all [access levels]
541
+ # [google.identity.accesscontextmanager.v1.AccessLevel] for an access
542
+ # policy.
543
+ #
544
+ # @overload list_access_levels(request, options = nil)
545
+ # Pass arguments to `list_access_levels` via a request object, either of type
546
+ # {::Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest} or an equivalent Hash.
547
+ #
548
+ # @param request [::Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest, ::Hash]
549
+ # A request object representing the call parameters. Required. To specify no
550
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
551
+ # @param options [::Gapic::CallOptions, ::Hash]
552
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
553
+ #
554
+ # @overload list_access_levels(parent: nil, page_size: nil, page_token: nil, access_level_format: nil)
555
+ # Pass arguments to `list_access_levels` via keyword arguments. Note that at
556
+ # least one keyword argument is required. To specify no parameters, or to keep all
557
+ # the default parameter values, pass an empty Hash as a request object (see above).
558
+ #
559
+ # @param parent [::String]
560
+ # Required. Resource name for the access policy to list [Access Levels]
561
+ # [google.identity.accesscontextmanager.v1.AccessLevel] from.
562
+ #
563
+ # Format:
564
+ # `accessPolicies/{policy_id}`
565
+ # @param page_size [::Integer]
566
+ # Number of [Access Levels]
567
+ # [google.identity.accesscontextmanager.v1.AccessLevel] to include in
568
+ # the list. Default 100.
569
+ # @param page_token [::String]
570
+ # Next page token for the next batch of [Access Level]
571
+ # [google.identity.accesscontextmanager.v1.AccessLevel] instances.
572
+ # Defaults to the first page of results.
573
+ # @param access_level_format [::Google::Identity::AccessContextManager::V1::LevelFormat]
574
+ # Whether to return `BasicLevels` in the Cloud Common Expression language, as
575
+ # `CustomLevels`, rather than as `BasicLevels`. Defaults to returning
576
+ # `AccessLevels` in the format they were defined.
577
+ # @yield [result, operation] Access the result along with the TransportOperation object
578
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::AccessLevel>]
579
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
580
+ #
581
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::AccessLevel>]
582
+ #
583
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
584
+ def list_access_levels request, options = nil
585
+ raise ::ArgumentError, "request must be provided" if request.nil?
586
+
587
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest
588
+
589
+ # Converts hash and nil to an options object
590
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
591
+
592
+ # Customize the options with defaults
593
+ call_metadata = @config.rpcs.list_access_levels.metadata.to_h
594
+
595
+ # Set x-goog-api-client and x-goog-user-project headers
596
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
597
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
598
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
599
+ transports_version_send: [:rest]
600
+
601
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
602
+
603
+ options.apply_defaults timeout: @config.rpcs.list_access_levels.timeout,
604
+ metadata: call_metadata,
605
+ retry_policy: @config.rpcs.list_access_levels.retry_policy
606
+
607
+ options.apply_defaults timeout: @config.timeout,
608
+ metadata: @config.metadata,
609
+ retry_policy: @config.retry_policy
610
+
611
+ @access_context_manager_stub.list_access_levels request, options do |result, operation|
612
+ result = ::Gapic::Rest::PagedEnumerable.new @access_context_manager_stub, :list_access_levels, "access_levels", request, result, options
613
+ yield result, operation if block_given?
614
+ return result
615
+ end
616
+ rescue ::Gapic::Rest::Error => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # Gets an [access level]
622
+ # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource
623
+ # name.
624
+ #
625
+ # @overload get_access_level(request, options = nil)
626
+ # Pass arguments to `get_access_level` via a request object, either of type
627
+ # {::Google::Identity::AccessContextManager::V1::GetAccessLevelRequest} or an equivalent Hash.
628
+ #
629
+ # @param request [::Google::Identity::AccessContextManager::V1::GetAccessLevelRequest, ::Hash]
630
+ # A request object representing the call parameters. Required. To specify no
631
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
632
+ # @param options [::Gapic::CallOptions, ::Hash]
633
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
634
+ #
635
+ # @overload get_access_level(name: nil, access_level_format: nil)
636
+ # Pass arguments to `get_access_level` via keyword arguments. Note that at
637
+ # least one keyword argument is required. To specify no parameters, or to keep all
638
+ # the default parameter values, pass an empty Hash as a request object (see above).
639
+ #
640
+ # @param name [::String]
641
+ # Required. Resource name for the [Access Level]
642
+ # [google.identity.accesscontextmanager.v1.AccessLevel].
643
+ #
644
+ # Format:
645
+ # `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
646
+ # @param access_level_format [::Google::Identity::AccessContextManager::V1::LevelFormat]
647
+ # Whether to return `BasicLevels` in the Cloud Common Expression
648
+ # Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where
649
+ # [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel]
650
+ # are returned as `BasicLevels` or `CustomLevels` based on how they were
651
+ # created. If set to CEL, all [Access Levels]
652
+ # [google.identity.accesscontextmanager.v1.AccessLevel] are returned as
653
+ # `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent
654
+ # `CustomLevels`.
655
+ # @yield [result, operation] Access the result along with the TransportOperation object
656
+ # @yieldparam result [::Google::Identity::AccessContextManager::V1::AccessLevel]
657
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
658
+ #
659
+ # @return [::Google::Identity::AccessContextManager::V1::AccessLevel]
660
+ #
661
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
662
+ def get_access_level request, options = nil
663
+ raise ::ArgumentError, "request must be provided" if request.nil?
664
+
665
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::GetAccessLevelRequest
666
+
667
+ # Converts hash and nil to an options object
668
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
669
+
670
+ # Customize the options with defaults
671
+ call_metadata = @config.rpcs.get_access_level.metadata.to_h
672
+
673
+ # Set x-goog-api-client and x-goog-user-project headers
674
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
675
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
676
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
677
+ transports_version_send: [:rest]
678
+
679
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
680
+
681
+ options.apply_defaults timeout: @config.rpcs.get_access_level.timeout,
682
+ metadata: call_metadata,
683
+ retry_policy: @config.rpcs.get_access_level.retry_policy
684
+
685
+ options.apply_defaults timeout: @config.timeout,
686
+ metadata: @config.metadata,
687
+ retry_policy: @config.retry_policy
688
+
689
+ @access_context_manager_stub.get_access_level request, options do |result, operation|
690
+ yield result, operation if block_given?
691
+ return result
692
+ end
693
+ rescue ::Gapic::Rest::Error => e
694
+ raise ::Google::Cloud::Error.from_error(e)
695
+ end
696
+
697
+ ##
698
+ # Creates an [access level]
699
+ # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running
700
+ # operation from this RPC has a successful status after the [access
701
+ # level] [google.identity.accesscontextmanager.v1.AccessLevel]
702
+ # propagates to long-lasting storage. If [access levels]
703
+ # [google.identity.accesscontextmanager.v1.AccessLevel] contain
704
+ # errors, an error response is returned for the first error encountered.
705
+ #
706
+ # @overload create_access_level(request, options = nil)
707
+ # Pass arguments to `create_access_level` via a request object, either of type
708
+ # {::Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest} or an equivalent Hash.
709
+ #
710
+ # @param request [::Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest, ::Hash]
711
+ # A request object representing the call parameters. Required. To specify no
712
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
713
+ # @param options [::Gapic::CallOptions, ::Hash]
714
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
715
+ #
716
+ # @overload create_access_level(parent: nil, access_level: nil)
717
+ # Pass arguments to `create_access_level` via keyword arguments. Note that at
718
+ # least one keyword argument is required. To specify no parameters, or to keep all
719
+ # the default parameter values, pass an empty Hash as a request object (see above).
720
+ #
721
+ # @param parent [::String]
722
+ # Required. Resource name for the access policy which owns this [Access
723
+ # Level] [google.identity.accesscontextmanager.v1.AccessLevel].
724
+ #
725
+ # Format: `accessPolicies/{policy_id}`
726
+ # @param access_level [::Google::Identity::AccessContextManager::V1::AccessLevel, ::Hash]
727
+ # Required. The [Access Level]
728
+ # [google.identity.accesscontextmanager.v1.AccessLevel] to create.
729
+ # Syntactic correctness of the [Access Level]
730
+ # [google.identity.accesscontextmanager.v1.AccessLevel] is a
731
+ # precondition for creation.
732
+ # @yield [result, operation] Access the result along with the TransportOperation object
733
+ # @yieldparam result [::Gapic::Operation]
734
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
735
+ #
736
+ # @return [::Gapic::Operation]
737
+ #
738
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
739
+ def create_access_level request, options = nil
740
+ raise ::ArgumentError, "request must be provided" if request.nil?
741
+
742
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest
743
+
744
+ # Converts hash and nil to an options object
745
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
746
+
747
+ # Customize the options with defaults
748
+ call_metadata = @config.rpcs.create_access_level.metadata.to_h
749
+
750
+ # Set x-goog-api-client and x-goog-user-project headers
751
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
752
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
753
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
754
+ transports_version_send: [:rest]
755
+
756
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
757
+
758
+ options.apply_defaults timeout: @config.rpcs.create_access_level.timeout,
759
+ metadata: call_metadata,
760
+ retry_policy: @config.rpcs.create_access_level.retry_policy
761
+
762
+ options.apply_defaults timeout: @config.timeout,
763
+ metadata: @config.metadata,
764
+ retry_policy: @config.retry_policy
765
+
766
+ @access_context_manager_stub.create_access_level request, options do |result, operation|
767
+ result = ::Gapic::Operation.new result, @operations_client, options: options
768
+ yield result, operation if block_given?
769
+ return result
770
+ end
771
+ rescue ::Gapic::Rest::Error => e
772
+ raise ::Google::Cloud::Error.from_error(e)
773
+ end
774
+
775
+ ##
776
+ # Updates an [access level]
777
+ # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running
778
+ # operation from this RPC has a successful status after the changes to
779
+ # the [access level]
780
+ # [google.identity.accesscontextmanager.v1.AccessLevel] propagate
781
+ # to long-lasting storage. If [access levels]
782
+ # [google.identity.accesscontextmanager.v1.AccessLevel] contain
783
+ # errors, an error response is returned for the first error encountered.
784
+ #
785
+ # @overload update_access_level(request, options = nil)
786
+ # Pass arguments to `update_access_level` via a request object, either of type
787
+ # {::Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest} or an equivalent Hash.
788
+ #
789
+ # @param request [::Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest, ::Hash]
790
+ # A request object representing the call parameters. Required. To specify no
791
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
792
+ # @param options [::Gapic::CallOptions, ::Hash]
793
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
794
+ #
795
+ # @overload update_access_level(access_level: nil, update_mask: nil)
796
+ # Pass arguments to `update_access_level` via keyword arguments. Note that at
797
+ # least one keyword argument is required. To specify no parameters, or to keep all
798
+ # the default parameter values, pass an empty Hash as a request object (see above).
799
+ #
800
+ # @param access_level [::Google::Identity::AccessContextManager::V1::AccessLevel, ::Hash]
801
+ # Required. The updated [Access Level]
802
+ # [google.identity.accesscontextmanager.v1.AccessLevel]. Syntactic
803
+ # correctness of the [Access Level]
804
+ # [google.identity.accesscontextmanager.v1.AccessLevel] is a
805
+ # precondition for creation.
806
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
807
+ # Required. Mask to control which fields get updated. Must be non-empty.
808
+ # @yield [result, operation] Access the result along with the TransportOperation object
809
+ # @yieldparam result [::Gapic::Operation]
810
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
811
+ #
812
+ # @return [::Gapic::Operation]
813
+ #
814
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
815
+ def update_access_level request, options = nil
816
+ raise ::ArgumentError, "request must be provided" if request.nil?
817
+
818
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest
819
+
820
+ # Converts hash and nil to an options object
821
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
822
+
823
+ # Customize the options with defaults
824
+ call_metadata = @config.rpcs.update_access_level.metadata.to_h
825
+
826
+ # Set x-goog-api-client and x-goog-user-project headers
827
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
828
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
829
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
830
+ transports_version_send: [:rest]
831
+
832
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
833
+
834
+ options.apply_defaults timeout: @config.rpcs.update_access_level.timeout,
835
+ metadata: call_metadata,
836
+ retry_policy: @config.rpcs.update_access_level.retry_policy
837
+
838
+ options.apply_defaults timeout: @config.timeout,
839
+ metadata: @config.metadata,
840
+ retry_policy: @config.retry_policy
841
+
842
+ @access_context_manager_stub.update_access_level request, options do |result, operation|
843
+ result = ::Gapic::Operation.new result, @operations_client, options: options
844
+ yield result, operation if block_given?
845
+ return result
846
+ end
847
+ rescue ::Gapic::Rest::Error => e
848
+ raise ::Google::Cloud::Error.from_error(e)
849
+ end
850
+
851
+ ##
852
+ # Deletes an [access level]
853
+ # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource
854
+ # name. The long-running operation from this RPC has a successful status
855
+ # after the [access level]
856
+ # [google.identity.accesscontextmanager.v1.AccessLevel] has been removed
857
+ # from long-lasting storage.
858
+ #
859
+ # @overload delete_access_level(request, options = nil)
860
+ # Pass arguments to `delete_access_level` via a request object, either of type
861
+ # {::Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest} or an equivalent Hash.
862
+ #
863
+ # @param request [::Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest, ::Hash]
864
+ # A request object representing the call parameters. Required. To specify no
865
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
866
+ # @param options [::Gapic::CallOptions, ::Hash]
867
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
868
+ #
869
+ # @overload delete_access_level(name: nil)
870
+ # Pass arguments to `delete_access_level` via keyword arguments. Note that at
871
+ # least one keyword argument is required. To specify no parameters, or to keep all
872
+ # the default parameter values, pass an empty Hash as a request object (see above).
873
+ #
874
+ # @param name [::String]
875
+ # Required. Resource name for the [Access Level]
876
+ # [google.identity.accesscontextmanager.v1.AccessLevel].
877
+ #
878
+ # Format:
879
+ # `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
880
+ # @yield [result, operation] Access the result along with the TransportOperation object
881
+ # @yieldparam result [::Gapic::Operation]
882
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
883
+ #
884
+ # @return [::Gapic::Operation]
885
+ #
886
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
887
+ def delete_access_level request, options = nil
888
+ raise ::ArgumentError, "request must be provided" if request.nil?
889
+
890
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest
891
+
892
+ # Converts hash and nil to an options object
893
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
894
+
895
+ # Customize the options with defaults
896
+ call_metadata = @config.rpcs.delete_access_level.metadata.to_h
897
+
898
+ # Set x-goog-api-client and x-goog-user-project headers
899
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
900
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
901
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
902
+ transports_version_send: [:rest]
903
+
904
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
905
+
906
+ options.apply_defaults timeout: @config.rpcs.delete_access_level.timeout,
907
+ metadata: call_metadata,
908
+ retry_policy: @config.rpcs.delete_access_level.retry_policy
909
+
910
+ options.apply_defaults timeout: @config.timeout,
911
+ metadata: @config.metadata,
912
+ retry_policy: @config.retry_policy
913
+
914
+ @access_context_manager_stub.delete_access_level request, options do |result, operation|
915
+ result = ::Gapic::Operation.new result, @operations_client, options: options
916
+ yield result, operation if block_given?
917
+ return result
918
+ end
919
+ rescue ::Gapic::Rest::Error => e
920
+ raise ::Google::Cloud::Error.from_error(e)
921
+ end
922
+
923
+ ##
924
+ # Replaces all existing [access levels]
925
+ # [google.identity.accesscontextmanager.v1.AccessLevel] in an [access
926
+ # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with
927
+ # the [access levels]
928
+ # [google.identity.accesscontextmanager.v1.AccessLevel] provided. This
929
+ # is done atomically. The long-running operation from this RPC has a
930
+ # successful status after all replacements propagate to long-lasting
931
+ # storage. If the replacement contains errors, an error response is returned
932
+ # for the first error encountered. Upon error, the replacement is cancelled,
933
+ # and existing [access levels]
934
+ # [google.identity.accesscontextmanager.v1.AccessLevel] are not
935
+ # affected. The Operation.response field contains
936
+ # ReplaceAccessLevelsResponse. Removing [access levels]
937
+ # [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing
938
+ # [service perimeters]
939
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an
940
+ # error.
941
+ #
942
+ # @overload replace_access_levels(request, options = nil)
943
+ # Pass arguments to `replace_access_levels` via a request object, either of type
944
+ # {::Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest} or an equivalent Hash.
945
+ #
946
+ # @param request [::Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest, ::Hash]
947
+ # A request object representing the call parameters. Required. To specify no
948
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
949
+ # @param options [::Gapic::CallOptions, ::Hash]
950
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
951
+ #
952
+ # @overload replace_access_levels(parent: nil, access_levels: nil, etag: nil)
953
+ # Pass arguments to `replace_access_levels` via keyword arguments. Note that at
954
+ # least one keyword argument is required. To specify no parameters, or to keep all
955
+ # the default parameter values, pass an empty Hash as a request object (see above).
956
+ #
957
+ # @param parent [::String]
958
+ # Required. Resource name for the access policy which owns these
959
+ # [Access Levels]
960
+ # [google.identity.accesscontextmanager.v1.AccessLevel].
961
+ #
962
+ # Format: `accessPolicies/{policy_id}`
963
+ # @param access_levels [::Array<::Google::Identity::AccessContextManager::V1::AccessLevel, ::Hash>]
964
+ # Required. The desired [Access Levels]
965
+ # [google.identity.accesscontextmanager.v1.AccessLevel] that should
966
+ # replace all existing [Access Levels]
967
+ # [google.identity.accesscontextmanager.v1.AccessLevel] in the
968
+ # [Access Policy]
969
+ # [google.identity.accesscontextmanager.v1.AccessPolicy].
970
+ # @param etag [::String]
971
+ # Optional. The etag for the version of the [Access Policy]
972
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] that this
973
+ # replace operation is to be performed on. If, at the time of replace, the
974
+ # etag for the Access Policy stored in Access Context Manager is different
975
+ # from the specified etag, then the replace operation will not be performed
976
+ # and the call will fail. This field is not required. If etag is not
977
+ # provided, the operation will be performed as if a valid etag is provided.
978
+ # @yield [result, operation] Access the result along with the TransportOperation object
979
+ # @yieldparam result [::Gapic::Operation]
980
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
981
+ #
982
+ # @return [::Gapic::Operation]
983
+ #
984
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
985
+ def replace_access_levels request, options = nil
986
+ raise ::ArgumentError, "request must be provided" if request.nil?
987
+
988
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest
989
+
990
+ # Converts hash and nil to an options object
991
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
992
+
993
+ # Customize the options with defaults
994
+ call_metadata = @config.rpcs.replace_access_levels.metadata.to_h
995
+
996
+ # Set x-goog-api-client and x-goog-user-project headers
997
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
998
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
999
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1000
+ transports_version_send: [:rest]
1001
+
1002
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1003
+
1004
+ options.apply_defaults timeout: @config.rpcs.replace_access_levels.timeout,
1005
+ metadata: call_metadata,
1006
+ retry_policy: @config.rpcs.replace_access_levels.retry_policy
1007
+
1008
+ options.apply_defaults timeout: @config.timeout,
1009
+ metadata: @config.metadata,
1010
+ retry_policy: @config.retry_policy
1011
+
1012
+ @access_context_manager_stub.replace_access_levels request, options do |result, operation|
1013
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1014
+ yield result, operation if block_given?
1015
+ return result
1016
+ end
1017
+ rescue ::Gapic::Rest::Error => e
1018
+ raise ::Google::Cloud::Error.from_error(e)
1019
+ end
1020
+
1021
+ ##
1022
+ # Lists all [service perimeters]
1023
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] for an
1024
+ # access policy.
1025
+ #
1026
+ # @overload list_service_perimeters(request, options = nil)
1027
+ # Pass arguments to `list_service_perimeters` via a request object, either of type
1028
+ # {::Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest} or an equivalent Hash.
1029
+ #
1030
+ # @param request [::Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest, ::Hash]
1031
+ # A request object representing the call parameters. Required. To specify no
1032
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1033
+ # @param options [::Gapic::CallOptions, ::Hash]
1034
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1035
+ #
1036
+ # @overload list_service_perimeters(parent: nil, page_size: nil, page_token: nil)
1037
+ # Pass arguments to `list_service_perimeters` via keyword arguments. Note that at
1038
+ # least one keyword argument is required. To specify no parameters, or to keep all
1039
+ # the default parameter values, pass an empty Hash as a request object (see above).
1040
+ #
1041
+ # @param parent [::String]
1042
+ # Required. Resource name for the access policy to list [Service Perimeters]
1043
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] from.
1044
+ #
1045
+ # Format:
1046
+ # `accessPolicies/{policy_id}`
1047
+ # @param page_size [::Integer]
1048
+ # Number of [Service Perimeters]
1049
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] to include
1050
+ # in the list. Default 100.
1051
+ # @param page_token [::String]
1052
+ # Next page token for the next batch of [Service Perimeter]
1053
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] instances.
1054
+ # Defaults to the first page of results.
1055
+ # @yield [result, operation] Access the result along with the TransportOperation object
1056
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::ServicePerimeter>]
1057
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1058
+ #
1059
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::ServicePerimeter>]
1060
+ #
1061
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1062
+ def list_service_perimeters request, options = nil
1063
+ raise ::ArgumentError, "request must be provided" if request.nil?
1064
+
1065
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest
1066
+
1067
+ # Converts hash and nil to an options object
1068
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1069
+
1070
+ # Customize the options with defaults
1071
+ call_metadata = @config.rpcs.list_service_perimeters.metadata.to_h
1072
+
1073
+ # Set x-goog-api-client and x-goog-user-project headers
1074
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1075
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1076
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1077
+ transports_version_send: [:rest]
1078
+
1079
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1080
+
1081
+ options.apply_defaults timeout: @config.rpcs.list_service_perimeters.timeout,
1082
+ metadata: call_metadata,
1083
+ retry_policy: @config.rpcs.list_service_perimeters.retry_policy
1084
+
1085
+ options.apply_defaults timeout: @config.timeout,
1086
+ metadata: @config.metadata,
1087
+ retry_policy: @config.retry_policy
1088
+
1089
+ @access_context_manager_stub.list_service_perimeters request, options do |result, operation|
1090
+ result = ::Gapic::Rest::PagedEnumerable.new @access_context_manager_stub, :list_service_perimeters, "service_perimeters", request, result, options
1091
+ yield result, operation if block_given?
1092
+ return result
1093
+ end
1094
+ rescue ::Gapic::Rest::Error => e
1095
+ raise ::Google::Cloud::Error.from_error(e)
1096
+ end
1097
+
1098
+ ##
1099
+ # Gets a [service perimeter]
1100
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the
1101
+ # resource name.
1102
+ #
1103
+ # @overload get_service_perimeter(request, options = nil)
1104
+ # Pass arguments to `get_service_perimeter` via a request object, either of type
1105
+ # {::Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest} or an equivalent Hash.
1106
+ #
1107
+ # @param request [::Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest, ::Hash]
1108
+ # A request object representing the call parameters. Required. To specify no
1109
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1110
+ # @param options [::Gapic::CallOptions, ::Hash]
1111
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1112
+ #
1113
+ # @overload get_service_perimeter(name: nil)
1114
+ # Pass arguments to `get_service_perimeter` via keyword arguments. Note that at
1115
+ # least one keyword argument is required. To specify no parameters, or to keep all
1116
+ # the default parameter values, pass an empty Hash as a request object (see above).
1117
+ #
1118
+ # @param name [::String]
1119
+ # Required. Resource name for the [Service Perimeter]
1120
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter].
1121
+ #
1122
+ # Format:
1123
+ # `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}`
1124
+ # @yield [result, operation] Access the result along with the TransportOperation object
1125
+ # @yieldparam result [::Google::Identity::AccessContextManager::V1::ServicePerimeter]
1126
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1127
+ #
1128
+ # @return [::Google::Identity::AccessContextManager::V1::ServicePerimeter]
1129
+ #
1130
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1131
+ def get_service_perimeter request, options = nil
1132
+ raise ::ArgumentError, "request must be provided" if request.nil?
1133
+
1134
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest
1135
+
1136
+ # Converts hash and nil to an options object
1137
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1138
+
1139
+ # Customize the options with defaults
1140
+ call_metadata = @config.rpcs.get_service_perimeter.metadata.to_h
1141
+
1142
+ # Set x-goog-api-client and x-goog-user-project headers
1143
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1144
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1145
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1146
+ transports_version_send: [:rest]
1147
+
1148
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1149
+
1150
+ options.apply_defaults timeout: @config.rpcs.get_service_perimeter.timeout,
1151
+ metadata: call_metadata,
1152
+ retry_policy: @config.rpcs.get_service_perimeter.retry_policy
1153
+
1154
+ options.apply_defaults timeout: @config.timeout,
1155
+ metadata: @config.metadata,
1156
+ retry_policy: @config.retry_policy
1157
+
1158
+ @access_context_manager_stub.get_service_perimeter request, options do |result, operation|
1159
+ yield result, operation if block_given?
1160
+ return result
1161
+ end
1162
+ rescue ::Gapic::Rest::Error => e
1163
+ raise ::Google::Cloud::Error.from_error(e)
1164
+ end
1165
+
1166
+ ##
1167
+ # Creates a [service perimeter]
1168
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The
1169
+ # long-running operation from this RPC has a successful status after the
1170
+ # [service perimeter]
1171
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter]
1172
+ # propagates to long-lasting storage. If a [service perimeter]
1173
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains
1174
+ # errors, an error response is returned for the first error encountered.
1175
+ #
1176
+ # @overload create_service_perimeter(request, options = nil)
1177
+ # Pass arguments to `create_service_perimeter` via a request object, either of type
1178
+ # {::Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest} or an equivalent Hash.
1179
+ #
1180
+ # @param request [::Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest, ::Hash]
1181
+ # A request object representing the call parameters. Required. To specify no
1182
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1183
+ # @param options [::Gapic::CallOptions, ::Hash]
1184
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1185
+ #
1186
+ # @overload create_service_perimeter(parent: nil, service_perimeter: nil)
1187
+ # Pass arguments to `create_service_perimeter` via keyword arguments. Note that at
1188
+ # least one keyword argument is required. To specify no parameters, or to keep all
1189
+ # the default parameter values, pass an empty Hash as a request object (see above).
1190
+ #
1191
+ # @param parent [::String]
1192
+ # Required. Resource name for the access policy which owns this [Service
1193
+ # Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter].
1194
+ #
1195
+ # Format: `accessPolicies/{policy_id}`
1196
+ # @param service_perimeter [::Google::Identity::AccessContextManager::V1::ServicePerimeter, ::Hash]
1197
+ # Required. The [Service Perimeter]
1198
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] to create.
1199
+ # Syntactic correctness of the [Service Perimeter]
1200
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] is a
1201
+ # precondition for creation.
1202
+ # @yield [result, operation] Access the result along with the TransportOperation object
1203
+ # @yieldparam result [::Gapic::Operation]
1204
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1205
+ #
1206
+ # @return [::Gapic::Operation]
1207
+ #
1208
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1209
+ def create_service_perimeter request, options = nil
1210
+ raise ::ArgumentError, "request must be provided" if request.nil?
1211
+
1212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest
1213
+
1214
+ # Converts hash and nil to an options object
1215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1216
+
1217
+ # Customize the options with defaults
1218
+ call_metadata = @config.rpcs.create_service_perimeter.metadata.to_h
1219
+
1220
+ # Set x-goog-api-client and x-goog-user-project headers
1221
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1223
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1224
+ transports_version_send: [:rest]
1225
+
1226
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1227
+
1228
+ options.apply_defaults timeout: @config.rpcs.create_service_perimeter.timeout,
1229
+ metadata: call_metadata,
1230
+ retry_policy: @config.rpcs.create_service_perimeter.retry_policy
1231
+
1232
+ options.apply_defaults timeout: @config.timeout,
1233
+ metadata: @config.metadata,
1234
+ retry_policy: @config.retry_policy
1235
+
1236
+ @access_context_manager_stub.create_service_perimeter request, options do |result, operation|
1237
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1238
+ yield result, operation if block_given?
1239
+ return result
1240
+ end
1241
+ rescue ::Gapic::Rest::Error => e
1242
+ raise ::Google::Cloud::Error.from_error(e)
1243
+ end
1244
+
1245
+ ##
1246
+ # Updates a [service perimeter]
1247
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The
1248
+ # long-running operation from this RPC has a successful status after the
1249
+ # [service perimeter]
1250
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter]
1251
+ # propagates to long-lasting storage. If a [service perimeter]
1252
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains
1253
+ # errors, an error response is returned for the first error encountered.
1254
+ #
1255
+ # @overload update_service_perimeter(request, options = nil)
1256
+ # Pass arguments to `update_service_perimeter` via a request object, either of type
1257
+ # {::Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest} or an equivalent Hash.
1258
+ #
1259
+ # @param request [::Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest, ::Hash]
1260
+ # A request object representing the call parameters. Required. To specify no
1261
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1262
+ # @param options [::Gapic::CallOptions, ::Hash]
1263
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1264
+ #
1265
+ # @overload update_service_perimeter(service_perimeter: nil, update_mask: nil)
1266
+ # Pass arguments to `update_service_perimeter` via keyword arguments. Note that at
1267
+ # least one keyword argument is required. To specify no parameters, or to keep all
1268
+ # the default parameter values, pass an empty Hash as a request object (see above).
1269
+ #
1270
+ # @param service_perimeter [::Google::Identity::AccessContextManager::V1::ServicePerimeter, ::Hash]
1271
+ # Required. The updated `ServicePerimeter`. Syntactic correctness of the
1272
+ # `ServicePerimeter` is a precondition for creation.
1273
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1274
+ # Required. Mask to control which fields get updated. Must be non-empty.
1275
+ # @yield [result, operation] Access the result along with the TransportOperation object
1276
+ # @yieldparam result [::Gapic::Operation]
1277
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1278
+ #
1279
+ # @return [::Gapic::Operation]
1280
+ #
1281
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1282
+ def update_service_perimeter request, options = nil
1283
+ raise ::ArgumentError, "request must be provided" if request.nil?
1284
+
1285
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest
1286
+
1287
+ # Converts hash and nil to an options object
1288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1289
+
1290
+ # Customize the options with defaults
1291
+ call_metadata = @config.rpcs.update_service_perimeter.metadata.to_h
1292
+
1293
+ # Set x-goog-api-client and x-goog-user-project headers
1294
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1296
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1297
+ transports_version_send: [:rest]
1298
+
1299
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1300
+
1301
+ options.apply_defaults timeout: @config.rpcs.update_service_perimeter.timeout,
1302
+ metadata: call_metadata,
1303
+ retry_policy: @config.rpcs.update_service_perimeter.retry_policy
1304
+
1305
+ options.apply_defaults timeout: @config.timeout,
1306
+ metadata: @config.metadata,
1307
+ retry_policy: @config.retry_policy
1308
+
1309
+ @access_context_manager_stub.update_service_perimeter request, options do |result, operation|
1310
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1311
+ yield result, operation if block_given?
1312
+ return result
1313
+ end
1314
+ rescue ::Gapic::Rest::Error => e
1315
+ raise ::Google::Cloud::Error.from_error(e)
1316
+ end
1317
+
1318
+ ##
1319
+ # Deletes a [service perimeter]
1320
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the
1321
+ # resource name. The long-running operation from this RPC has a successful
1322
+ # status after the [service perimeter]
1323
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from
1324
+ # long-lasting storage.
1325
+ #
1326
+ # @overload delete_service_perimeter(request, options = nil)
1327
+ # Pass arguments to `delete_service_perimeter` via a request object, either of type
1328
+ # {::Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest} or an equivalent Hash.
1329
+ #
1330
+ # @param request [::Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest, ::Hash]
1331
+ # A request object representing the call parameters. Required. To specify no
1332
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1333
+ # @param options [::Gapic::CallOptions, ::Hash]
1334
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1335
+ #
1336
+ # @overload delete_service_perimeter(name: nil)
1337
+ # Pass arguments to `delete_service_perimeter` via keyword arguments. Note that at
1338
+ # least one keyword argument is required. To specify no parameters, or to keep all
1339
+ # the default parameter values, pass an empty Hash as a request object (see above).
1340
+ #
1341
+ # @param name [::String]
1342
+ # Required. Resource name for the [Service Perimeter]
1343
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter].
1344
+ #
1345
+ # Format:
1346
+ # `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}`
1347
+ # @yield [result, operation] Access the result along with the TransportOperation object
1348
+ # @yieldparam result [::Gapic::Operation]
1349
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1350
+ #
1351
+ # @return [::Gapic::Operation]
1352
+ #
1353
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1354
+ def delete_service_perimeter request, options = nil
1355
+ raise ::ArgumentError, "request must be provided" if request.nil?
1356
+
1357
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest
1358
+
1359
+ # Converts hash and nil to an options object
1360
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1361
+
1362
+ # Customize the options with defaults
1363
+ call_metadata = @config.rpcs.delete_service_perimeter.metadata.to_h
1364
+
1365
+ # Set x-goog-api-client and x-goog-user-project headers
1366
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1367
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1368
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1369
+ transports_version_send: [:rest]
1370
+
1371
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1372
+
1373
+ options.apply_defaults timeout: @config.rpcs.delete_service_perimeter.timeout,
1374
+ metadata: call_metadata,
1375
+ retry_policy: @config.rpcs.delete_service_perimeter.retry_policy
1376
+
1377
+ options.apply_defaults timeout: @config.timeout,
1378
+ metadata: @config.metadata,
1379
+ retry_policy: @config.retry_policy
1380
+
1381
+ @access_context_manager_stub.delete_service_perimeter request, options do |result, operation|
1382
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1383
+ yield result, operation if block_given?
1384
+ return result
1385
+ end
1386
+ rescue ::Gapic::Rest::Error => e
1387
+ raise ::Google::Cloud::Error.from_error(e)
1388
+ end
1389
+
1390
+ ##
1391
+ # Replace all existing [service perimeters]
1392
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access
1393
+ # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the
1394
+ # [service perimeters]
1395
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This
1396
+ # is done atomically. The long-running operation from this RPC has a
1397
+ # successful status after all replacements propagate to long-lasting storage.
1398
+ # Replacements containing errors result in an error response for the first
1399
+ # error encountered. Upon an error, replacement are cancelled and existing
1400
+ # [service perimeters]
1401
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] are not
1402
+ # affected. The Operation.response field contains
1403
+ # ReplaceServicePerimetersResponse.
1404
+ #
1405
+ # @overload replace_service_perimeters(request, options = nil)
1406
+ # Pass arguments to `replace_service_perimeters` via a request object, either of type
1407
+ # {::Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest} or an equivalent Hash.
1408
+ #
1409
+ # @param request [::Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest, ::Hash]
1410
+ # A request object representing the call parameters. Required. To specify no
1411
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1412
+ # @param options [::Gapic::CallOptions, ::Hash]
1413
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1414
+ #
1415
+ # @overload replace_service_perimeters(parent: nil, service_perimeters: nil, etag: nil)
1416
+ # Pass arguments to `replace_service_perimeters` via keyword arguments. Note that at
1417
+ # least one keyword argument is required. To specify no parameters, or to keep all
1418
+ # the default parameter values, pass an empty Hash as a request object (see above).
1419
+ #
1420
+ # @param parent [::String]
1421
+ # Required. Resource name for the access policy which owns these
1422
+ # [Service Perimeters]
1423
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter].
1424
+ #
1425
+ # Format: `accessPolicies/{policy_id}`
1426
+ # @param service_perimeters [::Array<::Google::Identity::AccessContextManager::V1::ServicePerimeter, ::Hash>]
1427
+ # Required. The desired [Service Perimeters]
1428
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] that should
1429
+ # replace all existing [Service Perimeters]
1430
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] in the
1431
+ # [Access Policy]
1432
+ # [google.identity.accesscontextmanager.v1.AccessPolicy].
1433
+ # @param etag [::String]
1434
+ # Optional. The etag for the version of the [Access Policy]
1435
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] that this
1436
+ # replace operation is to be performed on. If, at the time of replace, the
1437
+ # etag for the Access Policy stored in Access Context Manager is different
1438
+ # from the specified etag, then the replace operation will not be performed
1439
+ # and the call will fail. This field is not required. If etag is not
1440
+ # provided, the operation will be performed as if a valid etag is provided.
1441
+ # @yield [result, operation] Access the result along with the TransportOperation object
1442
+ # @yieldparam result [::Gapic::Operation]
1443
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1444
+ #
1445
+ # @return [::Gapic::Operation]
1446
+ #
1447
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1448
+ def replace_service_perimeters request, options = nil
1449
+ raise ::ArgumentError, "request must be provided" if request.nil?
1450
+
1451
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest
1452
+
1453
+ # Converts hash and nil to an options object
1454
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1455
+
1456
+ # Customize the options with defaults
1457
+ call_metadata = @config.rpcs.replace_service_perimeters.metadata.to_h
1458
+
1459
+ # Set x-goog-api-client and x-goog-user-project headers
1460
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1461
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1462
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1463
+ transports_version_send: [:rest]
1464
+
1465
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1466
+
1467
+ options.apply_defaults timeout: @config.rpcs.replace_service_perimeters.timeout,
1468
+ metadata: call_metadata,
1469
+ retry_policy: @config.rpcs.replace_service_perimeters.retry_policy
1470
+
1471
+ options.apply_defaults timeout: @config.timeout,
1472
+ metadata: @config.metadata,
1473
+ retry_policy: @config.retry_policy
1474
+
1475
+ @access_context_manager_stub.replace_service_perimeters request, options do |result, operation|
1476
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1477
+ yield result, operation if block_given?
1478
+ return result
1479
+ end
1480
+ rescue ::Gapic::Rest::Error => e
1481
+ raise ::Google::Cloud::Error.from_error(e)
1482
+ end
1483
+
1484
+ ##
1485
+ # Commits the dry-run specification for all the [service perimeters]
1486
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an
1487
+ # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}.
1488
+ # A commit operation on a service perimeter involves copying its `spec` field
1489
+ # to the `status` field of the service perimeter. Only [service perimeters]
1490
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] with
1491
+ # `use_explicit_dry_run_spec` field set to true are affected by a commit
1492
+ # operation. The long-running operation from this RPC has a successful
1493
+ # status after the dry-run specifications for all the [service perimeters]
1494
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] have been
1495
+ # committed. If a commit fails, it causes the long-running operation to
1496
+ # return an error response and the entire commit operation is cancelled.
1497
+ # When successful, the Operation.response field contains
1498
+ # CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are
1499
+ # cleared after a successful commit operation.
1500
+ #
1501
+ # @overload commit_service_perimeters(request, options = nil)
1502
+ # Pass arguments to `commit_service_perimeters` via a request object, either of type
1503
+ # {::Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest} or an equivalent Hash.
1504
+ #
1505
+ # @param request [::Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest, ::Hash]
1506
+ # A request object representing the call parameters. Required. To specify no
1507
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1508
+ # @param options [::Gapic::CallOptions, ::Hash]
1509
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1510
+ #
1511
+ # @overload commit_service_perimeters(parent: nil, etag: nil)
1512
+ # Pass arguments to `commit_service_perimeters` via keyword arguments. Note that at
1513
+ # least one keyword argument is required. To specify no parameters, or to keep all
1514
+ # the default parameter values, pass an empty Hash as a request object (see above).
1515
+ #
1516
+ # @param parent [::String]
1517
+ # Required. Resource name for the parent [Access Policy]
1518
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all
1519
+ # [Service Perimeters]
1520
+ # [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for
1521
+ # the commit operation.
1522
+ #
1523
+ # Format: `accessPolicies/{policy_id}`
1524
+ # @param etag [::String]
1525
+ # Optional. The etag for the version of the [Access Policy]
1526
+ # [google.identity.accesscontextmanager.v1.AccessPolicy] that this
1527
+ # commit operation is to be performed on. If, at the time of commit, the
1528
+ # etag for the Access Policy stored in Access Context Manager is different
1529
+ # from the specified etag, then the commit operation will not be performed
1530
+ # and the call will fail. This field is not required. If etag is not
1531
+ # provided, the operation will be performed as if a valid etag is provided.
1532
+ # @yield [result, operation] Access the result along with the TransportOperation object
1533
+ # @yieldparam result [::Gapic::Operation]
1534
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1535
+ #
1536
+ # @return [::Gapic::Operation]
1537
+ #
1538
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1539
+ def commit_service_perimeters request, options = nil
1540
+ raise ::ArgumentError, "request must be provided" if request.nil?
1541
+
1542
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest
1543
+
1544
+ # Converts hash and nil to an options object
1545
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1546
+
1547
+ # Customize the options with defaults
1548
+ call_metadata = @config.rpcs.commit_service_perimeters.metadata.to_h
1549
+
1550
+ # Set x-goog-api-client and x-goog-user-project headers
1551
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1552
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1553
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1554
+ transports_version_send: [:rest]
1555
+
1556
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1557
+
1558
+ options.apply_defaults timeout: @config.rpcs.commit_service_perimeters.timeout,
1559
+ metadata: call_metadata,
1560
+ retry_policy: @config.rpcs.commit_service_perimeters.retry_policy
1561
+
1562
+ options.apply_defaults timeout: @config.timeout,
1563
+ metadata: @config.metadata,
1564
+ retry_policy: @config.retry_policy
1565
+
1566
+ @access_context_manager_stub.commit_service_perimeters request, options do |result, operation|
1567
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1568
+ yield result, operation if block_given?
1569
+ return result
1570
+ end
1571
+ rescue ::Gapic::Rest::Error => e
1572
+ raise ::Google::Cloud::Error.from_error(e)
1573
+ end
1574
+
1575
+ ##
1576
+ # Lists all [GcpUserAccessBindings]
1577
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a
1578
+ # Google Cloud organization.
1579
+ #
1580
+ # @overload list_gcp_user_access_bindings(request, options = nil)
1581
+ # Pass arguments to `list_gcp_user_access_bindings` via a request object, either of type
1582
+ # {::Google::Identity::AccessContextManager::V1::ListGcpUserAccessBindingsRequest} or an equivalent Hash.
1583
+ #
1584
+ # @param request [::Google::Identity::AccessContextManager::V1::ListGcpUserAccessBindingsRequest, ::Hash]
1585
+ # A request object representing the call parameters. Required. To specify no
1586
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1587
+ # @param options [::Gapic::CallOptions, ::Hash]
1588
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1589
+ #
1590
+ # @overload list_gcp_user_access_bindings(parent: nil, page_size: nil, page_token: nil)
1591
+ # Pass arguments to `list_gcp_user_access_bindings` via keyword arguments. Note that at
1592
+ # least one keyword argument is required. To specify no parameters, or to keep all
1593
+ # the default parameter values, pass an empty Hash as a request object (see above).
1594
+ #
1595
+ # @param parent [::String]
1596
+ # Required. Example: "organizations/256"
1597
+ # @param page_size [::Integer]
1598
+ # Optional. Maximum number of items to return. The server may return fewer items.
1599
+ # If left blank, the server may return any number of items.
1600
+ # @param page_token [::String]
1601
+ # Optional. If left blank, returns the first page. To enumerate all items, use the
1602
+ # [next_page_token]
1603
+ # [google.identity.accesscontextmanager.v1.ListGcpUserAccessBindingsResponse.next_page_token]
1604
+ # from your previous list operation.
1605
+ # @yield [result, operation] Access the result along with the TransportOperation object
1606
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding>]
1607
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1608
+ #
1609
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding>]
1610
+ #
1611
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1612
+ def list_gcp_user_access_bindings request, options = nil
1613
+ raise ::ArgumentError, "request must be provided" if request.nil?
1614
+
1615
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::ListGcpUserAccessBindingsRequest
1616
+
1617
+ # Converts hash and nil to an options object
1618
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1619
+
1620
+ # Customize the options with defaults
1621
+ call_metadata = @config.rpcs.list_gcp_user_access_bindings.metadata.to_h
1622
+
1623
+ # Set x-goog-api-client and x-goog-user-project headers
1624
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1625
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1626
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1627
+ transports_version_send: [:rest]
1628
+
1629
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1630
+
1631
+ options.apply_defaults timeout: @config.rpcs.list_gcp_user_access_bindings.timeout,
1632
+ metadata: call_metadata,
1633
+ retry_policy: @config.rpcs.list_gcp_user_access_bindings.retry_policy
1634
+
1635
+ options.apply_defaults timeout: @config.timeout,
1636
+ metadata: @config.metadata,
1637
+ retry_policy: @config.retry_policy
1638
+
1639
+ @access_context_manager_stub.list_gcp_user_access_bindings request, options do |result, operation|
1640
+ result = ::Gapic::Rest::PagedEnumerable.new @access_context_manager_stub, :list_gcp_user_access_bindings, "gcp_user_access_bindings", request, result, options
1641
+ yield result, operation if block_given?
1642
+ return result
1643
+ end
1644
+ rescue ::Gapic::Rest::Error => e
1645
+ raise ::Google::Cloud::Error.from_error(e)
1646
+ end
1647
+
1648
+ ##
1649
+ # Gets the [GcpUserAccessBinding]
1650
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] with
1651
+ # the given name.
1652
+ #
1653
+ # @overload get_gcp_user_access_binding(request, options = nil)
1654
+ # Pass arguments to `get_gcp_user_access_binding` via a request object, either of type
1655
+ # {::Google::Identity::AccessContextManager::V1::GetGcpUserAccessBindingRequest} or an equivalent Hash.
1656
+ #
1657
+ # @param request [::Google::Identity::AccessContextManager::V1::GetGcpUserAccessBindingRequest, ::Hash]
1658
+ # A request object representing the call parameters. Required. To specify no
1659
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1660
+ # @param options [::Gapic::CallOptions, ::Hash]
1661
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1662
+ #
1663
+ # @overload get_gcp_user_access_binding(name: nil)
1664
+ # Pass arguments to `get_gcp_user_access_binding` via keyword arguments. Note that at
1665
+ # least one keyword argument is required. To specify no parameters, or to keep all
1666
+ # the default parameter values, pass an empty Hash as a request object (see above).
1667
+ #
1668
+ # @param name [::String]
1669
+ # Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
1670
+ # @yield [result, operation] Access the result along with the TransportOperation object
1671
+ # @yieldparam result [::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding]
1672
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1673
+ #
1674
+ # @return [::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding]
1675
+ #
1676
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1677
+ def get_gcp_user_access_binding request, options = nil
1678
+ raise ::ArgumentError, "request must be provided" if request.nil?
1679
+
1680
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::GetGcpUserAccessBindingRequest
1681
+
1682
+ # Converts hash and nil to an options object
1683
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1684
+
1685
+ # Customize the options with defaults
1686
+ call_metadata = @config.rpcs.get_gcp_user_access_binding.metadata.to_h
1687
+
1688
+ # Set x-goog-api-client and x-goog-user-project headers
1689
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1690
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1691
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1692
+ transports_version_send: [:rest]
1693
+
1694
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1695
+
1696
+ options.apply_defaults timeout: @config.rpcs.get_gcp_user_access_binding.timeout,
1697
+ metadata: call_metadata,
1698
+ retry_policy: @config.rpcs.get_gcp_user_access_binding.retry_policy
1699
+
1700
+ options.apply_defaults timeout: @config.timeout,
1701
+ metadata: @config.metadata,
1702
+ retry_policy: @config.retry_policy
1703
+
1704
+ @access_context_manager_stub.get_gcp_user_access_binding request, options do |result, operation|
1705
+ yield result, operation if block_given?
1706
+ return result
1707
+ end
1708
+ rescue ::Gapic::Rest::Error => e
1709
+ raise ::Google::Cloud::Error.from_error(e)
1710
+ end
1711
+
1712
+ ##
1713
+ # Creates a [GcpUserAccessBinding]
1714
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the
1715
+ # client specifies a [name]
1716
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name],
1717
+ # the server ignores it. Fails if a resource already exists with the same
1718
+ # [group_key]
1719
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key].
1720
+ # Completion of this long-running operation does not necessarily signify that
1721
+ # the new binding is deployed onto all affected users, which may take more
1722
+ # time.
1723
+ #
1724
+ # @overload create_gcp_user_access_binding(request, options = nil)
1725
+ # Pass arguments to `create_gcp_user_access_binding` via a request object, either of type
1726
+ # {::Google::Identity::AccessContextManager::V1::CreateGcpUserAccessBindingRequest} or an equivalent Hash.
1727
+ #
1728
+ # @param request [::Google::Identity::AccessContextManager::V1::CreateGcpUserAccessBindingRequest, ::Hash]
1729
+ # A request object representing the call parameters. Required. To specify no
1730
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1731
+ # @param options [::Gapic::CallOptions, ::Hash]
1732
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1733
+ #
1734
+ # @overload create_gcp_user_access_binding(parent: nil, gcp_user_access_binding: nil)
1735
+ # Pass arguments to `create_gcp_user_access_binding` via keyword arguments. Note that at
1736
+ # least one keyword argument is required. To specify no parameters, or to keep all
1737
+ # the default parameter values, pass an empty Hash as a request object (see above).
1738
+ #
1739
+ # @param parent [::String]
1740
+ # Required. Example: "organizations/256"
1741
+ # @param gcp_user_access_binding [::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding, ::Hash]
1742
+ # Required. [GcpUserAccessBinding]
1743
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]
1744
+ # @yield [result, operation] Access the result along with the TransportOperation object
1745
+ # @yieldparam result [::Gapic::Operation]
1746
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1747
+ #
1748
+ # @return [::Gapic::Operation]
1749
+ #
1750
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1751
+ def create_gcp_user_access_binding request, options = nil
1752
+ raise ::ArgumentError, "request must be provided" if request.nil?
1753
+
1754
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::CreateGcpUserAccessBindingRequest
1755
+
1756
+ # Converts hash and nil to an options object
1757
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1758
+
1759
+ # Customize the options with defaults
1760
+ call_metadata = @config.rpcs.create_gcp_user_access_binding.metadata.to_h
1761
+
1762
+ # Set x-goog-api-client and x-goog-user-project headers
1763
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1764
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1765
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1766
+ transports_version_send: [:rest]
1767
+
1768
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1769
+
1770
+ options.apply_defaults timeout: @config.rpcs.create_gcp_user_access_binding.timeout,
1771
+ metadata: call_metadata,
1772
+ retry_policy: @config.rpcs.create_gcp_user_access_binding.retry_policy
1773
+
1774
+ options.apply_defaults timeout: @config.timeout,
1775
+ metadata: @config.metadata,
1776
+ retry_policy: @config.retry_policy
1777
+
1778
+ @access_context_manager_stub.create_gcp_user_access_binding request, options do |result, operation|
1779
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1780
+ yield result, operation if block_given?
1781
+ return result
1782
+ end
1783
+ rescue ::Gapic::Rest::Error => e
1784
+ raise ::Google::Cloud::Error.from_error(e)
1785
+ end
1786
+
1787
+ ##
1788
+ # Updates a [GcpUserAccessBinding]
1789
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding].
1790
+ # Completion of this long-running operation does not necessarily signify that
1791
+ # the changed binding is deployed onto all affected users, which may take
1792
+ # more time.
1793
+ #
1794
+ # @overload update_gcp_user_access_binding(request, options = nil)
1795
+ # Pass arguments to `update_gcp_user_access_binding` via a request object, either of type
1796
+ # {::Google::Identity::AccessContextManager::V1::UpdateGcpUserAccessBindingRequest} or an equivalent Hash.
1797
+ #
1798
+ # @param request [::Google::Identity::AccessContextManager::V1::UpdateGcpUserAccessBindingRequest, ::Hash]
1799
+ # A request object representing the call parameters. Required. To specify no
1800
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1801
+ # @param options [::Gapic::CallOptions, ::Hash]
1802
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1803
+ #
1804
+ # @overload update_gcp_user_access_binding(gcp_user_access_binding: nil, update_mask: nil)
1805
+ # Pass arguments to `update_gcp_user_access_binding` via keyword arguments. Note that at
1806
+ # least one keyword argument is required. To specify no parameters, or to keep all
1807
+ # the default parameter values, pass an empty Hash as a request object (see above).
1808
+ #
1809
+ # @param gcp_user_access_binding [::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding, ::Hash]
1810
+ # Required. [GcpUserAccessBinding]
1811
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]
1812
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1813
+ # Required. Only the fields specified in this mask are updated. Because name and
1814
+ # group_key cannot be changed, update_mask is required and must always be:
1815
+ #
1816
+ # update_mask {
1817
+ # paths: "access_levels"
1818
+ # }
1819
+ # @yield [result, operation] Access the result along with the TransportOperation object
1820
+ # @yieldparam result [::Gapic::Operation]
1821
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1822
+ #
1823
+ # @return [::Gapic::Operation]
1824
+ #
1825
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1826
+ def update_gcp_user_access_binding request, options = nil
1827
+ raise ::ArgumentError, "request must be provided" if request.nil?
1828
+
1829
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::UpdateGcpUserAccessBindingRequest
1830
+
1831
+ # Converts hash and nil to an options object
1832
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1833
+
1834
+ # Customize the options with defaults
1835
+ call_metadata = @config.rpcs.update_gcp_user_access_binding.metadata.to_h
1836
+
1837
+ # Set x-goog-api-client and x-goog-user-project headers
1838
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1839
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1840
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1841
+ transports_version_send: [:rest]
1842
+
1843
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1844
+
1845
+ options.apply_defaults timeout: @config.rpcs.update_gcp_user_access_binding.timeout,
1846
+ metadata: call_metadata,
1847
+ retry_policy: @config.rpcs.update_gcp_user_access_binding.retry_policy
1848
+
1849
+ options.apply_defaults timeout: @config.timeout,
1850
+ metadata: @config.metadata,
1851
+ retry_policy: @config.retry_policy
1852
+
1853
+ @access_context_manager_stub.update_gcp_user_access_binding request, options do |result, operation|
1854
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1855
+ yield result, operation if block_given?
1856
+ return result
1857
+ end
1858
+ rescue ::Gapic::Rest::Error => e
1859
+ raise ::Google::Cloud::Error.from_error(e)
1860
+ end
1861
+
1862
+ ##
1863
+ # Deletes a [GcpUserAccessBinding]
1864
+ # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding].
1865
+ # Completion of this long-running operation does not necessarily signify that
1866
+ # the binding deletion is deployed onto all affected users, which may take
1867
+ # more time.
1868
+ #
1869
+ # @overload delete_gcp_user_access_binding(request, options = nil)
1870
+ # Pass arguments to `delete_gcp_user_access_binding` via a request object, either of type
1871
+ # {::Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest} or an equivalent Hash.
1872
+ #
1873
+ # @param request [::Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest, ::Hash]
1874
+ # A request object representing the call parameters. Required. To specify no
1875
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1876
+ # @param options [::Gapic::CallOptions, ::Hash]
1877
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1878
+ #
1879
+ # @overload delete_gcp_user_access_binding(name: nil)
1880
+ # Pass arguments to `delete_gcp_user_access_binding` via keyword arguments. Note that at
1881
+ # least one keyword argument is required. To specify no parameters, or to keep all
1882
+ # the default parameter values, pass an empty Hash as a request object (see above).
1883
+ #
1884
+ # @param name [::String]
1885
+ # Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N"
1886
+ # @yield [result, operation] Access the result along with the TransportOperation object
1887
+ # @yieldparam result [::Gapic::Operation]
1888
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1889
+ #
1890
+ # @return [::Gapic::Operation]
1891
+ #
1892
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1893
+ def delete_gcp_user_access_binding request, options = nil
1894
+ raise ::ArgumentError, "request must be provided" if request.nil?
1895
+
1896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest
1897
+
1898
+ # Converts hash and nil to an options object
1899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1900
+
1901
+ # Customize the options with defaults
1902
+ call_metadata = @config.rpcs.delete_gcp_user_access_binding.metadata.to_h
1903
+
1904
+ # Set x-goog-api-client and x-goog-user-project headers
1905
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1907
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1908
+ transports_version_send: [:rest]
1909
+
1910
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1911
+
1912
+ options.apply_defaults timeout: @config.rpcs.delete_gcp_user_access_binding.timeout,
1913
+ metadata: call_metadata,
1914
+ retry_policy: @config.rpcs.delete_gcp_user_access_binding.retry_policy
1915
+
1916
+ options.apply_defaults timeout: @config.timeout,
1917
+ metadata: @config.metadata,
1918
+ retry_policy: @config.retry_policy
1919
+
1920
+ @access_context_manager_stub.delete_gcp_user_access_binding request, options do |result, operation|
1921
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1922
+ yield result, operation if block_given?
1923
+ return result
1924
+ end
1925
+ rescue ::Gapic::Rest::Error => e
1926
+ raise ::Google::Cloud::Error.from_error(e)
1927
+ end
1928
+
1929
+ ##
1930
+ # Sets the IAM policy for the specified Access Context Manager
1931
+ # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}.
1932
+ # This method replaces the existing IAM policy on the access policy. The IAM
1933
+ # policy controls the set of users who can perform specific operations on the
1934
+ # Access Context Manager [access
1935
+ # policy][google.identity.accesscontextmanager.v1.AccessPolicy].
1936
+ #
1937
+ # @overload set_iam_policy(request, options = nil)
1938
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1939
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1940
+ #
1941
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1942
+ # A request object representing the call parameters. Required. To specify no
1943
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1944
+ # @param options [::Gapic::CallOptions, ::Hash]
1945
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1946
+ #
1947
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1948
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1949
+ # least one keyword argument is required. To specify no parameters, or to keep all
1950
+ # the default parameter values, pass an empty Hash as a request object (see above).
1951
+ #
1952
+ # @param resource [::String]
1953
+ # REQUIRED: The resource for which the policy is being specified.
1954
+ # See the operation documentation for the appropriate value for this field.
1955
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1956
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1957
+ # the policy is limited to a few 10s of KB. An empty policy is a
1958
+ # valid policy but certain Cloud Platform services (such as Projects)
1959
+ # might reject them.
1960
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1961
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1962
+ # the fields in the mask will be modified. If no mask is provided, the
1963
+ # following default mask is used:
1964
+ #
1965
+ # `paths: "bindings, etag"`
1966
+ # @yield [result, operation] Access the result along with the TransportOperation object
1967
+ # @yieldparam result [::Google::Iam::V1::Policy]
1968
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1969
+ #
1970
+ # @return [::Google::Iam::V1::Policy]
1971
+ #
1972
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1973
+ def set_iam_policy request, options = nil
1974
+ raise ::ArgumentError, "request must be provided" if request.nil?
1975
+
1976
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1977
+
1978
+ # Converts hash and nil to an options object
1979
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1980
+
1981
+ # Customize the options with defaults
1982
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1983
+
1984
+ # Set x-goog-api-client and x-goog-user-project headers
1985
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1986
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1987
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
1988
+ transports_version_send: [:rest]
1989
+
1990
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1991
+
1992
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1993
+ metadata: call_metadata,
1994
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1995
+
1996
+ options.apply_defaults timeout: @config.timeout,
1997
+ metadata: @config.metadata,
1998
+ retry_policy: @config.retry_policy
1999
+
2000
+ @access_context_manager_stub.set_iam_policy request, options do |result, operation|
2001
+ yield result, operation if block_given?
2002
+ return result
2003
+ end
2004
+ rescue ::Gapic::Rest::Error => e
2005
+ raise ::Google::Cloud::Error.from_error(e)
2006
+ end
2007
+
2008
+ ##
2009
+ # Gets the IAM policy for the specified Access Context Manager
2010
+ # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}.
2011
+ #
2012
+ # @overload get_iam_policy(request, options = nil)
2013
+ # Pass arguments to `get_iam_policy` via a request object, either of type
2014
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
2015
+ #
2016
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
2017
+ # A request object representing the call parameters. Required. To specify no
2018
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2019
+ # @param options [::Gapic::CallOptions, ::Hash]
2020
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2021
+ #
2022
+ # @overload get_iam_policy(resource: nil, options: nil)
2023
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
2024
+ # least one keyword argument is required. To specify no parameters, or to keep all
2025
+ # the default parameter values, pass an empty Hash as a request object (see above).
2026
+ #
2027
+ # @param resource [::String]
2028
+ # REQUIRED: The resource for which the policy is being requested.
2029
+ # See the operation documentation for the appropriate value for this field.
2030
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
2031
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
2032
+ # `GetIamPolicy`.
2033
+ # @yield [result, operation] Access the result along with the TransportOperation object
2034
+ # @yieldparam result [::Google::Iam::V1::Policy]
2035
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2036
+ #
2037
+ # @return [::Google::Iam::V1::Policy]
2038
+ #
2039
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2040
+ def get_iam_policy request, options = nil
2041
+ raise ::ArgumentError, "request must be provided" if request.nil?
2042
+
2043
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
2044
+
2045
+ # Converts hash and nil to an options object
2046
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2047
+
2048
+ # Customize the options with defaults
2049
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
2050
+
2051
+ # Set x-goog-api-client and x-goog-user-project headers
2052
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2053
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2054
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
2055
+ transports_version_send: [:rest]
2056
+
2057
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2058
+
2059
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
2060
+ metadata: call_metadata,
2061
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
2062
+
2063
+ options.apply_defaults timeout: @config.timeout,
2064
+ metadata: @config.metadata,
2065
+ retry_policy: @config.retry_policy
2066
+
2067
+ @access_context_manager_stub.get_iam_policy request, options do |result, operation|
2068
+ yield result, operation if block_given?
2069
+ return result
2070
+ end
2071
+ rescue ::Gapic::Rest::Error => e
2072
+ raise ::Google::Cloud::Error.from_error(e)
2073
+ end
2074
+
2075
+ ##
2076
+ # Returns the IAM permissions that the caller has on the specified Access
2077
+ # Context Manager resource. The resource can be an
2078
+ # {::Google::Identity::AccessContextManager::V1::AccessPolicy AccessPolicy},
2079
+ # {::Google::Identity::AccessContextManager::V1::AccessLevel AccessLevel}, or
2080
+ # [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter
2081
+ # ]. This method does not support other resources.
2082
+ #
2083
+ # @overload test_iam_permissions(request, options = nil)
2084
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
2085
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
2086
+ #
2087
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
2088
+ # A request object representing the call parameters. Required. To specify no
2089
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2090
+ # @param options [::Gapic::CallOptions, ::Hash]
2091
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2092
+ #
2093
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
2094
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
2095
+ # least one keyword argument is required. To specify no parameters, or to keep all
2096
+ # the default parameter values, pass an empty Hash as a request object (see above).
2097
+ #
2098
+ # @param resource [::String]
2099
+ # REQUIRED: The resource for which the policy detail is being requested.
2100
+ # See the operation documentation for the appropriate value for this field.
2101
+ # @param permissions [::Array<::String>]
2102
+ # The set of permissions to check for the `resource`. Permissions with
2103
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
2104
+ # information see
2105
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2106
+ # @yield [result, operation] Access the result along with the TransportOperation object
2107
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
2108
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2109
+ #
2110
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
2111
+ #
2112
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2113
+ def test_iam_permissions request, options = nil
2114
+ raise ::ArgumentError, "request must be provided" if request.nil?
2115
+
2116
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
2117
+
2118
+ # Converts hash and nil to an options object
2119
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2120
+
2121
+ # Customize the options with defaults
2122
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
2123
+
2124
+ # Set x-goog-api-client and x-goog-user-project headers
2125
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2126
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2127
+ gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION,
2128
+ transports_version_send: [:rest]
2129
+
2130
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2131
+
2132
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
2133
+ metadata: call_metadata,
2134
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
2135
+
2136
+ options.apply_defaults timeout: @config.timeout,
2137
+ metadata: @config.metadata,
2138
+ retry_policy: @config.retry_policy
2139
+
2140
+ @access_context_manager_stub.test_iam_permissions request, options do |result, operation|
2141
+ yield result, operation if block_given?
2142
+ return result
2143
+ end
2144
+ rescue ::Gapic::Rest::Error => e
2145
+ raise ::Google::Cloud::Error.from_error(e)
2146
+ end
2147
+
2148
+ ##
2149
+ # Configuration class for the AccessContextManager REST API.
2150
+ #
2151
+ # This class represents the configuration for AccessContextManager REST,
2152
+ # providing control over timeouts, retry behavior, logging, transport
2153
+ # parameters, and other low-level controls. Certain parameters can also be
2154
+ # applied individually to specific RPCs. See
2155
+ # {::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client::Configuration::Rpcs}
2156
+ # for a list of RPCs that can be configured independently.
2157
+ #
2158
+ # Configuration can be applied globally to all clients, or to a single client
2159
+ # on construction.
2160
+ #
2161
+ # @example
2162
+ #
2163
+ # # Modify the global config, setting the timeout for
2164
+ # # list_access_policies to 20 seconds,
2165
+ # # and all remaining timeouts to 10 seconds.
2166
+ # ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.configure do |config|
2167
+ # config.timeout = 10.0
2168
+ # config.rpcs.list_access_policies.timeout = 20.0
2169
+ # end
2170
+ #
2171
+ # # Apply the above configuration only to a new client.
2172
+ # client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Rest::Client.new do |config|
2173
+ # config.timeout = 10.0
2174
+ # config.rpcs.list_access_policies.timeout = 20.0
2175
+ # end
2176
+ #
2177
+ # @!attribute [rw] endpoint
2178
+ # The hostname or hostname:port of the service endpoint.
2179
+ # Defaults to `"accesscontextmanager.googleapis.com"`.
2180
+ # @return [::String]
2181
+ # @!attribute [rw] credentials
2182
+ # Credentials to send with calls. You may provide any of the following types:
2183
+ # * (`String`) The path to a service account key file in JSON format
2184
+ # * (`Hash`) A service account key as a Hash
2185
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2186
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2187
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2188
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2189
+ # * (`nil`) indicating no credentials
2190
+ # @return [::Object]
2191
+ # @!attribute [rw] scope
2192
+ # The OAuth scopes
2193
+ # @return [::Array<::String>]
2194
+ # @!attribute [rw] lib_name
2195
+ # The library name as recorded in instrumentation and logging
2196
+ # @return [::String]
2197
+ # @!attribute [rw] lib_version
2198
+ # The library version as recorded in instrumentation and logging
2199
+ # @return [::String]
2200
+ # @!attribute [rw] timeout
2201
+ # The call timeout in seconds.
2202
+ # @return [::Numeric]
2203
+ # @!attribute [rw] metadata
2204
+ # Additional headers to be sent with the call.
2205
+ # @return [::Hash{::Symbol=>::String}]
2206
+ # @!attribute [rw] retry_policy
2207
+ # The retry policy. The value is a hash with the following keys:
2208
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2209
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2210
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2211
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2212
+ # trigger a retry.
2213
+ # @return [::Hash]
2214
+ # @!attribute [rw] quota_project
2215
+ # A separate project against which to charge quota.
2216
+ # @return [::String]
2217
+ #
2218
+ class Configuration
2219
+ extend ::Gapic::Config
2220
+
2221
+ config_attr :endpoint, "accesscontextmanager.googleapis.com", ::String
2222
+ config_attr :credentials, nil do |value|
2223
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2224
+ allowed.any? { |klass| klass === value }
2225
+ end
2226
+ config_attr :scope, nil, ::String, ::Array, nil
2227
+ config_attr :lib_name, nil, ::String, nil
2228
+ config_attr :lib_version, nil, ::String, nil
2229
+ config_attr :timeout, nil, ::Numeric, nil
2230
+ config_attr :metadata, nil, ::Hash, nil
2231
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2232
+ config_attr :quota_project, nil, ::String, nil
2233
+
2234
+ # @private
2235
+ def initialize parent_config = nil
2236
+ @parent_config = parent_config unless parent_config.nil?
2237
+
2238
+ yield self if block_given?
2239
+ end
2240
+
2241
+ ##
2242
+ # Configurations for individual RPCs
2243
+ # @return [Rpcs]
2244
+ #
2245
+ def rpcs
2246
+ @rpcs ||= begin
2247
+ parent_rpcs = nil
2248
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2249
+ Rpcs.new parent_rpcs
2250
+ end
2251
+ end
2252
+
2253
+ ##
2254
+ # Configuration RPC class for the AccessContextManager API.
2255
+ #
2256
+ # Includes fields providing the configuration for each RPC in this service.
2257
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2258
+ # the following configuration fields:
2259
+ #
2260
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2261
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2262
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2263
+ # include the following keys:
2264
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2265
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2266
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2267
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2268
+ # trigger a retry.
2269
+ #
2270
+ class Rpcs
2271
+ ##
2272
+ # RPC-specific configuration for `list_access_policies`
2273
+ # @return [::Gapic::Config::Method]
2274
+ #
2275
+ attr_reader :list_access_policies
2276
+ ##
2277
+ # RPC-specific configuration for `get_access_policy`
2278
+ # @return [::Gapic::Config::Method]
2279
+ #
2280
+ attr_reader :get_access_policy
2281
+ ##
2282
+ # RPC-specific configuration for `create_access_policy`
2283
+ # @return [::Gapic::Config::Method]
2284
+ #
2285
+ attr_reader :create_access_policy
2286
+ ##
2287
+ # RPC-specific configuration for `update_access_policy`
2288
+ # @return [::Gapic::Config::Method]
2289
+ #
2290
+ attr_reader :update_access_policy
2291
+ ##
2292
+ # RPC-specific configuration for `delete_access_policy`
2293
+ # @return [::Gapic::Config::Method]
2294
+ #
2295
+ attr_reader :delete_access_policy
2296
+ ##
2297
+ # RPC-specific configuration for `list_access_levels`
2298
+ # @return [::Gapic::Config::Method]
2299
+ #
2300
+ attr_reader :list_access_levels
2301
+ ##
2302
+ # RPC-specific configuration for `get_access_level`
2303
+ # @return [::Gapic::Config::Method]
2304
+ #
2305
+ attr_reader :get_access_level
2306
+ ##
2307
+ # RPC-specific configuration for `create_access_level`
2308
+ # @return [::Gapic::Config::Method]
2309
+ #
2310
+ attr_reader :create_access_level
2311
+ ##
2312
+ # RPC-specific configuration for `update_access_level`
2313
+ # @return [::Gapic::Config::Method]
2314
+ #
2315
+ attr_reader :update_access_level
2316
+ ##
2317
+ # RPC-specific configuration for `delete_access_level`
2318
+ # @return [::Gapic::Config::Method]
2319
+ #
2320
+ attr_reader :delete_access_level
2321
+ ##
2322
+ # RPC-specific configuration for `replace_access_levels`
2323
+ # @return [::Gapic::Config::Method]
2324
+ #
2325
+ attr_reader :replace_access_levels
2326
+ ##
2327
+ # RPC-specific configuration for `list_service_perimeters`
2328
+ # @return [::Gapic::Config::Method]
2329
+ #
2330
+ attr_reader :list_service_perimeters
2331
+ ##
2332
+ # RPC-specific configuration for `get_service_perimeter`
2333
+ # @return [::Gapic::Config::Method]
2334
+ #
2335
+ attr_reader :get_service_perimeter
2336
+ ##
2337
+ # RPC-specific configuration for `create_service_perimeter`
2338
+ # @return [::Gapic::Config::Method]
2339
+ #
2340
+ attr_reader :create_service_perimeter
2341
+ ##
2342
+ # RPC-specific configuration for `update_service_perimeter`
2343
+ # @return [::Gapic::Config::Method]
2344
+ #
2345
+ attr_reader :update_service_perimeter
2346
+ ##
2347
+ # RPC-specific configuration for `delete_service_perimeter`
2348
+ # @return [::Gapic::Config::Method]
2349
+ #
2350
+ attr_reader :delete_service_perimeter
2351
+ ##
2352
+ # RPC-specific configuration for `replace_service_perimeters`
2353
+ # @return [::Gapic::Config::Method]
2354
+ #
2355
+ attr_reader :replace_service_perimeters
2356
+ ##
2357
+ # RPC-specific configuration for `commit_service_perimeters`
2358
+ # @return [::Gapic::Config::Method]
2359
+ #
2360
+ attr_reader :commit_service_perimeters
2361
+ ##
2362
+ # RPC-specific configuration for `list_gcp_user_access_bindings`
2363
+ # @return [::Gapic::Config::Method]
2364
+ #
2365
+ attr_reader :list_gcp_user_access_bindings
2366
+ ##
2367
+ # RPC-specific configuration for `get_gcp_user_access_binding`
2368
+ # @return [::Gapic::Config::Method]
2369
+ #
2370
+ attr_reader :get_gcp_user_access_binding
2371
+ ##
2372
+ # RPC-specific configuration for `create_gcp_user_access_binding`
2373
+ # @return [::Gapic::Config::Method]
2374
+ #
2375
+ attr_reader :create_gcp_user_access_binding
2376
+ ##
2377
+ # RPC-specific configuration for `update_gcp_user_access_binding`
2378
+ # @return [::Gapic::Config::Method]
2379
+ #
2380
+ attr_reader :update_gcp_user_access_binding
2381
+ ##
2382
+ # RPC-specific configuration for `delete_gcp_user_access_binding`
2383
+ # @return [::Gapic::Config::Method]
2384
+ #
2385
+ attr_reader :delete_gcp_user_access_binding
2386
+ ##
2387
+ # RPC-specific configuration for `set_iam_policy`
2388
+ # @return [::Gapic::Config::Method]
2389
+ #
2390
+ attr_reader :set_iam_policy
2391
+ ##
2392
+ # RPC-specific configuration for `get_iam_policy`
2393
+ # @return [::Gapic::Config::Method]
2394
+ #
2395
+ attr_reader :get_iam_policy
2396
+ ##
2397
+ # RPC-specific configuration for `test_iam_permissions`
2398
+ # @return [::Gapic::Config::Method]
2399
+ #
2400
+ attr_reader :test_iam_permissions
2401
+
2402
+ # @private
2403
+ def initialize parent_rpcs = nil
2404
+ list_access_policies_config = parent_rpcs.list_access_policies if parent_rpcs.respond_to? :list_access_policies
2405
+ @list_access_policies = ::Gapic::Config::Method.new list_access_policies_config
2406
+ get_access_policy_config = parent_rpcs.get_access_policy if parent_rpcs.respond_to? :get_access_policy
2407
+ @get_access_policy = ::Gapic::Config::Method.new get_access_policy_config
2408
+ create_access_policy_config = parent_rpcs.create_access_policy if parent_rpcs.respond_to? :create_access_policy
2409
+ @create_access_policy = ::Gapic::Config::Method.new create_access_policy_config
2410
+ update_access_policy_config = parent_rpcs.update_access_policy if parent_rpcs.respond_to? :update_access_policy
2411
+ @update_access_policy = ::Gapic::Config::Method.new update_access_policy_config
2412
+ delete_access_policy_config = parent_rpcs.delete_access_policy if parent_rpcs.respond_to? :delete_access_policy
2413
+ @delete_access_policy = ::Gapic::Config::Method.new delete_access_policy_config
2414
+ list_access_levels_config = parent_rpcs.list_access_levels if parent_rpcs.respond_to? :list_access_levels
2415
+ @list_access_levels = ::Gapic::Config::Method.new list_access_levels_config
2416
+ get_access_level_config = parent_rpcs.get_access_level if parent_rpcs.respond_to? :get_access_level
2417
+ @get_access_level = ::Gapic::Config::Method.new get_access_level_config
2418
+ create_access_level_config = parent_rpcs.create_access_level if parent_rpcs.respond_to? :create_access_level
2419
+ @create_access_level = ::Gapic::Config::Method.new create_access_level_config
2420
+ update_access_level_config = parent_rpcs.update_access_level if parent_rpcs.respond_to? :update_access_level
2421
+ @update_access_level = ::Gapic::Config::Method.new update_access_level_config
2422
+ delete_access_level_config = parent_rpcs.delete_access_level if parent_rpcs.respond_to? :delete_access_level
2423
+ @delete_access_level = ::Gapic::Config::Method.new delete_access_level_config
2424
+ replace_access_levels_config = parent_rpcs.replace_access_levels if parent_rpcs.respond_to? :replace_access_levels
2425
+ @replace_access_levels = ::Gapic::Config::Method.new replace_access_levels_config
2426
+ list_service_perimeters_config = parent_rpcs.list_service_perimeters if parent_rpcs.respond_to? :list_service_perimeters
2427
+ @list_service_perimeters = ::Gapic::Config::Method.new list_service_perimeters_config
2428
+ get_service_perimeter_config = parent_rpcs.get_service_perimeter if parent_rpcs.respond_to? :get_service_perimeter
2429
+ @get_service_perimeter = ::Gapic::Config::Method.new get_service_perimeter_config
2430
+ create_service_perimeter_config = parent_rpcs.create_service_perimeter if parent_rpcs.respond_to? :create_service_perimeter
2431
+ @create_service_perimeter = ::Gapic::Config::Method.new create_service_perimeter_config
2432
+ update_service_perimeter_config = parent_rpcs.update_service_perimeter if parent_rpcs.respond_to? :update_service_perimeter
2433
+ @update_service_perimeter = ::Gapic::Config::Method.new update_service_perimeter_config
2434
+ delete_service_perimeter_config = parent_rpcs.delete_service_perimeter if parent_rpcs.respond_to? :delete_service_perimeter
2435
+ @delete_service_perimeter = ::Gapic::Config::Method.new delete_service_perimeter_config
2436
+ replace_service_perimeters_config = parent_rpcs.replace_service_perimeters if parent_rpcs.respond_to? :replace_service_perimeters
2437
+ @replace_service_perimeters = ::Gapic::Config::Method.new replace_service_perimeters_config
2438
+ commit_service_perimeters_config = parent_rpcs.commit_service_perimeters if parent_rpcs.respond_to? :commit_service_perimeters
2439
+ @commit_service_perimeters = ::Gapic::Config::Method.new commit_service_perimeters_config
2440
+ list_gcp_user_access_bindings_config = parent_rpcs.list_gcp_user_access_bindings if parent_rpcs.respond_to? :list_gcp_user_access_bindings
2441
+ @list_gcp_user_access_bindings = ::Gapic::Config::Method.new list_gcp_user_access_bindings_config
2442
+ get_gcp_user_access_binding_config = parent_rpcs.get_gcp_user_access_binding if parent_rpcs.respond_to? :get_gcp_user_access_binding
2443
+ @get_gcp_user_access_binding = ::Gapic::Config::Method.new get_gcp_user_access_binding_config
2444
+ create_gcp_user_access_binding_config = parent_rpcs.create_gcp_user_access_binding if parent_rpcs.respond_to? :create_gcp_user_access_binding
2445
+ @create_gcp_user_access_binding = ::Gapic::Config::Method.new create_gcp_user_access_binding_config
2446
+ update_gcp_user_access_binding_config = parent_rpcs.update_gcp_user_access_binding if parent_rpcs.respond_to? :update_gcp_user_access_binding
2447
+ @update_gcp_user_access_binding = ::Gapic::Config::Method.new update_gcp_user_access_binding_config
2448
+ delete_gcp_user_access_binding_config = parent_rpcs.delete_gcp_user_access_binding if parent_rpcs.respond_to? :delete_gcp_user_access_binding
2449
+ @delete_gcp_user_access_binding = ::Gapic::Config::Method.new delete_gcp_user_access_binding_config
2450
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
2451
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
2452
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
2453
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
2454
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
2455
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
2456
+
2457
+ yield self if block_given?
2458
+ end
2459
+ end
2460
+ end
2461
+ end
2462
+ end
2463
+ end
2464
+ end
2465
+ end
2466
+ end
2467
+ end