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

Side by Side Diff: generated/googleapis_beta/lib/cloudkms/v1beta1.dart

Issue 2649893002: Api-roll 44: 2017-01-23 (Closed)
Patch Set: Created 3 years, 11 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
(Empty)
1 // This is a generated file (see the discoveryapis_generator project).
2
3 library googleapis_beta.cloudkms.v1beta1;
4
5 import 'dart:core' as core;
6 import 'dart:async' as async;
7 import 'dart:convert' as convert;
8
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
10 import 'package:http/http.dart' as http;
11
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
13 ApiRequestError, DetailedApiRequestError;
14
15 const core.String USER_AGENT = 'dart-api-client cloudkms/v1beta1';
16
17 class CloudkmsApi {
18 /** View and manage your data across Google Cloud Platform services */
19 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf orm";
20
21
22 final commons.ApiRequester _requester;
23
24 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester);
25
26 CloudkmsApi(http.Client client, {core.String rootUrl: "https://cloudkms.google apis.com/", core.String servicePath: ""}) :
27 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
28 }
29
30
31 class ProjectsResourceApi {
32 final commons.ApiRequester _requester;
33
34 ProjectsLocationsResourceApi get locations => new ProjectsLocationsResourceApi (_requester);
35
36 ProjectsResourceApi(commons.ApiRequester client) :
37 _requester = client;
38 }
39
40
41 class ProjectsLocationsResourceApi {
42 final commons.ApiRequester _requester;
43
44 ProjectsLocationsKeyRingsResourceApi get keyRings => new ProjectsLocationsKeyR ingsResourceApi(_requester);
45
46 ProjectsLocationsResourceApi(commons.ApiRequester client) :
47 _requester = client;
48
49 /**
50 * Get information about a location.
51 *
52 * Request parameters:
53 *
54 * [name] - Resource name for the location.
55 * Value must have pattern "^projects/[^/]+/locations/[^/]+$".
56 *
57 * Completes with a [Location].
58 *
59 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
60 * error.
61 *
62 * If the used [http.Client] completes with an error when making a REST call,
63 * this method will complete with the same error.
64 */
65 async.Future<Location> get(core.String name) {
66 var _url = null;
67 var _queryParams = new core.Map();
68 var _uploadMedia = null;
69 var _uploadOptions = null;
70 var _downloadOptions = commons.DownloadOptions.Metadata;
71 var _body = null;
72
73 if (name == null) {
74 throw new core.ArgumentError("Parameter name is required.");
75 }
76
77 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
78
79 var _response = _requester.request(_url,
80 "GET",
81 body: _body,
82 queryParams: _queryParams,
83 uploadOptions: _uploadOptions,
84 uploadMedia: _uploadMedia,
85 downloadOptions: _downloadOptions);
86 return _response.then((data) => new Location.fromJson(data));
87 }
88
89 /**
90 * Lists information about the supported locations for this service.
91 *
92 * Request parameters:
93 *
94 * [name] - The resource that owns the locations collection, if applicable.
95 * Value must have pattern "^projects/[^/]+$".
96 *
97 * [pageSize] - The standard list page size.
98 *
99 * [filter] - The standard list filter.
100 *
101 * [pageToken] - The standard list page token.
102 *
103 * Completes with a [ListLocationsResponse].
104 *
105 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
106 * error.
107 *
108 * If the used [http.Client] completes with an error when making a REST call,
109 * this method will complete with the same error.
110 */
111 async.Future<ListLocationsResponse> list(core.String name, {core.int pageSize, core.String filter, core.String pageToken}) {
112 var _url = null;
113 var _queryParams = new core.Map();
114 var _uploadMedia = null;
115 var _uploadOptions = null;
116 var _downloadOptions = commons.DownloadOptions.Metadata;
117 var _body = null;
118
119 if (name == null) {
120 throw new core.ArgumentError("Parameter name is required.");
121 }
122 if (pageSize != null) {
123 _queryParams["pageSize"] = ["${pageSize}"];
124 }
125 if (filter != null) {
126 _queryParams["filter"] = [filter];
127 }
128 if (pageToken != null) {
129 _queryParams["pageToken"] = [pageToken];
130 }
131
132 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + '/locat ions';
133
134 var _response = _requester.request(_url,
135 "GET",
136 body: _body,
137 queryParams: _queryParams,
138 uploadOptions: _uploadOptions,
139 uploadMedia: _uploadMedia,
140 downloadOptions: _downloadOptions);
141 return _response.then((data) => new ListLocationsResponse.fromJson(data));
142 }
143
144 }
145
146
147 class ProjectsLocationsKeyRingsResourceApi {
148 final commons.ApiRequester _requester;
149
150 ProjectsLocationsKeyRingsCryptoKeysResourceApi get cryptoKeys => new ProjectsL ocationsKeyRingsCryptoKeysResourceApi(_requester);
151
152 ProjectsLocationsKeyRingsResourceApi(commons.ApiRequester client) :
153 _requester = client;
154
155 /**
156 * Create a new KeyRing in a given Project and Location.
157 *
158 * [request] - The metadata request object.
159 *
160 * Request parameters:
161 *
162 * [parent] - Required. The resource name of the location associated with the
163 * KeyRings, in the format `projects / * /locations / * `.
164 * Value must have pattern "^projects/[^/]+/locations/[^/]+$".
165 *
166 * [keyRingId] - Required. It must be unique within a location and match the
167 * regular
168 * expression `[a-zA-Z0-9_-]{1,63}`
169 *
170 * Completes with a [KeyRing].
171 *
172 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
173 * error.
174 *
175 * If the used [http.Client] completes with an error when making a REST call,
176 * this method will complete with the same error.
177 */
178 async.Future<KeyRing> create(KeyRing request, core.String parent, {core.String keyRingId}) {
179 var _url = null;
180 var _queryParams = new core.Map();
181 var _uploadMedia = null;
182 var _uploadOptions = null;
183 var _downloadOptions = commons.DownloadOptions.Metadata;
184 var _body = null;
185
186 if (request != null) {
187 _body = convert.JSON.encode((request).toJson());
188 }
189 if (parent == null) {
190 throw new core.ArgumentError("Parameter parent is required.");
191 }
192 if (keyRingId != null) {
193 _queryParams["keyRingId"] = [keyRingId];
194 }
195
196 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/key Rings';
197
198 var _response = _requester.request(_url,
199 "POST",
200 body: _body,
201 queryParams: _queryParams,
202 uploadOptions: _uploadOptions,
203 uploadMedia: _uploadMedia,
204 downloadOptions: _downloadOptions);
205 return _response.then((data) => new KeyRing.fromJson(data));
206 }
207
208 /**
209 * Returns metadata for a given KeyRing.
210 *
211 * Request parameters:
212 *
213 * [name] - The name of the KeyRing to get.
214 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
215 *
216 * Completes with a [KeyRing].
217 *
218 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
219 * error.
220 *
221 * If the used [http.Client] completes with an error when making a REST call,
222 * this method will complete with the same error.
223 */
224 async.Future<KeyRing> get(core.String name) {
225 var _url = null;
226 var _queryParams = new core.Map();
227 var _uploadMedia = null;
228 var _uploadOptions = null;
229 var _downloadOptions = commons.DownloadOptions.Metadata;
230 var _body = null;
231
232 if (name == null) {
233 throw new core.ArgumentError("Parameter name is required.");
234 }
235
236 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
237
238 var _response = _requester.request(_url,
239 "GET",
240 body: _body,
241 queryParams: _queryParams,
242 uploadOptions: _uploadOptions,
243 uploadMedia: _uploadMedia,
244 downloadOptions: _downloadOptions);
245 return _response.then((data) => new KeyRing.fromJson(data));
246 }
247
248 /**
249 * Gets the access control policy for a resource.
250 * Returns an empty policy if the resource exists and does not have a policy
251 * set.
252 *
253 * Request parameters:
254 *
255 * [resource] - REQUIRED: The resource for which the policy is being
256 * requested.
257 * `resource` is usually specified as a path. For example, a Project
258 * resource is specified as `projects/{project}`.
259 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
260 *
261 * Completes with a [Policy].
262 *
263 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
264 * error.
265 *
266 * If the used [http.Client] completes with an error when making a REST call,
267 * this method will complete with the same error.
268 */
269 async.Future<Policy> getIamPolicy(core.String resource) {
270 var _url = null;
271 var _queryParams = new core.Map();
272 var _uploadMedia = null;
273 var _uploadOptions = null;
274 var _downloadOptions = commons.DownloadOptions.Metadata;
275 var _body = null;
276
277 if (resource == null) {
278 throw new core.ArgumentError("Parameter resource is required.");
279 }
280
281 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g etIamPolicy';
282
283 var _response = _requester.request(_url,
284 "GET",
285 body: _body,
286 queryParams: _queryParams,
287 uploadOptions: _uploadOptions,
288 uploadMedia: _uploadMedia,
289 downloadOptions: _downloadOptions);
290 return _response.then((data) => new Policy.fromJson(data));
291 }
292
293 /**
294 * Lists KeyRings.
295 *
296 * Request parameters:
297 *
298 * [parent] - Required. The resource name of the location associated with the
299 * KeyRings, in the format `projects / * /locations / * `.
300 * Value must have pattern "^projects/[^/]+/locations/[^/]+$".
301 *
302 * [pageToken] - Optional pagination token, returned earlier via
303 * ListKeyRingsResponse.next_page_token.
304 *
305 * [pageSize] - Optional limit on the number of KeyRings to include in the
306 * response. Further KeyRings can subsequently be obtained by
307 * including the ListKeyRingsResponse.next_page_token in a subsequent
308 * request. If unspecified, the server will pick an appropriate default.
309 *
310 * Completes with a [ListKeyRingsResponse].
311 *
312 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
313 * error.
314 *
315 * If the used [http.Client] completes with an error when making a REST call,
316 * this method will complete with the same error.
317 */
318 async.Future<ListKeyRingsResponse> list(core.String parent, {core.String pageT oken, core.int pageSize}) {
319 var _url = null;
320 var _queryParams = new core.Map();
321 var _uploadMedia = null;
322 var _uploadOptions = null;
323 var _downloadOptions = commons.DownloadOptions.Metadata;
324 var _body = null;
325
326 if (parent == null) {
327 throw new core.ArgumentError("Parameter parent is required.");
328 }
329 if (pageToken != null) {
330 _queryParams["pageToken"] = [pageToken];
331 }
332 if (pageSize != null) {
333 _queryParams["pageSize"] = ["${pageSize}"];
334 }
335
336 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/key Rings';
337
338 var _response = _requester.request(_url,
339 "GET",
340 body: _body,
341 queryParams: _queryParams,
342 uploadOptions: _uploadOptions,
343 uploadMedia: _uploadMedia,
344 downloadOptions: _downloadOptions);
345 return _response.then((data) => new ListKeyRingsResponse.fromJson(data));
346 }
347
348 /**
349 * Sets the access control policy on the specified resource. Replaces any
350 * existing policy.
351 *
352 * [request] - The metadata request object.
353 *
354 * Request parameters:
355 *
356 * [resource] - REQUIRED: The resource for which the policy is being
357 * specified.
358 * `resource` is usually specified as a path. For example, a Project
359 * resource is specified as `projects/{project}`.
360 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
361 *
362 * Completes with a [Policy].
363 *
364 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
365 * error.
366 *
367 * If the used [http.Client] completes with an error when making a REST call,
368 * this method will complete with the same error.
369 */
370 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res ource) {
371 var _url = null;
372 var _queryParams = new core.Map();
373 var _uploadMedia = null;
374 var _uploadOptions = null;
375 var _downloadOptions = commons.DownloadOptions.Metadata;
376 var _body = null;
377
378 if (request != null) {
379 _body = convert.JSON.encode((request).toJson());
380 }
381 if (resource == null) {
382 throw new core.ArgumentError("Parameter resource is required.");
383 }
384
385 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s etIamPolicy';
386
387 var _response = _requester.request(_url,
388 "POST",
389 body: _body,
390 queryParams: _queryParams,
391 uploadOptions: _uploadOptions,
392 uploadMedia: _uploadMedia,
393 downloadOptions: _downloadOptions);
394 return _response.then((data) => new Policy.fromJson(data));
395 }
396
397 /**
398 * Returns permissions that a caller has on the specified resource.
399 * If the resource does not exist, this will return an empty set of
400 * permissions, not a NOT_FOUND error.
401 *
402 * [request] - The metadata request object.
403 *
404 * Request parameters:
405 *
406 * [resource] - REQUIRED: The resource for which the policy detail is being
407 * requested.
408 * `resource` is usually specified as a path. For example, a Project
409 * resource is specified as `projects/{project}`.
410 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
411 *
412 * Completes with a [TestIamPermissionsResponse].
413 *
414 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
415 * error.
416 *
417 * If the used [http.Client] completes with an error when making a REST call,
418 * this method will complete with the same error.
419 */
420 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions Request request, core.String resource) {
421 var _url = null;
422 var _queryParams = new core.Map();
423 var _uploadMedia = null;
424 var _uploadOptions = null;
425 var _downloadOptions = commons.DownloadOptions.Metadata;
426 var _body = null;
427
428 if (request != null) {
429 _body = convert.JSON.encode((request).toJson());
430 }
431 if (resource == null) {
432 throw new core.ArgumentError("Parameter resource is required.");
433 }
434
435 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':t estIamPermissions';
436
437 var _response = _requester.request(_url,
438 "POST",
439 body: _body,
440 queryParams: _queryParams,
441 uploadOptions: _uploadOptions,
442 uploadMedia: _uploadMedia,
443 downloadOptions: _downloadOptions);
444 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data ));
445 }
446
447 }
448
449
450 class ProjectsLocationsKeyRingsCryptoKeysResourceApi {
451 final commons.ApiRequester _requester;
452
453 ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsResourceApi get cryptoKeyV ersions => new ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsResourceApi(_ requester);
454
455 ProjectsLocationsKeyRingsCryptoKeysResourceApi(commons.ApiRequester client) :
456 _requester = client;
457
458 /**
459 * Create a new CryptoKey within a KeyRing.
460 *
461 * CryptoKey.purpose is required.
462 *
463 * [request] - The metadata request object.
464 *
465 * Request parameters:
466 *
467 * [parent] - Required. The name of the KeyRing associated with the
468 * CryptoKeys.
469 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
470 *
471 * [cryptoKeyId] - Required. It must be unique within a KeyRing and match the
472 * regular
473 * expression `[a-zA-Z0-9_-]{1,63}`
474 *
475 * Completes with a [CryptoKey].
476 *
477 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
478 * error.
479 *
480 * If the used [http.Client] completes with an error when making a REST call,
481 * this method will complete with the same error.
482 */
483 async.Future<CryptoKey> create(CryptoKey request, core.String parent, {core.St ring cryptoKeyId}) {
484 var _url = null;
485 var _queryParams = new core.Map();
486 var _uploadMedia = null;
487 var _uploadOptions = null;
488 var _downloadOptions = commons.DownloadOptions.Metadata;
489 var _body = null;
490
491 if (request != null) {
492 _body = convert.JSON.encode((request).toJson());
493 }
494 if (parent == null) {
495 throw new core.ArgumentError("Parameter parent is required.");
496 }
497 if (cryptoKeyId != null) {
498 _queryParams["cryptoKeyId"] = [cryptoKeyId];
499 }
500
501 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/cry ptoKeys';
502
503 var _response = _requester.request(_url,
504 "POST",
505 body: _body,
506 queryParams: _queryParams,
507 uploadOptions: _uploadOptions,
508 uploadMedia: _uploadMedia,
509 downloadOptions: _downloadOptions);
510 return _response.then((data) => new CryptoKey.fromJson(data));
511 }
512
513 /**
514 * Decrypt data that was protected by Encrypt.
515 *
516 * [request] - The metadata request object.
517 *
518 * Request parameters:
519 *
520 * [name] - Required. The resource name of the CryptoKey to use for
521 * decryption.
522 * The server will choose the appropriate version.
523 * Value must have pattern
524 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
525 *
526 * Completes with a [DecryptResponse].
527 *
528 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
529 * error.
530 *
531 * If the used [http.Client] completes with an error when making a REST call,
532 * this method will complete with the same error.
533 */
534 async.Future<DecryptResponse> decrypt(DecryptRequest request, core.String name ) {
535 var _url = null;
536 var _queryParams = new core.Map();
537 var _uploadMedia = null;
538 var _uploadOptions = null;
539 var _downloadOptions = commons.DownloadOptions.Metadata;
540 var _body = null;
541
542 if (request != null) {
543 _body = convert.JSON.encode((request).toJson());
544 }
545 if (name == null) {
546 throw new core.ArgumentError("Parameter name is required.");
547 }
548
549 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':decry pt';
550
551 var _response = _requester.request(_url,
552 "POST",
553 body: _body,
554 queryParams: _queryParams,
555 uploadOptions: _uploadOptions,
556 uploadMedia: _uploadMedia,
557 downloadOptions: _downloadOptions);
558 return _response.then((data) => new DecryptResponse.fromJson(data));
559 }
560
561 /**
562 * Encrypt data, so that it can only be recovered by a call to Decrypt.
563 *
564 * [request] - The metadata request object.
565 *
566 * Request parameters:
567 *
568 * [name] - Required. The resource name of the CryptoKey or CryptoKeyVersion
569 * to use for encryption.
570 *
571 * If a CryptoKey is specified, the server will use its
572 * primary version.
573 * Value must have pattern
574 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/.+$".
575 *
576 * Completes with a [EncryptResponse].
577 *
578 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
579 * error.
580 *
581 * If the used [http.Client] completes with an error when making a REST call,
582 * this method will complete with the same error.
583 */
584 async.Future<EncryptResponse> encrypt(EncryptRequest request, core.String name ) {
585 var _url = null;
586 var _queryParams = new core.Map();
587 var _uploadMedia = null;
588 var _uploadOptions = null;
589 var _downloadOptions = commons.DownloadOptions.Metadata;
590 var _body = null;
591
592 if (request != null) {
593 _body = convert.JSON.encode((request).toJson());
594 }
595 if (name == null) {
596 throw new core.ArgumentError("Parameter name is required.");
597 }
598
599 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':encry pt';
600
601 var _response = _requester.request(_url,
602 "POST",
603 body: _body,
604 queryParams: _queryParams,
605 uploadOptions: _uploadOptions,
606 uploadMedia: _uploadMedia,
607 downloadOptions: _downloadOptions);
608 return _response.then((data) => new EncryptResponse.fromJson(data));
609 }
610
611 /**
612 * Returns metadata for a given CryptoKey, as well as its
613 * primary CryptoKeyVersion.
614 *
615 * Request parameters:
616 *
617 * [name] - The name of the CryptoKey to get.
618 * Value must have pattern
619 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
620 *
621 * Completes with a [CryptoKey].
622 *
623 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
624 * error.
625 *
626 * If the used [http.Client] completes with an error when making a REST call,
627 * this method will complete with the same error.
628 */
629 async.Future<CryptoKey> get(core.String name) {
630 var _url = null;
631 var _queryParams = new core.Map();
632 var _uploadMedia = null;
633 var _uploadOptions = null;
634 var _downloadOptions = commons.DownloadOptions.Metadata;
635 var _body = null;
636
637 if (name == null) {
638 throw new core.ArgumentError("Parameter name is required.");
639 }
640
641 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
642
643 var _response = _requester.request(_url,
644 "GET",
645 body: _body,
646 queryParams: _queryParams,
647 uploadOptions: _uploadOptions,
648 uploadMedia: _uploadMedia,
649 downloadOptions: _downloadOptions);
650 return _response.then((data) => new CryptoKey.fromJson(data));
651 }
652
653 /**
654 * Gets the access control policy for a resource.
655 * Returns an empty policy if the resource exists and does not have a policy
656 * set.
657 *
658 * Request parameters:
659 *
660 * [resource] - REQUIRED: The resource for which the policy is being
661 * requested.
662 * `resource` is usually specified as a path. For example, a Project
663 * resource is specified as `projects/{project}`.
664 * Value must have pattern
665 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
666 *
667 * Completes with a [Policy].
668 *
669 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
670 * error.
671 *
672 * If the used [http.Client] completes with an error when making a REST call,
673 * this method will complete with the same error.
674 */
675 async.Future<Policy> getIamPolicy(core.String resource) {
676 var _url = null;
677 var _queryParams = new core.Map();
678 var _uploadMedia = null;
679 var _uploadOptions = null;
680 var _downloadOptions = commons.DownloadOptions.Metadata;
681 var _body = null;
682
683 if (resource == null) {
684 throw new core.ArgumentError("Parameter resource is required.");
685 }
686
687 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g etIamPolicy';
688
689 var _response = _requester.request(_url,
690 "GET",
691 body: _body,
692 queryParams: _queryParams,
693 uploadOptions: _uploadOptions,
694 uploadMedia: _uploadMedia,
695 downloadOptions: _downloadOptions);
696 return _response.then((data) => new Policy.fromJson(data));
697 }
698
699 /**
700 * Lists CryptoKeys.
701 *
702 * Request parameters:
703 *
704 * [parent] - Required. The resource name of the KeyRing to list, in the
705 * format
706 * `projects / * /locations / * /keyRings / * `.
707 * Value must have pattern "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+$".
708 *
709 * [pageSize] - Optional limit on the number of CryptoKeys to include in the
710 * response. Further CryptoKeys can subsequently be obtained by
711 * including the ListCryptoKeysResponse.next_page_token in a subsequent
712 * request. If unspecified, the server will pick an appropriate default.
713 *
714 * [pageToken] - Optional pagination token, returned earlier via
715 * ListCryptoKeysResponse.next_page_token.
716 *
717 * Completes with a [ListCryptoKeysResponse].
718 *
719 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
720 * error.
721 *
722 * If the used [http.Client] completes with an error when making a REST call,
723 * this method will complete with the same error.
724 */
725 async.Future<ListCryptoKeysResponse> list(core.String parent, {core.int pageSi ze, core.String pageToken}) {
726 var _url = null;
727 var _queryParams = new core.Map();
728 var _uploadMedia = null;
729 var _uploadOptions = null;
730 var _downloadOptions = commons.DownloadOptions.Metadata;
731 var _body = null;
732
733 if (parent == null) {
734 throw new core.ArgumentError("Parameter parent is required.");
735 }
736 if (pageSize != null) {
737 _queryParams["pageSize"] = ["${pageSize}"];
738 }
739 if (pageToken != null) {
740 _queryParams["pageToken"] = [pageToken];
741 }
742
743 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/cry ptoKeys';
744
745 var _response = _requester.request(_url,
746 "GET",
747 body: _body,
748 queryParams: _queryParams,
749 uploadOptions: _uploadOptions,
750 uploadMedia: _uploadMedia,
751 downloadOptions: _downloadOptions);
752 return _response.then((data) => new ListCryptoKeysResponse.fromJson(data));
753 }
754
755 /**
756 * Update a CryptoKey.
757 *
758 * [request] - The metadata request object.
759 *
760 * Request parameters:
761 *
762 * [name] - Output only. The resource name for this CryptoKey in the format
763 * `projects / * /locations / * /keyRings / * /cryptoKeys / * `.
764 * Value must have pattern
765 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
766 *
767 * [updateMask] - Required list of fields to be updated in this request.
768 *
769 * Completes with a [CryptoKey].
770 *
771 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
772 * error.
773 *
774 * If the used [http.Client] completes with an error when making a REST call,
775 * this method will complete with the same error.
776 */
777 async.Future<CryptoKey> patch(CryptoKey request, core.String name, {core.Strin g updateMask}) {
778 var _url = null;
779 var _queryParams = new core.Map();
780 var _uploadMedia = null;
781 var _uploadOptions = null;
782 var _downloadOptions = commons.DownloadOptions.Metadata;
783 var _body = null;
784
785 if (request != null) {
786 _body = convert.JSON.encode((request).toJson());
787 }
788 if (name == null) {
789 throw new core.ArgumentError("Parameter name is required.");
790 }
791 if (updateMask != null) {
792 _queryParams["updateMask"] = [updateMask];
793 }
794
795 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
796
797 var _response = _requester.request(_url,
798 "PATCH",
799 body: _body,
800 queryParams: _queryParams,
801 uploadOptions: _uploadOptions,
802 uploadMedia: _uploadMedia,
803 downloadOptions: _downloadOptions);
804 return _response.then((data) => new CryptoKey.fromJson(data));
805 }
806
807 /**
808 * Sets the access control policy on the specified resource. Replaces any
809 * existing policy.
810 *
811 * [request] - The metadata request object.
812 *
813 * Request parameters:
814 *
815 * [resource] - REQUIRED: The resource for which the policy is being
816 * specified.
817 * `resource` is usually specified as a path. For example, a Project
818 * resource is specified as `projects/{project}`.
819 * Value must have pattern
820 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
821 *
822 * Completes with a [Policy].
823 *
824 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
825 * error.
826 *
827 * If the used [http.Client] completes with an error when making a REST call,
828 * this method will complete with the same error.
829 */
830 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res ource) {
831 var _url = null;
832 var _queryParams = new core.Map();
833 var _uploadMedia = null;
834 var _uploadOptions = null;
835 var _downloadOptions = commons.DownloadOptions.Metadata;
836 var _body = null;
837
838 if (request != null) {
839 _body = convert.JSON.encode((request).toJson());
840 }
841 if (resource == null) {
842 throw new core.ArgumentError("Parameter resource is required.");
843 }
844
845 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s etIamPolicy';
846
847 var _response = _requester.request(_url,
848 "POST",
849 body: _body,
850 queryParams: _queryParams,
851 uploadOptions: _uploadOptions,
852 uploadMedia: _uploadMedia,
853 downloadOptions: _downloadOptions);
854 return _response.then((data) => new Policy.fromJson(data));
855 }
856
857 /**
858 * Returns permissions that a caller has on the specified resource.
859 * If the resource does not exist, this will return an empty set of
860 * permissions, not a NOT_FOUND error.
861 *
862 * [request] - The metadata request object.
863 *
864 * Request parameters:
865 *
866 * [resource] - REQUIRED: The resource for which the policy detail is being
867 * requested.
868 * `resource` is usually specified as a path. For example, a Project
869 * resource is specified as `projects/{project}`.
870 * Value must have pattern
871 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
872 *
873 * Completes with a [TestIamPermissionsResponse].
874 *
875 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
876 * error.
877 *
878 * If the used [http.Client] completes with an error when making a REST call,
879 * this method will complete with the same error.
880 */
881 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions Request request, core.String resource) {
882 var _url = null;
883 var _queryParams = new core.Map();
884 var _uploadMedia = null;
885 var _uploadOptions = null;
886 var _downloadOptions = commons.DownloadOptions.Metadata;
887 var _body = null;
888
889 if (request != null) {
890 _body = convert.JSON.encode((request).toJson());
891 }
892 if (resource == null) {
893 throw new core.ArgumentError("Parameter resource is required.");
894 }
895
896 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':t estIamPermissions';
897
898 var _response = _requester.request(_url,
899 "POST",
900 body: _body,
901 queryParams: _queryParams,
902 uploadOptions: _uploadOptions,
903 uploadMedia: _uploadMedia,
904 downloadOptions: _downloadOptions);
905 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data ));
906 }
907
908 /**
909 * Update the version of a CryptoKey that will be used in Encrypt
910 *
911 * [request] - The metadata request object.
912 *
913 * Request parameters:
914 *
915 * [name] - The resource name of the CryptoKey to update.
916 * Value must have pattern
917 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
918 *
919 * Completes with a [CryptoKey].
920 *
921 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
922 * error.
923 *
924 * If the used [http.Client] completes with an error when making a REST call,
925 * this method will complete with the same error.
926 */
927 async.Future<CryptoKey> updatePrimaryVersion(UpdateCryptoKeyPrimaryVersionRequ est request, core.String name) {
928 var _url = null;
929 var _queryParams = new core.Map();
930 var _uploadMedia = null;
931 var _uploadOptions = null;
932 var _downloadOptions = commons.DownloadOptions.Metadata;
933 var _body = null;
934
935 if (request != null) {
936 _body = convert.JSON.encode((request).toJson());
937 }
938 if (name == null) {
939 throw new core.ArgumentError("Parameter name is required.");
940 }
941
942 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':updat ePrimaryVersion';
943
944 var _response = _requester.request(_url,
945 "POST",
946 body: _body,
947 queryParams: _queryParams,
948 uploadOptions: _uploadOptions,
949 uploadMedia: _uploadMedia,
950 downloadOptions: _downloadOptions);
951 return _response.then((data) => new CryptoKey.fromJson(data));
952 }
953
954 }
955
956
957 class ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsResourceApi {
958 final commons.ApiRequester _requester;
959
960 ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsResourceApi(commons.ApiReq uester client) :
961 _requester = client;
962
963 /**
964 * Create a new CryptoKeyVersion in a CryptoKey.
965 *
966 * The server will assign the next sequential id. If unset,
967 * state will be set to
968 * ENABLED.
969 *
970 * [request] - The metadata request object.
971 *
972 * Request parameters:
973 *
974 * [parent] - Required. The name of the CryptoKey associated with
975 * the CryptoKeyVersions.
976 * Value must have pattern
977 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
978 *
979 * Completes with a [CryptoKeyVersion].
980 *
981 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
982 * error.
983 *
984 * If the used [http.Client] completes with an error when making a REST call,
985 * this method will complete with the same error.
986 */
987 async.Future<CryptoKeyVersion> create(CryptoKeyVersion request, core.String pa rent) {
988 var _url = null;
989 var _queryParams = new core.Map();
990 var _uploadMedia = null;
991 var _uploadOptions = null;
992 var _downloadOptions = commons.DownloadOptions.Metadata;
993 var _body = null;
994
995 if (request != null) {
996 _body = convert.JSON.encode((request).toJson());
997 }
998 if (parent == null) {
999 throw new core.ArgumentError("Parameter parent is required.");
1000 }
1001
1002 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/cry ptoKeyVersions';
1003
1004 var _response = _requester.request(_url,
1005 "POST",
1006 body: _body,
1007 queryParams: _queryParams,
1008 uploadOptions: _uploadOptions,
1009 uploadMedia: _uploadMedia,
1010 downloadOptions: _downloadOptions);
1011 return _response.then((data) => new CryptoKeyVersion.fromJson(data));
1012 }
1013
1014 /**
1015 * Schedule a CryptoKeyVersion for destruction.
1016 *
1017 * Upon calling this method, CryptoKeyVersion.state will be set to
1018 * DESTROY_SCHEDULED
1019 * and destroy_time will be set to a time 24
1020 * hours in the future, at which point the state
1021 * will be changed to
1022 * DESTROYED, and the key
1023 * material will be irrevocably destroyed.
1024 *
1025 * Before the destroy_time is reached,
1026 * RestoreCryptoKeyVersion may be called to reverse the process.
1027 *
1028 * [request] - The metadata request object.
1029 *
1030 * Request parameters:
1031 *
1032 * [name] - The resource name of the CryptoKeyVersion to destroy.
1033 * Value must have pattern
1034 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyV ersions/[^/]+$".
1035 *
1036 * Completes with a [CryptoKeyVersion].
1037 *
1038 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1039 * error.
1040 *
1041 * If the used [http.Client] completes with an error when making a REST call,
1042 * this method will complete with the same error.
1043 */
1044 async.Future<CryptoKeyVersion> destroy(DestroyCryptoKeyVersionRequest request, core.String name) {
1045 var _url = null;
1046 var _queryParams = new core.Map();
1047 var _uploadMedia = null;
1048 var _uploadOptions = null;
1049 var _downloadOptions = commons.DownloadOptions.Metadata;
1050 var _body = null;
1051
1052 if (request != null) {
1053 _body = convert.JSON.encode((request).toJson());
1054 }
1055 if (name == null) {
1056 throw new core.ArgumentError("Parameter name is required.");
1057 }
1058
1059 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':destr oy';
1060
1061 var _response = _requester.request(_url,
1062 "POST",
1063 body: _body,
1064 queryParams: _queryParams,
1065 uploadOptions: _uploadOptions,
1066 uploadMedia: _uploadMedia,
1067 downloadOptions: _downloadOptions);
1068 return _response.then((data) => new CryptoKeyVersion.fromJson(data));
1069 }
1070
1071 /**
1072 * Returns metadata for a given CryptoKeyVersion.
1073 *
1074 * Request parameters:
1075 *
1076 * [name] - The name of the CryptoKeyVersion to get.
1077 * Value must have pattern
1078 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyV ersions/[^/]+$".
1079 *
1080 * Completes with a [CryptoKeyVersion].
1081 *
1082 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1083 * error.
1084 *
1085 * If the used [http.Client] completes with an error when making a REST call,
1086 * this method will complete with the same error.
1087 */
1088 async.Future<CryptoKeyVersion> get(core.String name) {
1089 var _url = null;
1090 var _queryParams = new core.Map();
1091 var _uploadMedia = null;
1092 var _uploadOptions = null;
1093 var _downloadOptions = commons.DownloadOptions.Metadata;
1094 var _body = null;
1095
1096 if (name == null) {
1097 throw new core.ArgumentError("Parameter name is required.");
1098 }
1099
1100 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
1101
1102 var _response = _requester.request(_url,
1103 "GET",
1104 body: _body,
1105 queryParams: _queryParams,
1106 uploadOptions: _uploadOptions,
1107 uploadMedia: _uploadMedia,
1108 downloadOptions: _downloadOptions);
1109 return _response.then((data) => new CryptoKeyVersion.fromJson(data));
1110 }
1111
1112 /**
1113 * Lists CryptoKeyVersions.
1114 *
1115 * Request parameters:
1116 *
1117 * [parent] - Required. The resource name of the CryptoKey to list, in the
1118 * format
1119 * `projects / * /locations / * /keyRings / * /cryptoKeys / * `.
1120 * Value must have pattern
1121 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$".
1122 *
1123 * [pageToken] - Optional pagination token, returned earlier via
1124 * ListCryptoKeyVersionsResponse.next_page_token.
1125 *
1126 * [pageSize] - Optional limit on the number of CryptoKeyVersions to
1127 * include in the response. Further CryptoKeyVersions can
1128 * subsequently be obtained by including the
1129 * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request.
1130 * If unspecified, the server will pick an appropriate default.
1131 *
1132 * Completes with a [ListCryptoKeyVersionsResponse].
1133 *
1134 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1135 * error.
1136 *
1137 * If the used [http.Client] completes with an error when making a REST call,
1138 * this method will complete with the same error.
1139 */
1140 async.Future<ListCryptoKeyVersionsResponse> list(core.String parent, {core.Str ing pageToken, core.int pageSize}) {
1141 var _url = null;
1142 var _queryParams = new core.Map();
1143 var _uploadMedia = null;
1144 var _uploadOptions = null;
1145 var _downloadOptions = commons.DownloadOptions.Metadata;
1146 var _body = null;
1147
1148 if (parent == null) {
1149 throw new core.ArgumentError("Parameter parent is required.");
1150 }
1151 if (pageToken != null) {
1152 _queryParams["pageToken"] = [pageToken];
1153 }
1154 if (pageSize != null) {
1155 _queryParams["pageSize"] = ["${pageSize}"];
1156 }
1157
1158 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/cry ptoKeyVersions';
1159
1160 var _response = _requester.request(_url,
1161 "GET",
1162 body: _body,
1163 queryParams: _queryParams,
1164 uploadOptions: _uploadOptions,
1165 uploadMedia: _uploadMedia,
1166 downloadOptions: _downloadOptions);
1167 return _response.then((data) => new ListCryptoKeyVersionsResponse.fromJson(d ata));
1168 }
1169
1170 /**
1171 * Update a CryptoKeyVersion's metadata.
1172 *
1173 * state may be changed between
1174 * ENABLED and
1175 * DISABLED using this
1176 * method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to
1177 * move between other states.
1178 *
1179 * [request] - The metadata request object.
1180 *
1181 * Request parameters:
1182 *
1183 * [name] - Output only. The resource name for this CryptoKeyVersion in the
1184 * format
1185 * `projects / * /locations / * /keyRings / * /cryptoKeys / *
1186 * /cryptoKeyVersions / * `.
1187 * Value must have pattern
1188 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyV ersions/[^/]+$".
1189 *
1190 * [updateMask] - Required list of fields to be updated in this request.
1191 *
1192 * Completes with a [CryptoKeyVersion].
1193 *
1194 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1195 * error.
1196 *
1197 * If the used [http.Client] completes with an error when making a REST call,
1198 * this method will complete with the same error.
1199 */
1200 async.Future<CryptoKeyVersion> patch(CryptoKeyVersion request, core.String nam e, {core.String updateMask}) {
1201 var _url = null;
1202 var _queryParams = new core.Map();
1203 var _uploadMedia = null;
1204 var _uploadOptions = null;
1205 var _downloadOptions = commons.DownloadOptions.Metadata;
1206 var _body = null;
1207
1208 if (request != null) {
1209 _body = convert.JSON.encode((request).toJson());
1210 }
1211 if (name == null) {
1212 throw new core.ArgumentError("Parameter name is required.");
1213 }
1214 if (updateMask != null) {
1215 _queryParams["updateMask"] = [updateMask];
1216 }
1217
1218 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name');
1219
1220 var _response = _requester.request(_url,
1221 "PATCH",
1222 body: _body,
1223 queryParams: _queryParams,
1224 uploadOptions: _uploadOptions,
1225 uploadMedia: _uploadMedia,
1226 downloadOptions: _downloadOptions);
1227 return _response.then((data) => new CryptoKeyVersion.fromJson(data));
1228 }
1229
1230 /**
1231 * Restore a CryptoKeyVersion in the
1232 * DESTROY_SCHEDULED,
1233 * state.
1234 *
1235 * Upon restoration of the CryptoKeyVersion, state
1236 * will be set to DISABLED,
1237 * and destroy_time will be cleared.
1238 *
1239 * [request] - The metadata request object.
1240 *
1241 * Request parameters:
1242 *
1243 * [name] - The resource name of the CryptoKeyVersion to restore.
1244 * Value must have pattern
1245 * "^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+/cryptoKeyV ersions/[^/]+$".
1246 *
1247 * Completes with a [CryptoKeyVersion].
1248 *
1249 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1250 * error.
1251 *
1252 * If the used [http.Client] completes with an error when making a REST call,
1253 * this method will complete with the same error.
1254 */
1255 async.Future<CryptoKeyVersion> restore(RestoreCryptoKeyVersionRequest request, core.String name) {
1256 var _url = null;
1257 var _queryParams = new core.Map();
1258 var _uploadMedia = null;
1259 var _uploadOptions = null;
1260 var _downloadOptions = commons.DownloadOptions.Metadata;
1261 var _body = null;
1262
1263 if (request != null) {
1264 _body = convert.JSON.encode((request).toJson());
1265 }
1266 if (name == null) {
1267 throw new core.ArgumentError("Parameter name is required.");
1268 }
1269
1270 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':resto re';
1271
1272 var _response = _requester.request(_url,
1273 "POST",
1274 body: _body,
1275 queryParams: _queryParams,
1276 uploadOptions: _uploadOptions,
1277 uploadMedia: _uploadMedia,
1278 downloadOptions: _downloadOptions);
1279 return _response.then((data) => new CryptoKeyVersion.fromJson(data));
1280 }
1281
1282 }
1283
1284
1285
1286 /**
1287 * Specifies the audit configuration for a service.
1288 * It consists of which permission types are logged, and what identities, if
1289 * any, are exempted from logging.
1290 * An AuditConifg must have one or more AuditLogConfigs.
1291 */
1292 class AuditConfig {
1293 /**
1294 * The configuration for logging of each type of permission.
1295 * Next ID: 4
1296 */
1297 core.List<AuditLogConfig> auditLogConfigs;
1298 /**
1299 * Specifies the identities that are exempted from "data access" audit
1300 * logging for the `service` specified above.
1301 * Follows the same format of Binding.members.
1302 * This field is deprecated in favor of per-permission-type exemptions.
1303 */
1304 core.List<core.String> exemptedMembers;
1305 /**
1306 * Specifies a service that will be enabled for audit logging.
1307 * For example, `resourcemanager`, `storage`, `compute`.
1308 * `allServices` is a special value that covers all services.
1309 */
1310 core.String service;
1311
1312 AuditConfig();
1313
1314 AuditConfig.fromJson(core.Map _json) {
1315 if (_json.containsKey("auditLogConfigs")) {
1316 auditLogConfigs = _json["auditLogConfigs"].map((value) => new AuditLogConf ig.fromJson(value)).toList();
1317 }
1318 if (_json.containsKey("exemptedMembers")) {
1319 exemptedMembers = _json["exemptedMembers"];
1320 }
1321 if (_json.containsKey("service")) {
1322 service = _json["service"];
1323 }
1324 }
1325
1326 core.Map toJson() {
1327 var _json = new core.Map();
1328 if (auditLogConfigs != null) {
1329 _json["auditLogConfigs"] = auditLogConfigs.map((value) => (value).toJson() ).toList();
1330 }
1331 if (exemptedMembers != null) {
1332 _json["exemptedMembers"] = exemptedMembers;
1333 }
1334 if (service != null) {
1335 _json["service"] = service;
1336 }
1337 return _json;
1338 }
1339 }
1340
1341 /**
1342 * Provides the configuration for logging a type of permissions.
1343 * Example:
1344 *
1345 * {
1346 * "audit_log_configs": [
1347 * {
1348 * "log_type": "DATA_READ",
1349 * "exempted_members": [
1350 * "user:foo@gmail.com"
1351 * ]
1352 * },
1353 * {
1354 * "log_type": "DATA_WRITE",
1355 * }
1356 * ]
1357 * }
1358 *
1359 * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
1360 * foo@gmail.com from DATA_READ logging.
1361 */
1362 class AuditLogConfig {
1363 /**
1364 * Specifies the identities that do not cause logging for this type of
1365 * permission.
1366 * Follows the same format of Binding.members.
1367 */
1368 core.List<core.String> exemptedMembers;
1369 /**
1370 * The log type that this config enables.
1371 * Possible string values are:
1372 * - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this.
1373 * - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy
1374 * - "DATA_WRITE" : Data writes. Example: CloudSQL Users create
1375 * - "DATA_READ" : Data reads. Example: CloudSQL Users list
1376 */
1377 core.String logType;
1378
1379 AuditLogConfig();
1380
1381 AuditLogConfig.fromJson(core.Map _json) {
1382 if (_json.containsKey("exemptedMembers")) {
1383 exemptedMembers = _json["exemptedMembers"];
1384 }
1385 if (_json.containsKey("logType")) {
1386 logType = _json["logType"];
1387 }
1388 }
1389
1390 core.Map toJson() {
1391 var _json = new core.Map();
1392 if (exemptedMembers != null) {
1393 _json["exemptedMembers"] = exemptedMembers;
1394 }
1395 if (logType != null) {
1396 _json["logType"] = logType;
1397 }
1398 return _json;
1399 }
1400 }
1401
1402 /** Associates `members` with a `role`. */
1403 class Binding {
1404 /**
1405 * Specifies the identities requesting access for a Cloud Platform resource.
1406 * `members` can have the following values:
1407 *
1408 * * `allUsers`: A special identifier that represents anyone who is
1409 * on the internet; with or without a Google account.
1410 *
1411 * * `allAuthenticatedUsers`: A special identifier that represents anyone
1412 * who is authenticated with a Google account or a service account.
1413 *
1414 * * `user:{emailid}`: An email address that represents a specific Google
1415 * account. For example, `alice@gmail.com` or `joe@example.com`.
1416 *
1417 *
1418 * * `serviceAccount:{emailid}`: An email address that represents a service
1419 * account. For example, `my-other-app@appspot.gserviceaccount.com`.
1420 *
1421 * * `group:{emailid}`: An email address that represents a Google group.
1422 * For example, `admins@example.com`.
1423 *
1424 * * `domain:{domain}`: A Google Apps domain name that represents all the
1425 * users of that domain. For example, `google.com` or `example.com`.
1426 */
1427 core.List<core.String> members;
1428 /**
1429 * Role that is assigned to `members`.
1430 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1431 * Required
1432 */
1433 core.String role;
1434
1435 Binding();
1436
1437 Binding.fromJson(core.Map _json) {
1438 if (_json.containsKey("members")) {
1439 members = _json["members"];
1440 }
1441 if (_json.containsKey("role")) {
1442 role = _json["role"];
1443 }
1444 }
1445
1446 core.Map toJson() {
1447 var _json = new core.Map();
1448 if (members != null) {
1449 _json["members"] = members;
1450 }
1451 if (role != null) {
1452 _json["role"] = role;
1453 }
1454 return _json;
1455 }
1456 }
1457
1458 /** Write a Cloud Audit log */
1459 class CloudAuditOptions {
1460
1461 CloudAuditOptions();
1462
1463 CloudAuditOptions.fromJson(core.Map _json) {
1464 }
1465
1466 core.Map toJson() {
1467 var _json = new core.Map();
1468 return _json;
1469 }
1470 }
1471
1472 /** A condition to be met. */
1473 class Condition {
1474 /**
1475 * Trusted attributes supplied by the IAM system.
1476 * Possible string values are:
1477 * - "NO_ATTR" : Default non-attribute.
1478 * - "AUTHORITY" : Either principal or (if present) authority selector.
1479 * - "ATTRIBUTION" : The principal (even if an authority selector is present),
1480 * which
1481 * must only be used for attribution, not authorization.
1482 */
1483 core.String iam;
1484 /**
1485 * An operator to apply the subject with.
1486 * Possible string values are:
1487 * - "NO_OP" : Default no-op.
1488 * - "EQUALS" : DEPRECATED. Use IN instead.
1489 * - "NOT_EQUALS" : DEPRECATED. Use NOT_IN instead.
1490 * - "IN" : Set-inclusion check.
1491 * - "NOT_IN" : Set-exclusion check.
1492 * - "DISCHARGED" : Subject is discharged
1493 */
1494 core.String op;
1495 /** Trusted attributes discharged by the service. */
1496 core.String svc;
1497 /**
1498 * Trusted attributes supplied by any service that owns resources and uses
1499 * the IAM system for access control.
1500 * Possible string values are:
1501 * - "NO_ATTR" : Default non-attribute type
1502 * - "REGION" : Region of the resource
1503 * - "SERVICE" : Service name
1504 * - "NAME" : Resource name
1505 * - "IP" : IP address of the caller
1506 */
1507 core.String sys;
1508 /** DEPRECATED. Use 'values' instead. */
1509 core.String value;
1510 /** The objects of the condition. This is mutually exclusive with 'value'. */
1511 core.List<core.String> values;
1512
1513 Condition();
1514
1515 Condition.fromJson(core.Map _json) {
1516 if (_json.containsKey("iam")) {
1517 iam = _json["iam"];
1518 }
1519 if (_json.containsKey("op")) {
1520 op = _json["op"];
1521 }
1522 if (_json.containsKey("svc")) {
1523 svc = _json["svc"];
1524 }
1525 if (_json.containsKey("sys")) {
1526 sys = _json["sys"];
1527 }
1528 if (_json.containsKey("value")) {
1529 value = _json["value"];
1530 }
1531 if (_json.containsKey("values")) {
1532 values = _json["values"];
1533 }
1534 }
1535
1536 core.Map toJson() {
1537 var _json = new core.Map();
1538 if (iam != null) {
1539 _json["iam"] = iam;
1540 }
1541 if (op != null) {
1542 _json["op"] = op;
1543 }
1544 if (svc != null) {
1545 _json["svc"] = svc;
1546 }
1547 if (sys != null) {
1548 _json["sys"] = sys;
1549 }
1550 if (value != null) {
1551 _json["value"] = value;
1552 }
1553 if (values != null) {
1554 _json["values"] = values;
1555 }
1556 return _json;
1557 }
1558 }
1559
1560 /** Options for counters */
1561 class CounterOptions {
1562 /** The field value to attribute. */
1563 core.String field;
1564 /** The metric to update. */
1565 core.String metric;
1566
1567 CounterOptions();
1568
1569 CounterOptions.fromJson(core.Map _json) {
1570 if (_json.containsKey("field")) {
1571 field = _json["field"];
1572 }
1573 if (_json.containsKey("metric")) {
1574 metric = _json["metric"];
1575 }
1576 }
1577
1578 core.Map toJson() {
1579 var _json = new core.Map();
1580 if (field != null) {
1581 _json["field"] = field;
1582 }
1583 if (metric != null) {
1584 _json["metric"] = metric;
1585 }
1586 return _json;
1587 }
1588 }
1589
1590 /**
1591 * A CryptoKey represents a logical key that can be used for cryptographic
1592 * operations.
1593 *
1594 * A CryptoKey is made up of one or more versions, which
1595 * represent the actual key material used in cryptographic operations.
1596 */
1597 class CryptoKey {
1598 /** Output only. The time at which this CryptoKey was created. */
1599 core.String createTime;
1600 /**
1601 * Output only. The resource name for this CryptoKey in the format
1602 * `projects / * /locations / * /keyRings / * /cryptoKeys / * `.
1603 */
1604 core.String name;
1605 /**
1606 * At next_rotation_time, the Key Management Service will automatically:
1607 *
1608 * 1. Create a new version of this CryptoKey.
1609 * 2. Mark the new version as primary.
1610 *
1611 * Key rotations performed manually via
1612 * CreateCryptoKeyVersion and
1613 * UpdateCryptoKeyPrimaryVersion
1614 * do not affect next_rotation_time.
1615 */
1616 core.String nextRotationTime;
1617 /**
1618 * Output only. A copy of the "primary" CryptoKeyVersion that will be used
1619 * by Encrypt when this CryptoKey is given
1620 * in EncryptRequest.name.
1621 *
1622 * The CryptoKey's primary version can be updated via
1623 * UpdateCryptoKeyPrimaryVersion.
1624 */
1625 CryptoKeyVersion primary;
1626 /**
1627 * The immutable purpose of this CryptoKey. Currently, the only acceptable
1628 * purpose is ENCRYPT_DECRYPT.
1629 * Possible string values are:
1630 * - "CRYPTO_KEY_PURPOSE_UNSPECIFIED" : Not specified.
1631 * - "ENCRYPT_DECRYPT" : CryptoKeys with this purpose may be used with
1632 * Encrypt and
1633 * Decrypt.
1634 */
1635 core.String purpose;
1636 /**
1637 * next_rotation_time will be advanced by this period when the service
1638 * automatically rotates a key. Must be at least one day.
1639 *
1640 * If rotation_period is set, next_rotation_time must also be set.
1641 */
1642 core.String rotationPeriod;
1643
1644 CryptoKey();
1645
1646 CryptoKey.fromJson(core.Map _json) {
1647 if (_json.containsKey("createTime")) {
1648 createTime = _json["createTime"];
1649 }
1650 if (_json.containsKey("name")) {
1651 name = _json["name"];
1652 }
1653 if (_json.containsKey("nextRotationTime")) {
1654 nextRotationTime = _json["nextRotationTime"];
1655 }
1656 if (_json.containsKey("primary")) {
1657 primary = new CryptoKeyVersion.fromJson(_json["primary"]);
1658 }
1659 if (_json.containsKey("purpose")) {
1660 purpose = _json["purpose"];
1661 }
1662 if (_json.containsKey("rotationPeriod")) {
1663 rotationPeriod = _json["rotationPeriod"];
1664 }
1665 }
1666
1667 core.Map toJson() {
1668 var _json = new core.Map();
1669 if (createTime != null) {
1670 _json["createTime"] = createTime;
1671 }
1672 if (name != null) {
1673 _json["name"] = name;
1674 }
1675 if (nextRotationTime != null) {
1676 _json["nextRotationTime"] = nextRotationTime;
1677 }
1678 if (primary != null) {
1679 _json["primary"] = (primary).toJson();
1680 }
1681 if (purpose != null) {
1682 _json["purpose"] = purpose;
1683 }
1684 if (rotationPeriod != null) {
1685 _json["rotationPeriod"] = rotationPeriod;
1686 }
1687 return _json;
1688 }
1689 }
1690
1691 /**
1692 * A CryptoKeyVersion represents an individual cryptographic key, and the
1693 * associated key material.
1694 *
1695 * It can be used for cryptographic operations either directly, or via its
1696 * parent CryptoKey, in which case the server will choose the appropriate
1697 * version for the operation.
1698 */
1699 class CryptoKeyVersion {
1700 /** Output only. The time at which this CryptoKeyVersion was created. */
1701 core.String createTime;
1702 /**
1703 * Output only. The time this CryptoKeyVersion's key material was
1704 * destroyed. Only present if state is
1705 * DESTROYED.
1706 */
1707 core.String destroyEventTime;
1708 /**
1709 * Output only. The time this CryptoKeyVersion's key material is scheduled
1710 * for destruction. Only present if state is
1711 * DESTROY_SCHEDULED.
1712 */
1713 core.String destroyTime;
1714 /**
1715 * Output only. The resource name for this CryptoKeyVersion in the format
1716 * `projects / * /locations / * /keyRings / * /cryptoKeys / *
1717 * /cryptoKeyVersions / * `.
1718 */
1719 core.String name;
1720 /**
1721 * The current state of the CryptoKeyVersion.
1722 * Possible string values are:
1723 * - "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" : Not specified.
1724 * - "ENABLED" : This version may be used in Encrypt and
1725 * Decrypt requests.
1726 * - "DISABLED" : This version may not be used, but the key material is still
1727 * available,
1728 * and the version can be placed back into the ENABLED state.
1729 * - "DESTROYED" : This version is destroyed, and the key material is no
1730 * longer stored.
1731 * A version may not leave this state once entered.
1732 * - "DESTROY_SCHEDULED" : This version is scheduled for destruction, and will
1733 * be destroyed soon.
1734 * Call
1735 * RestoreCryptoKeyVersion
1736 * to put it back into the DISABLED state.
1737 */
1738 core.String state;
1739
1740 CryptoKeyVersion();
1741
1742 CryptoKeyVersion.fromJson(core.Map _json) {
1743 if (_json.containsKey("createTime")) {
1744 createTime = _json["createTime"];
1745 }
1746 if (_json.containsKey("destroyEventTime")) {
1747 destroyEventTime = _json["destroyEventTime"];
1748 }
1749 if (_json.containsKey("destroyTime")) {
1750 destroyTime = _json["destroyTime"];
1751 }
1752 if (_json.containsKey("name")) {
1753 name = _json["name"];
1754 }
1755 if (_json.containsKey("state")) {
1756 state = _json["state"];
1757 }
1758 }
1759
1760 core.Map toJson() {
1761 var _json = new core.Map();
1762 if (createTime != null) {
1763 _json["createTime"] = createTime;
1764 }
1765 if (destroyEventTime != null) {
1766 _json["destroyEventTime"] = destroyEventTime;
1767 }
1768 if (destroyTime != null) {
1769 _json["destroyTime"] = destroyTime;
1770 }
1771 if (name != null) {
1772 _json["name"] = name;
1773 }
1774 if (state != null) {
1775 _json["state"] = state;
1776 }
1777 return _json;
1778 }
1779 }
1780
1781 /** Write a Data Access (Gin) log */
1782 class DataAccessOptions {
1783
1784 DataAccessOptions();
1785
1786 DataAccessOptions.fromJson(core.Map _json) {
1787 }
1788
1789 core.Map toJson() {
1790 var _json = new core.Map();
1791 return _json;
1792 }
1793 }
1794
1795 /** Request message for KeyManagementService.Decrypt. */
1796 class DecryptRequest {
1797 /**
1798 * Optional data that must match the data originally supplied in
1799 * EncryptRequest.additional_authenticated_data.
1800 */
1801 core.String additionalAuthenticatedData;
1802 core.List<core.int> get additionalAuthenticatedDataAsBytes {
1803 return convert.BASE64.decode(additionalAuthenticatedData);
1804 }
1805
1806 void set additionalAuthenticatedDataAsBytes(core.List<core.int> _bytes) {
1807 additionalAuthenticatedData = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-");
1808 }
1809 /**
1810 * Required. The encrypted data originally returned in
1811 * EncryptResponse.ciphertext.
1812 */
1813 core.String ciphertext;
1814 core.List<core.int> get ciphertextAsBytes {
1815 return convert.BASE64.decode(ciphertext);
1816 }
1817
1818 void set ciphertextAsBytes(core.List<core.int> _bytes) {
1819 ciphertext = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(" +", "-");
1820 }
1821
1822 DecryptRequest();
1823
1824 DecryptRequest.fromJson(core.Map _json) {
1825 if (_json.containsKey("additionalAuthenticatedData")) {
1826 additionalAuthenticatedData = _json["additionalAuthenticatedData"];
1827 }
1828 if (_json.containsKey("ciphertext")) {
1829 ciphertext = _json["ciphertext"];
1830 }
1831 }
1832
1833 core.Map toJson() {
1834 var _json = new core.Map();
1835 if (additionalAuthenticatedData != null) {
1836 _json["additionalAuthenticatedData"] = additionalAuthenticatedData;
1837 }
1838 if (ciphertext != null) {
1839 _json["ciphertext"] = ciphertext;
1840 }
1841 return _json;
1842 }
1843 }
1844
1845 /** Response message for KeyManagementService.Decrypt. */
1846 class DecryptResponse {
1847 /** The decrypted data originally supplied in EncryptRequest.plaintext. */
1848 core.String plaintext;
1849 core.List<core.int> get plaintextAsBytes {
1850 return convert.BASE64.decode(plaintext);
1851 }
1852
1853 void set plaintextAsBytes(core.List<core.int> _bytes) {
1854 plaintext = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+ ", "-");
1855 }
1856
1857 DecryptResponse();
1858
1859 DecryptResponse.fromJson(core.Map _json) {
1860 if (_json.containsKey("plaintext")) {
1861 plaintext = _json["plaintext"];
1862 }
1863 }
1864
1865 core.Map toJson() {
1866 var _json = new core.Map();
1867 if (plaintext != null) {
1868 _json["plaintext"] = plaintext;
1869 }
1870 return _json;
1871 }
1872 }
1873
1874 /** Request message for KeyManagementService.DestroyCryptoKeyVersion. */
1875 class DestroyCryptoKeyVersionRequest {
1876
1877 DestroyCryptoKeyVersionRequest();
1878
1879 DestroyCryptoKeyVersionRequest.fromJson(core.Map _json) {
1880 }
1881
1882 core.Map toJson() {
1883 var _json = new core.Map();
1884 return _json;
1885 }
1886 }
1887
1888 /** Request message for KeyManagementService.Encrypt. */
1889 class EncryptRequest {
1890 /**
1891 * Optional data that, if specified, must also be provided during decryption
1892 * through DecryptRequest.additional_authenticated_data. Must be no
1893 * larger than 64KiB.
1894 */
1895 core.String additionalAuthenticatedData;
1896 core.List<core.int> get additionalAuthenticatedDataAsBytes {
1897 return convert.BASE64.decode(additionalAuthenticatedData);
1898 }
1899
1900 void set additionalAuthenticatedDataAsBytes(core.List<core.int> _bytes) {
1901 additionalAuthenticatedData = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-");
1902 }
1903 /** Required. The data to encrypt. Must be no larger than 64KiB. */
1904 core.String plaintext;
1905 core.List<core.int> get plaintextAsBytes {
1906 return convert.BASE64.decode(plaintext);
1907 }
1908
1909 void set plaintextAsBytes(core.List<core.int> _bytes) {
1910 plaintext = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+ ", "-");
1911 }
1912
1913 EncryptRequest();
1914
1915 EncryptRequest.fromJson(core.Map _json) {
1916 if (_json.containsKey("additionalAuthenticatedData")) {
1917 additionalAuthenticatedData = _json["additionalAuthenticatedData"];
1918 }
1919 if (_json.containsKey("plaintext")) {
1920 plaintext = _json["plaintext"];
1921 }
1922 }
1923
1924 core.Map toJson() {
1925 var _json = new core.Map();
1926 if (additionalAuthenticatedData != null) {
1927 _json["additionalAuthenticatedData"] = additionalAuthenticatedData;
1928 }
1929 if (plaintext != null) {
1930 _json["plaintext"] = plaintext;
1931 }
1932 return _json;
1933 }
1934 }
1935
1936 /** Response message for KeyManagementService.Encrypt. */
1937 class EncryptResponse {
1938 /** The encrypted data. */
1939 core.String ciphertext;
1940 core.List<core.int> get ciphertextAsBytes {
1941 return convert.BASE64.decode(ciphertext);
1942 }
1943
1944 void set ciphertextAsBytes(core.List<core.int> _bytes) {
1945 ciphertext = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll(" +", "-");
1946 }
1947 /** The resource name of the CryptoKeyVersion used in encryption. */
1948 core.String name;
1949
1950 EncryptResponse();
1951
1952 EncryptResponse.fromJson(core.Map _json) {
1953 if (_json.containsKey("ciphertext")) {
1954 ciphertext = _json["ciphertext"];
1955 }
1956 if (_json.containsKey("name")) {
1957 name = _json["name"];
1958 }
1959 }
1960
1961 core.Map toJson() {
1962 var _json = new core.Map();
1963 if (ciphertext != null) {
1964 _json["ciphertext"] = ciphertext;
1965 }
1966 if (name != null) {
1967 _json["name"] = name;
1968 }
1969 return _json;
1970 }
1971 }
1972
1973 /** A KeyRing is a toplevel logical grouping of CryptoKeys. */
1974 class KeyRing {
1975 /** Output only. The time at which this KeyRing was created. */
1976 core.String createTime;
1977 /**
1978 * Output only. The resource name for the KeyRing in the format
1979 * `projects / * /locations / * /keyRings / * `.
1980 */
1981 core.String name;
1982
1983 KeyRing();
1984
1985 KeyRing.fromJson(core.Map _json) {
1986 if (_json.containsKey("createTime")) {
1987 createTime = _json["createTime"];
1988 }
1989 if (_json.containsKey("name")) {
1990 name = _json["name"];
1991 }
1992 }
1993
1994 core.Map toJson() {
1995 var _json = new core.Map();
1996 if (createTime != null) {
1997 _json["createTime"] = createTime;
1998 }
1999 if (name != null) {
2000 _json["name"] = name;
2001 }
2002 return _json;
2003 }
2004 }
2005
2006 /** Response message for KeyManagementService.ListCryptoKeyVersions. */
2007 class ListCryptoKeyVersionsResponse {
2008 /** The list of CryptoKeyVersions. */
2009 core.List<CryptoKeyVersion> cryptoKeyVersions;
2010 /**
2011 * A token to retrieve next page of results. Pass this value in
2012 * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of
2013 * results.
2014 */
2015 core.String nextPageToken;
2016 /**
2017 * The total number of CryptoKeyVersions that matched the
2018 * query.
2019 */
2020 core.int totalSize;
2021
2022 ListCryptoKeyVersionsResponse();
2023
2024 ListCryptoKeyVersionsResponse.fromJson(core.Map _json) {
2025 if (_json.containsKey("cryptoKeyVersions")) {
2026 cryptoKeyVersions = _json["cryptoKeyVersions"].map((value) => new CryptoKe yVersion.fromJson(value)).toList();
2027 }
2028 if (_json.containsKey("nextPageToken")) {
2029 nextPageToken = _json["nextPageToken"];
2030 }
2031 if (_json.containsKey("totalSize")) {
2032 totalSize = _json["totalSize"];
2033 }
2034 }
2035
2036 core.Map toJson() {
2037 var _json = new core.Map();
2038 if (cryptoKeyVersions != null) {
2039 _json["cryptoKeyVersions"] = cryptoKeyVersions.map((value) => (value).toJs on()).toList();
2040 }
2041 if (nextPageToken != null) {
2042 _json["nextPageToken"] = nextPageToken;
2043 }
2044 if (totalSize != null) {
2045 _json["totalSize"] = totalSize;
2046 }
2047 return _json;
2048 }
2049 }
2050
2051 /** Response message for KeyManagementService.ListCryptoKeys. */
2052 class ListCryptoKeysResponse {
2053 /** The list of CryptoKeys. */
2054 core.List<CryptoKey> cryptoKeys;
2055 /**
2056 * A token to retrieve next page of results. Pass this value in
2057 * ListCryptoKeysRequest.page_token to retrieve the next page of results.
2058 */
2059 core.String nextPageToken;
2060 /** The total number of CryptoKeys that matched the query. */
2061 core.int totalSize;
2062
2063 ListCryptoKeysResponse();
2064
2065 ListCryptoKeysResponse.fromJson(core.Map _json) {
2066 if (_json.containsKey("cryptoKeys")) {
2067 cryptoKeys = _json["cryptoKeys"].map((value) => new CryptoKey.fromJson(val ue)).toList();
2068 }
2069 if (_json.containsKey("nextPageToken")) {
2070 nextPageToken = _json["nextPageToken"];
2071 }
2072 if (_json.containsKey("totalSize")) {
2073 totalSize = _json["totalSize"];
2074 }
2075 }
2076
2077 core.Map toJson() {
2078 var _json = new core.Map();
2079 if (cryptoKeys != null) {
2080 _json["cryptoKeys"] = cryptoKeys.map((value) => (value).toJson()).toList() ;
2081 }
2082 if (nextPageToken != null) {
2083 _json["nextPageToken"] = nextPageToken;
2084 }
2085 if (totalSize != null) {
2086 _json["totalSize"] = totalSize;
2087 }
2088 return _json;
2089 }
2090 }
2091
2092 /** Response message for KeyManagementService.ListKeyRings. */
2093 class ListKeyRingsResponse {
2094 /** The list of KeyRings. */
2095 core.List<KeyRing> keyRings;
2096 /**
2097 * A token to retrieve next page of results. Pass this value in
2098 * ListKeyRingsRequest.page_token to retrieve the next page of results.
2099 */
2100 core.String nextPageToken;
2101 /** The total number of KeyRings that matched the query. */
2102 core.int totalSize;
2103
2104 ListKeyRingsResponse();
2105
2106 ListKeyRingsResponse.fromJson(core.Map _json) {
2107 if (_json.containsKey("keyRings")) {
2108 keyRings = _json["keyRings"].map((value) => new KeyRing.fromJson(value)).t oList();
2109 }
2110 if (_json.containsKey("nextPageToken")) {
2111 nextPageToken = _json["nextPageToken"];
2112 }
2113 if (_json.containsKey("totalSize")) {
2114 totalSize = _json["totalSize"];
2115 }
2116 }
2117
2118 core.Map toJson() {
2119 var _json = new core.Map();
2120 if (keyRings != null) {
2121 _json["keyRings"] = keyRings.map((value) => (value).toJson()).toList();
2122 }
2123 if (nextPageToken != null) {
2124 _json["nextPageToken"] = nextPageToken;
2125 }
2126 if (totalSize != null) {
2127 _json["totalSize"] = totalSize;
2128 }
2129 return _json;
2130 }
2131 }
2132
2133 /** The response message for Locations.ListLocations. */
2134 class ListLocationsResponse {
2135 /** A list of locations that matches the specified filter in the request. */
2136 core.List<Location> locations;
2137 /** The standard List next-page token. */
2138 core.String nextPageToken;
2139
2140 ListLocationsResponse();
2141
2142 ListLocationsResponse.fromJson(core.Map _json) {
2143 if (_json.containsKey("locations")) {
2144 locations = _json["locations"].map((value) => new Location.fromJson(value) ).toList();
2145 }
2146 if (_json.containsKey("nextPageToken")) {
2147 nextPageToken = _json["nextPageToken"];
2148 }
2149 }
2150
2151 core.Map toJson() {
2152 var _json = new core.Map();
2153 if (locations != null) {
2154 _json["locations"] = locations.map((value) => (value).toJson()).toList();
2155 }
2156 if (nextPageToken != null) {
2157 _json["nextPageToken"] = nextPageToken;
2158 }
2159 return _json;
2160 }
2161 }
2162
2163 /** A resource that represents Google Cloud Platform location. */
2164 class Location {
2165 /**
2166 * Cross-service attributes for the location. For example
2167 *
2168 * {"cloud.googleapis.com/region": "us-east1"}
2169 */
2170 core.Map<core.String, core.String> labels;
2171 /** The canonical id for this location. For example: `"us-east1"`. */
2172 core.String locationId;
2173 /**
2174 * Service-specific metadata. For example the available capacity at the given
2175 * location.
2176 *
2177 * The values for Object must be JSON objects. It can consist of `num`,
2178 * `String`, `bool` and `null` as well as `Map` and `List` values.
2179 */
2180 core.Map<core.String, core.Object> metadata;
2181 /**
2182 * Resource name for the location, which may vary between implementations.
2183 * For example: `"projects/example-project/locations/us-east1"`
2184 */
2185 core.String name;
2186
2187 Location();
2188
2189 Location.fromJson(core.Map _json) {
2190 if (_json.containsKey("labels")) {
2191 labels = _json["labels"];
2192 }
2193 if (_json.containsKey("locationId")) {
2194 locationId = _json["locationId"];
2195 }
2196 if (_json.containsKey("metadata")) {
2197 metadata = _json["metadata"];
2198 }
2199 if (_json.containsKey("name")) {
2200 name = _json["name"];
2201 }
2202 }
2203
2204 core.Map toJson() {
2205 var _json = new core.Map();
2206 if (labels != null) {
2207 _json["labels"] = labels;
2208 }
2209 if (locationId != null) {
2210 _json["locationId"] = locationId;
2211 }
2212 if (metadata != null) {
2213 _json["metadata"] = metadata;
2214 }
2215 if (name != null) {
2216 _json["name"] = name;
2217 }
2218 return _json;
2219 }
2220 }
2221
2222 /**
2223 * Specifies what kind of log the caller must write
2224 * Increment a streamz counter with the specified metric and field names.
2225 *
2226 * Metric names should start with a '/', generally be lowercase-only,
2227 * and end in "_count". Field names should not contain an initial slash.
2228 * The actual exported metric names will have "/iam/policy" prepended.
2229 *
2230 * Field names correspond to IAM request parameters and field values are
2231 * their respective values.
2232 *
2233 * At present the only supported field names are
2234 * - "iam_principal", corresponding to IAMContext.principal;
2235 * - "" (empty string), resulting in one aggretated counter with no field.
2236 *
2237 * Examples:
2238 * counter { metric: "/debug_access_count" field: "iam_principal" }
2239 * ==> increment counter /iam/policy/backend_debug_access_count
2240 * {iam_principal=[value of IAMContext.principal]}
2241 *
2242 * At this time we do not support:
2243 * * multiple field names (though this may be supported in the future)
2244 * * decrementing the counter
2245 * * incrementing it by anything other than 1
2246 */
2247 class LogConfig {
2248 /** Cloud audit options. */
2249 CloudAuditOptions cloudAudit;
2250 /** Counter options. */
2251 CounterOptions counter;
2252 /** Data access options. */
2253 DataAccessOptions dataAccess;
2254
2255 LogConfig();
2256
2257 LogConfig.fromJson(core.Map _json) {
2258 if (_json.containsKey("cloudAudit")) {
2259 cloudAudit = new CloudAuditOptions.fromJson(_json["cloudAudit"]);
2260 }
2261 if (_json.containsKey("counter")) {
2262 counter = new CounterOptions.fromJson(_json["counter"]);
2263 }
2264 if (_json.containsKey("dataAccess")) {
2265 dataAccess = new DataAccessOptions.fromJson(_json["dataAccess"]);
2266 }
2267 }
2268
2269 core.Map toJson() {
2270 var _json = new core.Map();
2271 if (cloudAudit != null) {
2272 _json["cloudAudit"] = (cloudAudit).toJson();
2273 }
2274 if (counter != null) {
2275 _json["counter"] = (counter).toJson();
2276 }
2277 if (dataAccess != null) {
2278 _json["dataAccess"] = (dataAccess).toJson();
2279 }
2280 return _json;
2281 }
2282 }
2283
2284 /**
2285 * Defines an Identity and Access Management (IAM) policy. It is used to
2286 * specify access control policies for Cloud Platform resources.
2287 *
2288 *
2289 * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
2290 * `members` to a `role`, where the members can be user accounts, Google groups,
2291 * Google domains, and service accounts. A `role` is a named list of permissions
2292 * defined by IAM.
2293 *
2294 * **Example**
2295 *
2296 * {
2297 * "bindings": [
2298 * {
2299 * "role": "roles/owner",
2300 * "members": [
2301 * "user:mike@example.com",
2302 * "group:admins@example.com",
2303 * "domain:google.com",
2304 * "serviceAccount:my-other-app@appspot.gserviceaccount.com",
2305 * ]
2306 * },
2307 * {
2308 * "role": "roles/viewer",
2309 * "members": ["user:sean@example.com"]
2310 * }
2311 * ]
2312 * }
2313 *
2314 * For a description of IAM and its features, see the
2315 * [IAM developer's guide](https://cloud.google.com/iam).
2316 */
2317 class Policy {
2318 /** Specifies cloud audit logging configuration for this policy. */
2319 core.List<AuditConfig> auditConfigs;
2320 /**
2321 * Associates a list of `members` to a `role`.
2322 * Multiple `bindings` must not be specified for the same `role`.
2323 * `bindings` with no members will result in an error.
2324 */
2325 core.List<Binding> bindings;
2326 /**
2327 * `etag` is used for optimistic concurrency control as a way to help
2328 * prevent simultaneous updates of a policy from overwriting each other.
2329 * It is strongly suggested that systems make use of the `etag` in the
2330 * read-modify-write cycle to perform policy updates in order to avoid race
2331 * conditions: An `etag` is returned in the response to `getIamPolicy`, and
2332 * systems are expected to put that etag in the request to `setIamPolicy` to
2333 * ensure that their change will be applied to the same version of the policy.
2334 *
2335 * If no `etag` is provided in the call to `setIamPolicy`, then the existing
2336 * policy is overwritten blindly.
2337 */
2338 core.String etag;
2339 core.List<core.int> get etagAsBytes {
2340 return convert.BASE64.decode(etag);
2341 }
2342
2343 void set etagAsBytes(core.List<core.int> _bytes) {
2344 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "- ");
2345 }
2346 core.bool iamOwned;
2347 /**
2348 * If more than one rule is specified, the rules are applied in the following
2349 * manner:
2350 * - All matching LOG rules are always applied.
2351 * - If any DENY/DENY_WITH_LOG rule matches, permission is denied.
2352 * Logging will be applied if one or more matching rule requires logging.
2353 * - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
2354 * granted.
2355 * Logging will be applied if one or more matching rule requires logging.
2356 * - Otherwise, if no rule applies, permission is denied.
2357 */
2358 core.List<Rule> rules;
2359 /** Version of the `Policy`. The default version is 0. */
2360 core.int version;
2361
2362 Policy();
2363
2364 Policy.fromJson(core.Map _json) {
2365 if (_json.containsKey("auditConfigs")) {
2366 auditConfigs = _json["auditConfigs"].map((value) => new AuditConfig.fromJs on(value)).toList();
2367 }
2368 if (_json.containsKey("bindings")) {
2369 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t oList();
2370 }
2371 if (_json.containsKey("etag")) {
2372 etag = _json["etag"];
2373 }
2374 if (_json.containsKey("iamOwned")) {
2375 iamOwned = _json["iamOwned"];
2376 }
2377 if (_json.containsKey("rules")) {
2378 rules = _json["rules"].map((value) => new Rule.fromJson(value)).toList();
2379 }
2380 if (_json.containsKey("version")) {
2381 version = _json["version"];
2382 }
2383 }
2384
2385 core.Map toJson() {
2386 var _json = new core.Map();
2387 if (auditConfigs != null) {
2388 _json["auditConfigs"] = auditConfigs.map((value) => (value).toJson()).toLi st();
2389 }
2390 if (bindings != null) {
2391 _json["bindings"] = bindings.map((value) => (value).toJson()).toList();
2392 }
2393 if (etag != null) {
2394 _json["etag"] = etag;
2395 }
2396 if (iamOwned != null) {
2397 _json["iamOwned"] = iamOwned;
2398 }
2399 if (rules != null) {
2400 _json["rules"] = rules.map((value) => (value).toJson()).toList();
2401 }
2402 if (version != null) {
2403 _json["version"] = version;
2404 }
2405 return _json;
2406 }
2407 }
2408
2409 /** Request message for KeyManagementService.RestoreCryptoKeyVersion. */
2410 class RestoreCryptoKeyVersionRequest {
2411
2412 RestoreCryptoKeyVersionRequest();
2413
2414 RestoreCryptoKeyVersionRequest.fromJson(core.Map _json) {
2415 }
2416
2417 core.Map toJson() {
2418 var _json = new core.Map();
2419 return _json;
2420 }
2421 }
2422
2423 /** A rule to be applied in a Policy. */
2424 class Rule {
2425 /**
2426 * Required
2427 * Possible string values are:
2428 * - "NO_ACTION" : Default no action.
2429 * - "ALLOW" : Matching 'Entries' grant access.
2430 * - "ALLOW_WITH_LOG" : Matching 'Entries' grant access and the caller
2431 * promises to log
2432 * the request per the returned log_configs.
2433 * - "DENY" : Matching 'Entries' deny access.
2434 * - "DENY_WITH_LOG" : Matching 'Entries' deny access and the caller promises
2435 * to log
2436 * the request per the returned log_configs.
2437 * - "LOG" : Matching 'Entries' tell IAM.Check callers to generate logs.
2438 */
2439 core.String action;
2440 /** Additional restrictions that must be met */
2441 core.List<Condition> conditions;
2442 /** Human-readable description of the rule. */
2443 core.String description;
2444 /**
2445 * If one or more 'in' clauses are specified, the rule matches if
2446 * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
2447 */
2448 core.List<core.String> in_;
2449 /**
2450 * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries
2451 * that match the LOG action.
2452 */
2453 core.List<LogConfig> logConfig;
2454 /**
2455 * If one or more 'not_in' clauses are specified, the rule matches
2456 * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
2457 * The format for in and not_in entries is the same as for members in a
2458 * Binding (see google/iam/v1/policy.proto).
2459 */
2460 core.List<core.String> notIn;
2461 /**
2462 * A permission is a string of form '<service>.<resource type>.<verb>'
2463 * (e.g., 'storage.buckets.list'). A value of '*' matches all permissions,
2464 * and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
2465 */
2466 core.List<core.String> permissions;
2467
2468 Rule();
2469
2470 Rule.fromJson(core.Map _json) {
2471 if (_json.containsKey("action")) {
2472 action = _json["action"];
2473 }
2474 if (_json.containsKey("conditions")) {
2475 conditions = _json["conditions"].map((value) => new Condition.fromJson(val ue)).toList();
2476 }
2477 if (_json.containsKey("description")) {
2478 description = _json["description"];
2479 }
2480 if (_json.containsKey("in")) {
2481 in_ = _json["in"];
2482 }
2483 if (_json.containsKey("logConfig")) {
2484 logConfig = _json["logConfig"].map((value) => new LogConfig.fromJson(value )).toList();
2485 }
2486 if (_json.containsKey("notIn")) {
2487 notIn = _json["notIn"];
2488 }
2489 if (_json.containsKey("permissions")) {
2490 permissions = _json["permissions"];
2491 }
2492 }
2493
2494 core.Map toJson() {
2495 var _json = new core.Map();
2496 if (action != null) {
2497 _json["action"] = action;
2498 }
2499 if (conditions != null) {
2500 _json["conditions"] = conditions.map((value) => (value).toJson()).toList() ;
2501 }
2502 if (description != null) {
2503 _json["description"] = description;
2504 }
2505 if (in_ != null) {
2506 _json["in"] = in_;
2507 }
2508 if (logConfig != null) {
2509 _json["logConfig"] = logConfig.map((value) => (value).toJson()).toList();
2510 }
2511 if (notIn != null) {
2512 _json["notIn"] = notIn;
2513 }
2514 if (permissions != null) {
2515 _json["permissions"] = permissions;
2516 }
2517 return _json;
2518 }
2519 }
2520
2521 /** Request message for `SetIamPolicy` method. */
2522 class SetIamPolicyRequest {
2523 /**
2524 * REQUIRED: The complete policy to be applied to the `resource`. The size of
2525 * the policy is limited to a few 10s of KB. An empty policy is a
2526 * valid policy but certain Cloud Platform services (such as Projects)
2527 * might reject them.
2528 */
2529 Policy policy;
2530 /**
2531 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
2532 * the fields in the mask will be modified. If no mask is provided, a default
2533 * mask is used:
2534 * paths: "bindings, etag"
2535 * This field is only used by Cloud IAM.
2536 */
2537 core.String updateMask;
2538
2539 SetIamPolicyRequest();
2540
2541 SetIamPolicyRequest.fromJson(core.Map _json) {
2542 if (_json.containsKey("policy")) {
2543 policy = new Policy.fromJson(_json["policy"]);
2544 }
2545 if (_json.containsKey("updateMask")) {
2546 updateMask = _json["updateMask"];
2547 }
2548 }
2549
2550 core.Map toJson() {
2551 var _json = new core.Map();
2552 if (policy != null) {
2553 _json["policy"] = (policy).toJson();
2554 }
2555 if (updateMask != null) {
2556 _json["updateMask"] = updateMask;
2557 }
2558 return _json;
2559 }
2560 }
2561
2562 /** Request message for `TestIamPermissions` method. */
2563 class TestIamPermissionsRequest {
2564 /**
2565 * The set of permissions to check for the `resource`. Permissions with
2566 * wildcards (such as '*' or 'storage.*') are not allowed. For more
2567 * information see
2568 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2569 */
2570 core.List<core.String> permissions;
2571
2572 TestIamPermissionsRequest();
2573
2574 TestIamPermissionsRequest.fromJson(core.Map _json) {
2575 if (_json.containsKey("permissions")) {
2576 permissions = _json["permissions"];
2577 }
2578 }
2579
2580 core.Map toJson() {
2581 var _json = new core.Map();
2582 if (permissions != null) {
2583 _json["permissions"] = permissions;
2584 }
2585 return _json;
2586 }
2587 }
2588
2589 /** Response message for `TestIamPermissions` method. */
2590 class TestIamPermissionsResponse {
2591 /**
2592 * A subset of `TestPermissionsRequest.permissions` that the caller is
2593 * allowed.
2594 */
2595 core.List<core.String> permissions;
2596
2597 TestIamPermissionsResponse();
2598
2599 TestIamPermissionsResponse.fromJson(core.Map _json) {
2600 if (_json.containsKey("permissions")) {
2601 permissions = _json["permissions"];
2602 }
2603 }
2604
2605 core.Map toJson() {
2606 var _json = new core.Map();
2607 if (permissions != null) {
2608 _json["permissions"] = permissions;
2609 }
2610 return _json;
2611 }
2612 }
2613
2614 /** Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. */
2615 class UpdateCryptoKeyPrimaryVersionRequest {
2616 /** The id of the child CryptoKeyVersion to use as primary. */
2617 core.String cryptoKeyVersionId;
2618
2619 UpdateCryptoKeyPrimaryVersionRequest();
2620
2621 UpdateCryptoKeyPrimaryVersionRequest.fromJson(core.Map _json) {
2622 if (_json.containsKey("cryptoKeyVersionId")) {
2623 cryptoKeyVersionId = _json["cryptoKeyVersionId"];
2624 }
2625 }
2626
2627 core.Map toJson() {
2628 var _json = new core.Map();
2629 if (cryptoKeyVersionId != null) {
2630 _json["cryptoKeyVersionId"] = cryptoKeyVersionId;
2631 }
2632 return _json;
2633 }
2634 }
OLDNEW
« no previous file with comments | « generated/googleapis_beta/README.md ('k') | generated/googleapis_beta/lib/cloudresourcemanager/v1beta1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698