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,528 @@
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/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module WorkloadIdentity
26
+ module V1
27
+ module WorkloadIdentity
28
+ ##
29
+ # Client for the WorkloadIdentity service.
30
+ #
31
+ # Service describing handlers for resources
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "workloadidentity.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :workload_identity_stub
44
+
45
+ ##
46
+ # Configure the WorkloadIdentity Client class.
47
+ #
48
+ # See {::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all WorkloadIdentity clients
54
+ # ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "WorkloadIdentity", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.generate_service_agents.timeout = 60.0
75
+ default_config.rpcs.generate_service_agents.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the WorkloadIdentity Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @workload_identity_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new WorkloadIdentity client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the WorkloadIdentity client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/workloadidentity/v1/service_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
163
+ end
164
+
165
+ @workload_identity_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @workload_identity_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
187
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @workload_identity_stub.endpoint
191
+ config.universe_domain = @workload_identity_stub.universe_domain
192
+ config.logger = @workload_identity_stub.logger if config.respond_to? :logger=
193
+ end
194
+ end
195
+
196
+ ##
197
+ # Get the associated client for long-running operations.
198
+ #
199
+ # @return [::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Operations]
200
+ #
201
+ attr_reader :operations_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the Locations.
205
+ #
206
+ # @return [Google::Cloud::Location::Locations::Client]
207
+ #
208
+ attr_reader :location_client
209
+
210
+ ##
211
+ # The logger used for request/response debug logging.
212
+ #
213
+ # @return [Logger]
214
+ #
215
+ def logger
216
+ @workload_identity_stub.logger
217
+ end
218
+
219
+ # Service calls
220
+
221
+ ##
222
+ # Creates all service agents for a given resource, location and service
223
+ # producer.
224
+ #
225
+ # @overload generate_service_agents(request, options = nil)
226
+ # Pass arguments to `generate_service_agents` via a request object, either of type
227
+ # {::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest} or an equivalent Hash.
228
+ #
229
+ # @param request [::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest, ::Hash]
230
+ # A request object representing the call parameters. Required. To specify no
231
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
232
+ # @param options [::Gapic::CallOptions, ::Hash]
233
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
234
+ #
235
+ # @overload generate_service_agents(parent: nil)
236
+ # Pass arguments to `generate_service_agents` via keyword arguments. Note that at
237
+ # least one keyword argument is required. To specify no parameters, or to keep all
238
+ # the default parameter values, pass an empty Hash as a request object (see above).
239
+ #
240
+ # @param parent [::String]
241
+ # Required. The parent resource. The `location` for the parent resource must
242
+ # be `global`.
243
+ #
244
+ # Examples:
245
+ #
246
+ # - projects/1234/locations/global/serviceProducers/bigquery.googleapis.com
247
+ # - folders/2344/locations/global/serviceProducers/vertexai.googleapis.com
248
+ # - organizations/3344/locations/global/serviceProducers/iam.googleapis.com
249
+ #
250
+ # @yield [response, operation] Access the result along with the RPC operation
251
+ # @yieldparam response [::Gapic::Operation]
252
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
253
+ #
254
+ # @return [::Gapic::Operation]
255
+ #
256
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
257
+ #
258
+ # @example Basic example
259
+ # require "google/cloud/workload_identity/v1"
260
+ #
261
+ # # Create a client object. The client can be reused for multiple calls.
262
+ # client = Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new
263
+ #
264
+ # # Create a request. To set request fields, pass in keyword arguments.
265
+ # request = Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest.new
266
+ #
267
+ # # Call the generate_service_agents method.
268
+ # result = client.generate_service_agents request
269
+ #
270
+ # # The returned object is of type Gapic::Operation. You can use it to
271
+ # # check the status of an operation, cancel it, or wait for results.
272
+ # # Here is how to wait for a response.
273
+ # result.wait_until_done! timeout: 60
274
+ # if result.response?
275
+ # p result.response
276
+ # else
277
+ # puts "No response received."
278
+ # end
279
+ #
280
+ def generate_service_agents request, options = nil
281
+ raise ::ArgumentError, "request must be provided" if request.nil?
282
+
283
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WorkloadIdentity::V1::GenerateServiceAgentsRequest
284
+
285
+ # Converts hash and nil to an options object
286
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
287
+
288
+ # Customize the options with defaults
289
+ metadata = @config.rpcs.generate_service_agents.metadata.to_h
290
+
291
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
292
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
293
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
294
+ gapic_version: ::Google::Cloud::WorkloadIdentity::V1::VERSION
295
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
296
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
297
+
298
+ header_params = {}
299
+ if request.parent
300
+ header_params["parent"] = request.parent
301
+ end
302
+
303
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
304
+ metadata[:"x-goog-request-params"] ||= request_params_header
305
+
306
+ options.apply_defaults timeout: @config.rpcs.generate_service_agents.timeout,
307
+ metadata: metadata,
308
+ retry_policy: @config.rpcs.generate_service_agents.retry_policy
309
+
310
+ options.apply_defaults timeout: @config.timeout,
311
+ metadata: @config.metadata,
312
+ retry_policy: @config.retry_policy
313
+
314
+ @workload_identity_stub.call_rpc :generate_service_agents, request, options: options do |response, operation|
315
+ response = ::Gapic::Operation.new response, @operations_client, options: options
316
+ yield response, operation if block_given?
317
+ throw :response, response
318
+ end
319
+ rescue ::GRPC::BadStatus => e
320
+ raise ::Google::Cloud::Error.from_error(e)
321
+ end
322
+
323
+ ##
324
+ # Configuration class for the WorkloadIdentity API.
325
+ #
326
+ # This class represents the configuration for WorkloadIdentity,
327
+ # providing control over timeouts, retry behavior, logging, transport
328
+ # parameters, and other low-level controls. Certain parameters can also be
329
+ # applied individually to specific RPCs. See
330
+ # {::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client::Configuration::Rpcs}
331
+ # for a list of RPCs that can be configured independently.
332
+ #
333
+ # Configuration can be applied globally to all clients, or to a single client
334
+ # on construction.
335
+ #
336
+ # @example
337
+ #
338
+ # # Modify the global config, setting the timeout for
339
+ # # generate_service_agents to 20 seconds,
340
+ # # and all remaining timeouts to 10 seconds.
341
+ # ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.configure do |config|
342
+ # config.timeout = 10.0
343
+ # config.rpcs.generate_service_agents.timeout = 20.0
344
+ # end
345
+ #
346
+ # # Apply the above configuration only to a new client.
347
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new do |config|
348
+ # config.timeout = 10.0
349
+ # config.rpcs.generate_service_agents.timeout = 20.0
350
+ # end
351
+ #
352
+ # @!attribute [rw] endpoint
353
+ # A custom service endpoint, as a hostname or hostname:port. The default is
354
+ # nil, indicating to use the default endpoint in the current universe domain.
355
+ # @return [::String,nil]
356
+ # @!attribute [rw] credentials
357
+ # Credentials to send with calls. You may provide any of the following types:
358
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
359
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
360
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
361
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
362
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
363
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
364
+ # * (`nil`) indicating no credentials
365
+ #
366
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
367
+ # is deprecated. Providing an unvalidated credential configuration to
368
+ # Google APIs can compromise the security of your systems and data.
369
+ #
370
+ # @example
371
+ #
372
+ # # The recommended way to provide credentials is to use the `make_creds` method
373
+ # # on the appropriate credentials class for your environment.
374
+ #
375
+ # require "googleauth"
376
+ #
377
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
378
+ # json_key_io: ::File.open("/path/to/keyfile.json")
379
+ # )
380
+ #
381
+ # client = ::Google::Cloud::WorkloadIdentity::V1::WorkloadIdentity::Client.new do |config|
382
+ # config.credentials = credentials
383
+ # end
384
+ #
385
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
386
+ # external source for authentication to Google Cloud, you must validate it before
387
+ # providing it to a Google API client library. Providing an unvalidated credential
388
+ # configuration to Google APIs can compromise the security of your systems and data.
389
+ # For more information, refer to [Validate credential configurations from external
390
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
391
+ # @return [::Object]
392
+ # @!attribute [rw] scope
393
+ # The OAuth scopes
394
+ # @return [::Array<::String>]
395
+ # @!attribute [rw] lib_name
396
+ # The library name as recorded in instrumentation and logging
397
+ # @return [::String]
398
+ # @!attribute [rw] lib_version
399
+ # The library version as recorded in instrumentation and logging
400
+ # @return [::String]
401
+ # @!attribute [rw] channel_args
402
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
403
+ # `GRPC::Core::Channel` object is provided as the credential.
404
+ # @return [::Hash]
405
+ # @!attribute [rw] interceptors
406
+ # An array of interceptors that are run before calls are executed.
407
+ # @return [::Array<::GRPC::ClientInterceptor>]
408
+ # @!attribute [rw] timeout
409
+ # The call timeout in seconds.
410
+ # @return [::Numeric]
411
+ # @!attribute [rw] metadata
412
+ # Additional gRPC headers to be sent with the call.
413
+ # @return [::Hash{::Symbol=>::String}]
414
+ # @!attribute [rw] retry_policy
415
+ # The retry policy. The value is a hash with the following keys:
416
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
417
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
418
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
419
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
420
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
421
+ # trigger a retry.
422
+ # @return [::Hash]
423
+ # @!attribute [rw] quota_project
424
+ # A separate project against which to charge quota.
425
+ # @return [::String]
426
+ # @!attribute [rw] universe_domain
427
+ # The universe domain within which to make requests. This determines the
428
+ # default endpoint URL. The default value of nil uses the environment
429
+ # universe (usually the default "googleapis.com" universe).
430
+ # @return [::String,nil]
431
+ # @!attribute [rw] logger
432
+ # A custom logger to use for request/response debug logging, or the value
433
+ # `:default` (the default) to construct a default logger, or `nil` to
434
+ # explicitly disable logging.
435
+ # @return [::Logger,:default,nil]
436
+ #
437
+ class Configuration
438
+ extend ::Gapic::Config
439
+
440
+ # @private
441
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
442
+ DEFAULT_ENDPOINT = "workloadidentity.googleapis.com"
443
+
444
+ config_attr :endpoint, nil, ::String, nil
445
+ config_attr :credentials, nil do |value|
446
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
447
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
448
+ allowed.any? { |klass| klass === value }
449
+ end
450
+ config_attr :scope, nil, ::String, ::Array, nil
451
+ config_attr :lib_name, nil, ::String, nil
452
+ config_attr :lib_version, nil, ::String, nil
453
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
454
+ config_attr :interceptors, nil, ::Array, nil
455
+ config_attr :timeout, nil, ::Numeric, nil
456
+ config_attr :metadata, nil, ::Hash, nil
457
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
458
+ config_attr :quota_project, nil, ::String, nil
459
+ config_attr :universe_domain, nil, ::String, nil
460
+ config_attr :logger, :default, ::Logger, nil, :default
461
+
462
+ # @private
463
+ def initialize parent_config = nil
464
+ @parent_config = parent_config unless parent_config.nil?
465
+
466
+ yield self if block_given?
467
+ end
468
+
469
+ ##
470
+ # Configurations for individual RPCs
471
+ # @return [Rpcs]
472
+ #
473
+ def rpcs
474
+ @rpcs ||= begin
475
+ parent_rpcs = nil
476
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
477
+ Rpcs.new parent_rpcs
478
+ end
479
+ end
480
+
481
+ ##
482
+ # Configuration for the channel pool
483
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
484
+ #
485
+ def channel_pool
486
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
487
+ end
488
+
489
+ ##
490
+ # Configuration RPC class for the WorkloadIdentity API.
491
+ #
492
+ # Includes fields providing the configuration for each RPC in this service.
493
+ # Each configuration object is of type `Gapic::Config::Method` and includes
494
+ # the following configuration fields:
495
+ #
496
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
497
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
498
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
499
+ # include the following keys:
500
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
501
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
502
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
503
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
504
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
505
+ # trigger a retry.
506
+ #
507
+ class Rpcs
508
+ ##
509
+ # RPC-specific configuration for `generate_service_agents`
510
+ # @return [::Gapic::Config::Method]
511
+ #
512
+ attr_reader :generate_service_agents
513
+
514
+ # @private
515
+ def initialize parent_rpcs = nil
516
+ generate_service_agents_config = parent_rpcs.generate_service_agents if parent_rpcs.respond_to? :generate_service_agents
517
+ @generate_service_agents = ::Gapic::Config::Method.new generate_service_agents_config
518
+
519
+ yield self if block_given?
520
+ end
521
+ end
522
+ end
523
+ end
524
+ end
525
+ end
526
+ end
527
+ end
528
+ end
@@ -0,0 +1,47 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module WorkloadIdentity
24
+ module V1
25
+ module WorkloadIdentity
26
+ # Credentials for the WorkloadIdentity API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end