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

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

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

Powered by Google App Engine
This is Rietveld 408576698