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