google-cloud-vm_migration-v1 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,671 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/iam/v1/iam_policy_pb"
21
+ require "google/iam/v1/iam_policy/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Iam
26
+ module V1
27
+ module IAMPolicy
28
+ module Rest
29
+ ##
30
+ # REST client for the IAMPolicy service.
31
+ #
32
+ # API Overview
33
+ #
34
+ # Manages Identity and Access Management (IAM) policies.
35
+ #
36
+ # Any implementation of an API that offers access control features
37
+ # implements the google.iam.v1.IAMPolicy interface.
38
+ #
39
+ # ## Data model
40
+ #
41
+ # Access control is applied when a principal (user or service account), takes
42
+ # some action on a resource exposed by a service. Resources, identified by
43
+ # URI-like names, are the unit of access control specification. Service
44
+ # implementations can choose the granularity of access control and the
45
+ # supported permissions for their resources.
46
+ # For example one database service may allow access control to be
47
+ # specified only at the Table level, whereas another might allow access control
48
+ # to also be specified at the Column level.
49
+ #
50
+ # ## Policy Structure
51
+ #
52
+ # See google.iam.v1.Policy
53
+ #
54
+ # This is intentionally not a CRUD style API because access control policies
55
+ # are created and deleted implicitly with the resources to which they are
56
+ # attached.
57
+ #
58
+ class Client
59
+ # @private
60
+ API_VERSION = ""
61
+
62
+ # @private
63
+ DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$"
64
+
65
+ # @private
66
+ attr_reader :iam_policy_stub
67
+
68
+ ##
69
+ # Configure the IAMPolicy Client class.
70
+ #
71
+ # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration}
72
+ # for a description of the configuration fields.
73
+ #
74
+ # @example
75
+ #
76
+ # # Modify the configuration for all IAMPolicy clients
77
+ # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config|
78
+ # config.timeout = 10.0
79
+ # end
80
+ #
81
+ # @yield [config] Configure the Client client.
82
+ # @yieldparam config [Client::Configuration]
83
+ #
84
+ # @return [Client::Configuration]
85
+ #
86
+ def self.configure
87
+ @configure ||= begin
88
+ namespace = ["Google", "Iam", "V1"]
89
+ parent_config = while namespace.any?
90
+ parent_name = namespace.join "::"
91
+ parent_const = const_get parent_name
92
+ break parent_const.configure if parent_const.respond_to? :configure
93
+ namespace.pop
94
+ end
95
+ default_config = Client::Configuration.new parent_config
96
+
97
+ default_config
98
+ end
99
+ yield @configure if block_given?
100
+ @configure
101
+ end
102
+
103
+ ##
104
+ # Configure the IAMPolicy Client instance.
105
+ #
106
+ # The configuration is set to the derived mode, meaning that values can be changed,
107
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
108
+ # should be made on {Client.configure}.
109
+ #
110
+ # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration}
111
+ # for a description of the configuration fields.
112
+ #
113
+ # @yield [config] Configure the Client client.
114
+ # @yieldparam config [Client::Configuration]
115
+ #
116
+ # @return [Client::Configuration]
117
+ #
118
+ def configure
119
+ yield @config if block_given?
120
+ @config
121
+ end
122
+
123
+ ##
124
+ # The effective universe domain
125
+ #
126
+ # @return [String]
127
+ #
128
+ def universe_domain
129
+ @iam_policy_stub.universe_domain
130
+ end
131
+
132
+ ##
133
+ # Create a new IAMPolicy REST client object.
134
+ #
135
+ # @example
136
+ #
137
+ # # Create a client using the default configuration
138
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new
139
+ #
140
+ # # Create a client using a custom configuration
141
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
142
+ # config.timeout = 10.0
143
+ # end
144
+ #
145
+ # @yield [config] Configure the IAMPolicy client.
146
+ # @yieldparam config [Client::Configuration]
147
+ #
148
+ def initialize
149
+ # Create the configuration object
150
+ @config = Configuration.new Client.configure
151
+
152
+ # Yield the configuration if needed
153
+ yield @config if block_given?
154
+
155
+ # Create credentials
156
+ credentials = @config.credentials
157
+ # Use self-signed JWT if the endpoint is unchanged from default,
158
+ # but only if the default endpoint does not have a region prefix.
159
+ enable_self_signed_jwt = @config.endpoint.nil? ||
160
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
161
+ !@config.endpoint.split(".").first.include?("-"))
162
+ credentials ||= Credentials.default scope: @config.scope,
163
+ enable_self_signed_jwt: enable_self_signed_jwt
164
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
165
+ credentials = Credentials.new credentials, scope: @config.scope
166
+ end
167
+
168
+ @quota_project_id = @config.quota_project
169
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
170
+
171
+ @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new(
172
+ endpoint: @config.endpoint,
173
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
174
+ universe_domain: @config.universe_domain,
175
+ credentials: credentials,
176
+ logger: @config.logger
177
+ )
178
+
179
+ @iam_policy_stub.logger(stub: true)&.info do |entry|
180
+ entry.set_system_name
181
+ entry.set_service
182
+ entry.message = "Created client for #{entry.service}"
183
+ entry.set_credentials_fields credentials
184
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
185
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
186
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
187
+ end
188
+
189
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
190
+ config.credentials = credentials
191
+ config.quota_project = @quota_project_id
192
+ config.endpoint = @iam_policy_stub.endpoint
193
+ config.universe_domain = @iam_policy_stub.universe_domain
194
+ config.bindings_override = @config.bindings_override
195
+ config.logger = @iam_policy_stub.logger if config.respond_to? :logger=
196
+ end
197
+ end
198
+
199
+ ##
200
+ # Get the associated client for mix-in of the Locations.
201
+ #
202
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
203
+ #
204
+ attr_reader :location_client
205
+
206
+ ##
207
+ # The logger used for request/response debug logging.
208
+ #
209
+ # @return [Logger]
210
+ #
211
+ def logger
212
+ @iam_policy_stub.logger
213
+ end
214
+
215
+ # Service calls
216
+
217
+ ##
218
+ # Sets the access control policy on the specified resource. Replaces any
219
+ # existing policy.
220
+ #
221
+ # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
222
+ #
223
+ # @overload set_iam_policy(request, options = nil)
224
+ # Pass arguments to `set_iam_policy` via a request object, either of type
225
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
226
+ #
227
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
228
+ # A request object representing the call parameters. Required. To specify no
229
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
230
+ # @param options [::Gapic::CallOptions, ::Hash]
231
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
232
+ #
233
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
234
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
235
+ # least one keyword argument is required. To specify no parameters, or to keep all
236
+ # the default parameter values, pass an empty Hash as a request object (see above).
237
+ #
238
+ # @param resource [::String]
239
+ # REQUIRED: The resource for which the policy is being specified.
240
+ # See the operation documentation for the appropriate value for this field.
241
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
242
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
243
+ # the policy is limited to a few 10s of KB. An empty policy is a
244
+ # valid policy but certain Cloud Platform services (such as Projects)
245
+ # might reject them.
246
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
247
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
248
+ # the fields in the mask will be modified. If no mask is provided, the
249
+ # following default mask is used:
250
+ #
251
+ # `paths: "bindings, etag"`
252
+ # @yield [result, operation] Access the result along with the TransportOperation object
253
+ # @yieldparam result [::Google::Iam::V1::Policy]
254
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
255
+ #
256
+ # @return [::Google::Iam::V1::Policy]
257
+ #
258
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
259
+ #
260
+ # @example Basic example
261
+ # require "google/iam/v1"
262
+ #
263
+ # # Create a client object. The client can be reused for multiple calls.
264
+ # client = Google::Iam::V1::IAMPolicy::Rest::Client.new
265
+ #
266
+ # # Create a request. To set request fields, pass in keyword arguments.
267
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
268
+ #
269
+ # # Call the set_iam_policy method.
270
+ # result = client.set_iam_policy request
271
+ #
272
+ # # The returned object is of type Google::Iam::V1::Policy.
273
+ # p result
274
+ #
275
+ def set_iam_policy request, options = nil
276
+ raise ::ArgumentError, "request must be provided" if request.nil?
277
+
278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
279
+
280
+ # Converts hash and nil to an options object
281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
282
+
283
+ # Customize the options with defaults
284
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
285
+
286
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
287
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
289
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION,
290
+ transports_version_send: [:rest]
291
+
292
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
293
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
294
+
295
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
296
+ metadata: call_metadata,
297
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
298
+
299
+ options.apply_defaults timeout: @config.timeout,
300
+ metadata: @config.metadata,
301
+ retry_policy: @config.retry_policy
302
+
303
+ @iam_policy_stub.set_iam_policy request, options do |result, operation|
304
+ yield result, operation if block_given?
305
+ end
306
+ rescue ::Gapic::Rest::Error => e
307
+ raise ::Google::Cloud::Error.from_error(e)
308
+ end
309
+
310
+ ##
311
+ # Gets the access control policy for a resource.
312
+ # Returns an empty policy if the resource exists and does not have a policy
313
+ # set.
314
+ #
315
+ # @overload get_iam_policy(request, options = nil)
316
+ # Pass arguments to `get_iam_policy` via a request object, either of type
317
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
324
+ #
325
+ # @overload get_iam_policy(resource: nil, options: nil)
326
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param resource [::String]
331
+ # REQUIRED: The resource for which the policy is being requested.
332
+ # See the operation documentation for the appropriate value for this field.
333
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
334
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
335
+ # `GetIamPolicy`.
336
+ # @yield [result, operation] Access the result along with the TransportOperation object
337
+ # @yieldparam result [::Google::Iam::V1::Policy]
338
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
339
+ #
340
+ # @return [::Google::Iam::V1::Policy]
341
+ #
342
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
343
+ #
344
+ # @example Basic example
345
+ # require "google/iam/v1"
346
+ #
347
+ # # Create a client object. The client can be reused for multiple calls.
348
+ # client = Google::Iam::V1::IAMPolicy::Rest::Client.new
349
+ #
350
+ # # Create a request. To set request fields, pass in keyword arguments.
351
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
352
+ #
353
+ # # Call the get_iam_policy method.
354
+ # result = client.get_iam_policy request
355
+ #
356
+ # # The returned object is of type Google::Iam::V1::Policy.
357
+ # p result
358
+ #
359
+ def get_iam_policy request, options = nil
360
+ raise ::ArgumentError, "request must be provided" if request.nil?
361
+
362
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
363
+
364
+ # Converts hash and nil to an options object
365
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
366
+
367
+ # Customize the options with defaults
368
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
369
+
370
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
371
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
372
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
373
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION,
374
+ transports_version_send: [:rest]
375
+
376
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
+
379
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
380
+ metadata: call_metadata,
381
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
382
+
383
+ options.apply_defaults timeout: @config.timeout,
384
+ metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
386
+
387
+ @iam_policy_stub.get_iam_policy request, options do |result, operation|
388
+ yield result, operation if block_given?
389
+ end
390
+ rescue ::Gapic::Rest::Error => e
391
+ raise ::Google::Cloud::Error.from_error(e)
392
+ end
393
+
394
+ ##
395
+ # Returns permissions that a caller has on the specified resource.
396
+ # If the resource does not exist, this will return an empty set of
397
+ # permissions, not a `NOT_FOUND` error.
398
+ #
399
+ # Note: This operation is designed to be used for building permission-aware
400
+ # UIs and command-line tools, not for authorization checking. This operation
401
+ # may "fail open" without warning.
402
+ #
403
+ # @overload test_iam_permissions(request, options = nil)
404
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
405
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
406
+ #
407
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
408
+ # A request object representing the call parameters. Required. To specify no
409
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
410
+ # @param options [::Gapic::CallOptions, ::Hash]
411
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
412
+ #
413
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
414
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
415
+ # least one keyword argument is required. To specify no parameters, or to keep all
416
+ # the default parameter values, pass an empty Hash as a request object (see above).
417
+ #
418
+ # @param resource [::String]
419
+ # REQUIRED: The resource for which the policy detail is being requested.
420
+ # See the operation documentation for the appropriate value for this field.
421
+ # @param permissions [::Array<::String>]
422
+ # The set of permissions to check for the `resource`. Permissions with
423
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
424
+ # information see
425
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
426
+ # @yield [result, operation] Access the result along with the TransportOperation object
427
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
428
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
429
+ #
430
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
431
+ #
432
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
433
+ #
434
+ # @example Basic example
435
+ # require "google/iam/v1"
436
+ #
437
+ # # Create a client object. The client can be reused for multiple calls.
438
+ # client = Google::Iam::V1::IAMPolicy::Rest::Client.new
439
+ #
440
+ # # Create a request. To set request fields, pass in keyword arguments.
441
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
442
+ #
443
+ # # Call the test_iam_permissions method.
444
+ # result = client.test_iam_permissions request
445
+ #
446
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
447
+ # p result
448
+ #
449
+ def test_iam_permissions request, options = nil
450
+ raise ::ArgumentError, "request must be provided" if request.nil?
451
+
452
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
453
+
454
+ # Converts hash and nil to an options object
455
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
456
+
457
+ # Customize the options with defaults
458
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
459
+
460
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
461
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
462
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
463
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION,
464
+ transports_version_send: [:rest]
465
+
466
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
467
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
468
+
469
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
470
+ metadata: call_metadata,
471
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
472
+
473
+ options.apply_defaults timeout: @config.timeout,
474
+ metadata: @config.metadata,
475
+ retry_policy: @config.retry_policy
476
+
477
+ @iam_policy_stub.test_iam_permissions request, options do |result, operation|
478
+ yield result, operation if block_given?
479
+ end
480
+ rescue ::Gapic::Rest::Error => e
481
+ raise ::Google::Cloud::Error.from_error(e)
482
+ end
483
+
484
+ ##
485
+ # Configuration class for the IAMPolicy REST API.
486
+ #
487
+ # This class represents the configuration for IAMPolicy REST,
488
+ # providing control over timeouts, retry behavior, logging, transport
489
+ # parameters, and other low-level controls. Certain parameters can also be
490
+ # applied individually to specific RPCs. See
491
+ # {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration::Rpcs}
492
+ # for a list of RPCs that can be configured independently.
493
+ #
494
+ # Configuration can be applied globally to all clients, or to a single client
495
+ # on construction.
496
+ #
497
+ # @example
498
+ #
499
+ # # Modify the global config, setting the timeout for
500
+ # # set_iam_policy to 20 seconds,
501
+ # # and all remaining timeouts to 10 seconds.
502
+ # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config|
503
+ # config.timeout = 10.0
504
+ # config.rpcs.set_iam_policy.timeout = 20.0
505
+ # end
506
+ #
507
+ # # Apply the above configuration only to a new client.
508
+ # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
509
+ # config.timeout = 10.0
510
+ # config.rpcs.set_iam_policy.timeout = 20.0
511
+ # end
512
+ #
513
+ # @!attribute [rw] endpoint
514
+ # A custom service endpoint, as a hostname or hostname:port. The default is
515
+ # nil, indicating to use the default endpoint in the current universe domain.
516
+ # @return [::String,nil]
517
+ # @!attribute [rw] credentials
518
+ # Credentials to send with calls. You may provide any of the following types:
519
+ # * (`String`) The path to a service account key file in JSON format
520
+ # * (`Hash`) A service account key as a Hash
521
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
522
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
523
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
524
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
525
+ # * (`nil`) indicating no credentials
526
+ #
527
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
528
+ # external source for authentication to Google Cloud, you must validate it before
529
+ # providing it to a Google API client library. Providing an unvalidated credential
530
+ # configuration to Google APIs can compromise the security of your systems and data.
531
+ # For more information, refer to [Validate credential configurations from external
532
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
533
+ # @return [::Object]
534
+ # @!attribute [rw] scope
535
+ # The OAuth scopes
536
+ # @return [::Array<::String>]
537
+ # @!attribute [rw] lib_name
538
+ # The library name as recorded in instrumentation and logging
539
+ # @return [::String]
540
+ # @!attribute [rw] lib_version
541
+ # The library version as recorded in instrumentation and logging
542
+ # @return [::String]
543
+ # @!attribute [rw] timeout
544
+ # The call timeout in seconds.
545
+ # @return [::Numeric]
546
+ # @!attribute [rw] metadata
547
+ # Additional headers to be sent with the call.
548
+ # @return [::Hash{::Symbol=>::String}]
549
+ # @!attribute [rw] retry_policy
550
+ # The retry policy. The value is a hash with the following keys:
551
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
552
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
553
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
554
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
555
+ # trigger a retry.
556
+ # @return [::Hash]
557
+ # @!attribute [rw] quota_project
558
+ # A separate project against which to charge quota.
559
+ # @return [::String]
560
+ # @!attribute [rw] universe_domain
561
+ # The universe domain within which to make requests. This determines the
562
+ # default endpoint URL. The default value of nil uses the environment
563
+ # universe (usually the default "googleapis.com" universe).
564
+ # @return [::String,nil]
565
+ # @!attribute [rw] logger
566
+ # A custom logger to use for request/response debug logging, or the value
567
+ # `:default` (the default) to construct a default logger, or `nil` to
568
+ # explicitly disable logging.
569
+ # @return [::Logger,:default,nil]
570
+ #
571
+ class Configuration
572
+ extend ::Gapic::Config
573
+
574
+ # @private
575
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
576
+ DEFAULT_ENDPOINT = "iam-meta-api.googleapis.com"
577
+
578
+ config_attr :endpoint, nil, ::String, nil
579
+ config_attr :credentials, nil do |value|
580
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
581
+ allowed.any? { |klass| klass === value }
582
+ end
583
+ config_attr :scope, nil, ::String, ::Array, nil
584
+ config_attr :lib_name, nil, ::String, nil
585
+ config_attr :lib_version, nil, ::String, nil
586
+ config_attr :timeout, nil, ::Numeric, nil
587
+ config_attr :metadata, nil, ::Hash, nil
588
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
589
+ config_attr :quota_project, nil, ::String, nil
590
+ config_attr :universe_domain, nil, ::String, nil
591
+
592
+ # @private
593
+ # Overrides for http bindings for the RPCs of this service
594
+ # are only used when this service is used as mixin, and only
595
+ # by the host service.
596
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
597
+ config_attr :bindings_override, {}, ::Hash, nil
598
+ config_attr :logger, :default, ::Logger, nil, :default
599
+
600
+ # @private
601
+ def initialize parent_config = nil
602
+ @parent_config = parent_config unless parent_config.nil?
603
+
604
+ yield self if block_given?
605
+ end
606
+
607
+ ##
608
+ # Configurations for individual RPCs
609
+ # @return [Rpcs]
610
+ #
611
+ def rpcs
612
+ @rpcs ||= begin
613
+ parent_rpcs = nil
614
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
615
+ Rpcs.new parent_rpcs
616
+ end
617
+ end
618
+
619
+ ##
620
+ # Configuration RPC class for the IAMPolicy API.
621
+ #
622
+ # Includes fields providing the configuration for each RPC in this service.
623
+ # Each configuration object is of type `Gapic::Config::Method` and includes
624
+ # the following configuration fields:
625
+ #
626
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
627
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
628
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
629
+ # include the following keys:
630
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
631
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
632
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
633
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
634
+ # trigger a retry.
635
+ #
636
+ class Rpcs
637
+ ##
638
+ # RPC-specific configuration for `set_iam_policy`
639
+ # @return [::Gapic::Config::Method]
640
+ #
641
+ attr_reader :set_iam_policy
642
+ ##
643
+ # RPC-specific configuration for `get_iam_policy`
644
+ # @return [::Gapic::Config::Method]
645
+ #
646
+ attr_reader :get_iam_policy
647
+ ##
648
+ # RPC-specific configuration for `test_iam_permissions`
649
+ # @return [::Gapic::Config::Method]
650
+ #
651
+ attr_reader :test_iam_permissions
652
+
653
+ # @private
654
+ def initialize parent_rpcs = nil
655
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
656
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
657
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
658
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
659
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
660
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
661
+
662
+ yield self if block_given?
663
+ end
664
+ end
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end
671
+ end