Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: generated/googleapis/lib/servicecontrol/v1.dart

Issue 2695743002: Api-roll 45: 2017-02-13 (Closed)
Patch Set: reverted local changes to pubspec file Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // This is a generated file (see the discoveryapis_generator project). 1 // This is a generated file (see the discoveryapis_generator project).
2 2
3 library googleapis.servicecontrol.v1; 3 library googleapis.servicecontrol.v1;
4 4
5 import 'dart:core' as core; 5 import 'dart:core' as core;
6 import 'dart:async' as async; 6 import 'dart:async' as async;
7 import 'dart:convert' as convert; 7 import 'dart:convert' as convert;
8 8
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 37
38 class ServicesResourceApi { 38 class ServicesResourceApi {
39 final commons.ApiRequester _requester; 39 final commons.ApiRequester _requester;
40 40
41 ServicesResourceApi(commons.ApiRequester client) : 41 ServicesResourceApi(commons.ApiRequester client) :
42 _requester = client; 42 _requester = client;
43 43
44 /** 44 /**
45 * Attempts to allocate quota for the specified consumer. It should be called
46 * before the operation is executed.
47 *
48 * This method requires the `servicemanagement.services.quota`
49 * permission on the specified service. For more information, see
50 * [Google Cloud IAM](https://cloud.google.com/iam).
51 *
52 * [request] - The metadata request object.
53 *
54 * Request parameters:
55 *
56 * [serviceName] - Name of the service as specified in the service
57 * configuration. For example,
58 * `"pubsub.googleapis.com"`.
59 *
60 * See google.api.Service for the definition of a service name.
61 *
62 * Completes with a [AllocateQuotaResponse].
63 *
64 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
65 * error.
66 *
67 * If the used [http.Client] completes with an error when making a REST call,
68 * this method will complete with the same error.
69 */
70 async.Future<AllocateQuotaResponse> allocateQuota(AllocateQuotaRequest request , core.String serviceName) {
71 var _url = null;
72 var _queryParams = new core.Map();
73 var _uploadMedia = null;
74 var _uploadOptions = null;
75 var _downloadOptions = commons.DownloadOptions.Metadata;
76 var _body = null;
77
78 if (request != null) {
79 _body = convert.JSON.encode((request).toJson());
80 }
81 if (serviceName == null) {
82 throw new core.ArgumentError("Parameter serviceName is required.");
83 }
84
85 _url = 'v1/services/' + commons.Escaper.ecapeVariable('$serviceName') + ':al locateQuota';
86
87 var _response = _requester.request(_url,
88 "POST",
89 body: _body,
90 queryParams: _queryParams,
91 uploadOptions: _uploadOptions,
92 uploadMedia: _uploadMedia,
93 downloadOptions: _downloadOptions);
94 return _response.then((data) => new AllocateQuotaResponse.fromJson(data));
95 }
96
97 /**
45 * Checks an operation with Google Service Control to decide whether 98 * Checks an operation with Google Service Control to decide whether
46 * the given operation should proceed. It should be called before the 99 * the given operation should proceed. It should be called before the
47 * operation is executed. 100 * operation is executed.
48 * 101 *
49 * If feasible, the client should cache the check results and reuse them for 102 * If feasible, the client should cache the check results and reuse them for
50 * 60 seconds. In case of server errors, the client can rely on the cached 103 * 60 seconds. In case of server errors, the client can rely on the cached
51 * results for longer time. 104 * results for longer time.
52 * 105 *
53 * NOTE: the `CheckRequest` has the size limit of 64KB. 106 * NOTE: the `CheckRequest` has the size limit of 64KB.
54 * 107 *
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 "POST", 148 "POST",
96 body: _body, 149 body: _body,
97 queryParams: _queryParams, 150 queryParams: _queryParams,
98 uploadOptions: _uploadOptions, 151 uploadOptions: _uploadOptions,
99 uploadMedia: _uploadMedia, 152 uploadMedia: _uploadMedia,
100 downloadOptions: _downloadOptions); 153 downloadOptions: _downloadOptions);
101 return _response.then((data) => new CheckResponse.fromJson(data)); 154 return _response.then((data) => new CheckResponse.fromJson(data));
102 } 155 }
103 156
104 /** 157 /**
158 * Signals the quota controller that service ends the ongoing usage
159 * reconciliation.
160 *
161 * This method requires the `servicemanagement.services.quota`
162 * permission on the specified service. For more information, see
163 * [Google Cloud IAM](https://cloud.google.com/iam).
164 *
165 * [request] - The metadata request object.
166 *
167 * Request parameters:
168 *
169 * [serviceName] - Name of the service as specified in the service
170 * configuration. For example,
171 * `"pubsub.googleapis.com"`.
172 *
173 * See google.api.Service for the definition of a service name.
174 *
175 * Completes with a [EndReconciliationResponse].
176 *
177 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
178 * error.
179 *
180 * If the used [http.Client] completes with an error when making a REST call,
181 * this method will complete with the same error.
182 */
183 async.Future<EndReconciliationResponse> endReconciliation(EndReconciliationReq uest request, core.String serviceName) {
184 var _url = null;
185 var _queryParams = new core.Map();
186 var _uploadMedia = null;
187 var _uploadOptions = null;
188 var _downloadOptions = commons.DownloadOptions.Metadata;
189 var _body = null;
190
191 if (request != null) {
192 _body = convert.JSON.encode((request).toJson());
193 }
194 if (serviceName == null) {
195 throw new core.ArgumentError("Parameter serviceName is required.");
196 }
197
198 _url = 'v1/services/' + commons.Escaper.ecapeVariable('$serviceName') + ':en dReconciliation';
199
200 var _response = _requester.request(_url,
201 "POST",
202 body: _body,
203 queryParams: _queryParams,
204 uploadOptions: _uploadOptions,
205 uploadMedia: _uploadMedia,
206 downloadOptions: _downloadOptions);
207 return _response.then((data) => new EndReconciliationResponse.fromJson(data) );
208 }
209
210 /**
211 * Releases previously allocated quota done through AllocateQuota method.
212 *
213 * This method requires the `servicemanagement.services.quota`
214 * permission on the specified service. For more information, see
215 * [Google Cloud IAM](https://cloud.google.com/iam).
216 *
217 * [request] - The metadata request object.
218 *
219 * Request parameters:
220 *
221 * [serviceName] - Name of the service as specified in the service
222 * configuration. For example,
223 * `"pubsub.googleapis.com"`.
224 *
225 * See google.api.Service for the definition of a service name.
226 *
227 * Completes with a [ReleaseQuotaResponse].
228 *
229 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
230 * error.
231 *
232 * If the used [http.Client] completes with an error when making a REST call,
233 * this method will complete with the same error.
234 */
235 async.Future<ReleaseQuotaResponse> releaseQuota(ReleaseQuotaRequest request, c ore.String serviceName) {
236 var _url = null;
237 var _queryParams = new core.Map();
238 var _uploadMedia = null;
239 var _uploadOptions = null;
240 var _downloadOptions = commons.DownloadOptions.Metadata;
241 var _body = null;
242
243 if (request != null) {
244 _body = convert.JSON.encode((request).toJson());
245 }
246 if (serviceName == null) {
247 throw new core.ArgumentError("Parameter serviceName is required.");
248 }
249
250 _url = 'v1/services/' + commons.Escaper.ecapeVariable('$serviceName') + ':re leaseQuota';
251
252 var _response = _requester.request(_url,
253 "POST",
254 body: _body,
255 queryParams: _queryParams,
256 uploadOptions: _uploadOptions,
257 uploadMedia: _uploadMedia,
258 downloadOptions: _downloadOptions);
259 return _response.then((data) => new ReleaseQuotaResponse.fromJson(data));
260 }
261
262 /**
105 * Reports operation results to Google Service Control, such as logs and 263 * Reports operation results to Google Service Control, such as logs and
106 * metrics. It should be called after an operation is completed. 264 * metrics. It should be called after an operation is completed.
107 * 265 *
108 * If feasible, the client should aggregate reporting data for up to 5 266 * If feasible, the client should aggregate reporting data for up to 5
109 * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to 267 * seconds to reduce API traffic. Limiting aggregation to 5 seconds is to
110 * reduce data loss during client crashes. Clients should carefully choose 268 * reduce data loss during client crashes. Clients should carefully choose
111 * the aggregation time window to avoid data loss risk more than 0.01% 269 * the aggregation time window to avoid data loss risk more than 0.01%
112 * for business and compliance reasons. 270 * for business and compliance reasons.
113 * 271 *
114 * NOTE: the `ReportRequest` has the size limit of 1MB. 272 * NOTE: the `ReportRequest` has the size limit of 1MB.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 var _response = _requester.request(_url, 313 var _response = _requester.request(_url,
156 "POST", 314 "POST",
157 body: _body, 315 body: _body,
158 queryParams: _queryParams, 316 queryParams: _queryParams,
159 uploadOptions: _uploadOptions, 317 uploadOptions: _uploadOptions,
160 uploadMedia: _uploadMedia, 318 uploadMedia: _uploadMedia,
161 downloadOptions: _downloadOptions); 319 downloadOptions: _downloadOptions);
162 return _response.then((data) => new ReportResponse.fromJson(data)); 320 return _response.then((data) => new ReportResponse.fromJson(data));
163 } 321 }
164 322
165 } 323 /**
166 324 * Unlike rate quota, allocation quota does not get refilled periodically.
167 325 * So, it is possible that the quota usage as seen by the service differs from
326 * what the One Platform considers the usage is. This is expected to happen
327 * only rarely, but over time this can accumulate. Services can invoke
328 * StartReconciliation and EndReconciliation to correct this usage drift, as
329 * described below:
330 * 1. Service sends StartReconciliation with a timestamp in future for each
331 * metric that needs to be reconciled. The timestamp being in future allows
332 * to account for in-flight AllocateQuota and ReleaseQuota requests for the
333 * same metric.
334 * 2. One Platform records this timestamp and starts tracking subsequent
335 * AllocateQuota and ReleaseQuota requests until EndReconciliation is
336 * called.
337 * 3. At or after the time specified in the StartReconciliation, service
338 * sends EndReconciliation with the usage that needs to be reconciled to.
339 * 4. One Platform adjusts its own record of usage for that metric to the
340 * value specified in EndReconciliation by taking in to account any
341 * allocation or release between StartReconciliation and EndReconciliation.
342 *
343 * Signals the quota controller that the service wants to perform a usage
344 * reconciliation as specified in the request.
345 *
346 * This method requires the `servicemanagement.services.quota`
347 * permission on the specified service. For more information, see
348 * [Google Cloud IAM](https://cloud.google.com/iam).
349 *
350 * [request] - The metadata request object.
351 *
352 * Request parameters:
353 *
354 * [serviceName] - Name of the service as specified in the service
355 * configuration. For example,
356 * `"pubsub.googleapis.com"`.
357 *
358 * See google.api.Service for the definition of a service name.
359 *
360 * Completes with a [StartReconciliationResponse].
361 *
362 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
363 * error.
364 *
365 * If the used [http.Client] completes with an error when making a REST call,
366 * this method will complete with the same error.
367 */
368 async.Future<StartReconciliationResponse> startReconciliation(StartReconciliat ionRequest request, core.String serviceName) {
369 var _url = null;
370 var _queryParams = new core.Map();
371 var _uploadMedia = null;
372 var _uploadOptions = null;
373 var _downloadOptions = commons.DownloadOptions.Metadata;
374 var _body = null;
375
376 if (request != null) {
377 _body = convert.JSON.encode((request).toJson());
378 }
379 if (serviceName == null) {
380 throw new core.ArgumentError("Parameter serviceName is required.");
381 }
382
383 _url = 'v1/services/' + commons.Escaper.ecapeVariable('$serviceName') + ':st artReconciliation';
384
385 var _response = _requester.request(_url,
386 "POST",
387 body: _body,
388 queryParams: _queryParams,
389 uploadOptions: _uploadOptions,
390 uploadMedia: _uploadMedia,
391 downloadOptions: _downloadOptions);
392 return _response.then((data) => new StartReconciliationResponse.fromJson(dat a));
393 }
394
395 }
396
397
398
399 /** Request message for the AllocateQuota method. */
400 class AllocateQuotaRequest {
401 /** Operation that describes the quota allocation. */
402 QuotaOperation allocateOperation;
403 /**
404 * Allocation mode for this operation.
405 * Deprecated: use QuotaMode inside the QuotaOperation.
406 * Possible string values are:
407 * - "UNSPECIFIED"
408 * - "NORMAL" : Allocates quota for the amount specified in the service
409 * configuration or
410 * specified using the quota_metrics. If the amount is higher than the
411 * available quota, allocation error will be returned and no quota will be
412 * allocated.
413 * - "BEST_EFFORT" : Allocates quota for the amount specified in the service
414 * configuration or
415 * specified using the quota_metrics. If the amount is higher than the
416 * available quota, request does not fail but all available quota will be
417 * allocated.
418 * - "CHECK_ONLY" : Only checks if there is enough quota available and does
419 * not change the
420 * available quota. No lock is placed on the available quota either.
421 */
422 core.String allocationMode;
423 /**
424 * Specifies which version of service configuration should be used to process
425 * the request. If unspecified or no matching version can be found, the latest
426 * one will be used.
427 */
428 core.String serviceConfigId;
429
430 AllocateQuotaRequest();
431
432 AllocateQuotaRequest.fromJson(core.Map _json) {
433 if (_json.containsKey("allocateOperation")) {
434 allocateOperation = new QuotaOperation.fromJson(_json["allocateOperation"] );
435 }
436 if (_json.containsKey("allocationMode")) {
437 allocationMode = _json["allocationMode"];
438 }
439 if (_json.containsKey("serviceConfigId")) {
440 serviceConfigId = _json["serviceConfigId"];
441 }
442 }
443
444 core.Map toJson() {
445 var _json = new core.Map();
446 if (allocateOperation != null) {
447 _json["allocateOperation"] = (allocateOperation).toJson();
448 }
449 if (allocationMode != null) {
450 _json["allocationMode"] = allocationMode;
451 }
452 if (serviceConfigId != null) {
453 _json["serviceConfigId"] = serviceConfigId;
454 }
455 return _json;
456 }
457 }
458
459 /** Response message for the AllocateQuota method. */
460 class AllocateQuotaResponse {
461 /** Indicates the decision of the allocate. */
462 core.List<QuotaError> allocateErrors;
463 /**
464 * The same operation_id value used in the AllocateQuotaRequest. Used for
465 * logging and diagnostics purposes.
466 */
467 core.String operationId;
468 /**
469 * Quota metrics to indicate the result of allocation. Depending on the
470 * request, one or more of the following metrics will be included:
471 *
472 * 1. For rate quota, per quota group or per quota metric incremental usage
473 * will be specified using the following delta metric:
474 * "serviceruntime.googleapis.com/api/consumer/quota_used_count"
475 *
476 * 2. For allocation quota, per quota metric total usage will be specified
477 * using the following gauge metric:
478 * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count"
479 *
480 * 3. For both rate quota and allocation quota, the quota limit reached
481 * condition will be specified using the following boolean metric:
482 * "serviceruntime.googleapis.com/quota/exceeded"
483 */
484 core.List<MetricValueSet> quotaMetrics;
485 /** ID of the actual config used to process the request. */
486 core.String serviceConfigId;
487
488 AllocateQuotaResponse();
489
490 AllocateQuotaResponse.fromJson(core.Map _json) {
491 if (_json.containsKey("allocateErrors")) {
492 allocateErrors = _json["allocateErrors"].map((value) => new QuotaError.fro mJson(value)).toList();
493 }
494 if (_json.containsKey("operationId")) {
495 operationId = _json["operationId"];
496 }
497 if (_json.containsKey("quotaMetrics")) {
498 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
499 }
500 if (_json.containsKey("serviceConfigId")) {
501 serviceConfigId = _json["serviceConfigId"];
502 }
503 }
504
505 core.Map toJson() {
506 var _json = new core.Map();
507 if (allocateErrors != null) {
508 _json["allocateErrors"] = allocateErrors.map((value) => (value).toJson()). toList();
509 }
510 if (operationId != null) {
511 _json["operationId"] = operationId;
512 }
513 if (quotaMetrics != null) {
514 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
515 }
516 if (serviceConfigId != null) {
517 _json["serviceConfigId"] = serviceConfigId;
518 }
519 return _json;
520 }
521 }
522
523 /** Common audit log format for Google Cloud Platform API operations. */
524 class AuditLog {
525 /** Authentication information. */
526 AuthenticationInfo authenticationInfo;
527 /**
528 * Authorization information. If there are multiple
529 * resources or permissions involved, then there is
530 * one AuthorizationInfo element for each {resource, permission} tuple.
531 */
532 core.List<AuthorizationInfo> authorizationInfo;
533 /**
534 * The name of the service method or operation.
535 * For API calls, this should be the name of the API method.
536 * For example,
537 *
538 * "google.datastore.v1.Datastore.RunQuery"
539 * "google.logging.v1.LoggingService.DeleteLog"
540 */
541 core.String methodName;
542 /**
543 * The number of items returned from a List or Query API method,
544 * if applicable.
545 */
546 core.String numResponseItems;
547 /**
548 * The operation request. This may not include all request parameters,
549 * such as those that are too large, privacy-sensitive, or duplicated
550 * elsewhere in the log record.
551 * It should never include user-generated data, such as file contents.
552 * When the JSON object represented here has a proto equivalent, the proto
553 * name will be indicated in the `@type` property.
554 *
555 * The values for Object must be JSON objects. It can consist of `num`,
556 * `String`, `bool` and `null` as well as `Map` and `List` values.
557 */
558 core.Map<core.String, core.Object> request;
559 /** Metadata about the operation. */
560 RequestMetadata requestMetadata;
561 /**
562 * The resource or collection that is the target of the operation.
563 * The name is a scheme-less URI, not including the API service name.
564 * For example:
565 *
566 * "shelves/SHELF_ID/books"
567 * "shelves/SHELF_ID/books/BOOK_ID"
568 */
569 core.String resourceName;
570 /**
571 * The operation response. This may not include all response elements,
572 * such as those that are too large, privacy-sensitive, or duplicated
573 * elsewhere in the log record.
574 * It should never include user-generated data, such as file contents.
575 * When the JSON object represented here has a proto equivalent, the proto
576 * name will be indicated in the `@type` property.
577 *
578 * The values for Object must be JSON objects. It can consist of `num`,
579 * `String`, `bool` and `null` as well as `Map` and `List` values.
580 */
581 core.Map<core.String, core.Object> response;
582 /**
583 * Other service-specific data about the request, response, and other
584 * activities.
585 *
586 * The values for Object must be JSON objects. It can consist of `num`,
587 * `String`, `bool` and `null` as well as `Map` and `List` values.
588 */
589 core.Map<core.String, core.Object> serviceData;
590 /**
591 * The name of the API service performing the operation. For example,
592 * `"datastore.googleapis.com"`.
593 */
594 core.String serviceName;
595 /** The status of the overall operation. */
596 Status status;
597
598 AuditLog();
599
600 AuditLog.fromJson(core.Map _json) {
601 if (_json.containsKey("authenticationInfo")) {
602 authenticationInfo = new AuthenticationInfo.fromJson(_json["authentication Info"]);
603 }
604 if (_json.containsKey("authorizationInfo")) {
605 authorizationInfo = _json["authorizationInfo"].map((value) => new Authoriz ationInfo.fromJson(value)).toList();
606 }
607 if (_json.containsKey("methodName")) {
608 methodName = _json["methodName"];
609 }
610 if (_json.containsKey("numResponseItems")) {
611 numResponseItems = _json["numResponseItems"];
612 }
613 if (_json.containsKey("request")) {
614 request = _json["request"];
615 }
616 if (_json.containsKey("requestMetadata")) {
617 requestMetadata = new RequestMetadata.fromJson(_json["requestMetadata"]);
618 }
619 if (_json.containsKey("resourceName")) {
620 resourceName = _json["resourceName"];
621 }
622 if (_json.containsKey("response")) {
623 response = _json["response"];
624 }
625 if (_json.containsKey("serviceData")) {
626 serviceData = _json["serviceData"];
627 }
628 if (_json.containsKey("serviceName")) {
629 serviceName = _json["serviceName"];
630 }
631 if (_json.containsKey("status")) {
632 status = new Status.fromJson(_json["status"]);
633 }
634 }
635
636 core.Map toJson() {
637 var _json = new core.Map();
638 if (authenticationInfo != null) {
639 _json["authenticationInfo"] = (authenticationInfo).toJson();
640 }
641 if (authorizationInfo != null) {
642 _json["authorizationInfo"] = authorizationInfo.map((value) => (value).toJs on()).toList();
643 }
644 if (methodName != null) {
645 _json["methodName"] = methodName;
646 }
647 if (numResponseItems != null) {
648 _json["numResponseItems"] = numResponseItems;
649 }
650 if (request != null) {
651 _json["request"] = request;
652 }
653 if (requestMetadata != null) {
654 _json["requestMetadata"] = (requestMetadata).toJson();
655 }
656 if (resourceName != null) {
657 _json["resourceName"] = resourceName;
658 }
659 if (response != null) {
660 _json["response"] = response;
661 }
662 if (serviceData != null) {
663 _json["serviceData"] = serviceData;
664 }
665 if (serviceName != null) {
666 _json["serviceName"] = serviceName;
667 }
668 if (status != null) {
669 _json["status"] = (status).toJson();
670 }
671 return _json;
672 }
673 }
674
675 /** Authentication information for the operation. */
676 class AuthenticationInfo {
677 /**
678 * The authority selector specified by the requestor, if any.
679 * It is not guaranteed that the principal was allowed to use this authority.
680 */
681 core.String authoritySelector;
682 /** The email address of the authenticated user making the request. */
683 core.String principalEmail;
684
685 AuthenticationInfo();
686
687 AuthenticationInfo.fromJson(core.Map _json) {
688 if (_json.containsKey("authoritySelector")) {
689 authoritySelector = _json["authoritySelector"];
690 }
691 if (_json.containsKey("principalEmail")) {
692 principalEmail = _json["principalEmail"];
693 }
694 }
695
696 core.Map toJson() {
697 var _json = new core.Map();
698 if (authoritySelector != null) {
699 _json["authoritySelector"] = authoritySelector;
700 }
701 if (principalEmail != null) {
702 _json["principalEmail"] = principalEmail;
703 }
704 return _json;
705 }
706 }
707
708 /** Authorization information for the operation. */
709 class AuthorizationInfo {
710 /**
711 * Whether or not authorization for `resource` and `permission`
712 * was granted.
713 */
714 core.bool granted;
715 /** The required IAM permission. */
716 core.String permission;
717 /**
718 * The resource being accessed, as a REST-style string. For example:
719 *
720 * bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID
721 */
722 core.String resource;
723
724 AuthorizationInfo();
725
726 AuthorizationInfo.fromJson(core.Map _json) {
727 if (_json.containsKey("granted")) {
728 granted = _json["granted"];
729 }
730 if (_json.containsKey("permission")) {
731 permission = _json["permission"];
732 }
733 if (_json.containsKey("resource")) {
734 resource = _json["resource"];
735 }
736 }
737
738 core.Map toJson() {
739 var _json = new core.Map();
740 if (granted != null) {
741 _json["granted"] = granted;
742 }
743 if (permission != null) {
744 _json["permission"] = permission;
745 }
746 if (resource != null) {
747 _json["resource"] = resource;
748 }
749 return _json;
750 }
751 }
168 752
169 /** 753 /**
170 * Defines the errors to be returned in 754 * Defines the errors to be returned in
171 * google.api.servicecontrol.v1.CheckResponse.check_errors. 755 * google.api.servicecontrol.v1.CheckResponse.check_errors.
172 */ 756 */
173 class CheckError { 757 class CheckError {
174 /** 758 /**
175 * The error code. 759 * The error code.
176 * Possible string values are: 760 * Possible string values are:
177 * - "ERROR_CODE_UNSPECIFIED" : This is never used in `CheckResponse`. 761 * - "ERROR_CODE_UNSPECIFIED" : This is never used in `CheckResponse`.
178 * - "NOT_FOUND" : The consumer's project id was not found. 762 * - "NOT_FOUND" : The consumer's project id was not found.
179 * Same as google.rpc.Code.NOT_FOUND. 763 * Same as google.rpc.Code.NOT_FOUND.
180 * - "PERMISSION_DENIED" : The consumer doesn't have access to the specified 764 * - "PERMISSION_DENIED" : The consumer doesn't have access to the specified
181 * resource. 765 * resource.
182 * Same as google.rpc.Code.PERMISSION_DENIED. 766 * Same as google.rpc.Code.PERMISSION_DENIED.
183 * - "RESOURCE_EXHAUSTED" : Quota check failed. Same as 767 * - "RESOURCE_EXHAUSTED" : Quota check failed. Same as
184 * google.rpc.Code.RESOURCE_EXHAUSTED. 768 * google.rpc.Code.RESOURCE_EXHAUSTED.
769 * - "BUDGET_EXCEEDED" : Budget check failed.
770 * - "DENIAL_OF_SERVICE_DETECTED" : The consumer's request has been flagged as
771 * a DoS attack.
772 * - "LOAD_SHEDDING" : The consumer's request should be rejected in order to
773 * protect the service
774 * from being overloaded.
775 * - "ABUSER_DETECTED" : The consumer has been flagged as an abuser.
185 * - "SERVICE_NOT_ACTIVATED" : The consumer hasn't activated the service. 776 * - "SERVICE_NOT_ACTIVATED" : The consumer hasn't activated the service.
777 * - "VISIBILITY_DENIED" : The consumer cannot access the service due to
778 * visibility configuration.
186 * - "BILLING_DISABLED" : The consumer cannot access the service because 779 * - "BILLING_DISABLED" : The consumer cannot access the service because
187 * billing is disabled. 780 * billing is disabled.
188 * - "PROJECT_DELETED" : The consumer's project has been marked as deleted 781 * - "PROJECT_DELETED" : The consumer's project has been marked as deleted
189 * (soft deletion). 782 * (soft deletion).
190 * - "PROJECT_INVALID" : The consumer's project number or id does not 783 * - "PROJECT_INVALID" : The consumer's project number or id does not
191 * represent a valid project. 784 * represent a valid project.
192 * - "IP_ADDRESS_BLOCKED" : The IP address of the consumer is invalid for the 785 * - "IP_ADDRESS_BLOCKED" : The IP address of the consumer is invalid for the
193 * specific consumer 786 * specific consumer
194 * project. 787 * project.
195 * - "REFERER_BLOCKED" : The referer address of the consumer request is 788 * - "REFERER_BLOCKED" : The referer address of the consumer request is
196 * invalid for the specific 789 * invalid for the specific
197 * consumer project. 790 * consumer project.
198 * - "CLIENT_APP_BLOCKED" : The client application of the consumer request is 791 * - "CLIENT_APP_BLOCKED" : The client application of the consumer request is
199 * invalid for the 792 * invalid for the
200 * specific consumer project. 793 * specific consumer project.
201 * - "API_TARGET_BLOCKED" : The API targeted by this request is invalid for 794 * - "API_TARGET_BLOCKED" : The API targeted by this request is invalid for
202 * the specified consumer 795 * the specified consumer
203 * project. 796 * project.
204 * - "API_KEY_INVALID" : The consumer's API key is invalid. 797 * - "API_KEY_INVALID" : The consumer's API key is invalid.
205 * - "API_KEY_EXPIRED" : The consumer's API Key has expired. 798 * - "API_KEY_EXPIRED" : The consumer's API Key has expired.
206 * - "API_KEY_NOT_FOUND" : The consumer's API Key was not found in config 799 * - "API_KEY_NOT_FOUND" : The consumer's API Key was not found in config
207 * record. 800 * record.
801 * - "SPATULA_HEADER_INVALID" : The consumer's spatula header is invalid.
802 * - "LOAS_ROLE_INVALID" : The consumer's LOAS role is invalid.
803 * - "NO_LOAS_PROJECT" : The consumer's LOAS role has no associated project.
804 * - "LOAS_PROJECT_DISABLED" : The consumer's LOAS project is not `ACTIVE` in
805 * LoquatV2.
806 * - "SECURITY_POLICY_VIOLATED" : Request is not allowed as per security
807 * policies defined in Org Policy.
208 * - "NAMESPACE_LOOKUP_UNAVAILABLE" : The backend server for looking up 808 * - "NAMESPACE_LOOKUP_UNAVAILABLE" : The backend server for looking up
209 * project id/number is unavailable. 809 * project id/number is unavailable.
210 * - "SERVICE_STATUS_UNAVAILABLE" : The backend server for checking service 810 * - "SERVICE_STATUS_UNAVAILABLE" : The backend server for checking service
211 * status is unavailable. 811 * status is unavailable.
212 * - "BILLING_STATUS_UNAVAILABLE" : The backend server for checking billing 812 * - "BILLING_STATUS_UNAVAILABLE" : The backend server for checking billing
213 * status is unavailable. 813 * status is unavailable.
814 * - "QUOTA_CHECK_UNAVAILABLE" : The backend server for checking quota limits
815 * is unavailable.
816 * - "LOAS_PROJECT_LOOKUP_UNAVAILABLE" : The Spanner for looking up LOAS
817 * project is unavailable.
818 * - "CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE" : Cloud Resource Manager
819 * backend server is unavailable.
820 * - "SECURITY_POLICY_BACKEND_UNAVAILABLE" : Backend server for evaluating
821 * security policy is unavailable.
214 */ 822 */
215 core.String code; 823 core.String code;
216 /** Free-form text providing details on the error cause of the error. */ 824 /** Free-form text providing details on the error cause of the error. */
217 core.String detail; 825 core.String detail;
218 826
219 CheckError(); 827 CheckError();
220 828
221 CheckError.fromJson(core.Map _json) { 829 CheckError.fromJson(core.Map _json) {
222 if (_json.containsKey("code")) { 830 if (_json.containsKey("code")) {
223 code = _json["code"]; 831 code = _json["code"];
224 } 832 }
225 if (_json.containsKey("detail")) { 833 if (_json.containsKey("detail")) {
226 detail = _json["detail"]; 834 detail = _json["detail"];
227 } 835 }
228 } 836 }
229 837
230 core.Map toJson() { 838 core.Map toJson() {
231 var _json = new core.Map(); 839 var _json = new core.Map();
232 if (code != null) { 840 if (code != null) {
233 _json["code"] = code; 841 _json["code"] = code;
234 } 842 }
235 if (detail != null) { 843 if (detail != null) {
236 _json["detail"] = detail; 844 _json["detail"] = detail;
237 } 845 }
238 return _json; 846 return _json;
239 } 847 }
240 } 848 }
241 849
850 class CheckInfo {
851 /**
852 * A list of fields and label keys that are ignored by the server.
853 * The client doesn't need to send them for following requests to improve
854 * performance and allow better aggregation.
855 */
856 core.List<core.String> unusedArguments;
857
858 CheckInfo();
859
860 CheckInfo.fromJson(core.Map _json) {
861 if (_json.containsKey("unusedArguments")) {
862 unusedArguments = _json["unusedArguments"];
863 }
864 }
865
866 core.Map toJson() {
867 var _json = new core.Map();
868 if (unusedArguments != null) {
869 _json["unusedArguments"] = unusedArguments;
870 }
871 return _json;
872 }
873 }
874
242 /** Request message for the Check method. */ 875 /** Request message for the Check method. */
243 class CheckRequest { 876 class CheckRequest {
244 /** The operation to be checked. */ 877 /** The operation to be checked. */
245 Operation operation; 878 Operation operation;
246 /** 879 /**
880 * Requests the project settings to be returned as part of the check response.
881 */
882 core.bool requestProjectSettings;
883 /**
247 * Specifies which version of service configuration should be used to process 884 * Specifies which version of service configuration should be used to process
248 * the request. 885 * the request.
249 * 886 *
250 * If unspecified or no matching version can be found, the 887 * If unspecified or no matching version can be found, the
251 * latest one will be used. 888 * latest one will be used.
252 */ 889 */
253 core.String serviceConfigId; 890 core.String serviceConfigId;
891 /**
892 * Indicates if service activation check should be skipped for this request.
893 * Default behavior is to perform the check and apply relevant quota.
894 */
895 core.bool skipActivationCheck;
254 896
255 CheckRequest(); 897 CheckRequest();
256 898
257 CheckRequest.fromJson(core.Map _json) { 899 CheckRequest.fromJson(core.Map _json) {
258 if (_json.containsKey("operation")) { 900 if (_json.containsKey("operation")) {
259 operation = new Operation.fromJson(_json["operation"]); 901 operation = new Operation.fromJson(_json["operation"]);
260 } 902 }
903 if (_json.containsKey("requestProjectSettings")) {
904 requestProjectSettings = _json["requestProjectSettings"];
905 }
261 if (_json.containsKey("serviceConfigId")) { 906 if (_json.containsKey("serviceConfigId")) {
262 serviceConfigId = _json["serviceConfigId"]; 907 serviceConfigId = _json["serviceConfigId"];
263 } 908 }
909 if (_json.containsKey("skipActivationCheck")) {
910 skipActivationCheck = _json["skipActivationCheck"];
911 }
264 } 912 }
265 913
266 core.Map toJson() { 914 core.Map toJson() {
267 var _json = new core.Map(); 915 var _json = new core.Map();
268 if (operation != null) { 916 if (operation != null) {
269 _json["operation"] = (operation).toJson(); 917 _json["operation"] = (operation).toJson();
270 } 918 }
919 if (requestProjectSettings != null) {
920 _json["requestProjectSettings"] = requestProjectSettings;
921 }
271 if (serviceConfigId != null) { 922 if (serviceConfigId != null) {
272 _json["serviceConfigId"] = serviceConfigId; 923 _json["serviceConfigId"] = serviceConfigId;
273 } 924 }
925 if (skipActivationCheck != null) {
926 _json["skipActivationCheck"] = skipActivationCheck;
927 }
274 return _json; 928 return _json;
275 } 929 }
276 } 930 }
277 931
278 /** Response message for the Check method. */ 932 /** Response message for the Check method. */
279 class CheckResponse { 933 class CheckResponse {
280 /** 934 /**
281 * Indicate the decision of the check. 935 * Indicate the decision of the check.
282 * 936 *
283 * If no check errors are present, the service should process the operation. 937 * If no check errors are present, the service should process the operation.
284 * Otherwise the service should use the list of errors to determine the 938 * Otherwise the service should use the list of errors to determine the
285 * appropriate action. 939 * appropriate action.
286 */ 940 */
287 core.List<CheckError> checkErrors; 941 core.List<CheckError> checkErrors;
288 /** 942 /**
943 * Feedback data returned from the server during processing a Check request.
944 */
945 CheckInfo checkInfo;
946 /**
289 * The same operation_id value used in the CheckRequest. 947 * The same operation_id value used in the CheckRequest.
290 * Used for logging and diagnostics purposes. 948 * Used for logging and diagnostics purposes.
291 */ 949 */
292 core.String operationId; 950 core.String operationId;
951 /** Quota information for the check request associated with this response. */
952 QuotaInfo quotaInfo;
293 /** The actual config id used to process the request. */ 953 /** The actual config id used to process the request. */
294 core.String serviceConfigId; 954 core.String serviceConfigId;
295 955
296 CheckResponse(); 956 CheckResponse();
297 957
298 CheckResponse.fromJson(core.Map _json) { 958 CheckResponse.fromJson(core.Map _json) {
299 if (_json.containsKey("checkErrors")) { 959 if (_json.containsKey("checkErrors")) {
300 checkErrors = _json["checkErrors"].map((value) => new CheckError.fromJson( value)).toList(); 960 checkErrors = _json["checkErrors"].map((value) => new CheckError.fromJson( value)).toList();
301 } 961 }
962 if (_json.containsKey("checkInfo")) {
963 checkInfo = new CheckInfo.fromJson(_json["checkInfo"]);
964 }
302 if (_json.containsKey("operationId")) { 965 if (_json.containsKey("operationId")) {
303 operationId = _json["operationId"]; 966 operationId = _json["operationId"];
304 } 967 }
968 if (_json.containsKey("quotaInfo")) {
969 quotaInfo = new QuotaInfo.fromJson(_json["quotaInfo"]);
970 }
305 if (_json.containsKey("serviceConfigId")) { 971 if (_json.containsKey("serviceConfigId")) {
306 serviceConfigId = _json["serviceConfigId"]; 972 serviceConfigId = _json["serviceConfigId"];
307 } 973 }
308 } 974 }
309 975
310 core.Map toJson() { 976 core.Map toJson() {
311 var _json = new core.Map(); 977 var _json = new core.Map();
312 if (checkErrors != null) { 978 if (checkErrors != null) {
313 _json["checkErrors"] = checkErrors.map((value) => (value).toJson()).toList (); 979 _json["checkErrors"] = checkErrors.map((value) => (value).toJson()).toList ();
314 } 980 }
981 if (checkInfo != null) {
982 _json["checkInfo"] = (checkInfo).toJson();
983 }
315 if (operationId != null) { 984 if (operationId != null) {
316 _json["operationId"] = operationId; 985 _json["operationId"] = operationId;
317 } 986 }
987 if (quotaInfo != null) {
988 _json["quotaInfo"] = (quotaInfo).toJson();
989 }
318 if (serviceConfigId != null) { 990 if (serviceConfigId != null) {
319 _json["serviceConfigId"] = serviceConfigId; 991 _json["serviceConfigId"] = serviceConfigId;
320 } 992 }
321 return _json; 993 return _json;
322 } 994 }
323 } 995 }
324 996
325 /** 997 /**
326 * Distribution represents a frequency distribution of double-valued sample 998 * Distribution represents a frequency distribution of double-valued sample
327 * points. It contains the size of the population of sample points plus 999 * points. It contains the size of the population of sample points plus
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 _json["mean"] = mean; 1100 _json["mean"] = mean;
429 } 1101 }
430 if (minimum != null) { 1102 if (minimum != null) {
431 _json["minimum"] = minimum; 1103 _json["minimum"] = minimum;
432 } 1104 }
433 if (sumOfSquaredDeviation != null) { 1105 if (sumOfSquaredDeviation != null) {
434 _json["sumOfSquaredDeviation"] = sumOfSquaredDeviation; 1106 _json["sumOfSquaredDeviation"] = sumOfSquaredDeviation;
435 } 1107 }
436 return _json; 1108 return _json;
437 } 1109 }
1110 }
1111
1112 class EndReconciliationRequest {
1113 /** Operation that describes the quota reconciliation. */
1114 QuotaOperation reconciliationOperation;
1115 /**
1116 * Specifies which version of service configuration should be used to process
1117 * the request. If unspecified or no matching version can be found, the latest
1118 * one will be used.
1119 */
1120 core.String serviceConfigId;
1121
1122 EndReconciliationRequest();
1123
1124 EndReconciliationRequest.fromJson(core.Map _json) {
1125 if (_json.containsKey("reconciliationOperation")) {
1126 reconciliationOperation = new QuotaOperation.fromJson(_json["reconciliatio nOperation"]);
1127 }
1128 if (_json.containsKey("serviceConfigId")) {
1129 serviceConfigId = _json["serviceConfigId"];
1130 }
1131 }
1132
1133 core.Map toJson() {
1134 var _json = new core.Map();
1135 if (reconciliationOperation != null) {
1136 _json["reconciliationOperation"] = (reconciliationOperation).toJson();
1137 }
1138 if (serviceConfigId != null) {
1139 _json["serviceConfigId"] = serviceConfigId;
1140 }
1141 return _json;
1142 }
1143 }
1144
1145 class EndReconciliationResponse {
1146 /**
1147 * The same operation_id value used in the EndReconciliationRequest. Used for
1148 * logging and diagnostics purposes.
1149 */
1150 core.String operationId;
1151 /**
1152 * Metric values as tracked by One Platform before the adjustment was made.
1153 */
1154 core.List<MetricValueSet> quotaMetrics;
1155 /** Indicates the decision of the reconciliation end. */
1156 core.List<QuotaError> reconciliationErrors;
1157 /** ID of the actual config used to process the request. */
1158 core.String serviceConfigId;
1159
1160 EndReconciliationResponse();
1161
1162 EndReconciliationResponse.fromJson(core.Map _json) {
1163 if (_json.containsKey("operationId")) {
1164 operationId = _json["operationId"];
1165 }
1166 if (_json.containsKey("quotaMetrics")) {
1167 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
1168 }
1169 if (_json.containsKey("reconciliationErrors")) {
1170 reconciliationErrors = _json["reconciliationErrors"].map((value) => new Qu otaError.fromJson(value)).toList();
1171 }
1172 if (_json.containsKey("serviceConfigId")) {
1173 serviceConfigId = _json["serviceConfigId"];
1174 }
1175 }
1176
1177 core.Map toJson() {
1178 var _json = new core.Map();
1179 if (operationId != null) {
1180 _json["operationId"] = operationId;
1181 }
1182 if (quotaMetrics != null) {
1183 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
1184 }
1185 if (reconciliationErrors != null) {
1186 _json["reconciliationErrors"] = reconciliationErrors.map((value) => (value ).toJson()).toList();
1187 }
1188 if (serviceConfigId != null) {
1189 _json["serviceConfigId"] = serviceConfigId;
1190 }
1191 return _json;
1192 }
438 } 1193 }
439 1194
440 /** Describing buckets with arbitrary user-provided width. */ 1195 /** Describing buckets with arbitrary user-provided width. */
441 class ExplicitBuckets { 1196 class ExplicitBuckets {
442 /** 1197 /**
443 * 'bound' is a list of strictly increasing boundaries between 1198 * 'bound' is a list of strictly increasing boundaries between
444 * buckets. Note that a list of length N-1 defines N buckets because 1199 * buckets. Note that a list of length N-1 defines N buckets because
445 * of fenceposting. See comments on `bucket_options` for details. 1200 * of fenceposting. See comments on `bucket_options` for details.
446 * 1201 *
447 * The i'th finite bucket covers the interval 1202 * The i'th finite bucket covers the interval
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 */ 1466 */
712 core.String endTime; 1467 core.String endTime;
713 /** A signed 64-bit integer value. */ 1468 /** A signed 64-bit integer value. */
714 core.String int64Value; 1469 core.String int64Value;
715 /** 1470 /**
716 * The labels describing the metric value. 1471 * The labels describing the metric value.
717 * See comments on google.api.servicecontrol.v1.Operation.labels for 1472 * See comments on google.api.servicecontrol.v1.Operation.labels for
718 * the overriding relationship. 1473 * the overriding relationship.
719 */ 1474 */
720 core.Map<core.String, core.String> labels; 1475 core.Map<core.String, core.String> labels;
1476 /** A money value. */
1477 Money moneyValue;
721 /** 1478 /**
722 * The start of the time period over which this metric value's measurement 1479 * The start of the time period over which this metric value's measurement
723 * applies. The time period has different semantics for different metric 1480 * applies. The time period has different semantics for different metric
724 * types (cumulative, delta, and gauge). See the metric definition 1481 * types (cumulative, delta, and gauge). See the metric definition
725 * documentation in the service configuration for details. 1482 * documentation in the service configuration for details.
726 */ 1483 */
727 core.String startTime; 1484 core.String startTime;
728 /** A text string value. */ 1485 /** A text string value. */
729 core.String stringValue; 1486 core.String stringValue;
730 1487
(...skipping 11 matching lines...) Expand all
742 } 1499 }
743 if (_json.containsKey("endTime")) { 1500 if (_json.containsKey("endTime")) {
744 endTime = _json["endTime"]; 1501 endTime = _json["endTime"];
745 } 1502 }
746 if (_json.containsKey("int64Value")) { 1503 if (_json.containsKey("int64Value")) {
747 int64Value = _json["int64Value"]; 1504 int64Value = _json["int64Value"];
748 } 1505 }
749 if (_json.containsKey("labels")) { 1506 if (_json.containsKey("labels")) {
750 labels = _json["labels"]; 1507 labels = _json["labels"];
751 } 1508 }
1509 if (_json.containsKey("moneyValue")) {
1510 moneyValue = new Money.fromJson(_json["moneyValue"]);
1511 }
752 if (_json.containsKey("startTime")) { 1512 if (_json.containsKey("startTime")) {
753 startTime = _json["startTime"]; 1513 startTime = _json["startTime"];
754 } 1514 }
755 if (_json.containsKey("stringValue")) { 1515 if (_json.containsKey("stringValue")) {
756 stringValue = _json["stringValue"]; 1516 stringValue = _json["stringValue"];
757 } 1517 }
758 } 1518 }
759 1519
760 core.Map toJson() { 1520 core.Map toJson() {
761 var _json = new core.Map(); 1521 var _json = new core.Map();
762 if (boolValue != null) { 1522 if (boolValue != null) {
763 _json["boolValue"] = boolValue; 1523 _json["boolValue"] = boolValue;
764 } 1524 }
765 if (distributionValue != null) { 1525 if (distributionValue != null) {
766 _json["distributionValue"] = (distributionValue).toJson(); 1526 _json["distributionValue"] = (distributionValue).toJson();
767 } 1527 }
768 if (doubleValue != null) { 1528 if (doubleValue != null) {
769 _json["doubleValue"] = doubleValue; 1529 _json["doubleValue"] = doubleValue;
770 } 1530 }
771 if (endTime != null) { 1531 if (endTime != null) {
772 _json["endTime"] = endTime; 1532 _json["endTime"] = endTime;
773 } 1533 }
774 if (int64Value != null) { 1534 if (int64Value != null) {
775 _json["int64Value"] = int64Value; 1535 _json["int64Value"] = int64Value;
776 } 1536 }
777 if (labels != null) { 1537 if (labels != null) {
778 _json["labels"] = labels; 1538 _json["labels"] = labels;
779 } 1539 }
1540 if (moneyValue != null) {
1541 _json["moneyValue"] = (moneyValue).toJson();
1542 }
780 if (startTime != null) { 1543 if (startTime != null) {
781 _json["startTime"] = startTime; 1544 _json["startTime"] = startTime;
782 } 1545 }
783 if (stringValue != null) { 1546 if (stringValue != null) {
784 _json["stringValue"] = stringValue; 1547 _json["stringValue"] = stringValue;
785 } 1548 }
786 return _json; 1549 return _json;
787 } 1550 }
788 } 1551 }
789 1552
(...skipping 24 matching lines...) Expand all
814 if (metricName != null) { 1577 if (metricName != null) {
815 _json["metricName"] = metricName; 1578 _json["metricName"] = metricName;
816 } 1579 }
817 if (metricValues != null) { 1580 if (metricValues != null) {
818 _json["metricValues"] = metricValues.map((value) => (value).toJson()).toLi st(); 1581 _json["metricValues"] = metricValues.map((value) => (value).toJson()).toLi st();
819 } 1582 }
820 return _json; 1583 return _json;
821 } 1584 }
822 } 1585 }
823 1586
1587 /** Represents an amount of money with its currency type. */
1588 class Money {
1589 /** The 3-letter currency code defined in ISO 4217. */
1590 core.String currencyCode;
1591 /**
1592 * Number of nano (10^-9) units of the amount.
1593 * The value must be between -999,999,999 and +999,999,999 inclusive.
1594 * If `units` is positive, `nanos` must be positive or zero.
1595 * If `units` is zero, `nanos` can be positive, zero, or negative.
1596 * If `units` is negative, `nanos` must be negative or zero.
1597 * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
1598 */
1599 core.int nanos;
1600 /**
1601 * The whole units of the amount.
1602 * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar.
1603 */
1604 core.String units;
1605
1606 Money();
1607
1608 Money.fromJson(core.Map _json) {
1609 if (_json.containsKey("currencyCode")) {
1610 currencyCode = _json["currencyCode"];
1611 }
1612 if (_json.containsKey("nanos")) {
1613 nanos = _json["nanos"];
1614 }
1615 if (_json.containsKey("units")) {
1616 units = _json["units"];
1617 }
1618 }
1619
1620 core.Map toJson() {
1621 var _json = new core.Map();
1622 if (currencyCode != null) {
1623 _json["currencyCode"] = currencyCode;
1624 }
1625 if (nanos != null) {
1626 _json["nanos"] = nanos;
1627 }
1628 if (units != null) {
1629 _json["units"] = units;
1630 }
1631 return _json;
1632 }
1633 }
1634
824 /** Represents information regarding an operation. */ 1635 /** Represents information regarding an operation. */
825 class Operation { 1636 class Operation {
826 /** 1637 /**
827 * Identity of the consumer who is using the service. 1638 * Identity of the consumer who is using the service.
828 * This field should be filled in for the operations initiated by a 1639 * This field should be filled in for the operations initiated by a
829 * consumer, but not for service-initiated operations that are 1640 * consumer, but not for service-initiated operations that are
830 * not related to a specific consumer. 1641 * not related to a specific consumer.
831 * 1642 *
832 * This can be in one of the following formats: 1643 * This can be in one of the following formats:
833 * project:<project_id>, 1644 * project:<project_id>,
834 * project_number:<project_number>, 1645 * project_number:<project_number>,
835 * api_key:<api_key>. 1646 * api_key:<api_key>.
836 */ 1647 */
837 core.String consumerId; 1648 core.String consumerId;
838 /** 1649 /**
839 * End time of the operation. 1650 * End time of the operation.
840 * Required when the operation is used in ServiceController.Report, 1651 * Required when the operation is used in ServiceController.Report,
841 * but optional when the operation is used in ServiceController.Check. 1652 * but optional when the operation is used in ServiceController.Check.
842 */ 1653 */
843 core.String endTime; 1654 core.String endTime;
844 /** 1655 /**
845 * DO NOT USE. This is an experimental field. 1656 * DO NOT USE. This is an experimental field.
846 * Possible string values are: 1657 * Possible string values are:
847 * - "LOW" : The API implementation may cache and aggregate the data. 1658 * - "LOW" : The API implementation may cache and aggregate the data.
848 * The data may be lost when rare and unexpected system failures occur. 1659 * The data may be lost when rare and unexpected system failures occur.
849 * - "HIGH" : The API implementation doesn't cache and aggregate the data. 1660 * - "HIGH" : The API implementation doesn't cache and aggregate the data.
850 * If the method returns successfully, it's guaranteed that the data has 1661 * If the method returns successfully, it's guaranteed that the data has
851 * been persisted in durable storage. 1662 * been persisted in durable storage.
1663 * - "DEBUG" : In addition to the behavior described in HIGH, DEBUG enables
1664 * additional validation logic that is only useful during the onboarding
1665 * process. This is only available to Google internal services and
1666 * the service must be whitelisted by chemist-dev@google.com in order
1667 * to use this level.
852 */ 1668 */
853 core.String importance; 1669 core.String importance;
854 /** 1670 /**
855 * Labels describing the operation. Only the following labels are allowed: 1671 * Labels describing the operation. Only the following labels are allowed:
856 * 1672 *
857 * - Labels describing monitored resources as defined in 1673 * - Labels describing monitored resources as defined in
858 * the service configuration. 1674 * the service configuration.
859 * - Default labels of metric values. When specified, labels defined in the 1675 * - Default labels of metric values. When specified, labels defined in the
860 * metric value override these default. 1676 * metric value override these default.
861 * - The following labels defined by Google Cloud Platform: 1677 * - The following labels defined by Google Cloud Platform:
862 * - `cloud.googleapis.com/location` describing the location where the 1678 * - `cloud.googleapis.com/location` describing the location where the
863 * operation happened, 1679 * operation happened,
864 * - `servicecontrol.googleapis.com/user_agent` describing the user agent 1680 * - `servicecontrol.googleapis.com/user_agent` describing the user agent
865 * of the API request, 1681 * of the API request,
866 * - `servicecontrol.googleapis.com/service_agent` describing the service 1682 * - `servicecontrol.googleapis.com/service_agent` describing the service
867 * used to handle the API request (e.g. ESP), 1683 * used to handle the API request (e.g. ESP),
868 * - `servicecontrol.googleapis.com/platform` describing the platform 1684 * - `servicecontrol.googleapis.com/platform` describing the platform
869 * where the API is served (e.g. GAE, GCE, GKE). 1685 * where the API is served (e.g. GAE, GCE, GKE).
870 */ 1686 */
871 core.Map<core.String, core.String> labels; 1687 core.Map<core.String, core.String> labels;
872 /** Represents information to be logged. */ 1688 /** Represents information to be logged. */
873 core.List<LogEntry> logEntries; 1689 core.List<LogEntry> logEntries;
874 /** 1690 /**
875 * Represents information about this operation. Each MetricValueSet 1691 * Represents information about this operation. Each MetricValueSet
876 * corresponds to a metric defined in the service configuration. 1692 * corresponds to a metric defined in the service configuration.
1693 * The data type used in the MetricValueSet must agree with
1694 * the data type specified in the metric definition.
1695 *
1696 * Within a single operation, it is not allowed to have more than one
1697 * MetricValue instances that have the same metric names and identical
1698 * label value combinations. If a request has such duplicated MetricValue
1699 * instances, the entire request is rejected with
1700 * an invalid argument error.
1701 */
1702 core.List<MetricValueSet> metricValueSets;
1703 /**
1704 * Identity of the operation. This must be unique within the scope of the
1705 * service that generated the operation. If the service calls
1706 * Check() and Report() on the same operation, the two calls should carry
1707 * the same id.
1708 *
1709 * UUID version 4 is recommended, though not required.
1710 * In scenarios where an operation is computed from existing information
1711 * and an idempotent id is desirable for deduplication purpose, UUID version 5
1712 * is recommended. See RFC 4122 for details.
1713 */
1714 core.String operationId;
1715 /** Fully qualified name of the operation. Reserved for future use. */
1716 core.String operationName;
1717 /**
1718 * Represents the properties needed for quota check. Applicable only if this
1719 * operation is for a quota check request.
1720 */
1721 QuotaProperties quotaProperties;
1722 /**
1723 * The resource name of the parent of a resource in the resource hierarchy.
1724 *
1725 * This can be in one of the following formats:
1726 * - “projects/<project-id or project-number>”
1727 * - “folders/<folder-id>”
1728 * - “organizations/<organization-id>”
1729 */
1730 core.String resourceContainer;
1731 /** Required. Start time of the operation. */
1732 core.String startTime;
1733 /**
1734 * User defined labels for the resource that this operation is associated
1735 * with.
1736 */
1737 core.Map<core.String, core.String> userLabels;
1738
1739 Operation();
1740
1741 Operation.fromJson(core.Map _json) {
1742 if (_json.containsKey("consumerId")) {
1743 consumerId = _json["consumerId"];
1744 }
1745 if (_json.containsKey("endTime")) {
1746 endTime = _json["endTime"];
1747 }
1748 if (_json.containsKey("importance")) {
1749 importance = _json["importance"];
1750 }
1751 if (_json.containsKey("labels")) {
1752 labels = _json["labels"];
1753 }
1754 if (_json.containsKey("logEntries")) {
1755 logEntries = _json["logEntries"].map((value) => new LogEntry.fromJson(valu e)).toList();
1756 }
1757 if (_json.containsKey("metricValueSets")) {
1758 metricValueSets = _json["metricValueSets"].map((value) => new MetricValueS et.fromJson(value)).toList();
1759 }
1760 if (_json.containsKey("operationId")) {
1761 operationId = _json["operationId"];
1762 }
1763 if (_json.containsKey("operationName")) {
1764 operationName = _json["operationName"];
1765 }
1766 if (_json.containsKey("quotaProperties")) {
1767 quotaProperties = new QuotaProperties.fromJson(_json["quotaProperties"]);
1768 }
1769 if (_json.containsKey("resourceContainer")) {
1770 resourceContainer = _json["resourceContainer"];
1771 }
1772 if (_json.containsKey("startTime")) {
1773 startTime = _json["startTime"];
1774 }
1775 if (_json.containsKey("userLabels")) {
1776 userLabels = _json["userLabels"];
1777 }
1778 }
1779
1780 core.Map toJson() {
1781 var _json = new core.Map();
1782 if (consumerId != null) {
1783 _json["consumerId"] = consumerId;
1784 }
1785 if (endTime != null) {
1786 _json["endTime"] = endTime;
1787 }
1788 if (importance != null) {
1789 _json["importance"] = importance;
1790 }
1791 if (labels != null) {
1792 _json["labels"] = labels;
1793 }
1794 if (logEntries != null) {
1795 _json["logEntries"] = logEntries.map((value) => (value).toJson()).toList() ;
1796 }
1797 if (metricValueSets != null) {
1798 _json["metricValueSets"] = metricValueSets.map((value) => (value).toJson() ).toList();
1799 }
1800 if (operationId != null) {
1801 _json["operationId"] = operationId;
1802 }
1803 if (operationName != null) {
1804 _json["operationName"] = operationName;
1805 }
1806 if (quotaProperties != null) {
1807 _json["quotaProperties"] = (quotaProperties).toJson();
1808 }
1809 if (resourceContainer != null) {
1810 _json["resourceContainer"] = resourceContainer;
1811 }
1812 if (startTime != null) {
1813 _json["startTime"] = startTime;
1814 }
1815 if (userLabels != null) {
1816 _json["userLabels"] = userLabels;
1817 }
1818 return _json;
1819 }
1820 }
1821
1822 class QuotaError {
1823 /**
1824 * Error code.
1825 * Possible string values are:
1826 * - "UNSPECIFIED" : This is never used.
1827 * - "RESOURCE_EXHAUSTED" : Quota allocation failed.
1828 * Same as google.rpc.Code.RESOURCE_EXHAUSTED.
1829 * - "PROJECT_SUSPENDED" : Consumer project has been suspended.
1830 * - "SERVICE_NOT_ENABLED" : Consumer has not enabled the service.
1831 * - "BILLING_NOT_ACTIVE" : Consumer cannot access the service because billing
1832 * is disabled.
1833 * - "PROJECT_DELETED" : Consumer's project has been marked as deleted (soft
1834 * deletion).
1835 * - "PROJECT_INVALID" : Consumer's project number or ID does not represent a
1836 * valid project.
1837 * - "IP_ADDRESS_BLOCKED" : IP address of the consumer is invalid for the
1838 * specific consumer
1839 * project.
1840 * - "REFERER_BLOCKED" : Referer address of the consumer request is invalid
1841 * for the specific
1842 * consumer project.
1843 * - "CLIENT_APP_BLOCKED" : Client application of the consumer request is
1844 * invalid for the
1845 * specific consumer project.
1846 * - "API_KEY_INVALID" : Specified API key is invalid.
1847 * - "API_KEY_EXPIRED" : Specified API Key has expired.
1848 * - "SPATULA_HEADER_INVALID" : Consumer's spatula header is invalid.
1849 * - "LOAS_ROLE_INVALID" : The consumer's LOAS role is invalid.
1850 * - "NO_LOAS_PROJECT" : The consumer's LOAS role has no associated project.
1851 * - "PROJECT_STATUS_UNVAILABLE" : The backend server for looking up project
1852 * id/number is unavailable.
1853 * - "SERVICE_STATUS_UNAVAILABLE" : The backend server for checking service
1854 * status is unavailable.
1855 * - "BILLING_STATUS_UNAVAILABLE" : The backend server for checking billing
1856 * status is unavailable.
1857 * - "QUOTA_SYSTEM_UNAVAILABLE" : The backend server for checking quota limits
1858 * is unavailable.
1859 */
1860 core.String code;
1861 /** Free-form text that provides details on the cause of the error. */
1862 core.String description;
1863 /**
1864 * Subject to whom this error applies. See the specific enum for more details
1865 * on this field. For example, "clientip:<ip address of client>" or
1866 * "project:<Google developer project id>".
1867 */
1868 core.String subject;
1869
1870 QuotaError();
1871
1872 QuotaError.fromJson(core.Map _json) {
1873 if (_json.containsKey("code")) {
1874 code = _json["code"];
1875 }
1876 if (_json.containsKey("description")) {
1877 description = _json["description"];
1878 }
1879 if (_json.containsKey("subject")) {
1880 subject = _json["subject"];
1881 }
1882 }
1883
1884 core.Map toJson() {
1885 var _json = new core.Map();
1886 if (code != null) {
1887 _json["code"] = code;
1888 }
1889 if (description != null) {
1890 _json["description"] = description;
1891 }
1892 if (subject != null) {
1893 _json["subject"] = subject;
1894 }
1895 return _json;
1896 }
1897 }
1898
1899 /** Contains the quota information for a quota check response. */
1900 class QuotaInfo {
1901 /**
1902 * Quota Metrics that have exceeded quota limits.
1903 * For QuotaGroup-based quota, this is QuotaGroup.name
1904 * For QuotaLimit-based quota, this is QuotaLimit.name
1905 * See: google.api.Quota
1906 * Deprecated: Use quota_metrics to get per quota group limit exceeded status.
1907 */
1908 core.List<core.String> limitExceeded;
1909 /**
1910 * Map of quota group name to the actual number of tokens consumed. If the
1911 * quota check was not successful, then this will not be populated due to no
1912 * quota consumption.
1913 * Deprecated: Use quota_metrics to get per quota group usage.
1914 */
1915 core.Map<core.String, core.int> quotaConsumed;
1916 /**
1917 * Quota metrics to indicate the usage. Depending on the check request, one or
1918 * more of the following metrics will be included:
1919 *
1920 * 1. For rate quota, per quota group or per quota metric incremental usage
1921 * will be specified using the following delta metric:
1922 * "serviceruntime.googleapis.com/api/consumer/quota_used_count"
1923 *
1924 * 2. For allocation quota, per quota metric total usage will be specified
1925 * using the following gauge metric:
1926 * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count"
1927 *
1928 * 3. For both rate quota and allocation quota, the quota limit reached
1929 * condition will be specified using the following boolean metric:
1930 * "serviceruntime.googleapis.com/quota/exceeded"
1931 */
1932 core.List<MetricValueSet> quotaMetrics;
1933
1934 QuotaInfo();
1935
1936 QuotaInfo.fromJson(core.Map _json) {
1937 if (_json.containsKey("limitExceeded")) {
1938 limitExceeded = _json["limitExceeded"];
1939 }
1940 if (_json.containsKey("quotaConsumed")) {
1941 quotaConsumed = _json["quotaConsumed"];
1942 }
1943 if (_json.containsKey("quotaMetrics")) {
1944 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
1945 }
1946 }
1947
1948 core.Map toJson() {
1949 var _json = new core.Map();
1950 if (limitExceeded != null) {
1951 _json["limitExceeded"] = limitExceeded;
1952 }
1953 if (quotaConsumed != null) {
1954 _json["quotaConsumed"] = quotaConsumed;
1955 }
1956 if (quotaMetrics != null) {
1957 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
1958 }
1959 return _json;
1960 }
1961 }
1962
1963 /** Represents information regarding a quota operation. */
1964 class QuotaOperation {
1965 /**
1966 * Identity of the consumer for whom this quota operation is being performed.
1967 *
1968 * This can be in one of the following formats:
1969 * project:<project_id>,
1970 * project_number:<project_number>,
1971 * api_key:<api_key>.
1972 */
1973 core.String consumerId;
1974 /** Labels describing the operation. */
1975 core.Map<core.String, core.String> labels;
1976 /**
1977 * Fully qualified name of the API method for which this quota operation is
1978 * requested. This name is used for matching quota rules or metric rules and
1979 * billing status rules defined in service configuration. This field is not
1980 * required if the quota operation is performed on non-API resources.
1981 *
1982 * Example of an RPC method name:
1983 * google.example.library.v1.LibraryService.CreateShelf
1984 */
1985 core.String methodName;
1986 /**
1987 * Identity of the operation. This must be unique within the scope of the
1988 * service that generated the operation. If the service calls AllocateQuota
1989 * and ReleaseQuota on the same operation, the two calls should carry the
1990 * same ID.
1991 *
1992 * UUID version 4 is recommended, though not required. In scenarios where an
1993 * operation is computed from existing information and an idempotent id is
1994 * desirable for deduplication purpose, UUID version 5 is recommended. See
1995 * RFC 4122 for details.
1996 */
1997 core.String operationId;
1998 /**
1999 * Represents information about this operation. Each MetricValueSet
2000 * corresponds to a metric defined in the service configuration.
877 * The data type used in the MetricValueSet must agree with 2001 * The data type used in the MetricValueSet must agree with
878 * the data type specified in the metric definition. 2002 * the data type specified in the metric definition.
879 * 2003 *
880 * Within a single operation, it is not allowed to have more than one 2004 * Within a single operation, it is not allowed to have more than one
881 * MetricValue instances that have the same metric names and identical 2005 * MetricValue instances that have the same metric names and identical
882 * label value combinations. If a request has such duplicated MetricValue 2006 * label value combinations. If a request has such duplicated MetricValue
883 * instances, the entire request is rejected with 2007 * instances, the entire request is rejected with
884 * an invalid argument error. 2008 * an invalid argument error.
885 */ 2009 */
886 core.List<MetricValueSet> metricValueSets; 2010 core.List<MetricValueSet> quotaMetrics;
887 /** 2011 /**
888 * Identity of the operation. This must be unique within the scope of the 2012 * Quota mode for this operation.
889 * service that generated the operation. If the service calls 2013 * Possible string values are:
890 * Check() and Report() on the same operation, the two calls should carry 2014 * - "UNSPECIFIED"
891 * the same id. 2015 * - "NORMAL" : For AllocateQuota request, allocates quota for the amount
892 * 2016 * specified in
893 * UUID version 4 is recommended, though not required. 2017 * the service configuration or specified using the quota metrics. If the
894 * In scenarios where an operation is computed from existing information 2018 * amount is higher than the available quota, allocation error will be
895 * and an idempotent id is desirable for deduplication purpose, UUID version 5 2019 * returned and no quota will be allocated.
896 * is recommended. See RFC 4122 for details. 2020 * For ReleaseQuota request, this mode is supported only for precise quota
2021 * limits. In this case, this operation releases quota for the amount
2022 * specified in the service configuration or specified using the quota
2023 * metrics. If the release can make available quota negative, release error
2024 * will be returned and no quota will be released.
2025 * - "BEST_EFFORT" : For AllocateQuota request, this mode is supported only
2026 * for imprecise
2027 * quota limits. In this case, the operation allocates quota for the amount
2028 * specified in the service configuration or specified using the quota
2029 * metrics. If the amount is higher than the available quota, request does
2030 * not fail but all available quota will be allocated.
2031 * For ReleaseQuota request, this mode is supported for both precise quota
2032 * limits and imprecise quota limits. In this case, this operation releases
2033 * quota for the amount specified in the service configuration or specified
2034 * using the quota metrics. If the release can make available quota
2035 * negative, request does not fail but only the available quota will be
2036 * released. After the ReleaseQuota request completes, the available quota
2037 * will be 0, and never goes to negative.
2038 * - "CHECK_ONLY" : For AllocateQuota request, only checks if there is enough
2039 * quota
2040 * available and does not change the available quota. No lock is placed on
2041 * the available quota either. Not supported for ReleaseQuota request.
897 */ 2042 */
898 core.String operationId; 2043 core.String quotaMode;
899 /** Fully qualified name of the operation. Reserved for future use. */
900 core.String operationName;
901 /** Required. Start time of the operation. */
902 core.String startTime;
903 2044
904 Operation(); 2045 QuotaOperation();
905 2046
906 Operation.fromJson(core.Map _json) { 2047 QuotaOperation.fromJson(core.Map _json) {
907 if (_json.containsKey("consumerId")) { 2048 if (_json.containsKey("consumerId")) {
908 consumerId = _json["consumerId"]; 2049 consumerId = _json["consumerId"];
909 } 2050 }
910 if (_json.containsKey("endTime")) {
911 endTime = _json["endTime"];
912 }
913 if (_json.containsKey("importance")) {
914 importance = _json["importance"];
915 }
916 if (_json.containsKey("labels")) { 2051 if (_json.containsKey("labels")) {
917 labels = _json["labels"]; 2052 labels = _json["labels"];
918 } 2053 }
919 if (_json.containsKey("logEntries")) { 2054 if (_json.containsKey("methodName")) {
920 logEntries = _json["logEntries"].map((value) => new LogEntry.fromJson(valu e)).toList(); 2055 methodName = _json["methodName"];
921 }
922 if (_json.containsKey("metricValueSets")) {
923 metricValueSets = _json["metricValueSets"].map((value) => new MetricValueS et.fromJson(value)).toList();
924 } 2056 }
925 if (_json.containsKey("operationId")) { 2057 if (_json.containsKey("operationId")) {
926 operationId = _json["operationId"]; 2058 operationId = _json["operationId"];
927 } 2059 }
928 if (_json.containsKey("operationName")) { 2060 if (_json.containsKey("quotaMetrics")) {
929 operationName = _json["operationName"]; 2061 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
930 } 2062 }
931 if (_json.containsKey("startTime")) { 2063 if (_json.containsKey("quotaMode")) {
932 startTime = _json["startTime"]; 2064 quotaMode = _json["quotaMode"];
933 } 2065 }
934 } 2066 }
935 2067
936 core.Map toJson() { 2068 core.Map toJson() {
937 var _json = new core.Map(); 2069 var _json = new core.Map();
938 if (consumerId != null) { 2070 if (consumerId != null) {
939 _json["consumerId"] = consumerId; 2071 _json["consumerId"] = consumerId;
940 } 2072 }
941 if (endTime != null) {
942 _json["endTime"] = endTime;
943 }
944 if (importance != null) {
945 _json["importance"] = importance;
946 }
947 if (labels != null) { 2073 if (labels != null) {
948 _json["labels"] = labels; 2074 _json["labels"] = labels;
949 } 2075 }
950 if (logEntries != null) { 2076 if (methodName != null) {
951 _json["logEntries"] = logEntries.map((value) => (value).toJson()).toList() ; 2077 _json["methodName"] = methodName;
952 }
953 if (metricValueSets != null) {
954 _json["metricValueSets"] = metricValueSets.map((value) => (value).toJson() ).toList();
955 } 2078 }
956 if (operationId != null) { 2079 if (operationId != null) {
957 _json["operationId"] = operationId; 2080 _json["operationId"] = operationId;
958 } 2081 }
959 if (operationName != null) { 2082 if (quotaMetrics != null) {
960 _json["operationName"] = operationName; 2083 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
961 } 2084 }
962 if (startTime != null) { 2085 if (quotaMode != null) {
963 _json["startTime"] = startTime; 2086 _json["quotaMode"] = quotaMode;
964 } 2087 }
965 return _json; 2088 return _json;
966 } 2089 }
2090 }
2091
2092 /**
2093 * Represents the properties needed for quota operations.
2094 *
2095 * Use the metric_value_sets field in Operation message to provide cost
2096 * override with metric_name in <service_name>/quota/<quota_group_name>/cost
2097 * format. Overrides for unmatched quota groups will be ignored.
2098 * Costs are expected to be >= 0. Cost 0 will cause no quota check,
2099 * but still traffic restrictions will be enforced.
2100 */
2101 class QuotaProperties {
2102 /**
2103 * LimitType IDs that should be used for checking quota. Key in this map
2104 * should be a valid LimitType string, and the value is the ID to be used. For
2105 * example, an entry <USER, 123> will cause all user quota limits to use 123
2106 * as the user ID. See google/api/quota.proto for the definition of LimitType.
2107 * CLIENT_PROJECT: Not supported.
2108 * USER: Value of this entry will be used for enforcing user-level quota
2109 * limits. If none specified, caller IP passed in the
2110 * servicecontrol.googleapis.com/caller_ip label will be used instead.
2111 * If the server cannot resolve a value for this LimitType, an error
2112 * will be thrown. No validation will be performed on this ID.
2113 * Deprecated: use servicecontrol.googleapis.com/user label to send user ID.
2114 */
2115 core.Map<core.String, core.String> limitByIds;
2116 /**
2117 * Quota mode for this operation.
2118 * Possible string values are:
2119 * - "ACQUIRE" : Decreases available quota by the cost specified for the
2120 * operation.
2121 * If cost is higher than available quota, operation fails and returns
2122 * error.
2123 * - "ACQUIRE_BEST_EFFORT" : Decreases available quota by the cost specified
2124 * for the operation.
2125 * If cost is higher than available quota, operation does not fail and
2126 * available quota goes down to zero but it returns error.
2127 * - "CHECK" : Does not change any available quota. Only checks if there is
2128 * enough
2129 * quota.
2130 * No lock is placed on the checked tokens neither.
2131 * - "RELEASE" : Increases available quota by the operation cost specified for
2132 * the
2133 * operation.
2134 */
2135 core.String quotaMode;
2136
2137 QuotaProperties();
2138
2139 QuotaProperties.fromJson(core.Map _json) {
2140 if (_json.containsKey("limitByIds")) {
2141 limitByIds = _json["limitByIds"];
2142 }
2143 if (_json.containsKey("quotaMode")) {
2144 quotaMode = _json["quotaMode"];
2145 }
2146 }
2147
2148 core.Map toJson() {
2149 var _json = new core.Map();
2150 if (limitByIds != null) {
2151 _json["limitByIds"] = limitByIds;
2152 }
2153 if (quotaMode != null) {
2154 _json["quotaMode"] = quotaMode;
2155 }
2156 return _json;
2157 }
2158 }
2159
2160 /** Request message for the ReleaseQuota method. */
2161 class ReleaseQuotaRequest {
2162 /** Operation that describes the quota release. */
2163 QuotaOperation releaseOperation;
2164 /**
2165 * Specifies which version of service configuration should be used to process
2166 * the request. If unspecified or no matching version can be found, the latest
2167 * one will be used.
2168 */
2169 core.String serviceConfigId;
2170
2171 ReleaseQuotaRequest();
2172
2173 ReleaseQuotaRequest.fromJson(core.Map _json) {
2174 if (_json.containsKey("releaseOperation")) {
2175 releaseOperation = new QuotaOperation.fromJson(_json["releaseOperation"]);
2176 }
2177 if (_json.containsKey("serviceConfigId")) {
2178 serviceConfigId = _json["serviceConfigId"];
2179 }
2180 }
2181
2182 core.Map toJson() {
2183 var _json = new core.Map();
2184 if (releaseOperation != null) {
2185 _json["releaseOperation"] = (releaseOperation).toJson();
2186 }
2187 if (serviceConfigId != null) {
2188 _json["serviceConfigId"] = serviceConfigId;
2189 }
2190 return _json;
2191 }
2192 }
2193
2194 /** Response message for the ReleaseQuota method. */
2195 class ReleaseQuotaResponse {
2196 /**
2197 * The same operation_id value used in the ReleaseQuotaRequest. Used for
2198 * logging and diagnostics purposes.
2199 */
2200 core.String operationId;
2201 /**
2202 * Quota metrics to indicate the result of release. Depending on the
2203 * request, one or more of the following metrics will be included:
2204 *
2205 * 1. For rate quota, per quota group or per quota metric released amount
2206 * will be specified using the following delta metric:
2207 * "serviceruntime.googleapis.com/api/consumer/quota_refund_count"
2208 *
2209 * 2. For allocation quota, per quota metric total usage will be specified
2210 * using the following gauge metric:
2211 * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count"
2212 */
2213 core.List<MetricValueSet> quotaMetrics;
2214 /** Indicates the decision of the release. */
2215 core.List<QuotaError> releaseErrors;
2216 /** ID of the actual config used to process the request. */
2217 core.String serviceConfigId;
2218
2219 ReleaseQuotaResponse();
2220
2221 ReleaseQuotaResponse.fromJson(core.Map _json) {
2222 if (_json.containsKey("operationId")) {
2223 operationId = _json["operationId"];
2224 }
2225 if (_json.containsKey("quotaMetrics")) {
2226 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
2227 }
2228 if (_json.containsKey("releaseErrors")) {
2229 releaseErrors = _json["releaseErrors"].map((value) => new QuotaError.fromJ son(value)).toList();
2230 }
2231 if (_json.containsKey("serviceConfigId")) {
2232 serviceConfigId = _json["serviceConfigId"];
2233 }
2234 }
2235
2236 core.Map toJson() {
2237 var _json = new core.Map();
2238 if (operationId != null) {
2239 _json["operationId"] = operationId;
2240 }
2241 if (quotaMetrics != null) {
2242 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
2243 }
2244 if (releaseErrors != null) {
2245 _json["releaseErrors"] = releaseErrors.map((value) => (value).toJson()).to List();
2246 }
2247 if (serviceConfigId != null) {
2248 _json["serviceConfigId"] = serviceConfigId;
2249 }
2250 return _json;
2251 }
967 } 2252 }
968 2253
969 /** Represents the processing error of one `Operation` in the request. */ 2254 /** Represents the processing error of one `Operation` in the request. */
970 class ReportError { 2255 class ReportError {
971 /** The Operation.operation_id value from the request. */ 2256 /** The Operation.operation_id value from the request. */
972 core.String operationId; 2257 core.String operationId;
973 /** Details of the error when processing the `Operation`. */ 2258 /** Details of the error when processing the `Operation`. */
974 Status status; 2259 Status status;
975 2260
976 ReportError(); 2261 ReportError();
(...skipping 12 matching lines...) Expand all
989 if (operationId != null) { 2274 if (operationId != null) {
990 _json["operationId"] = operationId; 2275 _json["operationId"] = operationId;
991 } 2276 }
992 if (status != null) { 2277 if (status != null) {
993 _json["status"] = (status).toJson(); 2278 _json["status"] = (status).toJson();
994 } 2279 }
995 return _json; 2280 return _json;
996 } 2281 }
997 } 2282 }
998 2283
2284 class ReportInfo {
2285 /** The Operation.operation_id value from the request. */
2286 core.String operationId;
2287 /** Quota usage info when processing the `Operation`. */
2288 QuotaInfo quotaInfo;
2289
2290 ReportInfo();
2291
2292 ReportInfo.fromJson(core.Map _json) {
2293 if (_json.containsKey("operationId")) {
2294 operationId = _json["operationId"];
2295 }
2296 if (_json.containsKey("quotaInfo")) {
2297 quotaInfo = new QuotaInfo.fromJson(_json["quotaInfo"]);
2298 }
2299 }
2300
2301 core.Map toJson() {
2302 var _json = new core.Map();
2303 if (operationId != null) {
2304 _json["operationId"] = operationId;
2305 }
2306 if (quotaInfo != null) {
2307 _json["quotaInfo"] = (quotaInfo).toJson();
2308 }
2309 return _json;
2310 }
2311 }
2312
999 /** Request message for the Report method. */ 2313 /** Request message for the Report method. */
1000 class ReportRequest { 2314 class ReportRequest {
1001 /** 2315 /**
1002 * Operations to be reported. 2316 * Operations to be reported.
1003 * 2317 *
1004 * Typically the service should report one operation per request. 2318 * Typically the service should report one operation per request.
1005 * Putting multiple operations into a single request is allowed, but should 2319 * Putting multiple operations into a single request is allowed, but should
1006 * be used only when multiple operations are natually available at the time 2320 * be used only when multiple operations are natually available at the time
1007 * of the report. 2321 * of the report.
1008 * 2322 *
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 * 2. The combination of a successful RPC status and a non-empty 2369 * 2. The combination of a successful RPC status and a non-empty
1056 * `report_errors` list indicates a partial success where some 2370 * `report_errors` list indicates a partial success where some
1057 * `Operations` in the request succeeded. Each 2371 * `Operations` in the request succeeded. Each
1058 * `Operation` that failed processing has a corresponding item 2372 * `Operation` that failed processing has a corresponding item
1059 * in this list. 2373 * in this list.
1060 * 3. A failed RPC status indicates a general non-deterministic failure. 2374 * 3. A failed RPC status indicates a general non-deterministic failure.
1061 * When this happens, it's impossible to know which of the 2375 * When this happens, it's impossible to know which of the
1062 * 'Operations' in the request succeeded or failed. 2376 * 'Operations' in the request succeeded or failed.
1063 */ 2377 */
1064 core.List<ReportError> reportErrors; 2378 core.List<ReportError> reportErrors;
2379 /**
2380 * Quota usage for each quota release `Operation` request.
2381 *
2382 * Fully or partially failed quota release request may or may not be present
2383 * in `report_quota_info`. For example, a failed quota release request will
2384 * have the current quota usage info when precise quota library returns the
2385 * info. A deadline exceeded quota request will not have quota usage info.
2386 *
2387 * If there is no quota release request, report_quota_info will be empty.
2388 */
2389 core.List<ReportInfo> reportInfos;
1065 /** The actual config id used to process the request. */ 2390 /** The actual config id used to process the request. */
1066 core.String serviceConfigId; 2391 core.String serviceConfigId;
1067 2392
1068 ReportResponse(); 2393 ReportResponse();
1069 2394
1070 ReportResponse.fromJson(core.Map _json) { 2395 ReportResponse.fromJson(core.Map _json) {
1071 if (_json.containsKey("reportErrors")) { 2396 if (_json.containsKey("reportErrors")) {
1072 reportErrors = _json["reportErrors"].map((value) => new ReportError.fromJs on(value)).toList(); 2397 reportErrors = _json["reportErrors"].map((value) => new ReportError.fromJs on(value)).toList();
1073 } 2398 }
2399 if (_json.containsKey("reportInfos")) {
2400 reportInfos = _json["reportInfos"].map((value) => new ReportInfo.fromJson( value)).toList();
2401 }
1074 if (_json.containsKey("serviceConfigId")) { 2402 if (_json.containsKey("serviceConfigId")) {
1075 serviceConfigId = _json["serviceConfigId"]; 2403 serviceConfigId = _json["serviceConfigId"];
1076 } 2404 }
1077 } 2405 }
1078 2406
1079 core.Map toJson() { 2407 core.Map toJson() {
1080 var _json = new core.Map(); 2408 var _json = new core.Map();
1081 if (reportErrors != null) { 2409 if (reportErrors != null) {
1082 _json["reportErrors"] = reportErrors.map((value) => (value).toJson()).toLi st(); 2410 _json["reportErrors"] = reportErrors.map((value) => (value).toJson()).toLi st();
1083 } 2411 }
2412 if (reportInfos != null) {
2413 _json["reportInfos"] = reportInfos.map((value) => (value).toJson()).toList ();
2414 }
1084 if (serviceConfigId != null) { 2415 if (serviceConfigId != null) {
1085 _json["serviceConfigId"] = serviceConfigId; 2416 _json["serviceConfigId"] = serviceConfigId;
1086 } 2417 }
2418 return _json;
2419 }
2420 }
2421
2422 /** Metadata about the request. */
2423 class RequestMetadata {
2424 /** The IP address of the caller. */
2425 core.String callerIp;
2426 /**
2427 * The user agent of the caller.
2428 * This information is not authenticated and should be treated accordingly.
2429 * For example:
2430 *
2431 * + `google-api-python-client/1.4.0`:
2432 * The request was made by the Google API client for Python.
2433 * + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:
2434 * The request was made by the Google Cloud SDK CLI (gcloud).
2435 * + `AppEngine-Google; (+http://code.google.com/appengine; appid:
2436 * s~my-project`:
2437 * The request was made from the `my-project` App Engine app.
2438 */
2439 core.String callerSuppliedUserAgent;
2440
2441 RequestMetadata();
2442
2443 RequestMetadata.fromJson(core.Map _json) {
2444 if (_json.containsKey("callerIp")) {
2445 callerIp = _json["callerIp"];
2446 }
2447 if (_json.containsKey("callerSuppliedUserAgent")) {
2448 callerSuppliedUserAgent = _json["callerSuppliedUserAgent"];
2449 }
2450 }
2451
2452 core.Map toJson() {
2453 var _json = new core.Map();
2454 if (callerIp != null) {
2455 _json["callerIp"] = callerIp;
2456 }
2457 if (callerSuppliedUserAgent != null) {
2458 _json["callerSuppliedUserAgent"] = callerSuppliedUserAgent;
2459 }
2460 return _json;
2461 }
2462 }
2463
2464 class StartReconciliationRequest {
2465 /** Operation that describes the quota reconciliation. */
2466 QuotaOperation reconciliationOperation;
2467 /**
2468 * Specifies which version of service configuration should be used to process
2469 * the request. If unspecified or no matching version can be found, the latest
2470 * one will be used.
2471 */
2472 core.String serviceConfigId;
2473
2474 StartReconciliationRequest();
2475
2476 StartReconciliationRequest.fromJson(core.Map _json) {
2477 if (_json.containsKey("reconciliationOperation")) {
2478 reconciliationOperation = new QuotaOperation.fromJson(_json["reconciliatio nOperation"]);
2479 }
2480 if (_json.containsKey("serviceConfigId")) {
2481 serviceConfigId = _json["serviceConfigId"];
2482 }
2483 }
2484
2485 core.Map toJson() {
2486 var _json = new core.Map();
2487 if (reconciliationOperation != null) {
2488 _json["reconciliationOperation"] = (reconciliationOperation).toJson();
2489 }
2490 if (serviceConfigId != null) {
2491 _json["serviceConfigId"] = serviceConfigId;
2492 }
2493 return _json;
2494 }
2495 }
2496
2497 class StartReconciliationResponse {
2498 /**
2499 * The same operation_id value used in the StartReconciliationRequest. Used
2500 * for logging and diagnostics purposes.
2501 */
2502 core.String operationId;
2503 /**
2504 * Metric values as tracked by One Platform before the start of
2505 * reconciliation.
2506 */
2507 core.List<MetricValueSet> quotaMetrics;
2508 /** Indicates the decision of the reconciliation start. */
2509 core.List<QuotaError> reconciliationErrors;
2510 /** ID of the actual config used to process the request. */
2511 core.String serviceConfigId;
2512
2513 StartReconciliationResponse();
2514
2515 StartReconciliationResponse.fromJson(core.Map _json) {
2516 if (_json.containsKey("operationId")) {
2517 operationId = _json["operationId"];
2518 }
2519 if (_json.containsKey("quotaMetrics")) {
2520 quotaMetrics = _json["quotaMetrics"].map((value) => new MetricValueSet.fro mJson(value)).toList();
2521 }
2522 if (_json.containsKey("reconciliationErrors")) {
2523 reconciliationErrors = _json["reconciliationErrors"].map((value) => new Qu otaError.fromJson(value)).toList();
2524 }
2525 if (_json.containsKey("serviceConfigId")) {
2526 serviceConfigId = _json["serviceConfigId"];
2527 }
2528 }
2529
2530 core.Map toJson() {
2531 var _json = new core.Map();
2532 if (operationId != null) {
2533 _json["operationId"] = operationId;
2534 }
2535 if (quotaMetrics != null) {
2536 _json["quotaMetrics"] = quotaMetrics.map((value) => (value).toJson()).toLi st();
2537 }
2538 if (reconciliationErrors != null) {
2539 _json["reconciliationErrors"] = reconciliationErrors.map((value) => (value ).toJson()).toList();
2540 }
2541 if (serviceConfigId != null) {
2542 _json["serviceConfigId"] = serviceConfigId;
2543 }
1087 return _json; 2544 return _json;
1088 } 2545 }
1089 } 2546 }
1090 2547
1091 /** 2548 /**
1092 * The `Status` type defines a logical error model that is suitable for 2549 * The `Status` type defines a logical error model that is suitable for
1093 * different 2550 * different
1094 * programming environments, including REST APIs and RPC APIs. It is used by 2551 * programming environments, including REST APIs and RPC APIs. It is used by
1095 * [gRPC](https://github.com/grpc). The error model is designed to be: 2552 * [gRPC](https://github.com/grpc). The error model is designed to be:
1096 * 2553 *
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 } 2640 }
1184 if (details != null) { 2641 if (details != null) {
1185 _json["details"] = details; 2642 _json["details"] = details;
1186 } 2643 }
1187 if (message != null) { 2644 if (message != null) {
1188 _json["message"] = message; 2645 _json["message"] = message;
1189 } 2646 }
1190 return _json; 2647 return _json;
1191 } 2648 }
1192 } 2649 }
OLDNEW
« no previous file with comments | « generated/googleapis/lib/searchconsole/v1.dart ('k') | generated/googleapis/lib/servicemanagement/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698