google-cloud-workload_identity-v1 0.a → 0.1.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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/workload_identity/v1/bindings_override.rb +107 -0
  6. data/lib/google/cloud/workload_identity/v1/rest.rb +38 -0
  7. data/lib/google/cloud/workload_identity/v1/version.rb +7 -2
  8. data/lib/google/cloud/workload_identity/v1/workload_identity/client.rb +528 -0
  9. data/lib/google/cloud/workload_identity/v1/workload_identity/credentials.rb +47 -0
  10. data/lib/google/cloud/workload_identity/v1/workload_identity/operations.rb +843 -0
  11. data/lib/google/cloud/workload_identity/v1/workload_identity/paths.rb +91 -0
  12. data/lib/google/cloud/workload_identity/v1/workload_identity/rest/client.rb +486 -0
  13. data/lib/google/cloud/workload_identity/v1/workload_identity/rest/operations.rb +985 -0
  14. data/lib/google/cloud/workload_identity/v1/workload_identity/rest/service_stub.rb +159 -0
  15. data/lib/google/cloud/workload_identity/v1/workload_identity/rest.rb +54 -0
  16. data/lib/google/cloud/workload_identity/v1/workload_identity.rb +56 -0
  17. data/lib/google/cloud/workload_identity/v1.rb +45 -0
  18. data/lib/google/cloud/workloadidentity/v1/service_pb.rb +32 -0
  19. data/lib/google/cloud/workloadidentity/v1/service_services_pb.rb +46 -0
  20. data/lib/google-cloud-workload_identity-v1.rb +21 -0
  21. data/proto_docs/README.md +4 -0
  22. data/proto_docs/google/api/client.rb +593 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/api/resource.rb +227 -0
  26. data/proto_docs/google/cloud/workloadidentity/v1/service.rb +129 -0
  27. data/proto_docs/google/longrunning/operations.rb +191 -0
  28. data/proto_docs/google/protobuf/any.rb +145 -0
  29. data/proto_docs/google/protobuf/duration.rb +98 -0
  30. data/proto_docs/google/protobuf/empty.rb +34 -0
  31. data/proto_docs/google/protobuf/timestamp.rb +128 -0
  32. data/proto_docs/google/rpc/status.rb +48 -0
  33. metadata +79 -9
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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
+
20
+ module Google
21
+ module Cloud
22
+ module WorkloadIdentity
23
+ module V1
24
+ module WorkloadIdentity
25
+ # Path helper methods for the WorkloadIdentity API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified ServiceProducer resource string.
29
+ #
30
+ # @overload service_producer_path(project:, location:, service_producer:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/serviceProducers/{service_producer}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param service_producer [String]
38
+ #
39
+ # @overload service_producer_path(folder:, location:, service_producer:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `folders/{folder}/locations/{location}/serviceProducers/{service_producer}`
43
+ #
44
+ # @param folder [String]
45
+ # @param location [String]
46
+ # @param service_producer [String]
47
+ #
48
+ # @overload service_producer_path(organization:, location:, service_producer:)
49
+ # The resource will be in the following format:
50
+ #
51
+ # `organizations/{organization}/locations/{location}/serviceProducers/{service_producer}`
52
+ #
53
+ # @param organization [String]
54
+ # @param location [String]
55
+ # @param service_producer [String]
56
+ #
57
+ # @return [::String]
58
+ def service_producer_path **args
59
+ resources = {
60
+ "location:project:service_producer" => (proc do |project:, location:, service_producer:|
61
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
62
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
63
+
64
+ "projects/#{project}/locations/#{location}/serviceProducers/#{service_producer}"
65
+ end),
66
+ "folder:location:service_producer" => (proc do |folder:, location:, service_producer:|
67
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
68
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
69
+
70
+ "folders/#{folder}/locations/#{location}/serviceProducers/#{service_producer}"
71
+ end),
72
+ "location:organization:service_producer" => (proc do |organization:, location:, service_producer:|
73
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
74
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
75
+
76
+ "organizations/#{organization}/locations/#{location}/serviceProducers/#{service_producer}"
77
+ end)
78
+ }
79
+
80
+ resource = resources[args.keys.sort.join(":")]
81
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
82
+ resource.call(**args)
83
+ end
84
+
85
+ extend self
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,486 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/workloadidentity/v1/service_pb"
21
+ require "google/cloud/workload_identity/v1/workload_identity/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module WorkloadIdentity
27
+ module V1
28
+ module WorkloadIdentity
29
+ module Rest
30
+ ##
31
+ # REST client for the WorkloadIdentity service.
32
+ #
33
+ # Service describing handlers for resources
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "workloadidentity.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :workload_identity_stub
46
+
47
+ ##
48
+ # Configure the WorkloadIdentity Client class.
49
+ #
50
+ # See {::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all WorkloadIdentity clients
56
+ # ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "WorkloadIdentity", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.rpcs.generate_service_agents.timeout = 60.0
77
+ default_config.rpcs.generate_service_agents.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the WorkloadIdentity 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::Cloud::WorkloadIdentity::V1::WorkloadIdentity::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
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @workload_identity_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new WorkloadIdentity REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the WorkloadIdentity client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @operations_client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Operations.new do |config|
156
+ config.credentials = credentials
157
+ config.quota_project = @quota_project_id
158
+ config.endpoint = @config.endpoint
159
+ config.universe_domain = @config.universe_domain
160
+ end
161
+
162
+ @workload_identity_stub = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @workload_identity_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
180
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
181
+ config.credentials = credentials
182
+ config.quota_project = @quota_project_id
183
+ config.endpoint = @workload_identity_stub.endpoint
184
+ config.universe_domain = @workload_identity_stub.universe_domain
185
+ config.bindings_override = @config.bindings_override
186
+ config.logger = @workload_identity_stub.logger if config.respond_to? :logger=
187
+ end
188
+ end
189
+
190
+ ##
191
+ # Get the associated client for long-running operations.
192
+ #
193
+ # @return [::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Operations]
194
+ #
195
+ attr_reader :operations_client
196
+
197
+ ##
198
+ # Get the associated client for mix-in of the Locations.
199
+ #
200
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
201
+ #
202
+ attr_reader :location_client
203
+
204
+ ##
205
+ # The logger used for request/response debug logging.
206
+ #
207
+ # @return [Logger]
208
+ #
209
+ def logger
210
+ @workload_identity_stub.logger
211
+ end
212
+
213
+ # Service calls
214
+
215
+ ##
216
+ # Creates all service agents for a given resource, location and service
217
+ # producer.
218
+ #
219
+ # @overload generate_service_agents(request, options = nil)
220
+ # Pass arguments to `generate_service_agents` via a request object, either of type
221
+ # {::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
228
+ #
229
+ # @overload generate_service_agents(parent: nil)
230
+ # Pass arguments to `generate_service_agents` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param parent [::String]
235
+ # Required. The parent resource. The `location` for the parent resource must
236
+ # be `global`.
237
+ #
238
+ # Examples:
239
+ #
240
+ # - projects/1234/locations/global/serviceProducers/bigquery.googleapis.com
241
+ # - folders/2344/locations/global/serviceProducers/vertexai.googleapis.com
242
+ # - organizations/3344/locations/global/serviceProducers/iam.googleapis.com
243
+ # @yield [result, operation] Access the result along with the TransportOperation object
244
+ # @yieldparam result [::Gapic::Operation]
245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
246
+ #
247
+ # @return [::Gapic::Operation]
248
+ #
249
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
250
+ #
251
+ # @example Basic example
252
+ # require "google/cloud/workload_identity/v1"
253
+ #
254
+ # # Create a client object. The client can be reused for multiple calls.
255
+ # client = Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.new
256
+ #
257
+ # # Create a request. To set request fields, pass in keyword arguments.
258
+ # request = Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest.new
259
+ #
260
+ # # Call the generate_service_agents method.
261
+ # result = client.generate_service_agents request
262
+ #
263
+ # # The returned object is of type Gapic::Operation. You can use it to
264
+ # # check the status of an operation, cancel it, or wait for results.
265
+ # # Here is how to wait for a response.
266
+ # result.wait_until_done! timeout: 60
267
+ # if result.response?
268
+ # p result.response
269
+ # else
270
+ # puts "No response received."
271
+ # end
272
+ #
273
+ def generate_service_agents request, options = nil
274
+ raise ::ArgumentError, "request must be provided" if request.nil?
275
+
276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest
277
+
278
+ # Converts hash and nil to an options object
279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
280
+
281
+ # Customize the options with defaults
282
+ call_metadata = @config.rpcs.generate_service_agents.metadata.to_h
283
+
284
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
285
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
287
+ gapic_version: ::Google::Cloud::WorkloadIdentity::V1::VERSION,
288
+ transports_version_send: [:rest]
289
+
290
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
291
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
292
+
293
+ options.apply_defaults timeout: @config.rpcs.generate_service_agents.timeout,
294
+ metadata: call_metadata,
295
+ retry_policy: @config.rpcs.generate_service_agents.retry_policy
296
+
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata,
299
+ retry_policy: @config.retry_policy
300
+
301
+ @workload_identity_stub.generate_service_agents request, options do |result, operation|
302
+ result = ::Gapic::Operation.new result, @operations_client, options: options
303
+ yield result, operation if block_given?
304
+ throw :response, result
305
+ end
306
+ rescue ::Gapic::Rest::Error => e
307
+ raise ::Google::Cloud::Error.from_error(e)
308
+ end
309
+
310
+ ##
311
+ # Configuration class for the WorkloadIdentity REST API.
312
+ #
313
+ # This class represents the configuration for WorkloadIdentity REST,
314
+ # providing control over timeouts, retry behavior, logging, transport
315
+ # parameters, and other low-level controls. Certain parameters can also be
316
+ # applied individually to specific RPCs. See
317
+ # {::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client::Configuration::Rpcs}
318
+ # for a list of RPCs that can be configured independently.
319
+ #
320
+ # Configuration can be applied globally to all clients, or to a single client
321
+ # on construction.
322
+ #
323
+ # @example
324
+ #
325
+ # # Modify the global config, setting the timeout for
326
+ # # generate_service_agents to 20 seconds,
327
+ # # and all remaining timeouts to 10 seconds.
328
+ # ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.configure do |config|
329
+ # config.timeout = 10.0
330
+ # config.rpcs.generate_service_agents.timeout = 20.0
331
+ # end
332
+ #
333
+ # # Apply the above configuration only to a new client.
334
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Rest::Client.new do |config|
335
+ # config.timeout = 10.0
336
+ # config.rpcs.generate_service_agents.timeout = 20.0
337
+ # end
338
+ #
339
+ # @!attribute [rw] endpoint
340
+ # A custom service endpoint, as a hostname or hostname:port. The default is
341
+ # nil, indicating to use the default endpoint in the current universe domain.
342
+ # @return [::String,nil]
343
+ # @!attribute [rw] credentials
344
+ # Credentials to send with calls. You may provide any of the following types:
345
+ # * (`String`) The path to a service account key file in JSON format
346
+ # * (`Hash`) A service account key as a Hash
347
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
348
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
349
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
350
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
351
+ # * (`nil`) indicating no credentials
352
+ #
353
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
354
+ # external source for authentication to Google Cloud, you must validate it before
355
+ # providing it to a Google API client library. Providing an unvalidated credential
356
+ # configuration to Google APIs can compromise the security of your systems and data.
357
+ # For more information, refer to [Validate credential configurations from external
358
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
359
+ # @return [::Object]
360
+ # @!attribute [rw] scope
361
+ # The OAuth scopes
362
+ # @return [::Array<::String>]
363
+ # @!attribute [rw] lib_name
364
+ # The library name as recorded in instrumentation and logging
365
+ # @return [::String]
366
+ # @!attribute [rw] lib_version
367
+ # The library version as recorded in instrumentation and logging
368
+ # @return [::String]
369
+ # @!attribute [rw] timeout
370
+ # The call timeout in seconds.
371
+ # @return [::Numeric]
372
+ # @!attribute [rw] metadata
373
+ # Additional headers to be sent with the call.
374
+ # @return [::Hash{::Symbol=>::String}]
375
+ # @!attribute [rw] retry_policy
376
+ # The retry policy. The value is a hash with the following keys:
377
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
378
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
379
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
380
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
381
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
382
+ # trigger a retry.
383
+ # @return [::Hash]
384
+ # @!attribute [rw] quota_project
385
+ # A separate project against which to charge quota.
386
+ # @return [::String]
387
+ # @!attribute [rw] universe_domain
388
+ # The universe domain within which to make requests. This determines the
389
+ # default endpoint URL. The default value of nil uses the environment
390
+ # universe (usually the default "googleapis.com" universe).
391
+ # @return [::String,nil]
392
+ # @!attribute [rw] logger
393
+ # A custom logger to use for request/response debug logging, or the value
394
+ # `:default` (the default) to construct a default logger, or `nil` to
395
+ # explicitly disable logging.
396
+ # @return [::Logger,:default,nil]
397
+ #
398
+ class Configuration
399
+ extend ::Gapic::Config
400
+
401
+ # @private
402
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
403
+ DEFAULT_ENDPOINT = "workloadidentity.googleapis.com"
404
+
405
+ config_attr :endpoint, nil, ::String, nil
406
+ config_attr :credentials, nil do |value|
407
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
408
+ allowed.any? { |klass| klass === value }
409
+ end
410
+ config_attr :scope, nil, ::String, ::Array, nil
411
+ config_attr :lib_name, nil, ::String, nil
412
+ config_attr :lib_version, nil, ::String, nil
413
+ config_attr :timeout, nil, ::Numeric, nil
414
+ config_attr :metadata, nil, ::Hash, nil
415
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
416
+ config_attr :quota_project, nil, ::String, nil
417
+ config_attr :universe_domain, nil, ::String, nil
418
+
419
+ # @private
420
+ # Overrides for http bindings for the RPCs of this service
421
+ # are only used when this service is used as mixin, and only
422
+ # by the host service.
423
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
424
+ config_attr :bindings_override, {}, ::Hash, nil
425
+ config_attr :logger, :default, ::Logger, nil, :default
426
+
427
+ # @private
428
+ def initialize parent_config = nil
429
+ @parent_config = parent_config unless parent_config.nil?
430
+
431
+ yield self if block_given?
432
+ end
433
+
434
+ ##
435
+ # Configurations for individual RPCs
436
+ # @return [Rpcs]
437
+ #
438
+ def rpcs
439
+ @rpcs ||= begin
440
+ parent_rpcs = nil
441
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
442
+ Rpcs.new parent_rpcs
443
+ end
444
+ end
445
+
446
+ ##
447
+ # Configuration RPC class for the WorkloadIdentity API.
448
+ #
449
+ # Includes fields providing the configuration for each RPC in this service.
450
+ # Each configuration object is of type `Gapic::Config::Method` and includes
451
+ # the following configuration fields:
452
+ #
453
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
454
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
455
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
456
+ # include the following keys:
457
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
458
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
459
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
460
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
461
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
462
+ # trigger a retry.
463
+ #
464
+ class Rpcs
465
+ ##
466
+ # RPC-specific configuration for `generate_service_agents`
467
+ # @return [::Gapic::Config::Method]
468
+ #
469
+ attr_reader :generate_service_agents
470
+
471
+ # @private
472
+ def initialize parent_rpcs = nil
473
+ generate_service_agents_config = parent_rpcs.generate_service_agents if parent_rpcs.respond_to? :generate_service_agents
474
+ @generate_service_agents = ::Gapic::Config::Method.new generate_service_agents_config
475
+
476
+ yield self if block_given?
477
+ end
478
+ end
479
+ end
480
+ end
481
+ end
482
+ end
483
+ end
484
+ end
485
+ end
486
+ end