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