google-apis-serviceusage_v1beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,897 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module ServiceusageV1beta1
23
+ # Service Usage API
24
+ #
25
+ # Enables services that service consumers want to use on Google Cloud Platform,
26
+ # lists the available or enabled services, or disables services that service
27
+ # consumers no longer use.
28
+ #
29
+ # @example
30
+ # require 'google/apis/serviceusage_v1beta1'
31
+ #
32
+ # Serviceusage = Google::Apis::ServiceusageV1beta1 # Alias the module
33
+ # service = Serviceusage::ServiceUsageService.new
34
+ #
35
+ # @see https://cloud.google.com/service-usage/
36
+ class ServiceUsageService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://serviceusage.googleapis.com/', '',
49
+ client_name: 'google-apis-serviceusage_v1beta1',
50
+ client_version: Google::Apis::ServiceusageV1beta1::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Gets the latest state of a long-running operation. Clients can use this method
55
+ # to poll the operation result at intervals as recommended by the API service.
56
+ # @param [String] name
57
+ # The name of the operation resource.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def get_operation(name, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
77
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
78
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
79
+ command.params['name'] = name unless name.nil?
80
+ command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
+ execute_or_queue_command(command, &block)
83
+ end
84
+
85
+ # Lists operations that match the specified filter in the request. If the server
86
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
87
+ # binding allows API services to override the binding to use different resource
88
+ # name schemes, such as `users/*/operations`. To override the binding, API
89
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
90
+ # service configuration. For backwards compatibility, the default name includes
91
+ # the operations collection id, however overriding users must ensure the name
92
+ # binding is the parent resource, without the operations collection id.
93
+ # @param [String] filter
94
+ # The standard list filter.
95
+ # @param [String] name
96
+ # The name of the operation's parent resource.
97
+ # @param [Fixnum] page_size
98
+ # The standard list page size.
99
+ # @param [String] page_token
100
+ # The standard list page token.
101
+ # @param [String] fields
102
+ # Selector specifying which fields to include in a partial response.
103
+ # @param [String] quota_user
104
+ # Available to use for quota purposes for server-side applications. Can be any
105
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
106
+ # @param [Google::Apis::RequestOptions] options
107
+ # Request-specific options
108
+ #
109
+ # @yield [result, err] Result & error if block supplied
110
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ListOperationsResponse] parsed result object
111
+ # @yieldparam err [StandardError] error object if request failed
112
+ #
113
+ # @return [Google::Apis::ServiceusageV1beta1::ListOperationsResponse]
114
+ #
115
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
116
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
117
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
118
+ def list_operations(filter: nil, name: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
119
+ command = make_simple_command(:get, 'v1beta1/operations', options)
120
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ListOperationsResponse::Representation
121
+ command.response_class = Google::Apis::ServiceusageV1beta1::ListOperationsResponse
122
+ command.query['filter'] = filter unless filter.nil?
123
+ command.query['name'] = name unless name.nil?
124
+ command.query['pageSize'] = page_size unless page_size.nil?
125
+ command.query['pageToken'] = page_token unless page_token.nil?
126
+ command.query['fields'] = fields unless fields.nil?
127
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
128
+ execute_or_queue_command(command, &block)
129
+ end
130
+
131
+ # Enable multiple services on a project. The operation is atomic: if enabling
132
+ # any service fails, then the entire batch fails, and no state changes occur.
133
+ # Operation
134
+ # @param [String] parent
135
+ # Parent to enable services on. An example name would be: `projects/123` where `
136
+ # 123` is the project number (not project ID). The `BatchEnableServices` method
137
+ # currently only supports projects.
138
+ # @param [Google::Apis::ServiceusageV1beta1::BatchEnableServicesRequest] batch_enable_services_request_object
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def batch_enable_services(parent, batch_enable_services_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v1beta1/{+parent}/services:batchEnable', options)
158
+ command.request_representation = Google::Apis::ServiceusageV1beta1::BatchEnableServicesRequest::Representation
159
+ command.request_object = batch_enable_services_request_object
160
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
161
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
162
+ command.params['parent'] = parent unless parent.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Disable a service so that it can no longer be used with a project. This
169
+ # prevents unintended usage that may cause unexpected billing charges or
170
+ # security leaks. It is not valid to call the disable method on a service that
171
+ # is not currently enabled. Callers will receive a `FAILED_PRECONDITION` status
172
+ # if the target service is not currently enabled. Operation
173
+ # @param [String] name
174
+ # Name of the consumer and service to disable the service on. The enable and
175
+ # disable methods currently only support projects. An example name would be: `
176
+ # projects/123/services/serviceusage.googleapis.com` where `123` is the project
177
+ # number (not project ID).
178
+ # @param [Google::Apis::ServiceusageV1beta1::DisableServiceRequest] disable_service_request_object
179
+ # @param [String] fields
180
+ # Selector specifying which fields to include in a partial response.
181
+ # @param [String] quota_user
182
+ # Available to use for quota purposes for server-side applications. Can be any
183
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
184
+ # @param [Google::Apis::RequestOptions] options
185
+ # Request-specific options
186
+ #
187
+ # @yield [result, err] Result & error if block supplied
188
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
189
+ # @yieldparam err [StandardError] error object if request failed
190
+ #
191
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
192
+ #
193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
196
+ def disable_service(name, disable_service_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
197
+ command = make_simple_command(:post, 'v1beta1/{+name}:disable', options)
198
+ command.request_representation = Google::Apis::ServiceusageV1beta1::DisableServiceRequest::Representation
199
+ command.request_object = disable_service_request_object
200
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
201
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
202
+ command.params['name'] = name unless name.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Enable a service so that it can be used with a project. Operation
209
+ # @param [String] name
210
+ # Name of the consumer and service to enable the service on. The `EnableService`
211
+ # and `DisableService` methods currently only support projects. Enabling a
212
+ # service requires that the service is public or is shared with the user
213
+ # enabling the service. An example name would be: `projects/123/services/
214
+ # serviceusage.googleapis.com` where `123` is the project number (not project ID)
215
+ # .
216
+ # @param [Google::Apis::ServiceusageV1beta1::EnableServiceRequest] enable_service_request_object
217
+ # @param [String] fields
218
+ # Selector specifying which fields to include in a partial response.
219
+ # @param [String] quota_user
220
+ # Available to use for quota purposes for server-side applications. Can be any
221
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
222
+ # @param [Google::Apis::RequestOptions] options
223
+ # Request-specific options
224
+ #
225
+ # @yield [result, err] Result & error if block supplied
226
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
227
+ # @yieldparam err [StandardError] error object if request failed
228
+ #
229
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
230
+ #
231
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
232
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
233
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
234
+ def enable_service(name, enable_service_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
235
+ command = make_simple_command(:post, 'v1beta1/{+name}:enable', options)
236
+ command.request_representation = Google::Apis::ServiceusageV1beta1::EnableServiceRequest::Representation
237
+ command.request_object = enable_service_request_object
238
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
239
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
240
+ command.params['name'] = name unless name.nil?
241
+ command.query['fields'] = fields unless fields.nil?
242
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
243
+ execute_or_queue_command(command, &block)
244
+ end
245
+
246
+ # Generate service identity for service.
247
+ # @param [String] parent
248
+ # Name of the consumer and service to generate an identity for. The `
249
+ # GenerateServiceIdentity` methods currently only support projects. An example
250
+ # name would be: `projects/123/services/example.googleapis.com` where `123` is
251
+ # the project number.
252
+ # @param [String] fields
253
+ # Selector specifying which fields to include in a partial response.
254
+ # @param [String] quota_user
255
+ # Available to use for quota purposes for server-side applications. Can be any
256
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
257
+ # @param [Google::Apis::RequestOptions] options
258
+ # Request-specific options
259
+ #
260
+ # @yield [result, err] Result & error if block supplied
261
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
262
+ # @yieldparam err [StandardError] error object if request failed
263
+ #
264
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
265
+ #
266
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
267
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
268
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
269
+ def generate_service_service_identity(parent, fields: nil, quota_user: nil, options: nil, &block)
270
+ command = make_simple_command(:post, 'v1beta1/{+parent}:generateServiceIdentity', options)
271
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
272
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
273
+ command.params['parent'] = parent unless parent.nil?
274
+ command.query['fields'] = fields unless fields.nil?
275
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
276
+ execute_or_queue_command(command, &block)
277
+ end
278
+
279
+ # Returns the service configuration and enabled state for a given service.
280
+ # @param [String] name
281
+ # Name of the consumer and service to get the `ConsumerState` for. An example
282
+ # name would be: `projects/123/services/serviceusage.googleapis.com` where `123`
283
+ # is the project number (not project ID).
284
+ # @param [String] fields
285
+ # Selector specifying which fields to include in a partial response.
286
+ # @param [String] quota_user
287
+ # Available to use for quota purposes for server-side applications. Can be any
288
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
289
+ # @param [Google::Apis::RequestOptions] options
290
+ # Request-specific options
291
+ #
292
+ # @yield [result, err] Result & error if block supplied
293
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Service] parsed result object
294
+ # @yieldparam err [StandardError] error object if request failed
295
+ #
296
+ # @return [Google::Apis::ServiceusageV1beta1::Service]
297
+ #
298
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
299
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
300
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
301
+ def get_service(name, fields: nil, quota_user: nil, options: nil, &block)
302
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
303
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Service::Representation
304
+ command.response_class = Google::Apis::ServiceusageV1beta1::Service
305
+ command.params['name'] = name unless name.nil?
306
+ command.query['fields'] = fields unless fields.nil?
307
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
308
+ execute_or_queue_command(command, &block)
309
+ end
310
+
311
+ # List all services available to the specified project, and the current state of
312
+ # those services with respect to the project. The list includes all public
313
+ # services, all services for which the calling user has the `servicemanagement.
314
+ # services.bind` permission, and all services that have already been enabled on
315
+ # the project. The list can be filtered to only include services in a specific
316
+ # state, for example to only include services enabled on the project.
317
+ # @param [String] parent
318
+ # Parent to search for services on. An example name would be: `projects/123`
319
+ # where `123` is the project number (not project ID).
320
+ # @param [String] filter
321
+ # Only list services that conform to the given filter. The allowed filter
322
+ # strings are `state:ENABLED` and `state:DISABLED`.
323
+ # @param [Fixnum] page_size
324
+ # Requested size of the next page of data. Requested page size cannot exceed 200.
325
+ # If not set, the default page size is 50.
326
+ # @param [String] page_token
327
+ # Token identifying which result to start with, which is returned by a previous
328
+ # list call.
329
+ # @param [String] fields
330
+ # Selector specifying which fields to include in a partial response.
331
+ # @param [String] quota_user
332
+ # Available to use for quota purposes for server-side applications. Can be any
333
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
334
+ # @param [Google::Apis::RequestOptions] options
335
+ # Request-specific options
336
+ #
337
+ # @yield [result, err] Result & error if block supplied
338
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ListServicesResponse] parsed result object
339
+ # @yieldparam err [StandardError] error object if request failed
340
+ #
341
+ # @return [Google::Apis::ServiceusageV1beta1::ListServicesResponse]
342
+ #
343
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
344
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
345
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
346
+ def list_services(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
347
+ command = make_simple_command(:get, 'v1beta1/{+parent}/services', options)
348
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ListServicesResponse::Representation
349
+ command.response_class = Google::Apis::ServiceusageV1beta1::ListServicesResponse
350
+ command.params['parent'] = parent unless parent.nil?
351
+ command.query['filter'] = filter unless filter.nil?
352
+ command.query['pageSize'] = page_size unless page_size.nil?
353
+ command.query['pageToken'] = page_token unless page_token.nil?
354
+ command.query['fields'] = fields unless fields.nil?
355
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
356
+ execute_or_queue_command(command, &block)
357
+ end
358
+
359
+ # Retrieves a summary of quota information for a specific quota metric
360
+ # @param [String] name
361
+ # The resource name of the quota limit. An example name would be: projects/123/
362
+ # services/serviceusage.googleapis.com/quotas/metrics/serviceusage.googleapis.
363
+ # com%2Fmutate_requests
364
+ # @param [String] view
365
+ # Specifies the level of detail for quota information in the response.
366
+ # @param [String] fields
367
+ # Selector specifying which fields to include in a partial response.
368
+ # @param [String] quota_user
369
+ # Available to use for quota purposes for server-side applications. Can be any
370
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
371
+ # @param [Google::Apis::RequestOptions] options
372
+ # Request-specific options
373
+ #
374
+ # @yield [result, err] Result & error if block supplied
375
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ConsumerQuotaMetric] parsed result object
376
+ # @yieldparam err [StandardError] error object if request failed
377
+ #
378
+ # @return [Google::Apis::ServiceusageV1beta1::ConsumerQuotaMetric]
379
+ #
380
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
381
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
382
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
383
+ def get_service_consumer_quota_metric(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
384
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
385
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ConsumerQuotaMetric::Representation
386
+ command.response_class = Google::Apis::ServiceusageV1beta1::ConsumerQuotaMetric
387
+ command.params['name'] = name unless name.nil?
388
+ command.query['view'] = view unless view.nil?
389
+ command.query['fields'] = fields unless fields.nil?
390
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
391
+ execute_or_queue_command(command, &block)
392
+ end
393
+
394
+ # Create or update multiple admin overrides atomically, all on the same consumer,
395
+ # but on many different metrics or limits. The name field in the quota override
396
+ # message should not be set.
397
+ # @param [String] parent
398
+ # The resource name of the consumer. An example name would be: `projects/123/
399
+ # services/compute.googleapis.com`
400
+ # @param [Google::Apis::ServiceusageV1beta1::ImportAdminOverridesRequest] import_admin_overrides_request_object
401
+ # @param [String] fields
402
+ # Selector specifying which fields to include in a partial response.
403
+ # @param [String] quota_user
404
+ # Available to use for quota purposes for server-side applications. Can be any
405
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
406
+ # @param [Google::Apis::RequestOptions] options
407
+ # Request-specific options
408
+ #
409
+ # @yield [result, err] Result & error if block supplied
410
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
411
+ # @yieldparam err [StandardError] error object if request failed
412
+ #
413
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
414
+ #
415
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
416
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
417
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
418
+ def import_consumer_quota_metric_admin_overrides(parent, import_admin_overrides_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
419
+ command = make_simple_command(:post, 'v1beta1/{+parent}/consumerQuotaMetrics:importAdminOverrides', options)
420
+ command.request_representation = Google::Apis::ServiceusageV1beta1::ImportAdminOverridesRequest::Representation
421
+ command.request_object = import_admin_overrides_request_object
422
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
423
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
424
+ command.params['parent'] = parent unless parent.nil?
425
+ command.query['fields'] = fields unless fields.nil?
426
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
427
+ execute_or_queue_command(command, &block)
428
+ end
429
+
430
+ # Create or update multiple consumer overrides atomically, all on the same
431
+ # consumer, but on many different metrics or limits. The name field in the quota
432
+ # override message should not be set.
433
+ # @param [String] parent
434
+ # The resource name of the consumer. An example name would be: `projects/123/
435
+ # services/compute.googleapis.com`
436
+ # @param [Google::Apis::ServiceusageV1beta1::ImportConsumerOverridesRequest] import_consumer_overrides_request_object
437
+ # @param [String] fields
438
+ # Selector specifying which fields to include in a partial response.
439
+ # @param [String] quota_user
440
+ # Available to use for quota purposes for server-side applications. Can be any
441
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
442
+ # @param [Google::Apis::RequestOptions] options
443
+ # Request-specific options
444
+ #
445
+ # @yield [result, err] Result & error if block supplied
446
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
447
+ # @yieldparam err [StandardError] error object if request failed
448
+ #
449
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
450
+ #
451
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
452
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
453
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
454
+ def import_consumer_quota_metric_consumer_overrides(parent, import_consumer_overrides_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
455
+ command = make_simple_command(:post, 'v1beta1/{+parent}/consumerQuotaMetrics:importConsumerOverrides', options)
456
+ command.request_representation = Google::Apis::ServiceusageV1beta1::ImportConsumerOverridesRequest::Representation
457
+ command.request_object = import_consumer_overrides_request_object
458
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
459
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
460
+ command.params['parent'] = parent unless parent.nil?
461
+ command.query['fields'] = fields unless fields.nil?
462
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
463
+ execute_or_queue_command(command, &block)
464
+ end
465
+
466
+ # Retrieves a summary of all quota information visible to the service consumer,
467
+ # organized by service metric. Each metric includes information about all of its
468
+ # defined limits. Each limit includes the limit configuration (quota unit,
469
+ # preciseness, default value), the current effective limit value, and all of the
470
+ # overrides applied to the limit.
471
+ # @param [String] parent
472
+ # Parent of the quotas resource. Some example names would be: projects/123/
473
+ # services/serviceconsumermanagement.googleapis.com folders/345/services/
474
+ # serviceconsumermanagement.googleapis.com organizations/456/services/
475
+ # serviceconsumermanagement.googleapis.com
476
+ # @param [Fixnum] page_size
477
+ # Requested size of the next page of data.
478
+ # @param [String] page_token
479
+ # Token identifying which result to start with; returned by a previous list call.
480
+ # @param [String] view
481
+ # Specifies the level of detail for quota information in the response.
482
+ # @param [String] fields
483
+ # Selector specifying which fields to include in a partial response.
484
+ # @param [String] quota_user
485
+ # Available to use for quota purposes for server-side applications. Can be any
486
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
487
+ # @param [Google::Apis::RequestOptions] options
488
+ # Request-specific options
489
+ #
490
+ # @yield [result, err] Result & error if block supplied
491
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ListConsumerQuotaMetricsResponse] parsed result object
492
+ # @yieldparam err [StandardError] error object if request failed
493
+ #
494
+ # @return [Google::Apis::ServiceusageV1beta1::ListConsumerQuotaMetricsResponse]
495
+ #
496
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
497
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
498
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
499
+ def list_service_consumer_quota_metrics(parent, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
500
+ command = make_simple_command(:get, 'v1beta1/{+parent}/consumerQuotaMetrics', options)
501
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ListConsumerQuotaMetricsResponse::Representation
502
+ command.response_class = Google::Apis::ServiceusageV1beta1::ListConsumerQuotaMetricsResponse
503
+ command.params['parent'] = parent unless parent.nil?
504
+ command.query['pageSize'] = page_size unless page_size.nil?
505
+ command.query['pageToken'] = page_token unless page_token.nil?
506
+ command.query['view'] = view unless view.nil?
507
+ command.query['fields'] = fields unless fields.nil?
508
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
509
+ execute_or_queue_command(command, &block)
510
+ end
511
+
512
+ # Retrieves a summary of quota information for a specific quota limit.
513
+ # @param [String] name
514
+ # The resource name of the quota limit. Use the quota limit resource name
515
+ # returned by previous ListConsumerQuotaMetrics and GetConsumerQuotaMetric API
516
+ # calls.
517
+ # @param [String] view
518
+ # Specifies the level of detail for quota information in the response.
519
+ # @param [String] fields
520
+ # Selector specifying which fields to include in a partial response.
521
+ # @param [String] quota_user
522
+ # Available to use for quota purposes for server-side applications. Can be any
523
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
524
+ # @param [Google::Apis::RequestOptions] options
525
+ # Request-specific options
526
+ #
527
+ # @yield [result, err] Result & error if block supplied
528
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ConsumerQuotaLimit] parsed result object
529
+ # @yieldparam err [StandardError] error object if request failed
530
+ #
531
+ # @return [Google::Apis::ServiceusageV1beta1::ConsumerQuotaLimit]
532
+ #
533
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
534
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
535
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
536
+ def get_service_consumer_quota_metric_limit(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
537
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
538
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ConsumerQuotaLimit::Representation
539
+ command.response_class = Google::Apis::ServiceusageV1beta1::ConsumerQuotaLimit
540
+ command.params['name'] = name unless name.nil?
541
+ command.query['view'] = view unless view.nil?
542
+ command.query['fields'] = fields unless fields.nil?
543
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
544
+ execute_or_queue_command(command, &block)
545
+ end
546
+
547
+ # Creates an admin override. An admin override is applied by an administrator of
548
+ # a parent folder or parent organization of the consumer receiving the override.
549
+ # An admin override is intended to limit the amount of quota the consumer can
550
+ # use out of the total quota pool allocated to all children of the folder or
551
+ # organization.
552
+ # @param [String] parent
553
+ # The resource name of the parent quota limit, returned by a
554
+ # ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name would
555
+ # be: `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
556
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
557
+ # @param [Google::Apis::ServiceusageV1beta1::QuotaOverride] quota_override_object
558
+ # @param [Boolean] force
559
+ # Whether to force the creation of the quota override. If creating an override
560
+ # would cause the effective quota for the consumer to decrease by more than 10
561
+ # percent, the call is rejected, as a safety measure to avoid accidentally
562
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
563
+ # restriction.
564
+ # @param [String] fields
565
+ # Selector specifying which fields to include in a partial response.
566
+ # @param [String] quota_user
567
+ # Available to use for quota purposes for server-side applications. Can be any
568
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
569
+ # @param [Google::Apis::RequestOptions] options
570
+ # Request-specific options
571
+ #
572
+ # @yield [result, err] Result & error if block supplied
573
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
574
+ # @yieldparam err [StandardError] error object if request failed
575
+ #
576
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
577
+ #
578
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
579
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
580
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
581
+ def create_service_consumer_quota_metric_limit_admin_override(parent, quota_override_object = nil, force: nil, fields: nil, quota_user: nil, options: nil, &block)
582
+ command = make_simple_command(:post, 'v1beta1/{+parent}/adminOverrides', options)
583
+ command.request_representation = Google::Apis::ServiceusageV1beta1::QuotaOverride::Representation
584
+ command.request_object = quota_override_object
585
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
586
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
587
+ command.params['parent'] = parent unless parent.nil?
588
+ command.query['force'] = force unless force.nil?
589
+ command.query['fields'] = fields unless fields.nil?
590
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
591
+ execute_or_queue_command(command, &block)
592
+ end
593
+
594
+ # Deletes an admin override.
595
+ # @param [String] name
596
+ # The resource name of the override to delete. An example name would be: `
597
+ # projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
598
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
599
+ # @param [Boolean] force
600
+ # Whether to force the deletion of the quota override. If deleting an override
601
+ # would cause the effective quota for the consumer to decrease by more than 10
602
+ # percent, the call is rejected, as a safety measure to avoid accidentally
603
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
604
+ # restriction.
605
+ # @param [String] fields
606
+ # Selector specifying which fields to include in a partial response.
607
+ # @param [String] quota_user
608
+ # Available to use for quota purposes for server-side applications. Can be any
609
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
610
+ # @param [Google::Apis::RequestOptions] options
611
+ # Request-specific options
612
+ #
613
+ # @yield [result, err] Result & error if block supplied
614
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
615
+ # @yieldparam err [StandardError] error object if request failed
616
+ #
617
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
618
+ #
619
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
620
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
621
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
622
+ def delete_service_consumer_quota_metric_limit_admin_override(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
623
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
624
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
625
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
626
+ command.params['name'] = name unless name.nil?
627
+ command.query['force'] = force unless force.nil?
628
+ command.query['fields'] = fields unless fields.nil?
629
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
630
+ execute_or_queue_command(command, &block)
631
+ end
632
+
633
+ # Lists all admin overrides on this limit.
634
+ # @param [String] parent
635
+ # The resource name of the parent quota limit, returned by a
636
+ # ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name would
637
+ # be: `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
638
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
639
+ # @param [Fixnum] page_size
640
+ # Requested size of the next page of data.
641
+ # @param [String] page_token
642
+ # Token identifying which result to start with; returned by a previous list call.
643
+ # @param [String] fields
644
+ # Selector specifying which fields to include in a partial response.
645
+ # @param [String] quota_user
646
+ # Available to use for quota purposes for server-side applications. Can be any
647
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
648
+ # @param [Google::Apis::RequestOptions] options
649
+ # Request-specific options
650
+ #
651
+ # @yield [result, err] Result & error if block supplied
652
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ListAdminOverridesResponse] parsed result object
653
+ # @yieldparam err [StandardError] error object if request failed
654
+ #
655
+ # @return [Google::Apis::ServiceusageV1beta1::ListAdminOverridesResponse]
656
+ #
657
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
658
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
659
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
660
+ def list_service_consumer_quota_metric_limit_admin_overrides(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
661
+ command = make_simple_command(:get, 'v1beta1/{+parent}/adminOverrides', options)
662
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ListAdminOverridesResponse::Representation
663
+ command.response_class = Google::Apis::ServiceusageV1beta1::ListAdminOverridesResponse
664
+ command.params['parent'] = parent unless parent.nil?
665
+ command.query['pageSize'] = page_size unless page_size.nil?
666
+ command.query['pageToken'] = page_token unless page_token.nil?
667
+ command.query['fields'] = fields unless fields.nil?
668
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
669
+ execute_or_queue_command(command, &block)
670
+ end
671
+
672
+ # Updates an admin override.
673
+ # @param [String] name
674
+ # The resource name of the override to update. An example name would be: `
675
+ # projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
676
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`
677
+ # @param [Google::Apis::ServiceusageV1beta1::QuotaOverride] quota_override_object
678
+ # @param [Boolean] force
679
+ # Whether to force the update of the quota override. If updating an override
680
+ # would cause the effective quota for the consumer to decrease by more than 10
681
+ # percent, the call is rejected, as a safety measure to avoid accidentally
682
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
683
+ # restriction.
684
+ # @param [String] update_mask
685
+ # Update only the specified fields of the override. If unset, all fields will be
686
+ # updated.
687
+ # @param [String] fields
688
+ # Selector specifying which fields to include in a partial response.
689
+ # @param [String] quota_user
690
+ # Available to use for quota purposes for server-side applications. Can be any
691
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
692
+ # @param [Google::Apis::RequestOptions] options
693
+ # Request-specific options
694
+ #
695
+ # @yield [result, err] Result & error if block supplied
696
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
697
+ # @yieldparam err [StandardError] error object if request failed
698
+ #
699
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
700
+ #
701
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
702
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
703
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
704
+ def patch_service_consumer_quota_metric_limit_admin_override(name, quota_override_object = nil, force: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
705
+ command = make_simple_command(:patch, 'v1beta1/{+name}', options)
706
+ command.request_representation = Google::Apis::ServiceusageV1beta1::QuotaOverride::Representation
707
+ command.request_object = quota_override_object
708
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
709
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
710
+ command.params['name'] = name unless name.nil?
711
+ command.query['force'] = force unless force.nil?
712
+ command.query['updateMask'] = update_mask unless update_mask.nil?
713
+ command.query['fields'] = fields unless fields.nil?
714
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
715
+ execute_or_queue_command(command, &block)
716
+ end
717
+
718
+ # Creates a consumer override. A consumer override is applied to the consumer on
719
+ # its own authority to limit its own quota usage. Consumer overrides cannot be
720
+ # used to grant more quota than would be allowed by admin overrides, producer
721
+ # overrides, or the default limit of the service.
722
+ # @param [String] parent
723
+ # The resource name of the parent quota limit, returned by a
724
+ # ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name would
725
+ # be: `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
726
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
727
+ # @param [Google::Apis::ServiceusageV1beta1::QuotaOverride] quota_override_object
728
+ # @param [Boolean] force
729
+ # Whether to force the creation of the quota override. If creating an override
730
+ # would cause the effective quota for the consumer to decrease by more than 10
731
+ # percent, the call is rejected, as a safety measure to avoid accidentally
732
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
733
+ # restriction.
734
+ # @param [String] fields
735
+ # Selector specifying which fields to include in a partial response.
736
+ # @param [String] quota_user
737
+ # Available to use for quota purposes for server-side applications. Can be any
738
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
739
+ # @param [Google::Apis::RequestOptions] options
740
+ # Request-specific options
741
+ #
742
+ # @yield [result, err] Result & error if block supplied
743
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
744
+ # @yieldparam err [StandardError] error object if request failed
745
+ #
746
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
747
+ #
748
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
749
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
750
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
751
+ def create_service_consumer_quota_metric_limit_consumer_override(parent, quota_override_object = nil, force: nil, fields: nil, quota_user: nil, options: nil, &block)
752
+ command = make_simple_command(:post, 'v1beta1/{+parent}/consumerOverrides', options)
753
+ command.request_representation = Google::Apis::ServiceusageV1beta1::QuotaOverride::Representation
754
+ command.request_object = quota_override_object
755
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
756
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
757
+ command.params['parent'] = parent unless parent.nil?
758
+ command.query['force'] = force unless force.nil?
759
+ command.query['fields'] = fields unless fields.nil?
760
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
761
+ execute_or_queue_command(command, &block)
762
+ end
763
+
764
+ # Deletes a consumer override.
765
+ # @param [String] name
766
+ # The resource name of the override to delete. An example name would be: `
767
+ # projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
768
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
769
+ # @param [Boolean] force
770
+ # Whether to force the deletion of the quota override. If deleting an override
771
+ # would cause the effective quota for the consumer to decrease by more than 10
772
+ # percent, the call is rejected, as a safety measure to avoid accidentally
773
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
774
+ # restriction.
775
+ # @param [String] fields
776
+ # Selector specifying which fields to include in a partial response.
777
+ # @param [String] quota_user
778
+ # Available to use for quota purposes for server-side applications. Can be any
779
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
780
+ # @param [Google::Apis::RequestOptions] options
781
+ # Request-specific options
782
+ #
783
+ # @yield [result, err] Result & error if block supplied
784
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
785
+ # @yieldparam err [StandardError] error object if request failed
786
+ #
787
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
788
+ #
789
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
790
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
791
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
792
+ def delete_service_consumer_quota_metric_limit_consumer_override(name, force: nil, fields: nil, quota_user: nil, options: nil, &block)
793
+ command = make_simple_command(:delete, 'v1beta1/{+name}', options)
794
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
795
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
796
+ command.params['name'] = name unless name.nil?
797
+ command.query['force'] = force unless force.nil?
798
+ command.query['fields'] = fields unless fields.nil?
799
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
800
+ execute_or_queue_command(command, &block)
801
+ end
802
+
803
+ # Lists all consumer overrides on this limit.
804
+ # @param [String] parent
805
+ # The resource name of the parent quota limit, returned by a
806
+ # ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name would
807
+ # be: `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
808
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`
809
+ # @param [Fixnum] page_size
810
+ # Requested size of the next page of data.
811
+ # @param [String] page_token
812
+ # Token identifying which result to start with; returned by a previous list call.
813
+ # @param [String] fields
814
+ # Selector specifying which fields to include in a partial response.
815
+ # @param [String] quota_user
816
+ # Available to use for quota purposes for server-side applications. Can be any
817
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
818
+ # @param [Google::Apis::RequestOptions] options
819
+ # Request-specific options
820
+ #
821
+ # @yield [result, err] Result & error if block supplied
822
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::ListConsumerOverridesResponse] parsed result object
823
+ # @yieldparam err [StandardError] error object if request failed
824
+ #
825
+ # @return [Google::Apis::ServiceusageV1beta1::ListConsumerOverridesResponse]
826
+ #
827
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
828
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
829
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
830
+ def list_service_consumer_quota_metric_limit_consumer_overrides(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
831
+ command = make_simple_command(:get, 'v1beta1/{+parent}/consumerOverrides', options)
832
+ command.response_representation = Google::Apis::ServiceusageV1beta1::ListConsumerOverridesResponse::Representation
833
+ command.response_class = Google::Apis::ServiceusageV1beta1::ListConsumerOverridesResponse
834
+ command.params['parent'] = parent unless parent.nil?
835
+ command.query['pageSize'] = page_size unless page_size.nil?
836
+ command.query['pageToken'] = page_token unless page_token.nil?
837
+ command.query['fields'] = fields unless fields.nil?
838
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
839
+ execute_or_queue_command(command, &block)
840
+ end
841
+
842
+ # Updates a consumer override.
843
+ # @param [String] name
844
+ # The resource name of the override to update. An example name would be: `
845
+ # projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.
846
+ # googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d`
847
+ # @param [Google::Apis::ServiceusageV1beta1::QuotaOverride] quota_override_object
848
+ # @param [Boolean] force
849
+ # Whether to force the update of the quota override. If updating an override
850
+ # would cause the effective quota for the consumer to decrease by more than 10
851
+ # percent, the call is rejected, as a safety measure to avoid accidentally
852
+ # decreasing quota too quickly. Setting the force parameter to true ignores this
853
+ # restriction.
854
+ # @param [String] update_mask
855
+ # Update only the specified fields of the override. If unset, all fields will be
856
+ # updated.
857
+ # @param [String] fields
858
+ # Selector specifying which fields to include in a partial response.
859
+ # @param [String] quota_user
860
+ # Available to use for quota purposes for server-side applications. Can be any
861
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
862
+ # @param [Google::Apis::RequestOptions] options
863
+ # Request-specific options
864
+ #
865
+ # @yield [result, err] Result & error if block supplied
866
+ # @yieldparam result [Google::Apis::ServiceusageV1beta1::Operation] parsed result object
867
+ # @yieldparam err [StandardError] error object if request failed
868
+ #
869
+ # @return [Google::Apis::ServiceusageV1beta1::Operation]
870
+ #
871
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
872
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
873
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
874
+ def patch_service_consumer_quota_metric_limit_consumer_override(name, quota_override_object = nil, force: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
875
+ command = make_simple_command(:patch, 'v1beta1/{+name}', options)
876
+ command.request_representation = Google::Apis::ServiceusageV1beta1::QuotaOverride::Representation
877
+ command.request_object = quota_override_object
878
+ command.response_representation = Google::Apis::ServiceusageV1beta1::Operation::Representation
879
+ command.response_class = Google::Apis::ServiceusageV1beta1::Operation
880
+ command.params['name'] = name unless name.nil?
881
+ command.query['force'] = force unless force.nil?
882
+ command.query['updateMask'] = update_mask unless update_mask.nil?
883
+ command.query['fields'] = fields unless fields.nil?
884
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
885
+ execute_or_queue_command(command, &block)
886
+ end
887
+
888
+ protected
889
+
890
+ def apply_command_defaults(command)
891
+ command.query['key'] = key unless key.nil?
892
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
893
+ end
894
+ end
895
+ end
896
+ end
897
+ end