google-cloud-cloud_quotas-v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +154 -0
  6. data/lib/google/api/cloudquotas/v1beta/cloudquotas_pb.rb +58 -0
  7. data/lib/google/api/cloudquotas/v1beta/cloudquotas_services_pb.rb +62 -0
  8. data/lib/google/api/cloudquotas/v1beta/quota_adjuster_settings_pb.rb +54 -0
  9. data/lib/google/api/cloudquotas/v1beta/quota_adjuster_settings_services_pb.rb +52 -0
  10. data/lib/google/api/cloudquotas/v1beta/resources_pb.rb +59 -0
  11. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/client.rb +1030 -0
  12. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/credentials.rb +47 -0
  13. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/paths.rb +265 -0
  14. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/rest/client.rb +960 -0
  15. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/rest/service_stub.rb +537 -0
  16. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas/rest.rb +58 -0
  17. data/lib/google/cloud/cloud_quotas/v1beta/cloud_quotas.rb +61 -0
  18. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/client.rb +564 -0
  19. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/credentials.rb +47 -0
  20. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/paths.rb +50 -0
  21. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/rest/client.rb +524 -0
  22. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/rest/service_stub.rb +204 -0
  23. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager/rest.rb +57 -0
  24. data/lib/google/cloud/cloud_quotas/v1beta/quota_adjuster_settings_manager.rb +60 -0
  25. data/lib/google/cloud/cloud_quotas/v1beta/rest.rb +38 -0
  26. data/lib/google/cloud/cloud_quotas/v1beta/version.rb +28 -0
  27. data/lib/google/cloud/cloud_quotas/v1beta.rb +46 -0
  28. data/lib/google-cloud-cloud_quotas-v1beta.rb +21 -0
  29. data/proto_docs/README.md +4 -0
  30. data/proto_docs/google/api/client.rb +459 -0
  31. data/proto_docs/google/api/cloudquotas/v1beta/cloudquotas.rb +193 -0
  32. data/proto_docs/google/api/cloudquotas/v1beta/quota_adjuster_settings.rb +89 -0
  33. data/proto_docs/google/api/cloudquotas/v1beta/resources.rb +348 -0
  34. data/proto_docs/google/api/field_behavior.rb +85 -0
  35. data/proto_docs/google/api/launch_stage.rb +71 -0
  36. data/proto_docs/google/api/resource.rb +227 -0
  37. data/proto_docs/google/protobuf/duration.rb +98 -0
  38. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  39. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  40. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  41. metadata +118 -0
@@ -0,0 +1,1030 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/api/cloudquotas/v1beta/cloudquotas_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module CloudQuotas
25
+ module V1beta
26
+ module CloudQuotas
27
+ ##
28
+ # Client for the CloudQuotas service.
29
+ #
30
+ # The Cloud Quotas API is an infrastructure service for Google Cloud that lets
31
+ # service consumers list and manage their resource usage limits.
32
+ #
33
+ # - List/Get the metadata and current status of the quotas for a service.
34
+ # - Create/Update quota preferencess that declare the preferred quota values.
35
+ # - Check the status of a quota preference request.
36
+ # - List/Get pending and historical quota preference.
37
+ #
38
+ class Client
39
+ # @private
40
+ API_VERSION = ""
41
+
42
+ # @private
43
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudquotas.$UNIVERSE_DOMAIN$"
44
+
45
+ include Paths
46
+
47
+ # @private
48
+ attr_reader :cloud_quotas_stub
49
+
50
+ ##
51
+ # Configure the CloudQuotas Client class.
52
+ #
53
+ # See {::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client::Configuration}
54
+ # for a description of the configuration fields.
55
+ #
56
+ # @example
57
+ #
58
+ # # Modify the configuration for all CloudQuotas clients
59
+ # ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.configure do |config|
60
+ # config.timeout = 10.0
61
+ # end
62
+ #
63
+ # @yield [config] Configure the Client client.
64
+ # @yieldparam config [Client::Configuration]
65
+ #
66
+ # @return [Client::Configuration]
67
+ #
68
+ def self.configure
69
+ @configure ||= begin
70
+ namespace = ["Google", "Cloud", "CloudQuotas", "V1beta"]
71
+ parent_config = while namespace.any?
72
+ parent_name = namespace.join "::"
73
+ parent_const = const_get parent_name
74
+ break parent_const.configure if parent_const.respond_to? :configure
75
+ namespace.pop
76
+ end
77
+ default_config = Client::Configuration.new parent_config
78
+
79
+ default_config.rpcs.list_quota_infos.timeout = 60.0
80
+ default_config.rpcs.list_quota_infos.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
+ }
83
+
84
+ default_config.rpcs.get_quota_info.timeout = 60.0
85
+ default_config.rpcs.get_quota_info.retry_policy = {
86
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
87
+ }
88
+
89
+ default_config.rpcs.list_quota_preferences.timeout = 60.0
90
+ default_config.rpcs.list_quota_preferences.retry_policy = {
91
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
92
+ }
93
+
94
+ default_config.rpcs.get_quota_preference.timeout = 60.0
95
+ default_config.rpcs.get_quota_preference.retry_policy = {
96
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
97
+ }
98
+
99
+ default_config.rpcs.create_quota_preference.timeout = 60.0
100
+ default_config.rpcs.create_quota_preference.retry_policy = {
101
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
102
+ }
103
+
104
+ default_config.rpcs.update_quota_preference.timeout = 60.0
105
+ default_config.rpcs.update_quota_preference.retry_policy = {
106
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
107
+ }
108
+
109
+ default_config
110
+ end
111
+ yield @configure if block_given?
112
+ @configure
113
+ end
114
+
115
+ ##
116
+ # Configure the CloudQuotas Client instance.
117
+ #
118
+ # The configuration is set to the derived mode, meaning that values can be changed,
119
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
120
+ # should be made on {Client.configure}.
121
+ #
122
+ # See {::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client::Configuration}
123
+ # for a description of the configuration fields.
124
+ #
125
+ # @yield [config] Configure the Client client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ # @return [Client::Configuration]
129
+ #
130
+ def configure
131
+ yield @config if block_given?
132
+ @config
133
+ end
134
+
135
+ ##
136
+ # The effective universe domain
137
+ #
138
+ # @return [String]
139
+ #
140
+ def universe_domain
141
+ @cloud_quotas_stub.universe_domain
142
+ end
143
+
144
+ ##
145
+ # Create a new CloudQuotas client object.
146
+ #
147
+ # @example
148
+ #
149
+ # # Create a client using the default configuration
150
+ # client = ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
151
+ #
152
+ # # Create a client using a custom configuration
153
+ # client = ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new do |config|
154
+ # config.timeout = 10.0
155
+ # end
156
+ #
157
+ # @yield [config] Configure the CloudQuotas client.
158
+ # @yieldparam config [Client::Configuration]
159
+ #
160
+ def initialize
161
+ # These require statements are intentionally placed here to initialize
162
+ # the gRPC module only when it's required.
163
+ # See https://github.com/googleapis/toolkit/issues/446
164
+ require "gapic/grpc"
165
+ require "google/api/cloudquotas/v1beta/cloudquotas_services_pb"
166
+
167
+ # Create the configuration object
168
+ @config = Configuration.new Client.configure
169
+
170
+ # Yield the configuration if needed
171
+ yield @config if block_given?
172
+
173
+ # Create credentials
174
+ credentials = @config.credentials
175
+ # Use self-signed JWT if the endpoint is unchanged from default,
176
+ # but only if the default endpoint does not have a region prefix.
177
+ enable_self_signed_jwt = @config.endpoint.nil? ||
178
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
179
+ !@config.endpoint.split(".").first.include?("-"))
180
+ credentials ||= Credentials.default scope: @config.scope,
181
+ enable_self_signed_jwt: enable_self_signed_jwt
182
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
183
+ credentials = Credentials.new credentials, scope: @config.scope
184
+ end
185
+ @quota_project_id = @config.quota_project
186
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
187
+
188
+ @cloud_quotas_stub = ::Gapic::ServiceStub.new(
189
+ ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Stub,
190
+ credentials: credentials,
191
+ endpoint: @config.endpoint,
192
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
193
+ universe_domain: @config.universe_domain,
194
+ channel_args: @config.channel_args,
195
+ interceptors: @config.interceptors,
196
+ channel_pool_config: @config.channel_pool,
197
+ logger: @config.logger
198
+ )
199
+
200
+ @cloud_quotas_stub.stub_logger&.info do |entry|
201
+ entry.set_system_name
202
+ entry.set_service
203
+ entry.message = "Created client for #{entry.service}"
204
+ entry.set_credentials_fields credentials
205
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
206
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
207
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
208
+ end
209
+ end
210
+
211
+ ##
212
+ # The logger used for request/response debug logging.
213
+ #
214
+ # @return [Logger]
215
+ #
216
+ def logger
217
+ @cloud_quotas_stub.logger
218
+ end
219
+
220
+ # Service calls
221
+
222
+ ##
223
+ # Lists QuotaInfos of all quotas for a given project, folder or organization.
224
+ #
225
+ # @overload list_quota_infos(request, options = nil)
226
+ # Pass arguments to `list_quota_infos` via a request object, either of type
227
+ # {::Google::Cloud::CloudQuotas::V1beta::ListQuotaInfosRequest} or an equivalent Hash.
228
+ #
229
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::ListQuotaInfosRequest, ::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 list_quota_infos(parent: nil, page_size: nil, page_token: nil)
236
+ # Pass arguments to `list_quota_infos` 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. Parent value of QuotaInfo resources.
242
+ # Listing across different resource containers (such as 'projects/-') is not
243
+ # allowed.
244
+ #
245
+ # Example names:
246
+ # `projects/123/locations/global/services/compute.googleapis.com`
247
+ # `folders/234/locations/global/services/compute.googleapis.com`
248
+ # `organizations/345/locations/global/services/compute.googleapis.com`
249
+ # @param page_size [::Integer]
250
+ # Optional. Requested page size. Server may return fewer items than
251
+ # requested. If unspecified, server will pick an appropriate default.
252
+ # @param page_token [::String]
253
+ # Optional. A token identifying a page of results the server should return.
254
+ #
255
+ # @yield [response, operation] Access the result along with the RPC operation
256
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudQuotas::V1beta::QuotaInfo>]
257
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
258
+ #
259
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudQuotas::V1beta::QuotaInfo>]
260
+ #
261
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
262
+ #
263
+ # @example Basic example
264
+ # require "google/cloud/cloud_quotas/v1beta"
265
+ #
266
+ # # Create a client object. The client can be reused for multiple calls.
267
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
268
+ #
269
+ # # Create a request. To set request fields, pass in keyword arguments.
270
+ # request = Google::Cloud::CloudQuotas::V1beta::ListQuotaInfosRequest.new
271
+ #
272
+ # # Call the list_quota_infos method.
273
+ # result = client.list_quota_infos request
274
+ #
275
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
276
+ # # over elements, and API calls will be issued to fetch pages as needed.
277
+ # result.each do |item|
278
+ # # Each element is of type ::Google::Cloud::CloudQuotas::V1beta::QuotaInfo.
279
+ # p item
280
+ # end
281
+ #
282
+ def list_quota_infos request, options = nil
283
+ raise ::ArgumentError, "request must be provided" if request.nil?
284
+
285
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::ListQuotaInfosRequest
286
+
287
+ # Converts hash and nil to an options object
288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
289
+
290
+ # Customize the options with defaults
291
+ metadata = @config.rpcs.list_quota_infos.metadata.to_h
292
+
293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
294
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
296
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
297
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
298
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ header_params = {}
301
+ if request.parent
302
+ header_params["parent"] = request.parent
303
+ end
304
+
305
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
306
+ metadata[:"x-goog-request-params"] ||= request_params_header
307
+
308
+ options.apply_defaults timeout: @config.rpcs.list_quota_infos.timeout,
309
+ metadata: metadata,
310
+ retry_policy: @config.rpcs.list_quota_infos.retry_policy
311
+
312
+ options.apply_defaults timeout: @config.timeout,
313
+ metadata: @config.metadata,
314
+ retry_policy: @config.retry_policy
315
+
316
+ @cloud_quotas_stub.call_rpc :list_quota_infos, request, options: options do |response, operation|
317
+ response = ::Gapic::PagedEnumerable.new @cloud_quotas_stub, :list_quota_infos, request, response, operation, options
318
+ yield response, operation if block_given?
319
+ throw :response, response
320
+ end
321
+ rescue ::GRPC::BadStatus => e
322
+ raise ::Google::Cloud::Error.from_error(e)
323
+ end
324
+
325
+ ##
326
+ # Retrieve the QuotaInfo of a quota for a project, folder or organization.
327
+ #
328
+ # @overload get_quota_info(request, options = nil)
329
+ # Pass arguments to `get_quota_info` via a request object, either of type
330
+ # {::Google::Cloud::CloudQuotas::V1beta::GetQuotaInfoRequest} or an equivalent Hash.
331
+ #
332
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::GetQuotaInfoRequest, ::Hash]
333
+ # A request object representing the call parameters. Required. To specify no
334
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
335
+ # @param options [::Gapic::CallOptions, ::Hash]
336
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
337
+ #
338
+ # @overload get_quota_info(name: nil)
339
+ # Pass arguments to `get_quota_info` via keyword arguments. Note that at
340
+ # least one keyword argument is required. To specify no parameters, or to keep all
341
+ # the default parameter values, pass an empty Hash as a request object (see above).
342
+ #
343
+ # @param name [::String]
344
+ # Required. The resource name of the quota info.
345
+ #
346
+ # An example name:
347
+ # `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
348
+ #
349
+ # @yield [response, operation] Access the result along with the RPC operation
350
+ # @yieldparam response [::Google::Cloud::CloudQuotas::V1beta::QuotaInfo]
351
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
352
+ #
353
+ # @return [::Google::Cloud::CloudQuotas::V1beta::QuotaInfo]
354
+ #
355
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
356
+ #
357
+ # @example Basic example
358
+ # require "google/cloud/cloud_quotas/v1beta"
359
+ #
360
+ # # Create a client object. The client can be reused for multiple calls.
361
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
362
+ #
363
+ # # Create a request. To set request fields, pass in keyword arguments.
364
+ # request = Google::Cloud::CloudQuotas::V1beta::GetQuotaInfoRequest.new
365
+ #
366
+ # # Call the get_quota_info method.
367
+ # result = client.get_quota_info request
368
+ #
369
+ # # The returned object is of type Google::Cloud::CloudQuotas::V1beta::QuotaInfo.
370
+ # p result
371
+ #
372
+ def get_quota_info request, options = nil
373
+ raise ::ArgumentError, "request must be provided" if request.nil?
374
+
375
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::GetQuotaInfoRequest
376
+
377
+ # Converts hash and nil to an options object
378
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
379
+
380
+ # Customize the options with defaults
381
+ metadata = @config.rpcs.get_quota_info.metadata.to_h
382
+
383
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
384
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
385
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
386
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
387
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
388
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
389
+
390
+ header_params = {}
391
+ if request.name
392
+ header_params["name"] = request.name
393
+ end
394
+
395
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
396
+ metadata[:"x-goog-request-params"] ||= request_params_header
397
+
398
+ options.apply_defaults timeout: @config.rpcs.get_quota_info.timeout,
399
+ metadata: metadata,
400
+ retry_policy: @config.rpcs.get_quota_info.retry_policy
401
+
402
+ options.apply_defaults timeout: @config.timeout,
403
+ metadata: @config.metadata,
404
+ retry_policy: @config.retry_policy
405
+
406
+ @cloud_quotas_stub.call_rpc :get_quota_info, request, options: options do |response, operation|
407
+ yield response, operation if block_given?
408
+ end
409
+ rescue ::GRPC::BadStatus => e
410
+ raise ::Google::Cloud::Error.from_error(e)
411
+ end
412
+
413
+ ##
414
+ # Lists QuotaPreferences in a given project, folder or organization.
415
+ #
416
+ # @overload list_quota_preferences(request, options = nil)
417
+ # Pass arguments to `list_quota_preferences` via a request object, either of type
418
+ # {::Google::Cloud::CloudQuotas::V1beta::ListQuotaPreferencesRequest} or an equivalent Hash.
419
+ #
420
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::ListQuotaPreferencesRequest, ::Hash]
421
+ # A request object representing the call parameters. Required. To specify no
422
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
423
+ # @param options [::Gapic::CallOptions, ::Hash]
424
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
425
+ #
426
+ # @overload list_quota_preferences(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
427
+ # Pass arguments to `list_quota_preferences` via keyword arguments. Note that at
428
+ # least one keyword argument is required. To specify no parameters, or to keep all
429
+ # the default parameter values, pass an empty Hash as a request object (see above).
430
+ #
431
+ # @param parent [::String]
432
+ # Required. Parent value of QuotaPreference resources.
433
+ # Listing across different resource containers (such as 'projects/-') is not
434
+ # allowed.
435
+ #
436
+ # When the value starts with 'folders' or 'organizations', it lists the
437
+ # QuotaPreferences for org quotas in the container. It does not list the
438
+ # QuotaPreferences in the descendant projects of the container.
439
+ #
440
+ # Example parents:
441
+ # `projects/123/locations/global`
442
+ # @param page_size [::Integer]
443
+ # Optional. Requested page size. Server may return fewer items than
444
+ # requested. If unspecified, server will pick an appropriate default.
445
+ # @param page_token [::String]
446
+ # Optional. A token identifying a page of results the server should return.
447
+ # @param filter [::String]
448
+ # Optional. Filter result QuotaPreferences by their state, type,
449
+ # create/update time range.
450
+ #
451
+ # Example filters:
452
+ # `reconciling=true AND request_type=CLOUD_CONSOLE`,
453
+ # `reconciling=true OR creation_time>2022-12-03T10:30:00`
454
+ # @param order_by [::String]
455
+ # Optional. How to order of the results. By default, the results are ordered
456
+ # by create time.
457
+ #
458
+ # Example orders:
459
+ # `quota_id`,
460
+ # `service, create_time`
461
+ #
462
+ # @yield [response, operation] Access the result along with the RPC operation
463
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudQuotas::V1beta::QuotaPreference>]
464
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
465
+ #
466
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::CloudQuotas::V1beta::QuotaPreference>]
467
+ #
468
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
469
+ #
470
+ # @example Basic example
471
+ # require "google/cloud/cloud_quotas/v1beta"
472
+ #
473
+ # # Create a client object. The client can be reused for multiple calls.
474
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
475
+ #
476
+ # # Create a request. To set request fields, pass in keyword arguments.
477
+ # request = Google::Cloud::CloudQuotas::V1beta::ListQuotaPreferencesRequest.new
478
+ #
479
+ # # Call the list_quota_preferences method.
480
+ # result = client.list_quota_preferences request
481
+ #
482
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
483
+ # # over elements, and API calls will be issued to fetch pages as needed.
484
+ # result.each do |item|
485
+ # # Each element is of type ::Google::Cloud::CloudQuotas::V1beta::QuotaPreference.
486
+ # p item
487
+ # end
488
+ #
489
+ def list_quota_preferences request, options = nil
490
+ raise ::ArgumentError, "request must be provided" if request.nil?
491
+
492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::ListQuotaPreferencesRequest
493
+
494
+ # Converts hash and nil to an options object
495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
496
+
497
+ # Customize the options with defaults
498
+ metadata = @config.rpcs.list_quota_preferences.metadata.to_h
499
+
500
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
501
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
503
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
504
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
505
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
506
+
507
+ header_params = {}
508
+ if request.parent
509
+ header_params["parent"] = request.parent
510
+ end
511
+
512
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
513
+ metadata[:"x-goog-request-params"] ||= request_params_header
514
+
515
+ options.apply_defaults timeout: @config.rpcs.list_quota_preferences.timeout,
516
+ metadata: metadata,
517
+ retry_policy: @config.rpcs.list_quota_preferences.retry_policy
518
+
519
+ options.apply_defaults timeout: @config.timeout,
520
+ metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @cloud_quotas_stub.call_rpc :list_quota_preferences, request, options: options do |response, operation|
524
+ response = ::Gapic::PagedEnumerable.new @cloud_quotas_stub, :list_quota_preferences, request, response, operation, options
525
+ yield response, operation if block_given?
526
+ throw :response, response
527
+ end
528
+ rescue ::GRPC::BadStatus => e
529
+ raise ::Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Gets details of a single QuotaPreference.
534
+ #
535
+ # @overload get_quota_preference(request, options = nil)
536
+ # Pass arguments to `get_quota_preference` via a request object, either of type
537
+ # {::Google::Cloud::CloudQuotas::V1beta::GetQuotaPreferenceRequest} or an equivalent Hash.
538
+ #
539
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::GetQuotaPreferenceRequest, ::Hash]
540
+ # A request object representing the call parameters. Required. To specify no
541
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
542
+ # @param options [::Gapic::CallOptions, ::Hash]
543
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
544
+ #
545
+ # @overload get_quota_preference(name: nil)
546
+ # Pass arguments to `get_quota_preference` via keyword arguments. Note that at
547
+ # least one keyword argument is required. To specify no parameters, or to keep all
548
+ # the default parameter values, pass an empty Hash as a request object (see above).
549
+ #
550
+ # @param name [::String]
551
+ # Required. Name of the resource
552
+ #
553
+ # Example name:
554
+ # `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
555
+ #
556
+ # @yield [response, operation] Access the result along with the RPC operation
557
+ # @yieldparam response [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
558
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
559
+ #
560
+ # @return [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
561
+ #
562
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
563
+ #
564
+ # @example Basic example
565
+ # require "google/cloud/cloud_quotas/v1beta"
566
+ #
567
+ # # Create a client object. The client can be reused for multiple calls.
568
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
569
+ #
570
+ # # Create a request. To set request fields, pass in keyword arguments.
571
+ # request = Google::Cloud::CloudQuotas::V1beta::GetQuotaPreferenceRequest.new
572
+ #
573
+ # # Call the get_quota_preference method.
574
+ # result = client.get_quota_preference request
575
+ #
576
+ # # The returned object is of type Google::Cloud::CloudQuotas::V1beta::QuotaPreference.
577
+ # p result
578
+ #
579
+ def get_quota_preference request, options = nil
580
+ raise ::ArgumentError, "request must be provided" if request.nil?
581
+
582
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::GetQuotaPreferenceRequest
583
+
584
+ # Converts hash and nil to an options object
585
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
586
+
587
+ # Customize the options with defaults
588
+ metadata = @config.rpcs.get_quota_preference.metadata.to_h
589
+
590
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
591
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
592
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
593
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
594
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
595
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ header_params = {}
598
+ if request.name
599
+ header_params["name"] = request.name
600
+ end
601
+
602
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
603
+ metadata[:"x-goog-request-params"] ||= request_params_header
604
+
605
+ options.apply_defaults timeout: @config.rpcs.get_quota_preference.timeout,
606
+ metadata: metadata,
607
+ retry_policy: @config.rpcs.get_quota_preference.retry_policy
608
+
609
+ options.apply_defaults timeout: @config.timeout,
610
+ metadata: @config.metadata,
611
+ retry_policy: @config.retry_policy
612
+
613
+ @cloud_quotas_stub.call_rpc :get_quota_preference, request, options: options do |response, operation|
614
+ yield response, operation if block_given?
615
+ end
616
+ rescue ::GRPC::BadStatus => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # Creates a new QuotaPreference that declares the desired value for a quota.
622
+ #
623
+ # @overload create_quota_preference(request, options = nil)
624
+ # Pass arguments to `create_quota_preference` via a request object, either of type
625
+ # {::Google::Cloud::CloudQuotas::V1beta::CreateQuotaPreferenceRequest} or an equivalent Hash.
626
+ #
627
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::CreateQuotaPreferenceRequest, ::Hash]
628
+ # A request object representing the call parameters. Required. To specify no
629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
630
+ # @param options [::Gapic::CallOptions, ::Hash]
631
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
632
+ #
633
+ # @overload create_quota_preference(parent: nil, quota_preference_id: nil, quota_preference: nil, ignore_safety_checks: nil)
634
+ # Pass arguments to `create_quota_preference` via keyword arguments. Note that at
635
+ # least one keyword argument is required. To specify no parameters, or to keep all
636
+ # the default parameter values, pass an empty Hash as a request object (see above).
637
+ #
638
+ # @param parent [::String]
639
+ # Required. Value for parent.
640
+ #
641
+ # Example:
642
+ # `projects/123/locations/global`
643
+ # @param quota_preference_id [::String]
644
+ # Optional. Id of the requesting object, must be unique under its parent.
645
+ # If client does not set this field, the service will generate one.
646
+ # @param quota_preference [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference, ::Hash]
647
+ # Required. The resource being created
648
+ # @param ignore_safety_checks [::Array<::Google::Cloud::CloudQuotas::V1beta::QuotaSafetyCheck>]
649
+ # The list of quota safety checks to be ignored.
650
+ #
651
+ # @yield [response, operation] Access the result along with the RPC operation
652
+ # @yieldparam response [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
653
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
654
+ #
655
+ # @return [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
656
+ #
657
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
658
+ #
659
+ # @example Basic example
660
+ # require "google/cloud/cloud_quotas/v1beta"
661
+ #
662
+ # # Create a client object. The client can be reused for multiple calls.
663
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
664
+ #
665
+ # # Create a request. To set request fields, pass in keyword arguments.
666
+ # request = Google::Cloud::CloudQuotas::V1beta::CreateQuotaPreferenceRequest.new
667
+ #
668
+ # # Call the create_quota_preference method.
669
+ # result = client.create_quota_preference request
670
+ #
671
+ # # The returned object is of type Google::Cloud::CloudQuotas::V1beta::QuotaPreference.
672
+ # p result
673
+ #
674
+ def create_quota_preference request, options = nil
675
+ raise ::ArgumentError, "request must be provided" if request.nil?
676
+
677
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::CreateQuotaPreferenceRequest
678
+
679
+ # Converts hash and nil to an options object
680
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
681
+
682
+ # Customize the options with defaults
683
+ metadata = @config.rpcs.create_quota_preference.metadata.to_h
684
+
685
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
686
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
687
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
688
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
689
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
690
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ header_params = {}
693
+ if request.parent
694
+ header_params["parent"] = request.parent
695
+ end
696
+
697
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
698
+ metadata[:"x-goog-request-params"] ||= request_params_header
699
+
700
+ options.apply_defaults timeout: @config.rpcs.create_quota_preference.timeout,
701
+ metadata: metadata,
702
+ retry_policy: @config.rpcs.create_quota_preference.retry_policy
703
+
704
+ options.apply_defaults timeout: @config.timeout,
705
+ metadata: @config.metadata,
706
+ retry_policy: @config.retry_policy
707
+
708
+ @cloud_quotas_stub.call_rpc :create_quota_preference, request, options: options do |response, operation|
709
+ yield response, operation if block_given?
710
+ end
711
+ rescue ::GRPC::BadStatus => e
712
+ raise ::Google::Cloud::Error.from_error(e)
713
+ end
714
+
715
+ ##
716
+ # Updates the parameters of a single QuotaPreference. It can updates the
717
+ # config in any states, not just the ones pending approval.
718
+ #
719
+ # @overload update_quota_preference(request, options = nil)
720
+ # Pass arguments to `update_quota_preference` via a request object, either of type
721
+ # {::Google::Cloud::CloudQuotas::V1beta::UpdateQuotaPreferenceRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::CloudQuotas::V1beta::UpdateQuotaPreferenceRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
728
+ #
729
+ # @overload update_quota_preference(update_mask: nil, quota_preference: nil, allow_missing: nil, validate_only: nil, ignore_safety_checks: nil)
730
+ # Pass arguments to `update_quota_preference` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
735
+ # Optional. Field mask is used to specify the fields to be overwritten in the
736
+ # QuotaPreference resource by the update.
737
+ # The fields specified in the update_mask are relative to the resource, not
738
+ # the full request. A field will be overwritten if it is in the mask. If the
739
+ # user does not provide a mask then all fields will be overwritten.
740
+ # @param quota_preference [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference, ::Hash]
741
+ # Required. The resource being updated
742
+ # @param allow_missing [::Boolean]
743
+ # Optional. If set to true, and the quota preference is not found, a new one
744
+ # will be created. In this situation, `update_mask` is ignored.
745
+ # @param validate_only [::Boolean]
746
+ # Optional. If set to true, validate the request, but do not actually update.
747
+ # Note that a request being valid does not mean that the request is
748
+ # guaranteed to be fulfilled.
749
+ # @param ignore_safety_checks [::Array<::Google::Cloud::CloudQuotas::V1beta::QuotaSafetyCheck>]
750
+ # The list of quota safety checks to be ignored.
751
+ #
752
+ # @yield [response, operation] Access the result along with the RPC operation
753
+ # @yieldparam response [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
754
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
755
+ #
756
+ # @return [::Google::Cloud::CloudQuotas::V1beta::QuotaPreference]
757
+ #
758
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
759
+ #
760
+ # @example Basic example
761
+ # require "google/cloud/cloud_quotas/v1beta"
762
+ #
763
+ # # Create a client object. The client can be reused for multiple calls.
764
+ # client = Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new
765
+ #
766
+ # # Create a request. To set request fields, pass in keyword arguments.
767
+ # request = Google::Cloud::CloudQuotas::V1beta::UpdateQuotaPreferenceRequest.new
768
+ #
769
+ # # Call the update_quota_preference method.
770
+ # result = client.update_quota_preference request
771
+ #
772
+ # # The returned object is of type Google::Cloud::CloudQuotas::V1beta::QuotaPreference.
773
+ # p result
774
+ #
775
+ def update_quota_preference request, options = nil
776
+ raise ::ArgumentError, "request must be provided" if request.nil?
777
+
778
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudQuotas::V1beta::UpdateQuotaPreferenceRequest
779
+
780
+ # Converts hash and nil to an options object
781
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
782
+
783
+ # Customize the options with defaults
784
+ metadata = @config.rpcs.update_quota_preference.metadata.to_h
785
+
786
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
787
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
788
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
789
+ gapic_version: ::Google::Cloud::CloudQuotas::V1beta::VERSION
790
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
791
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
792
+
793
+ header_params = {}
794
+ if request.quota_preference&.name
795
+ header_params["quota_preference.name"] = request.quota_preference.name
796
+ end
797
+
798
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
799
+ metadata[:"x-goog-request-params"] ||= request_params_header
800
+
801
+ options.apply_defaults timeout: @config.rpcs.update_quota_preference.timeout,
802
+ metadata: metadata,
803
+ retry_policy: @config.rpcs.update_quota_preference.retry_policy
804
+
805
+ options.apply_defaults timeout: @config.timeout,
806
+ metadata: @config.metadata,
807
+ retry_policy: @config.retry_policy
808
+
809
+ @cloud_quotas_stub.call_rpc :update_quota_preference, request, options: options do |response, operation|
810
+ yield response, operation if block_given?
811
+ end
812
+ rescue ::GRPC::BadStatus => e
813
+ raise ::Google::Cloud::Error.from_error(e)
814
+ end
815
+
816
+ ##
817
+ # Configuration class for the CloudQuotas API.
818
+ #
819
+ # This class represents the configuration for CloudQuotas,
820
+ # providing control over timeouts, retry behavior, logging, transport
821
+ # parameters, and other low-level controls. Certain parameters can also be
822
+ # applied individually to specific RPCs. See
823
+ # {::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client::Configuration::Rpcs}
824
+ # for a list of RPCs that can be configured independently.
825
+ #
826
+ # Configuration can be applied globally to all clients, or to a single client
827
+ # on construction.
828
+ #
829
+ # @example
830
+ #
831
+ # # Modify the global config, setting the timeout for
832
+ # # list_quota_infos to 20 seconds,
833
+ # # and all remaining timeouts to 10 seconds.
834
+ # ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.configure do |config|
835
+ # config.timeout = 10.0
836
+ # config.rpcs.list_quota_infos.timeout = 20.0
837
+ # end
838
+ #
839
+ # # Apply the above configuration only to a new client.
840
+ # client = ::Google::Cloud::CloudQuotas::V1beta::CloudQuotas::Client.new do |config|
841
+ # config.timeout = 10.0
842
+ # config.rpcs.list_quota_infos.timeout = 20.0
843
+ # end
844
+ #
845
+ # @!attribute [rw] endpoint
846
+ # A custom service endpoint, as a hostname or hostname:port. The default is
847
+ # nil, indicating to use the default endpoint in the current universe domain.
848
+ # @return [::String,nil]
849
+ # @!attribute [rw] credentials
850
+ # Credentials to send with calls. You may provide any of the following types:
851
+ # * (`String`) The path to a service account key file in JSON format
852
+ # * (`Hash`) A service account key as a Hash
853
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
854
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
855
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
856
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
857
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
858
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
859
+ # * (`nil`) indicating no credentials
860
+ # @return [::Object]
861
+ # @!attribute [rw] scope
862
+ # The OAuth scopes
863
+ # @return [::Array<::String>]
864
+ # @!attribute [rw] lib_name
865
+ # The library name as recorded in instrumentation and logging
866
+ # @return [::String]
867
+ # @!attribute [rw] lib_version
868
+ # The library version as recorded in instrumentation and logging
869
+ # @return [::String]
870
+ # @!attribute [rw] channel_args
871
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
872
+ # `GRPC::Core::Channel` object is provided as the credential.
873
+ # @return [::Hash]
874
+ # @!attribute [rw] interceptors
875
+ # An array of interceptors that are run before calls are executed.
876
+ # @return [::Array<::GRPC::ClientInterceptor>]
877
+ # @!attribute [rw] timeout
878
+ # The call timeout in seconds.
879
+ # @return [::Numeric]
880
+ # @!attribute [rw] metadata
881
+ # Additional gRPC headers to be sent with the call.
882
+ # @return [::Hash{::Symbol=>::String}]
883
+ # @!attribute [rw] retry_policy
884
+ # The retry policy. The value is a hash with the following keys:
885
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
886
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
887
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
888
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
889
+ # trigger a retry.
890
+ # @return [::Hash]
891
+ # @!attribute [rw] quota_project
892
+ # A separate project against which to charge quota.
893
+ # @return [::String]
894
+ # @!attribute [rw] universe_domain
895
+ # The universe domain within which to make requests. This determines the
896
+ # default endpoint URL. The default value of nil uses the environment
897
+ # universe (usually the default "googleapis.com" universe).
898
+ # @return [::String,nil]
899
+ # @!attribute [rw] logger
900
+ # A custom logger to use for request/response debug logging, or the value
901
+ # `:default` (the default) to construct a default logger, or `nil` to
902
+ # explicitly disable logging.
903
+ # @return [::Logger,:default,nil]
904
+ #
905
+ class Configuration
906
+ extend ::Gapic::Config
907
+
908
+ # @private
909
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
910
+ DEFAULT_ENDPOINT = "cloudquotas.googleapis.com"
911
+
912
+ config_attr :endpoint, nil, ::String, nil
913
+ config_attr :credentials, nil do |value|
914
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
915
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
916
+ allowed.any? { |klass| klass === value }
917
+ end
918
+ config_attr :scope, nil, ::String, ::Array, nil
919
+ config_attr :lib_name, nil, ::String, nil
920
+ config_attr :lib_version, nil, ::String, nil
921
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
922
+ config_attr :interceptors, nil, ::Array, nil
923
+ config_attr :timeout, nil, ::Numeric, nil
924
+ config_attr :metadata, nil, ::Hash, nil
925
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
926
+ config_attr :quota_project, nil, ::String, nil
927
+ config_attr :universe_domain, nil, ::String, nil
928
+ config_attr :logger, :default, ::Logger, nil, :default
929
+
930
+ # @private
931
+ def initialize parent_config = nil
932
+ @parent_config = parent_config unless parent_config.nil?
933
+
934
+ yield self if block_given?
935
+ end
936
+
937
+ ##
938
+ # Configurations for individual RPCs
939
+ # @return [Rpcs]
940
+ #
941
+ def rpcs
942
+ @rpcs ||= begin
943
+ parent_rpcs = nil
944
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
945
+ Rpcs.new parent_rpcs
946
+ end
947
+ end
948
+
949
+ ##
950
+ # Configuration for the channel pool
951
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
952
+ #
953
+ def channel_pool
954
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
955
+ end
956
+
957
+ ##
958
+ # Configuration RPC class for the CloudQuotas API.
959
+ #
960
+ # Includes fields providing the configuration for each RPC in this service.
961
+ # Each configuration object is of type `Gapic::Config::Method` and includes
962
+ # the following configuration fields:
963
+ #
964
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
965
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
966
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
967
+ # include the following keys:
968
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
969
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
970
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
971
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
972
+ # trigger a retry.
973
+ #
974
+ class Rpcs
975
+ ##
976
+ # RPC-specific configuration for `list_quota_infos`
977
+ # @return [::Gapic::Config::Method]
978
+ #
979
+ attr_reader :list_quota_infos
980
+ ##
981
+ # RPC-specific configuration for `get_quota_info`
982
+ # @return [::Gapic::Config::Method]
983
+ #
984
+ attr_reader :get_quota_info
985
+ ##
986
+ # RPC-specific configuration for `list_quota_preferences`
987
+ # @return [::Gapic::Config::Method]
988
+ #
989
+ attr_reader :list_quota_preferences
990
+ ##
991
+ # RPC-specific configuration for `get_quota_preference`
992
+ # @return [::Gapic::Config::Method]
993
+ #
994
+ attr_reader :get_quota_preference
995
+ ##
996
+ # RPC-specific configuration for `create_quota_preference`
997
+ # @return [::Gapic::Config::Method]
998
+ #
999
+ attr_reader :create_quota_preference
1000
+ ##
1001
+ # RPC-specific configuration for `update_quota_preference`
1002
+ # @return [::Gapic::Config::Method]
1003
+ #
1004
+ attr_reader :update_quota_preference
1005
+
1006
+ # @private
1007
+ def initialize parent_rpcs = nil
1008
+ list_quota_infos_config = parent_rpcs.list_quota_infos if parent_rpcs.respond_to? :list_quota_infos
1009
+ @list_quota_infos = ::Gapic::Config::Method.new list_quota_infos_config
1010
+ get_quota_info_config = parent_rpcs.get_quota_info if parent_rpcs.respond_to? :get_quota_info
1011
+ @get_quota_info = ::Gapic::Config::Method.new get_quota_info_config
1012
+ list_quota_preferences_config = parent_rpcs.list_quota_preferences if parent_rpcs.respond_to? :list_quota_preferences
1013
+ @list_quota_preferences = ::Gapic::Config::Method.new list_quota_preferences_config
1014
+ get_quota_preference_config = parent_rpcs.get_quota_preference if parent_rpcs.respond_to? :get_quota_preference
1015
+ @get_quota_preference = ::Gapic::Config::Method.new get_quota_preference_config
1016
+ create_quota_preference_config = parent_rpcs.create_quota_preference if parent_rpcs.respond_to? :create_quota_preference
1017
+ @create_quota_preference = ::Gapic::Config::Method.new create_quota_preference_config
1018
+ update_quota_preference_config = parent_rpcs.update_quota_preference if parent_rpcs.respond_to? :update_quota_preference
1019
+ @update_quota_preference = ::Gapic::Config::Method.new update_quota_preference_config
1020
+
1021
+ yield self if block_given?
1022
+ end
1023
+ end
1024
+ end
1025
+ end
1026
+ end
1027
+ end
1028
+ end
1029
+ end
1030
+ end