OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis_beta.cloudresourcemanager.v1beta1; | 3 library googleapis_beta.cloudresourcemanager.v1beta1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 class OrganizationsResourceApi { | 39 class OrganizationsResourceApi { |
40 final commons.ApiRequester _requester; | 40 final commons.ApiRequester _requester; |
41 | 41 |
42 OrganizationsResourceApi(commons.ApiRequester client) : | 42 OrganizationsResourceApi(commons.ApiRequester client) : |
43 _requester = client; | 43 _requester = client; |
44 | 44 |
45 /** | 45 /** |
46 * Clears a `Policy` from a resource. | |
47 * | |
48 * [request] - The metadata request object. | |
49 * | |
50 * Request parameters: | |
51 * | |
52 * [resource] - Name of the resource for the `Policy` to clear. | |
53 * Value must have pattern "^organizations/[^/]+$". | |
54 * | |
55 * Completes with a [Empty]. | |
56 * | |
57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
58 * error. | |
59 * | |
60 * If the used [http.Client] completes with an error when making a REST call, | |
61 * this method will complete with the same error. | |
62 */ | |
63 async.Future<Empty> clearOrgPolicy(ClearOrgPolicyRequest request, core.String
resource) { | |
64 var _url = null; | |
65 var _queryParams = new core.Map(); | |
66 var _uploadMedia = null; | |
67 var _uploadOptions = null; | |
68 var _downloadOptions = commons.DownloadOptions.Metadata; | |
69 var _body = null; | |
70 | |
71 if (request != null) { | |
72 _body = convert.JSON.encode((request).toJson()); | |
73 } | |
74 if (resource == null) { | |
75 throw new core.ArgumentError("Parameter resource is required."); | |
76 } | |
77 | |
78 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':c
learOrgPolicy'; | |
79 | |
80 var _response = _requester.request(_url, | |
81 "POST", | |
82 body: _body, | |
83 queryParams: _queryParams, | |
84 uploadOptions: _uploadOptions, | |
85 uploadMedia: _uploadMedia, | |
86 downloadOptions: _downloadOptions); | |
87 return _response.then((data) => new Empty.fromJson(data)); | |
88 } | |
89 | |
90 /** | |
91 * Clears a `Policy` from a resource. | |
92 * | |
93 * [request] - The metadata request object. | |
94 * | |
95 * Request parameters: | |
96 * | |
97 * [resource] - Name of the resource for the `Policy` to clear. | |
98 * Value must have pattern "^organizations/[^/]+$". | |
99 * | |
100 * Completes with a [Empty]. | |
101 * | |
102 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
103 * error. | |
104 * | |
105 * If the used [http.Client] completes with an error when making a REST call, | |
106 * this method will complete with the same error. | |
107 */ | |
108 async.Future<Empty> clearOrgPolicyV1(ClearOrgPolicyRequest request, core.Strin
g resource) { | |
109 var _url = null; | |
110 var _queryParams = new core.Map(); | |
111 var _uploadMedia = null; | |
112 var _uploadOptions = null; | |
113 var _downloadOptions = commons.DownloadOptions.Metadata; | |
114 var _body = null; | |
115 | |
116 if (request != null) { | |
117 _body = convert.JSON.encode((request).toJson()); | |
118 } | |
119 if (resource == null) { | |
120 throw new core.ArgumentError("Parameter resource is required."); | |
121 } | |
122 | |
123 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':c
learOrgPolicyV1'; | |
124 | |
125 var _response = _requester.request(_url, | |
126 "POST", | |
127 body: _body, | |
128 queryParams: _queryParams, | |
129 uploadOptions: _uploadOptions, | |
130 uploadMedia: _uploadMedia, | |
131 downloadOptions: _downloadOptions); | |
132 return _response.then((data) => new Empty.fromJson(data)); | |
133 } | |
134 | |
135 /** | |
136 * Fetches an Organization resource identified by the specified resource name. | 46 * Fetches an Organization resource identified by the specified resource name. |
137 * | 47 * |
138 * Request parameters: | 48 * Request parameters: |
139 * | 49 * |
140 * [name] - The resource name of the Organization to fetch, e.g. | 50 * [name] - The resource name of the Organization to fetch, e.g. |
141 * "organizations/1234". | 51 * "organizations/1234". |
142 * Value must have pattern "^organizations/[^/]+$". | 52 * Value must have pattern "^organizations/[^/]+$". |
143 * | 53 * |
144 * [organizationId] - The id of the Organization resource to fetch. | 54 * [organizationId] - The id of the Organization resource to fetch. |
145 * This field is deprecated and will be removed in v1. Use name instead. | 55 * This field is deprecated and will be removed in v1. Use name instead. |
146 * | 56 * |
147 * Completes with a [Organization]. | 57 * Completes with a [Organization]. |
148 * | 58 * |
149 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 59 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
150 * error. | 60 * error. |
151 * | |
152 * If the used [http.Client] completes with an error when making a REST call, | |
153 * this method will complete with the same error. | |
154 */ | |
155 async.Future<Organization> get(core.String name, {core.String organizationId})
{ | |
156 var _url = null; | |
157 var _queryParams = new core.Map(); | |
158 var _uploadMedia = null; | |
159 var _uploadOptions = null; | |
160 var _downloadOptions = commons.DownloadOptions.Metadata; | |
161 var _body = null; | |
162 | |
163 if (name == null) { | |
164 throw new core.ArgumentError("Parameter name is required."); | |
165 } | |
166 if (organizationId != null) { | |
167 _queryParams["organizationId"] = [organizationId]; | |
168 } | |
169 | |
170 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); | |
171 | |
172 var _response = _requester.request(_url, | |
173 "GET", | |
174 body: _body, | |
175 queryParams: _queryParams, | |
176 uploadOptions: _uploadOptions, | |
177 uploadMedia: _uploadMedia, | |
178 downloadOptions: _downloadOptions); | |
179 return _response.then((data) => new Organization.fromJson(data)); | |
180 } | |
181 | |
182 /** | |
183 * Gets the effective `Policy` on a resource. This is the result of merging | |
184 * `Policies` in the resource hierarchy. The returned `Policy` will not have | |
185 * an `etag`set because it is a computed `Policy` across multiple resources. | |
186 * | |
187 * [request] - The metadata request object. | |
188 * | |
189 * Request parameters: | |
190 * | |
191 * [resource] - The name of the resource to start computing the effective | |
192 * `Policy`. | |
193 * Value must have pattern "^organizations/[^/]+$". | |
194 * | |
195 * Completes with a [OrgPolicy]. | |
196 * | |
197 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
198 * error. | |
199 * | |
200 * If the used [http.Client] completes with an error when making a REST call, | |
201 * this method will complete with the same error. | |
202 */ | |
203 async.Future<OrgPolicy> getEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest req
uest, core.String resource) { | |
204 var _url = null; | |
205 var _queryParams = new core.Map(); | |
206 var _uploadMedia = null; | |
207 var _uploadOptions = null; | |
208 var _downloadOptions = commons.DownloadOptions.Metadata; | |
209 var _body = null; | |
210 | |
211 if (request != null) { | |
212 _body = convert.JSON.encode((request).toJson()); | |
213 } | |
214 if (resource == null) { | |
215 throw new core.ArgumentError("Parameter resource is required."); | |
216 } | |
217 | |
218 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etEffectiveOrgPolicy'; | |
219 | |
220 var _response = _requester.request(_url, | |
221 "POST", | |
222 body: _body, | |
223 queryParams: _queryParams, | |
224 uploadOptions: _uploadOptions, | |
225 uploadMedia: _uploadMedia, | |
226 downloadOptions: _downloadOptions); | |
227 return _response.then((data) => new OrgPolicy.fromJson(data)); | |
228 } | |
229 | |
230 /** | |
231 * Gets the effective `Policy` on a resource. This is the result of merging | |
232 * `Policies` in the resource hierarchy. The returned `Policy` will not have | |
233 * an `etag`set because it is a computed `Policy` across multiple resources. | |
234 * | |
235 * [request] - The metadata request object. | |
236 * | |
237 * Request parameters: | |
238 * | |
239 * [resource] - The name of the resource to start computing the effective | |
240 * `Policy`. | |
241 * Value must have pattern "^organizations/[^/]+$". | |
242 * | |
243 * Completes with a [OrgPolicy]. | |
244 * | |
245 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
246 * error. | |
247 * | |
248 * If the used [http.Client] completes with an error when making a REST call, | |
249 * this method will complete with the same error. | |
250 */ | |
251 async.Future<OrgPolicy> getEffectiveOrgPolicyV1(GetEffectiveOrgPolicyRequest r
equest, core.String resource) { | |
252 var _url = null; | |
253 var _queryParams = new core.Map(); | |
254 var _uploadMedia = null; | |
255 var _uploadOptions = null; | |
256 var _downloadOptions = commons.DownloadOptions.Metadata; | |
257 var _body = null; | |
258 | |
259 if (request != null) { | |
260 _body = convert.JSON.encode((request).toJson()); | |
261 } | |
262 if (resource == null) { | |
263 throw new core.ArgumentError("Parameter resource is required."); | |
264 } | |
265 | |
266 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etEffectiveOrgPolicyV1'; | |
267 | |
268 var _response = _requester.request(_url, | |
269 "POST", | |
270 body: _body, | |
271 queryParams: _queryParams, | |
272 uploadOptions: _uploadOptions, | |
273 uploadMedia: _uploadMedia, | |
274 downloadOptions: _downloadOptions); | |
275 return _response.then((data) => new OrgPolicy.fromJson(data)); | |
276 } | |
277 | |
278 /** | |
279 * Gets the access control policy for an Organization resource. May be empty | |
280 * if no such policy or resource exists. The `resource` field should be the | |
281 * organization's resource name, e.g. "organizations/123". | |
282 * | |
283 * [request] - The metadata request object. | |
284 * | |
285 * Request parameters: | |
286 * | |
287 * [resource] - REQUIRED: The resource for which the policy is being | |
288 * requested. | |
289 * See the operation documentation for the appropriate value for this field. | |
290 * Value must have pattern "^organizations/[^/]+$". | |
291 * | |
292 * Completes with a [Policy]. | |
293 * | |
294 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
295 * error. | |
296 * | |
297 * If the used [http.Client] completes with an error when making a REST call, | |
298 * this method will complete with the same error. | |
299 */ | |
300 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { | |
301 var _url = null; | |
302 var _queryParams = new core.Map(); | |
303 var _uploadMedia = null; | |
304 var _uploadOptions = null; | |
305 var _downloadOptions = commons.DownloadOptions.Metadata; | |
306 var _body = null; | |
307 | |
308 if (request != null) { | |
309 _body = convert.JSON.encode((request).toJson()); | |
310 } | |
311 if (resource == null) { | |
312 throw new core.ArgumentError("Parameter resource is required."); | |
313 } | |
314 | |
315 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etIamPolicy'; | |
316 | |
317 var _response = _requester.request(_url, | |
318 "POST", | |
319 body: _body, | |
320 queryParams: _queryParams, | |
321 uploadOptions: _uploadOptions, | |
322 uploadMedia: _uploadMedia, | |
323 downloadOptions: _downloadOptions); | |
324 return _response.then((data) => new Policy.fromJson(data)); | |
325 } | |
326 | |
327 /** | |
328 * Gets a `Policy` on a resource. | |
329 * | |
330 * If no `Policy` is set on the resource, a `Policy` is returned with default | |
331 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The | |
332 * `etag` value can be used with `SetOrgPolicy()` to create or update a | |
333 * `Policy` during read-modify-write. | |
334 * | |
335 * [request] - The metadata request object. | |
336 * | |
337 * Request parameters: | |
338 * | |
339 * [resource] - Name of the resource the `Policy` is set on. | |
340 * Value must have pattern "^organizations/[^/]+$". | |
341 * | |
342 * Completes with a [OrgPolicy]. | |
343 * | |
344 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
345 * error. | |
346 * | |
347 * If the used [http.Client] completes with an error when making a REST call, | |
348 * this method will complete with the same error. | |
349 */ | |
350 async.Future<OrgPolicy> getOrgPolicy(GetOrgPolicyRequest request, core.String
resource) { | |
351 var _url = null; | |
352 var _queryParams = new core.Map(); | |
353 var _uploadMedia = null; | |
354 var _uploadOptions = null; | |
355 var _downloadOptions = commons.DownloadOptions.Metadata; | |
356 var _body = null; | |
357 | |
358 if (request != null) { | |
359 _body = convert.JSON.encode((request).toJson()); | |
360 } | |
361 if (resource == null) { | |
362 throw new core.ArgumentError("Parameter resource is required."); | |
363 } | |
364 | |
365 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etOrgPolicy'; | |
366 | |
367 var _response = _requester.request(_url, | |
368 "POST", | |
369 body: _body, | |
370 queryParams: _queryParams, | |
371 uploadOptions: _uploadOptions, | |
372 uploadMedia: _uploadMedia, | |
373 downloadOptions: _downloadOptions); | |
374 return _response.then((data) => new OrgPolicy.fromJson(data)); | |
375 } | |
376 | |
377 /** | |
378 * Gets a `Policy` on a resource. | |
379 * | |
380 * If no `Policy` is set on the resource, a `Policy` is returned with default | |
381 * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The | |
382 * `etag` value can be used with `SetOrgPolicy()` to create or update a | |
383 * `Policy` during read-modify-write. | |
384 * | |
385 * [request] - The metadata request object. | |
386 * | |
387 * Request parameters: | |
388 * | |
389 * [resource] - Name of the resource the `Policy` is set on. | |
390 * Value must have pattern "^organizations/[^/]+$". | |
391 * | |
392 * Completes with a [OrgPolicy]. | |
393 * | |
394 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
395 * error. | |
396 * | |
397 * If the used [http.Client] completes with an error when making a REST call, | |
398 * this method will complete with the same error. | |
399 */ | |
400 async.Future<OrgPolicy> getOrgPolicyV1(GetOrgPolicyRequest request, core.Strin
g resource) { | |
401 var _url = null; | |
402 var _queryParams = new core.Map(); | |
403 var _uploadMedia = null; | |
404 var _uploadOptions = null; | |
405 var _downloadOptions = commons.DownloadOptions.Metadata; | |
406 var _body = null; | |
407 | |
408 if (request != null) { | |
409 _body = convert.JSON.encode((request).toJson()); | |
410 } | |
411 if (resource == null) { | |
412 throw new core.ArgumentError("Parameter resource is required."); | |
413 } | |
414 | |
415 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etOrgPolicyV1'; | |
416 | |
417 var _response = _requester.request(_url, | |
418 "POST", | |
419 body: _body, | |
420 queryParams: _queryParams, | |
421 uploadOptions: _uploadOptions, | |
422 uploadMedia: _uploadMedia, | |
423 downloadOptions: _downloadOptions); | |
424 return _response.then((data) => new OrgPolicy.fromJson(data)); | |
425 } | |
426 | |
427 /** | |
428 * Lists Organization resources that are visible to the user and satisfy | |
429 * the specified filter. This method returns Organizations in an unspecified | |
430 * order. New Organizations do not necessarily appear at the end of the list. | |
431 * | |
432 * Request parameters: | |
433 * | |
434 * [pageSize] - The maximum number of Organizations to return in the response. | |
435 * This field is optional. | |
436 * | |
437 * [filter] - An optional query string used to filter the Organizations to | |
438 * return in | |
439 * the response. Filter rules are case-insensitive. | |
440 * | |
441 * | |
442 * Organizations may be filtered by `owner.directoryCustomerId` or by | |
443 * `domain`, where the domain is a Google for Work domain, for example: | |
444 * | |
445 * |Filter|Description| | |
446 * |------|-----------| | |
447 * |owner.directorycustomerid:123456789|Organizations with | |
448 * `owner.directory_customer_id` equal to `123456789`.| | |
449 * |domain:google.com|Organizations corresponding to the domain `google.com`.| | |
450 * | |
451 * This field is optional. | |
452 * | |
453 * [pageToken] - A pagination token returned from a previous call to | |
454 * `ListOrganizations` | |
455 * that indicates from where listing should continue. | |
456 * This field is optional. | |
457 * | |
458 * Completes with a [ListOrganizationsResponse]. | |
459 * | |
460 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
461 * error. | |
462 * | |
463 * If the used [http.Client] completes with an error when making a REST call, | |
464 * this method will complete with the same error. | |
465 */ | |
466 async.Future<ListOrganizationsResponse> list({core.int pageSize, core.String f
ilter, core.String pageToken}) { | |
467 var _url = null; | |
468 var _queryParams = new core.Map(); | |
469 var _uploadMedia = null; | |
470 var _uploadOptions = null; | |
471 var _downloadOptions = commons.DownloadOptions.Metadata; | |
472 var _body = null; | |
473 | |
474 if (pageSize != null) { | |
475 _queryParams["pageSize"] = ["${pageSize}"]; | |
476 } | |
477 if (filter != null) { | |
478 _queryParams["filter"] = [filter]; | |
479 } | |
480 if (pageToken != null) { | |
481 _queryParams["pageToken"] = [pageToken]; | |
482 } | |
483 | |
484 _url = 'v1beta1/organizations'; | |
485 | |
486 var _response = _requester.request(_url, | |
487 "GET", | |
488 body: _body, | |
489 queryParams: _queryParams, | |
490 uploadOptions: _uploadOptions, | |
491 uploadMedia: _uploadMedia, | |
492 downloadOptions: _downloadOptions); | |
493 return _response.then((data) => new ListOrganizationsResponse.fromJson(data)
); | |
494 } | |
495 | |
496 /** | |
497 * Lists `Constraints` that could be applied on the specified resource. | |
498 * | |
499 * [request] - The metadata request object. | |
500 * | |
501 * Request parameters: | |
502 * | |
503 * [resource] - Name of the resource to list `Constraints` for. | |
504 * Value must have pattern "^organizations/[^/]+$". | |
505 * | |
506 * Completes with a [ListAvailableOrgPolicyConstraintsResponse]. | |
507 * | |
508 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
509 * error. | |
510 * | |
511 * If the used [http.Client] completes with an error when making a REST call, | |
512 * this method will complete with the same error. | |
513 */ | |
514 async.Future<ListAvailableOrgPolicyConstraintsResponse> listAvailableOrgPolicy
Constraints(ListAvailableOrgPolicyConstraintsRequest request, core.String resour
ce) { | |
515 var _url = null; | |
516 var _queryParams = new core.Map(); | |
517 var _uploadMedia = null; | |
518 var _uploadOptions = null; | |
519 var _downloadOptions = commons.DownloadOptions.Metadata; | |
520 var _body = null; | |
521 | |
522 if (request != null) { | |
523 _body = convert.JSON.encode((request).toJson()); | |
524 } | |
525 if (resource == null) { | |
526 throw new core.ArgumentError("Parameter resource is required."); | |
527 } | |
528 | |
529 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':l
istAvailableOrgPolicyConstraints'; | |
530 | |
531 var _response = _requester.request(_url, | |
532 "POST", | |
533 body: _body, | |
534 queryParams: _queryParams, | |
535 uploadOptions: _uploadOptions, | |
536 uploadMedia: _uploadMedia, | |
537 downloadOptions: _downloadOptions); | |
538 return _response.then((data) => new ListAvailableOrgPolicyConstraintsRespons
e.fromJson(data)); | |
539 } | |
540 | |
541 /** | |
542 * Lists all the `Policies` set for a particular resource. | |
543 * | |
544 * [request] - The metadata request object. | |
545 * | |
546 * Request parameters: | |
547 * | |
548 * [resource] - Name of the resource to list Policies for. | |
549 * Value must have pattern "^organizations/[^/]+$". | |
550 * | |
551 * Completes with a [ListOrgPoliciesResponse]. | |
552 * | |
553 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
554 * error. | |
555 * | 61 * |
556 * If the used [http.Client] completes with an error when making a REST call, | 62 * If the used [http.Client] completes with an error when making a REST call, |
557 * this method will complete with the same error. | 63 * this method will complete with the same error. |
558 */ | 64 */ |
559 async.Future<ListOrgPoliciesResponse> listOrgPolicies(ListOrgPoliciesRequest r
equest, core.String resource) { | 65 async.Future<Organization> get(core.String name, {core.String organizationId})
{ |
560 var _url = null; | 66 var _url = null; |
561 var _queryParams = new core.Map(); | 67 var _queryParams = new core.Map(); |
562 var _uploadMedia = null; | 68 var _uploadMedia = null; |
563 var _uploadOptions = null; | 69 var _uploadOptions = null; |
564 var _downloadOptions = commons.DownloadOptions.Metadata; | 70 var _downloadOptions = commons.DownloadOptions.Metadata; |
565 var _body = null; | 71 var _body = null; |
566 | 72 |
567 if (request != null) { | 73 if (name == null) { |
568 _body = convert.JSON.encode((request).toJson()); | 74 throw new core.ArgumentError("Parameter name is required."); |
569 } | 75 } |
570 if (resource == null) { | 76 if (organizationId != null) { |
571 throw new core.ArgumentError("Parameter resource is required."); | 77 _queryParams["organizationId"] = [organizationId]; |
572 } | 78 } |
573 | 79 |
574 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':l
istOrgPolicies'; | 80 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
575 | 81 |
576 var _response = _requester.request(_url, | 82 var _response = _requester.request(_url, |
577 "POST", | 83 "GET", |
578 body: _body, | 84 body: _body, |
579 queryParams: _queryParams, | 85 queryParams: _queryParams, |
580 uploadOptions: _uploadOptions, | 86 uploadOptions: _uploadOptions, |
581 uploadMedia: _uploadMedia, | 87 uploadMedia: _uploadMedia, |
582 downloadOptions: _downloadOptions); | 88 downloadOptions: _downloadOptions); |
583 return _response.then((data) => new ListOrgPoliciesResponse.fromJson(data)); | 89 return _response.then((data) => new Organization.fromJson(data)); |
584 } | 90 } |
585 | 91 |
586 /** | 92 /** |
587 * Sets the access control policy on an Organization resource. Replaces any | 93 * Gets the access control policy for an Organization resource. May be empty |
588 * existing policy. The `resource` field should be the organization's resource | 94 * if no such policy or resource exists. The `resource` field should be the |
589 * name, e.g. "organizations/123". | 95 * organization's resource name, e.g. "organizations/123". |
590 * | 96 * |
591 * [request] - The metadata request object. | 97 * [request] - The metadata request object. |
592 * | 98 * |
593 * Request parameters: | 99 * Request parameters: |
594 * | 100 * |
595 * [resource] - REQUIRED: The resource for which the policy is being | 101 * [resource] - REQUIRED: The resource for which the policy is being |
596 * specified. | 102 * requested. |
597 * See the operation documentation for the appropriate value for this field. | 103 * See the operation documentation for the appropriate value for this field. |
598 * Value must have pattern "^organizations/[^/]+$". | 104 * Value must have pattern "^organizations/[^/]+$". |
599 * | 105 * |
600 * Completes with a [Policy]. | 106 * Completes with a [Policy]. |
601 * | 107 * |
602 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 108 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
603 * error. | 109 * error. |
604 * | 110 * |
605 * If the used [http.Client] completes with an error when making a REST call, | 111 * If the used [http.Client] completes with an error when making a REST call, |
606 * this method will complete with the same error. | 112 * this method will complete with the same error. |
607 */ | 113 */ |
608 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { | 114 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { |
609 var _url = null; | 115 var _url = null; |
610 var _queryParams = new core.Map(); | 116 var _queryParams = new core.Map(); |
611 var _uploadMedia = null; | 117 var _uploadMedia = null; |
612 var _uploadOptions = null; | 118 var _uploadOptions = null; |
613 var _downloadOptions = commons.DownloadOptions.Metadata; | 119 var _downloadOptions = commons.DownloadOptions.Metadata; |
614 var _body = null; | 120 var _body = null; |
615 | 121 |
616 if (request != null) { | 122 if (request != null) { |
617 _body = convert.JSON.encode((request).toJson()); | 123 _body = convert.JSON.encode((request).toJson()); |
618 } | 124 } |
619 if (resource == null) { | 125 if (resource == null) { |
620 throw new core.ArgumentError("Parameter resource is required."); | 126 throw new core.ArgumentError("Parameter resource is required."); |
621 } | 127 } |
622 | 128 |
623 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s
etIamPolicy'; | 129 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etIamPolicy'; |
624 | 130 |
625 var _response = _requester.request(_url, | 131 var _response = _requester.request(_url, |
626 "POST", | 132 "POST", |
627 body: _body, | 133 body: _body, |
628 queryParams: _queryParams, | 134 queryParams: _queryParams, |
629 uploadOptions: _uploadOptions, | 135 uploadOptions: _uploadOptions, |
630 uploadMedia: _uploadMedia, | 136 uploadMedia: _uploadMedia, |
631 downloadOptions: _downloadOptions); | 137 downloadOptions: _downloadOptions); |
632 return _response.then((data) => new Policy.fromJson(data)); | 138 return _response.then((data) => new Policy.fromJson(data)); |
633 } | 139 } |
634 | 140 |
635 /** | 141 /** |
636 * Updates the specified `Policy` on the resource. Creates a new `Policy` for | 142 * Lists Organization resources that are visible to the user and satisfy |
637 * that `Constraint` on the resource if one does not exist. | 143 * the specified filter. This method returns Organizations in an unspecified |
638 * | 144 * order. New Organizations do not necessarily appear at the end of the list. |
639 * Not supplying an `etag` on the request `Policy` results in an unconditional | |
640 * write of the `Policy`. | |
641 * | |
642 * [request] - The metadata request object. | |
643 * | 145 * |
644 * Request parameters: | 146 * Request parameters: |
645 * | 147 * |
646 * [resource] - Resource name of the resource to attach the `Policy`. | 148 * [pageToken] - A pagination token returned from a previous call to |
647 * Value must have pattern "^organizations/[^/]+$". | 149 * `ListOrganizations` |
| 150 * that indicates from where listing should continue. |
| 151 * This field is optional. |
648 * | 152 * |
649 * Completes with a [OrgPolicy]. | 153 * [pageSize] - The maximum number of Organizations to return in the response. |
| 154 * This field is optional. |
| 155 * |
| 156 * [filter] - An optional query string used to filter the Organizations to |
| 157 * return in |
| 158 * the response. Filter rules are case-insensitive. |
| 159 * |
| 160 * |
| 161 * Organizations may be filtered by `owner.directoryCustomerId` or by |
| 162 * `domain`, where the domain is a Google for Work domain, for example: |
| 163 * |
| 164 * |Filter|Description| |
| 165 * |------|-----------| |
| 166 * |owner.directorycustomerid:123456789|Organizations with |
| 167 * `owner.directory_customer_id` equal to `123456789`.| |
| 168 * |domain:google.com|Organizations corresponding to the domain `google.com`.| |
| 169 * |
| 170 * This field is optional. |
| 171 * |
| 172 * Completes with a [ListOrganizationsResponse]. |
650 * | 173 * |
651 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 174 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
652 * error. | 175 * error. |
653 * | 176 * |
654 * If the used [http.Client] completes with an error when making a REST call, | 177 * If the used [http.Client] completes with an error when making a REST call, |
655 * this method will complete with the same error. | 178 * this method will complete with the same error. |
656 */ | 179 */ |
657 async.Future<OrgPolicy> setOrgPolicy(SetOrgPolicyRequest request, core.String
resource) { | 180 async.Future<ListOrganizationsResponse> list({core.String pageToken, core.int
pageSize, core.String filter}) { |
658 var _url = null; | 181 var _url = null; |
659 var _queryParams = new core.Map(); | 182 var _queryParams = new core.Map(); |
660 var _uploadMedia = null; | 183 var _uploadMedia = null; |
661 var _uploadOptions = null; | 184 var _uploadOptions = null; |
662 var _downloadOptions = commons.DownloadOptions.Metadata; | 185 var _downloadOptions = commons.DownloadOptions.Metadata; |
663 var _body = null; | 186 var _body = null; |
664 | 187 |
665 if (request != null) { | 188 if (pageToken != null) { |
666 _body = convert.JSON.encode((request).toJson()); | 189 _queryParams["pageToken"] = [pageToken]; |
667 } | 190 } |
668 if (resource == null) { | 191 if (pageSize != null) { |
669 throw new core.ArgumentError("Parameter resource is required."); | 192 _queryParams["pageSize"] = ["${pageSize}"]; |
| 193 } |
| 194 if (filter != null) { |
| 195 _queryParams["filter"] = [filter]; |
670 } | 196 } |
671 | 197 |
672 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s
etOrgPolicy'; | 198 _url = 'v1beta1/organizations'; |
673 | 199 |
674 var _response = _requester.request(_url, | 200 var _response = _requester.request(_url, |
675 "POST", | 201 "GET", |
676 body: _body, | 202 body: _body, |
677 queryParams: _queryParams, | 203 queryParams: _queryParams, |
678 uploadOptions: _uploadOptions, | 204 uploadOptions: _uploadOptions, |
679 uploadMedia: _uploadMedia, | 205 uploadMedia: _uploadMedia, |
680 downloadOptions: _downloadOptions); | 206 downloadOptions: _downloadOptions); |
681 return _response.then((data) => new OrgPolicy.fromJson(data)); | 207 return _response.then((data) => new ListOrganizationsResponse.fromJson(data)
); |
682 } | 208 } |
683 | 209 |
684 /** | 210 /** |
685 * Updates the specified `Policy` on the resource. Creates a new `Policy` for | 211 * Sets the access control policy on an Organization resource. Replaces any |
686 * that `Constraint` on the resource if one does not exist. | 212 * existing policy. The `resource` field should be the organization's resource |
687 * | 213 * name, e.g. "organizations/123". |
688 * Not supplying an `etag` on the request `Policy` results in an unconditional | |
689 * write of the `Policy`. | |
690 * | 214 * |
691 * [request] - The metadata request object. | 215 * [request] - The metadata request object. |
692 * | 216 * |
693 * Request parameters: | 217 * Request parameters: |
694 * | 218 * |
695 * [resource] - Resource name of the resource to attach the `Policy`. | 219 * [resource] - REQUIRED: The resource for which the policy is being |
| 220 * specified. |
| 221 * See the operation documentation for the appropriate value for this field. |
696 * Value must have pattern "^organizations/[^/]+$". | 222 * Value must have pattern "^organizations/[^/]+$". |
697 * | 223 * |
698 * Completes with a [OrgPolicy]. | 224 * Completes with a [Policy]. |
699 * | 225 * |
700 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 226 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
701 * error. | 227 * error. |
702 * | 228 * |
703 * If the used [http.Client] completes with an error when making a REST call, | 229 * If the used [http.Client] completes with an error when making a REST call, |
704 * this method will complete with the same error. | 230 * this method will complete with the same error. |
705 */ | 231 */ |
706 async.Future<OrgPolicy> setOrgPolicyV1(SetOrgPolicyRequest request, core.Strin
g resource) { | 232 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { |
707 var _url = null; | 233 var _url = null; |
708 var _queryParams = new core.Map(); | 234 var _queryParams = new core.Map(); |
709 var _uploadMedia = null; | 235 var _uploadMedia = null; |
710 var _uploadOptions = null; | 236 var _uploadOptions = null; |
711 var _downloadOptions = commons.DownloadOptions.Metadata; | 237 var _downloadOptions = commons.DownloadOptions.Metadata; |
712 var _body = null; | 238 var _body = null; |
713 | 239 |
714 if (request != null) { | 240 if (request != null) { |
715 _body = convert.JSON.encode((request).toJson()); | 241 _body = convert.JSON.encode((request).toJson()); |
716 } | 242 } |
717 if (resource == null) { | 243 if (resource == null) { |
718 throw new core.ArgumentError("Parameter resource is required."); | 244 throw new core.ArgumentError("Parameter resource is required."); |
719 } | 245 } |
720 | 246 |
721 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s
etOrgPolicyV1'; | 247 _url = 'v1beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s
etIamPolicy'; |
722 | 248 |
723 var _response = _requester.request(_url, | 249 var _response = _requester.request(_url, |
724 "POST", | 250 "POST", |
725 body: _body, | 251 body: _body, |
726 queryParams: _queryParams, | 252 queryParams: _queryParams, |
727 uploadOptions: _uploadOptions, | 253 uploadOptions: _uploadOptions, |
728 uploadMedia: _uploadMedia, | 254 uploadMedia: _uploadMedia, |
729 downloadOptions: _downloadOptions); | 255 downloadOptions: _downloadOptions); |
730 return _response.then((data) => new OrgPolicy.fromJson(data)); | 256 return _response.then((data) => new Policy.fromJson(data)); |
731 } | 257 } |
732 | 258 |
733 /** | 259 /** |
734 * Returns permissions that a caller has on the specified Organization. | 260 * Returns permissions that a caller has on the specified Organization. |
735 * The `resource` field should be the organization's resource name, | 261 * The `resource` field should be the organization's resource name, |
736 * e.g. "organizations/123". | 262 * e.g. "organizations/123". |
737 * | 263 * |
738 * [request] - The metadata request object. | 264 * [request] - The metadata request object. |
739 * | 265 * |
740 * Request parameters: | 266 * Request parameters: |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 return _response.then((data) => new Policy.fromJson(data)); | 617 return _response.then((data) => new Policy.fromJson(data)); |
1092 } | 618 } |
1093 | 619 |
1094 /** | 620 /** |
1095 * Lists Projects that are visible to the user and satisfy the | 621 * Lists Projects that are visible to the user and satisfy the |
1096 * specified filter. This method returns Projects in an unspecified order. | 622 * specified filter. This method returns Projects in an unspecified order. |
1097 * New Projects do not necessarily appear at the end of the list. | 623 * New Projects do not necessarily appear at the end of the list. |
1098 * | 624 * |
1099 * Request parameters: | 625 * Request parameters: |
1100 * | 626 * |
1101 * [pageSize] - The maximum number of Projects to return in the response. | |
1102 * The server can return fewer Projects than requested. | |
1103 * If unspecified, server picks an appropriate default. | |
1104 * | |
1105 * Optional. | |
1106 * | |
1107 * [filter] - An expression for filtering the results of the request. Filter | 627 * [filter] - An expression for filtering the results of the request. Filter |
1108 * rules are | 628 * rules are |
1109 * case insensitive. The fields eligible for filtering are: | 629 * case insensitive. The fields eligible for filtering are: |
1110 * | 630 * |
1111 * + `name` | 631 * + `name` |
1112 * + `id` | 632 * + `id` |
1113 * + <code>labels.<em>key</em></code> where *key* is the name of a label | 633 * + <code>labels.<em>key</em></code> where *key* is the name of a label |
1114 * | 634 * |
1115 * Some examples of using labels as filters: | 635 * Some examples of using labels as filters: |
1116 * | 636 * |
1117 * |Filter|Description| | 637 * |Filter|Description| |
1118 * |------|-----------| | 638 * |------|-----------| |
1119 * |name:*|The project has a name.| | 639 * |name:how*|The project's name starts with "how".| |
1120 * |name:Howl|The project's name is `Howl` or `howl`.| | 640 * |name:Howl|The project's name is `Howl` or `howl`.| |
1121 * |name:HOWL|Equivalent to above.| | 641 * |name:HOWL|Equivalent to above.| |
1122 * |NAME:howl|Equivalent to above.| | 642 * |NAME:howl|Equivalent to above.| |
1123 * |labels.color:*|The project has the label `color`.| | 643 * |labels.color:*|The project has the label `color`.| |
1124 * |labels.color:red|The project's label `color` has the value `red`.| | 644 * |labels.color:red|The project's label `color` has the value `red`.| |
1125 * |labels.color:red labels.size:big|The project's label `color` has the | 645 * |labels.color:red labels.size:big|The project's label `color` has the |
1126 * value `red` and its label `size` has the value `big`. | 646 * value `red` and its label `size` has the value `big`. |
1127 * | 647 * |
1128 * Optional. | 648 * Optional. |
1129 * | 649 * |
1130 * [pageToken] - A pagination token returned from a previous call to | 650 * [pageToken] - A pagination token returned from a previous call to |
1131 * ListProjects | 651 * ListProjects |
1132 * that indicates from where listing should continue. | 652 * that indicates from where listing should continue. |
1133 * | 653 * |
1134 * Optional. | 654 * Optional. |
1135 * | 655 * |
| 656 * [pageSize] - The maximum number of Projects to return in the response. |
| 657 * The server can return fewer Projects than requested. |
| 658 * If unspecified, server picks an appropriate default. |
| 659 * |
| 660 * Optional. |
| 661 * |
1136 * Completes with a [ListProjectsResponse]. | 662 * Completes with a [ListProjectsResponse]. |
1137 * | 663 * |
1138 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 664 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
1139 * error. | 665 * error. |
1140 * | 666 * |
1141 * If the used [http.Client] completes with an error when making a REST call, | 667 * If the used [http.Client] completes with an error when making a REST call, |
1142 * this method will complete with the same error. | 668 * this method will complete with the same error. |
1143 */ | 669 */ |
1144 async.Future<ListProjectsResponse> list({core.int pageSize, core.String filter
, core.String pageToken}) { | 670 async.Future<ListProjectsResponse> list({core.String filter, core.String pageT
oken, core.int pageSize}) { |
1145 var _url = null; | 671 var _url = null; |
1146 var _queryParams = new core.Map(); | 672 var _queryParams = new core.Map(); |
1147 var _uploadMedia = null; | 673 var _uploadMedia = null; |
1148 var _uploadOptions = null; | 674 var _uploadOptions = null; |
1149 var _downloadOptions = commons.DownloadOptions.Metadata; | 675 var _downloadOptions = commons.DownloadOptions.Metadata; |
1150 var _body = null; | 676 var _body = null; |
1151 | 677 |
1152 if (pageSize != null) { | |
1153 _queryParams["pageSize"] = ["${pageSize}"]; | |
1154 } | |
1155 if (filter != null) { | 678 if (filter != null) { |
1156 _queryParams["filter"] = [filter]; | 679 _queryParams["filter"] = [filter]; |
1157 } | 680 } |
1158 if (pageToken != null) { | 681 if (pageToken != null) { |
1159 _queryParams["pageToken"] = [pageToken]; | 682 _queryParams["pageToken"] = [pageToken]; |
1160 } | 683 } |
| 684 if (pageSize != null) { |
| 685 _queryParams["pageSize"] = ["${pageSize}"]; |
| 686 } |
1161 | 687 |
1162 _url = 'v1beta1/projects'; | 688 _url = 'v1beta1/projects'; |
1163 | 689 |
1164 var _response = _requester.request(_url, | 690 var _response = _requester.request(_url, |
1165 "GET", | 691 "GET", |
1166 body: _body, | 692 body: _body, |
1167 queryParams: _queryParams, | 693 queryParams: _queryParams, |
1168 uploadOptions: _uploadOptions, | 694 uploadOptions: _uploadOptions, |
1169 uploadMedia: _uploadMedia, | 695 uploadMedia: _uploadMedia, |
1170 downloadOptions: _downloadOptions); | 696 downloadOptions: _downloadOptions); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 _json["resourceId"] = (resourceId).toJson(); | 949 _json["resourceId"] = (resourceId).toJson(); |
1424 } | 950 } |
1425 return _json; | 951 return _json; |
1426 } | 952 } |
1427 } | 953 } |
1428 | 954 |
1429 /** | 955 /** |
1430 * Specifies the audit configuration for a service. | 956 * Specifies the audit configuration for a service. |
1431 * The configuration determines which permission types are logged, and what | 957 * The configuration determines which permission types are logged, and what |
1432 * identities, if any, are exempted from logging. | 958 * identities, if any, are exempted from logging. |
1433 * An AuditConifg must have one or more AuditLogConfigs. | 959 * An AuditConfig must have one or more AuditLogConfigs. |
1434 * | 960 * |
1435 * If there are AuditConfigs for both `allServices` and a specific service, | 961 * If there are AuditConfigs for both `allServices` and a specific service, |
1436 * the union of the two AuditConfigs is used for that service: the log_types | 962 * the union of the two AuditConfigs is used for that service: the log_types |
1437 * specified in each AuditConfig are enabled, and the exempted_members in each | 963 * specified in each AuditConfig are enabled, and the exempted_members in each |
1438 * AuditConfig are exempted. | 964 * AuditConfig are exempted. |
| 965 * |
1439 * Example Policy with multiple AuditConfigs: | 966 * Example Policy with multiple AuditConfigs: |
1440 * { | 967 * |
1441 * "audit_configs": [ | |
1442 * { | 968 * { |
1443 * "service": "allServices" | 969 * "audit_configs": [ |
1444 * "audit_log_configs": [ | |
1445 * { | 970 * { |
1446 * "log_type": "DATA_READ", | 971 * "service": "allServices" |
1447 * "exempted_members": [ | 972 * "audit_log_configs": [ |
1448 * "user:foo@gmail.com" | 973 * { |
| 974 * "log_type": "DATA_READ", |
| 975 * "exempted_members": [ |
| 976 * "user:foo@gmail.com" |
| 977 * ] |
| 978 * }, |
| 979 * { |
| 980 * "log_type": "DATA_WRITE", |
| 981 * }, |
| 982 * { |
| 983 * "log_type": "ADMIN_READ", |
| 984 * } |
1449 * ] | 985 * ] |
1450 * }, | 986 * }, |
1451 * { | 987 * { |
1452 * "log_type": "DATA_WRITE", | 988 * "service": "fooservice.googleapis.com" |
1453 * }, | 989 * "audit_log_configs": [ |
1454 * { | 990 * { |
1455 * "log_type": "ADMIN_READ", | 991 * "log_type": "DATA_READ", |
1456 * } | 992 * }, |
1457 * ] | 993 * { |
1458 * }, | 994 * "log_type": "DATA_WRITE", |
1459 * { | 995 * "exempted_members": [ |
1460 * "service": "fooservice@googleapis.com" | 996 * "user:bar@gmail.com" |
1461 * "audit_log_configs": [ | 997 * ] |
1462 * { | 998 * } |
1463 * "log_type": "DATA_READ", | |
1464 * }, | |
1465 * { | |
1466 * "log_type": "DATA_WRITE", | |
1467 * "exempted_members": [ | |
1468 * "user:bar@gmail.com" | |
1469 * ] | 999 * ] |
1470 * } | 1000 * } |
1471 * ] | 1001 * ] |
1472 * } | 1002 * } |
1473 * ] | 1003 * |
1474 * } | |
1475 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ | 1004 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
1476 * logging. It also exempts foo@gmail.com from DATA_READ logging, and | 1005 * logging. It also exempts foo@gmail.com from DATA_READ logging, and |
1477 * bar@gmail.com from DATA_WRITE logging. | 1006 * bar@gmail.com from DATA_WRITE logging. |
1478 */ | 1007 */ |
1479 class AuditConfig { | 1008 class AuditConfig { |
1480 /** | 1009 /** |
1481 * The configuration for logging of each type of permission. | 1010 * The configuration for logging of each type of permission. |
1482 * Next ID: 4 | 1011 * Next ID: 4 |
1483 */ | 1012 */ |
1484 core.List<AuditLogConfig> auditLogConfigs; | 1013 core.List<AuditLogConfig> auditLogConfigs; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 core.Map toJson() { | 1149 core.Map toJson() { |
1621 var _json = new core.Map(); | 1150 var _json = new core.Map(); |
1622 if (members != null) { | 1151 if (members != null) { |
1623 _json["members"] = members; | 1152 _json["members"] = members; |
1624 } | 1153 } |
1625 if (role != null) { | 1154 if (role != null) { |
1626 _json["role"] = role; | 1155 _json["role"] = role; |
1627 } | 1156 } |
1628 return _json; | 1157 return _json; |
1629 } | 1158 } |
1630 } | |
1631 | |
1632 /** | |
1633 * A `Constraint` that is either enforced or not. | |
1634 * | |
1635 * For example a constraint `constraints/compute.disableSerialPortAccess`. | |
1636 * If it is enforced on a VM instance, serial port connections will not be | |
1637 * opened to that instance. | |
1638 */ | |
1639 class BooleanConstraint { | |
1640 | |
1641 BooleanConstraint(); | |
1642 | |
1643 BooleanConstraint.fromJson(core.Map _json) { | |
1644 } | |
1645 | |
1646 core.Map toJson() { | |
1647 var _json = new core.Map(); | |
1648 return _json; | |
1649 } | |
1650 } | |
1651 | |
1652 /** | |
1653 * Used in `policy_type` to specify how `boolean_policy` will behave at this | |
1654 * resource. | |
1655 */ | |
1656 class BooleanPolicy { | |
1657 /** | |
1658 * If `true`, then the `Policy` is enforced. If `false`, then any | |
1659 * configuration is acceptable. | |
1660 * | |
1661 * Suppose you have a `Constraint` | |
1662 * `constraints/compute.disableSerialPortAccess` | |
1663 * with `constraint_default` set to `ALLOW`. A `Policy` for that | |
1664 * `Constraint` exhibits the following behavior: | |
1665 * - If the `Policy` at this resource has enforced set to `false`, serial | |
1666 * port connection attempts will be allowed. | |
1667 * - If the `Policy` at this resource has enforced set to `true`, serial | |
1668 * port connection attempts will be refused. | |
1669 * - If the `Policy` at this resource is `RestoreDefault`, serial port | |
1670 * connection attempts will be allowed. | |
1671 * - If no `Policy` is set at this resource or anywhere higher in the | |
1672 * resource hierarchy, serial port connection attempts will be allowed. | |
1673 * - If no `Policy` is set at this resource, but one exists higher in the | |
1674 * resource hierarchy, the behavior is as if the`Policy` were set at | |
1675 * this resource. | |
1676 * | |
1677 * The following examples demonstrate the different possible layerings: | |
1678 * | |
1679 * Example 1 (nearest `Constraint` wins): | |
1680 * `organizations/foo` has a `Policy` with: | |
1681 * {enforced: false} | |
1682 * `projects/bar` has no `Policy` set. | |
1683 * The constraint at `projects/bar` and `organizations/foo` will not be | |
1684 * enforced. | |
1685 * | |
1686 * Example 2 (enforcement gets replaced): | |
1687 * `organizations/foo` has a `Policy` with: | |
1688 * {enforced: false} | |
1689 * `projects/bar` has a `Policy` with: | |
1690 * {enforced: true} | |
1691 * The constraint at `organizations/foo` is not enforced. | |
1692 * The constraint at `projects/bar` is enforced. | |
1693 * | |
1694 * Example 3 (RestoreDefault): | |
1695 * `organizations/foo` has a `Policy` with: | |
1696 * {enforced: true} | |
1697 * `projects/bar` has a `Policy` with: | |
1698 * {RestoreDefault: {}} | |
1699 * The constraint at `organizations/foo` is enforced. | |
1700 * The constraint at `projects/bar` is not enforced, because | |
1701 * `constraint_default` for the `Constraint` is `ALLOW`. | |
1702 */ | |
1703 core.bool enforced; | |
1704 | |
1705 BooleanPolicy(); | |
1706 | |
1707 BooleanPolicy.fromJson(core.Map _json) { | |
1708 if (_json.containsKey("enforced")) { | |
1709 enforced = _json["enforced"]; | |
1710 } | |
1711 } | |
1712 | |
1713 core.Map toJson() { | |
1714 var _json = new core.Map(); | |
1715 if (enforced != null) { | |
1716 _json["enforced"] = enforced; | |
1717 } | |
1718 return _json; | |
1719 } | |
1720 } | |
1721 | |
1722 /** The request sent to the ClearOrgPolicy method. */ | |
1723 class ClearOrgPolicyRequest { | |
1724 /** Name of the `Constraint` of the `Policy` to clear. */ | |
1725 core.String constraint; | |
1726 /** | |
1727 * The current version, for concurrency control. Not sending an `etag` | |
1728 * will cause the `Policy` to be cleared blindly. | |
1729 */ | |
1730 core.String etag; | |
1731 core.List<core.int> get etagAsBytes { | |
1732 return convert.BASE64.decode(etag); | |
1733 } | |
1734 | |
1735 void set etagAsBytes(core.List<core.int> _bytes) { | |
1736 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | |
1737 } | |
1738 | |
1739 ClearOrgPolicyRequest(); | |
1740 | |
1741 ClearOrgPolicyRequest.fromJson(core.Map _json) { | |
1742 if (_json.containsKey("constraint")) { | |
1743 constraint = _json["constraint"]; | |
1744 } | |
1745 if (_json.containsKey("etag")) { | |
1746 etag = _json["etag"]; | |
1747 } | |
1748 } | |
1749 | |
1750 core.Map toJson() { | |
1751 var _json = new core.Map(); | |
1752 if (constraint != null) { | |
1753 _json["constraint"] = constraint; | |
1754 } | |
1755 if (etag != null) { | |
1756 _json["etag"] = etag; | |
1757 } | |
1758 return _json; | |
1759 } | |
1760 } | |
1761 | |
1762 /** | |
1763 * A `Constraint` describes a way in which a resource's configuration can be | |
1764 * restricted. For example, it controls which cloud services can be activated | |
1765 * across an organization, or whether a Compute Engine instance can have | |
1766 * serial port connections established. `Constraints` can be configured by the | |
1767 * organization's policy adminstrator to fit the needs of the organzation by | |
1768 * setting Policies for `Constraints` at different locations in the | |
1769 * organization's resource hierarchy. Policies are inherited down the resource | |
1770 * hierarchy from higher levels, but can also be overridden. For details about | |
1771 * the inheritance rules please read about | |
1772 * Policies. | |
1773 * | |
1774 * `Constraints` have a default behavior determined by the `constraint_default` | |
1775 * field, which is the enforcement behavior that is used in the absence of a | |
1776 * `Policy` being defined or inherited for the resource in question. | |
1777 */ | |
1778 class Constraint { | |
1779 /** Defines this constraint as being a BooleanConstraint. */ | |
1780 BooleanConstraint booleanConstraint; | |
1781 /** | |
1782 * The evaluation behavior of this constraint in the absense of 'Policy'. | |
1783 * Possible string values are: | |
1784 * - "CONSTRAINT_DEFAULT_UNSPECIFIED" : This is only used for distinguishing | |
1785 * unset values and should never be | |
1786 * used. | |
1787 * - "ALLOW" : Indicate that all values are allowed for list constraints. | |
1788 * Indicate that enforcement is off for boolean constraints. | |
1789 * - "DENY" : Indicate that all values are denied for list constraints. | |
1790 * Indicate that enforcement is on for boolean constraints. | |
1791 */ | |
1792 core.String constraintDefault; | |
1793 /** | |
1794 * Detailed description of what this `Constraint` controls as well as how and | |
1795 * where it is enforced. | |
1796 * | |
1797 * Mutable. | |
1798 */ | |
1799 core.String description; | |
1800 /** | |
1801 * The human readable name. | |
1802 * | |
1803 * Mutable. | |
1804 */ | |
1805 core.String displayName; | |
1806 /** Defines this constraint as being a ListConstraint. */ | |
1807 ListConstraint listConstraint; | |
1808 /** | |
1809 * Immutable value, required to globally be unique. For example, | |
1810 * `constraints/serviceuser.services` | |
1811 */ | |
1812 core.String name; | |
1813 /** Version of the `Constraint`. Default version is 0; */ | |
1814 core.int version; | |
1815 | |
1816 Constraint(); | |
1817 | |
1818 Constraint.fromJson(core.Map _json) { | |
1819 if (_json.containsKey("booleanConstraint")) { | |
1820 booleanConstraint = new BooleanConstraint.fromJson(_json["booleanConstrain
t"]); | |
1821 } | |
1822 if (_json.containsKey("constraintDefault")) { | |
1823 constraintDefault = _json["constraintDefault"]; | |
1824 } | |
1825 if (_json.containsKey("description")) { | |
1826 description = _json["description"]; | |
1827 } | |
1828 if (_json.containsKey("displayName")) { | |
1829 displayName = _json["displayName"]; | |
1830 } | |
1831 if (_json.containsKey("listConstraint")) { | |
1832 listConstraint = new ListConstraint.fromJson(_json["listConstraint"]); | |
1833 } | |
1834 if (_json.containsKey("name")) { | |
1835 name = _json["name"]; | |
1836 } | |
1837 if (_json.containsKey("version")) { | |
1838 version = _json["version"]; | |
1839 } | |
1840 } | |
1841 | |
1842 core.Map toJson() { | |
1843 var _json = new core.Map(); | |
1844 if (booleanConstraint != null) { | |
1845 _json["booleanConstraint"] = (booleanConstraint).toJson(); | |
1846 } | |
1847 if (constraintDefault != null) { | |
1848 _json["constraintDefault"] = constraintDefault; | |
1849 } | |
1850 if (description != null) { | |
1851 _json["description"] = description; | |
1852 } | |
1853 if (displayName != null) { | |
1854 _json["displayName"] = displayName; | |
1855 } | |
1856 if (listConstraint != null) { | |
1857 _json["listConstraint"] = (listConstraint).toJson(); | |
1858 } | |
1859 if (name != null) { | |
1860 _json["name"] = name; | |
1861 } | |
1862 if (version != null) { | |
1863 _json["version"] = version; | |
1864 } | |
1865 return _json; | |
1866 } | |
1867 } | 1159 } |
1868 | 1160 |
1869 /** | 1161 /** |
1870 * A generic empty message that you can re-use to avoid defining duplicated | 1162 * A generic empty message that you can re-use to avoid defining duplicated |
1871 * empty messages in your APIs. A typical example is to use it as the request | 1163 * empty messages in your APIs. A typical example is to use it as the request |
1872 * or the response type of an API method. For instance: | 1164 * or the response type of an API method. For instance: |
1873 * | 1165 * |
1874 * service Foo { | 1166 * service Foo { |
1875 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 1167 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
1876 * } | 1168 * } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 * display_name constraint. | 1256 * display_name constraint. |
1965 * - "RESOURCE_DELETED" : The resource being moved has been deleted. | 1257 * - "RESOURCE_DELETED" : The resource being moved has been deleted. |
1966 * - "PARENT_DELETED" : The resource a folder was being added to has been | 1258 * - "PARENT_DELETED" : The resource a folder was being added to has been |
1967 * deleted. | 1259 * deleted. |
1968 * - "CYCLE_INTRODUCED_ERROR" : The attempted action would introduce cycle in | 1260 * - "CYCLE_INTRODUCED_ERROR" : The attempted action would introduce cycle in |
1969 * resource path. | 1261 * resource path. |
1970 * - "FOLDER_BEING_MOVED" : The attempted action would move a folder that is | 1262 * - "FOLDER_BEING_MOVED" : The attempted action would move a folder that is |
1971 * already being moved. | 1263 * already being moved. |
1972 * - "FOLDER_TO_DELETE_NON_EMPTY" : The folder the caller is trying to delete | 1264 * - "FOLDER_TO_DELETE_NON_EMPTY" : The folder the caller is trying to delete |
1973 * contains active resources. | 1265 * contains active resources. |
| 1266 * - "DELETED_FOLDER_HEIGHT_VIOLATION" : The attempted action would violate |
| 1267 * the max deleted folder depth |
| 1268 * constraint. |
1974 */ | 1269 */ |
1975 core.String errorMessageId; | 1270 core.String errorMessageId; |
1976 | 1271 |
1977 FolderOperationError(); | 1272 FolderOperationError(); |
1978 | 1273 |
1979 FolderOperationError.fromJson(core.Map _json) { | 1274 FolderOperationError.fromJson(core.Map _json) { |
1980 if (_json.containsKey("errorMessageId")) { | 1275 if (_json.containsKey("errorMessageId")) { |
1981 errorMessageId = _json["errorMessageId"]; | 1276 errorMessageId = _json["errorMessageId"]; |
1982 } | 1277 } |
1983 } | 1278 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2028 | 1323 |
2029 core.Map toJson() { | 1324 core.Map toJson() { |
2030 var _json = new core.Map(); | 1325 var _json = new core.Map(); |
2031 if (ancestor != null) { | 1326 if (ancestor != null) { |
2032 _json["ancestor"] = ancestor.map((value) => (value).toJson()).toList(); | 1327 _json["ancestor"] = ancestor.map((value) => (value).toJson()).toList(); |
2033 } | 1328 } |
2034 return _json; | 1329 return _json; |
2035 } | 1330 } |
2036 } | 1331 } |
2037 | 1332 |
2038 /** The request sent to the GetEffectiveOrgPolicy method. */ | |
2039 class GetEffectiveOrgPolicyRequest { | |
2040 /** The name of the `Constraint` to compute the effective `Policy`. */ | |
2041 core.String constraint; | |
2042 | |
2043 GetEffectiveOrgPolicyRequest(); | |
2044 | |
2045 GetEffectiveOrgPolicyRequest.fromJson(core.Map _json) { | |
2046 if (_json.containsKey("constraint")) { | |
2047 constraint = _json["constraint"]; | |
2048 } | |
2049 } | |
2050 | |
2051 core.Map toJson() { | |
2052 var _json = new core.Map(); | |
2053 if (constraint != null) { | |
2054 _json["constraint"] = constraint; | |
2055 } | |
2056 return _json; | |
2057 } | |
2058 } | |
2059 | |
2060 /** Request message for `GetIamPolicy` method. */ | 1333 /** Request message for `GetIamPolicy` method. */ |
2061 class GetIamPolicyRequest { | 1334 class GetIamPolicyRequest { |
2062 | 1335 |
2063 GetIamPolicyRequest(); | 1336 GetIamPolicyRequest(); |
2064 | 1337 |
2065 GetIamPolicyRequest.fromJson(core.Map _json) { | 1338 GetIamPolicyRequest.fromJson(core.Map _json) { |
2066 } | 1339 } |
2067 | 1340 |
2068 core.Map toJson() { | 1341 core.Map toJson() { |
2069 var _json = new core.Map(); | 1342 var _json = new core.Map(); |
2070 return _json; | 1343 return _json; |
2071 } | 1344 } |
2072 } | 1345 } |
2073 | 1346 |
2074 /** The request sent to the GetOrgPolicy method. */ | |
2075 class GetOrgPolicyRequest { | |
2076 /** Name of the `Constraint` to get the `Policy`. */ | |
2077 core.String constraint; | |
2078 | |
2079 GetOrgPolicyRequest(); | |
2080 | |
2081 GetOrgPolicyRequest.fromJson(core.Map _json) { | |
2082 if (_json.containsKey("constraint")) { | |
2083 constraint = _json["constraint"]; | |
2084 } | |
2085 } | |
2086 | |
2087 core.Map toJson() { | |
2088 var _json = new core.Map(); | |
2089 if (constraint != null) { | |
2090 _json["constraint"] = constraint; | |
2091 } | |
2092 return _json; | |
2093 } | |
2094 } | |
2095 | |
2096 /** | |
2097 * The request sent to the [ListAvailableOrgPolicyConstraints] | |
2098 * google.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method. | |
2099 */ | |
2100 class ListAvailableOrgPolicyConstraintsRequest { | |
2101 /** | |
2102 * Size of the pages to be returned. This is currently unsupported and will | |
2103 * be ignored. The server may at any point start using this field to limit | |
2104 * page size. | |
2105 */ | |
2106 core.int pageSize; | |
2107 /** | |
2108 * Page token used to retrieve the next page. This is currently unsupported | |
2109 * and will be ignored. The server may at any point start using this field. | |
2110 */ | |
2111 core.String pageToken; | |
2112 | |
2113 ListAvailableOrgPolicyConstraintsRequest(); | |
2114 | |
2115 ListAvailableOrgPolicyConstraintsRequest.fromJson(core.Map _json) { | |
2116 if (_json.containsKey("pageSize")) { | |
2117 pageSize = _json["pageSize"]; | |
2118 } | |
2119 if (_json.containsKey("pageToken")) { | |
2120 pageToken = _json["pageToken"]; | |
2121 } | |
2122 } | |
2123 | |
2124 core.Map toJson() { | |
2125 var _json = new core.Map(); | |
2126 if (pageSize != null) { | |
2127 _json["pageSize"] = pageSize; | |
2128 } | |
2129 if (pageToken != null) { | |
2130 _json["pageToken"] = pageToken; | |
2131 } | |
2132 return _json; | |
2133 } | |
2134 } | |
2135 | |
2136 /** | |
2137 * The response returned from the ListAvailableOrgPolicyConstraints method. | |
2138 * Returns all `Constraints` that could be set at this level of the hierarchy | |
2139 * (contrast with the response from `ListPolicies`, which returns all policies | |
2140 * which are set). | |
2141 */ | |
2142 class ListAvailableOrgPolicyConstraintsResponse { | |
2143 /** | |
2144 * The collection of constraints that are settable on the request resource. | |
2145 */ | |
2146 core.List<Constraint> constraints; | |
2147 /** Page token used to retrieve the next page. This is currently not used. */ | |
2148 core.String nextPageToken; | |
2149 | |
2150 ListAvailableOrgPolicyConstraintsResponse(); | |
2151 | |
2152 ListAvailableOrgPolicyConstraintsResponse.fromJson(core.Map _json) { | |
2153 if (_json.containsKey("constraints")) { | |
2154 constraints = _json["constraints"].map((value) => new Constraint.fromJson(
value)).toList(); | |
2155 } | |
2156 if (_json.containsKey("nextPageToken")) { | |
2157 nextPageToken = _json["nextPageToken"]; | |
2158 } | |
2159 } | |
2160 | |
2161 core.Map toJson() { | |
2162 var _json = new core.Map(); | |
2163 if (constraints != null) { | |
2164 _json["constraints"] = constraints.map((value) => (value).toJson()).toList
(); | |
2165 } | |
2166 if (nextPageToken != null) { | |
2167 _json["nextPageToken"] = nextPageToken; | |
2168 } | |
2169 return _json; | |
2170 } | |
2171 } | |
2172 | |
2173 /** | |
2174 * A `Constraint` that allows or disallows a list of string values, which are | |
2175 * configured by an Organization's policy administrator with a `Policy`. | |
2176 */ | |
2177 class ListConstraint { | |
2178 /** | |
2179 * Optional. The Google Cloud Console will try to default to a configuration | |
2180 * that matches the value specified in this `Constraint`. | |
2181 */ | |
2182 core.String suggestedValue; | |
2183 | |
2184 ListConstraint(); | |
2185 | |
2186 ListConstraint.fromJson(core.Map _json) { | |
2187 if (_json.containsKey("suggestedValue")) { | |
2188 suggestedValue = _json["suggestedValue"]; | |
2189 } | |
2190 } | |
2191 | |
2192 core.Map toJson() { | |
2193 var _json = new core.Map(); | |
2194 if (suggestedValue != null) { | |
2195 _json["suggestedValue"] = suggestedValue; | |
2196 } | |
2197 return _json; | |
2198 } | |
2199 } | |
2200 | |
2201 /** The request sent to the ListOrgPolicies method. */ | |
2202 class ListOrgPoliciesRequest { | |
2203 /** | |
2204 * Size of the pages to be returned. This is currently unsupported and will | |
2205 * be ignored. The server may at any point start using this field to limit | |
2206 * page size. | |
2207 */ | |
2208 core.int pageSize; | |
2209 /** | |
2210 * Page token used to retrieve the next page. This is currently unsupported | |
2211 * and will be ignored. The server may at any point start using this field. | |
2212 */ | |
2213 core.String pageToken; | |
2214 | |
2215 ListOrgPoliciesRequest(); | |
2216 | |
2217 ListOrgPoliciesRequest.fromJson(core.Map _json) { | |
2218 if (_json.containsKey("pageSize")) { | |
2219 pageSize = _json["pageSize"]; | |
2220 } | |
2221 if (_json.containsKey("pageToken")) { | |
2222 pageToken = _json["pageToken"]; | |
2223 } | |
2224 } | |
2225 | |
2226 core.Map toJson() { | |
2227 var _json = new core.Map(); | |
2228 if (pageSize != null) { | |
2229 _json["pageSize"] = pageSize; | |
2230 } | |
2231 if (pageToken != null) { | |
2232 _json["pageToken"] = pageToken; | |
2233 } | |
2234 return _json; | |
2235 } | |
2236 } | |
2237 | |
2238 /** | |
2239 * The response returned from the ListOrgPolicies method. It will be empty | |
2240 * if no `Policies` are set on the resource. | |
2241 */ | |
2242 class ListOrgPoliciesResponse { | |
2243 /** | |
2244 * Page token used to retrieve the next page. This is currently not used, but | |
2245 * the server may at any point start supplying a valid token. | |
2246 */ | |
2247 core.String nextPageToken; | |
2248 /** | |
2249 * The `Policies` that are set on the resource. It will be empty if no | |
2250 * `Policies` are set. | |
2251 */ | |
2252 core.List<OrgPolicy> policies; | |
2253 | |
2254 ListOrgPoliciesResponse(); | |
2255 | |
2256 ListOrgPoliciesResponse.fromJson(core.Map _json) { | |
2257 if (_json.containsKey("nextPageToken")) { | |
2258 nextPageToken = _json["nextPageToken"]; | |
2259 } | |
2260 if (_json.containsKey("policies")) { | |
2261 policies = _json["policies"].map((value) => new OrgPolicy.fromJson(value))
.toList(); | |
2262 } | |
2263 } | |
2264 | |
2265 core.Map toJson() { | |
2266 var _json = new core.Map(); | |
2267 if (nextPageToken != null) { | |
2268 _json["nextPageToken"] = nextPageToken; | |
2269 } | |
2270 if (policies != null) { | |
2271 _json["policies"] = policies.map((value) => (value).toJson()).toList(); | |
2272 } | |
2273 return _json; | |
2274 } | |
2275 } | |
2276 | |
2277 /** The response returned from the `ListOrganizations` method. */ | 1347 /** The response returned from the `ListOrganizations` method. */ |
2278 class ListOrganizationsResponse { | 1348 class ListOrganizationsResponse { |
2279 /** | 1349 /** |
2280 * A pagination token to be used to retrieve the next page of results. If the | 1350 * A pagination token to be used to retrieve the next page of results. If the |
2281 * result is too large to fit within the page size specified in the request, | 1351 * result is too large to fit within the page size specified in the request, |
2282 * this field will be set with a token that can be used to fetch the next page | 1352 * this field will be set with a token that can be used to fetch the next page |
2283 * of results. If this field is empty, it indicates that this response | 1353 * of results. If this field is empty, it indicates that this response |
2284 * contains the last page of results. | 1354 * contains the last page of results. |
2285 */ | 1355 */ |
2286 core.String nextPageToken; | 1356 core.String nextPageToken; |
(...skipping 19 matching lines...) Expand all Loading... |
2306 _json["nextPageToken"] = nextPageToken; | 1376 _json["nextPageToken"] = nextPageToken; |
2307 } | 1377 } |
2308 if (organizations != null) { | 1378 if (organizations != null) { |
2309 _json["organizations"] = organizations.map((value) => (value).toJson()).to
List(); | 1379 _json["organizations"] = organizations.map((value) => (value).toJson()).to
List(); |
2310 } | 1380 } |
2311 return _json; | 1381 return _json; |
2312 } | 1382 } |
2313 } | 1383 } |
2314 | 1384 |
2315 /** | 1385 /** |
2316 * Used in `policy_type` to specify how `list_policy` behaves at this | |
2317 * resource. | |
2318 * | |
2319 * A `ListPolicy` can define specific values that are allowed or denied by | |
2320 * setting either the `allowed_values` or `denied_values` fields. It can also | |
2321 * be used to allow or deny all values, by setting the `all_values` field. If | |
2322 * `all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of `allowed_values` | |
2323 * or `denied_values` must be set (attempting to set both or neither will | |
2324 * result in a failed request). If `all_values` is set to either `ALLOW` or | |
2325 * `DENY`, `allowed_values` and `denied_values` must be unset. | |
2326 */ | |
2327 class ListPolicy { | |
2328 /** | |
2329 * The policy all_values state. | |
2330 * Possible string values are: | |
2331 * - "ALL_VALUES_UNSPECIFIED" : Indicates that either allowed_values or | |
2332 * denied_values must be set. | |
2333 * - "ALLOW" : A policy with this set allows all values. | |
2334 * - "DENY" : A policy with this set denies all values. | |
2335 */ | |
2336 core.String allValues; | |
2337 /** | |
2338 * List of values allowed at this resource. an only be set if no values are | |
2339 * set for `denied_values` and `all_values` is set to | |
2340 * `ALL_VALUES_UNSPECIFIED`. | |
2341 */ | |
2342 core.List<core.String> allowedValues; | |
2343 /** | |
2344 * List of values denied at this resource. Can only be set if no values are | |
2345 * set for `allowed_values` and `all_values` is set to | |
2346 * `ALL_VALUES_UNSPECIFIED`. | |
2347 */ | |
2348 core.List<core.String> deniedValues; | |
2349 /** | |
2350 * Determines the inheritance behavior for this `Policy`. | |
2351 * | |
2352 * By default, a `ListPolicy` set at a resource supercedes any `Policy` set | |
2353 * anywhere up the resource hierarchy. However, if `inherit_from_parent` is | |
2354 * set to `true`, then the values from the effective `Policy` of the parent | |
2355 * resource are inherited, meaning the values set in this `Policy` are | |
2356 * added to the values inherited up the hierarchy. | |
2357 * | |
2358 * Setting `Policy` hierarchies that inherit both allowed values and denied | |
2359 * values isn't recommended in most circumstances to keep the configuration | |
2360 * simple and understandable. However, it is possible to set a `Policy` with | |
2361 * `allowed_values` set that inherits a `Policy` with `denied_values` set. | |
2362 * In this case, the values that are allowed must be in `allowed_values` and | |
2363 * not present in `denied_values`. | |
2364 * | |
2365 * For example, suppose you have a `Constraint` | |
2366 * `constraints/serviceuser.services`, which has a `constraint_type` of | |
2367 * `list_constraint`, and with `constraint_default` set to `ALLOW`. | |
2368 * Suppose that at the Organization level, a `Policy` is applied that | |
2369 * restricts the allowed API activations to {`E1`, `E2`}. Then, if a | |
2370 * `Policy` is applied to a project below the Organization that has | |
2371 * `inherit_from_parent` set to `false` and field all_values set to DENY, | |
2372 * then an attempt to activate any API will be denied. | |
2373 * | |
2374 * The following examples demonstrate different possible layerings: | |
2375 * | |
2376 * Example 1 (no inherited values): | |
2377 * `organizations/foo` has a `Policy` with values: | |
2378 * {allowed_values: “E1” allowed_values:”E2”} | |
2379 * ``projects/bar`` has `inherit_from_parent` `false` and values: | |
2380 * {allowed_values: "E3" allowed_values: "E4"} | |
2381 * The accepted values at `organizations/foo` are `E1`, `E2`. | |
2382 * The accepted values at `projects/bar` are `E3`, and `E4`. | |
2383 * | |
2384 * Example 2 (inherited values): | |
2385 * `organizations/foo` has a `Policy` with values: | |
2386 * {allowed_values: “E1” allowed_values:”E2”} | |
2387 * `projects/bar` has a `Policy` with values: | |
2388 * {value: “E3” value: ”E4” inherit_from_parent: true} | |
2389 * The accepted values at `organizations/foo` are `E1`, `E2`. | |
2390 * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. | |
2391 * | |
2392 * Example 3 (inheriting both allowed and denied values): | |
2393 * `organizations/foo` has a `Policy` with values: | |
2394 * {allowed_values: "E1" allowed_values: "E2"} | |
2395 * `projects/bar` has a `Policy` with: | |
2396 * {denied_values: "E1"} | |
2397 * The accepted values at `organizations/foo` are `E1`, `E2`. | |
2398 * The value accepted at `projects/bar` is `E2`. | |
2399 * | |
2400 * Example 4 (RestoreDefault): | |
2401 * `organizations/foo` has a `Policy` with values: | |
2402 * {allowed_values: “E1” allowed_values:”E2”} | |
2403 * `projects/bar` has a `Policy` with values: | |
2404 * {RestoreDefault: {}} | |
2405 * The accepted values at `organizations/foo` are `E1`, `E2`. | |
2406 * The accepted values at `projects/bar` are either all or none depending on | |
2407 * the value of `constraint_default` (if `ALLOW`, all; if | |
2408 * `DENY`, none). | |
2409 * | |
2410 * Example 5 (no policy inherits parent policy): | |
2411 * `organizations/foo` has no `Policy` set. | |
2412 * `projects/bar` has no `Policy` set. | |
2413 * The accepted values at both levels are either all or none depending on | |
2414 * the value of `constraint_default` (if `ALLOW`, all; if | |
2415 * `DENY`, none). | |
2416 * | |
2417 * Example 6 (ListConstraint allowing all): | |
2418 * `organizations/foo` has a `Policy` with values: | |
2419 * {allowed_values: “E1” allowed_values: ”E2”} | |
2420 * `projects/bar` has a `Policy` with: | |
2421 * {all: ALLOW} | |
2422 * The accepted values at `organizations/foo` are `E1`, E2`. | |
2423 * Any value is accepted at `projects/bar`. | |
2424 * | |
2425 * Example 7 (ListConstraint allowing none): | |
2426 * `organizations/foo` has a `Policy` with values: | |
2427 * {allowed_values: “E1” allowed_values: ”E2”} | |
2428 * `projects/bar` has a `Policy` with: | |
2429 * {all: DENY} | |
2430 * The accepted values at `organizations/foo` are `E1`, E2`. | |
2431 * No value is accepted at `projects/bar`. | |
2432 */ | |
2433 core.bool inheritFromParent; | |
2434 /** | |
2435 * Optional. The Google Cloud Console will try to default to a configuration | |
2436 * that matches the value specified in this `Policy`. If `suggested_value` | |
2437 * is not set, it will inherit the value specified higher in the hierarchy, | |
2438 * unless `inherit_from_parent` is `false`. | |
2439 */ | |
2440 core.String suggestedValue; | |
2441 | |
2442 ListPolicy(); | |
2443 | |
2444 ListPolicy.fromJson(core.Map _json) { | |
2445 if (_json.containsKey("allValues")) { | |
2446 allValues = _json["allValues"]; | |
2447 } | |
2448 if (_json.containsKey("allowedValues")) { | |
2449 allowedValues = _json["allowedValues"]; | |
2450 } | |
2451 if (_json.containsKey("deniedValues")) { | |
2452 deniedValues = _json["deniedValues"]; | |
2453 } | |
2454 if (_json.containsKey("inheritFromParent")) { | |
2455 inheritFromParent = _json["inheritFromParent"]; | |
2456 } | |
2457 if (_json.containsKey("suggestedValue")) { | |
2458 suggestedValue = _json["suggestedValue"]; | |
2459 } | |
2460 } | |
2461 | |
2462 core.Map toJson() { | |
2463 var _json = new core.Map(); | |
2464 if (allValues != null) { | |
2465 _json["allValues"] = allValues; | |
2466 } | |
2467 if (allowedValues != null) { | |
2468 _json["allowedValues"] = allowedValues; | |
2469 } | |
2470 if (deniedValues != null) { | |
2471 _json["deniedValues"] = deniedValues; | |
2472 } | |
2473 if (inheritFromParent != null) { | |
2474 _json["inheritFromParent"] = inheritFromParent; | |
2475 } | |
2476 if (suggestedValue != null) { | |
2477 _json["suggestedValue"] = suggestedValue; | |
2478 } | |
2479 return _json; | |
2480 } | |
2481 } | |
2482 | |
2483 /** | |
2484 * A page of the response received from the | 1386 * A page of the response received from the |
2485 * ListProjects | 1387 * ListProjects |
2486 * method. | 1388 * method. |
2487 * | 1389 * |
2488 * A paginated response where more pages are available has | 1390 * A paginated response where more pages are available has |
2489 * `next_page_token` set. This token can be used in a subsequent request to | 1391 * `next_page_token` set. This token can be used in a subsequent request to |
2490 * retrieve the next request page. | 1392 * retrieve the next request page. |
2491 */ | 1393 */ |
2492 class ListProjectsResponse { | 1394 class ListProjectsResponse { |
2493 /** | 1395 /** |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2527 _json["nextPageToken"] = nextPageToken; | 1429 _json["nextPageToken"] = nextPageToken; |
2528 } | 1430 } |
2529 if (projects != null) { | 1431 if (projects != null) { |
2530 _json["projects"] = projects.map((value) => (value).toJson()).toList(); | 1432 _json["projects"] = projects.map((value) => (value).toJson()).toList(); |
2531 } | 1433 } |
2532 return _json; | 1434 return _json; |
2533 } | 1435 } |
2534 } | 1436 } |
2535 | 1437 |
2536 /** | 1438 /** |
2537 * Defines a Cloud Organization `Policy` which is used to specify `Constraints` | |
2538 * for configurations of Cloud Platform resources. | |
2539 */ | |
2540 class OrgPolicy { | |
2541 /** For boolean `Constraints`, whether to enforce the `Constraint` or not. */ | |
2542 BooleanPolicy booleanPolicy; | |
2543 /** | |
2544 * The name of the `Constraint` the `Policy` is configuring, for example, | |
2545 * `constraints/serviceuser.services`. | |
2546 * | |
2547 * Immutable after creation. | |
2548 */ | |
2549 core.String constraint; | |
2550 /** | |
2551 * An opaque tag indicating the current version of the `Policy`, used for | |
2552 * concurrency control. | |
2553 * | |
2554 * When the `Policy` is returned from either a `GetPolicy` or a | |
2555 * `ListOrgPolicy` request, this `etag` indicates the version of the current | |
2556 * `Policy` to use when executing a read-modify-write loop. | |
2557 * | |
2558 * When the `Policy` is returned from a `GetEffectivePolicy` request, the | |
2559 * `etag` will be unset. | |
2560 * | |
2561 * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value | |
2562 * that was returned from a `GetOrgPolicy` request as part of a | |
2563 * read-modify-write loop for concurrency control. Not setting the `etag`in a | |
2564 * `SetOrgPolicy` request will result in an unconditional write of the | |
2565 * `Policy`. | |
2566 */ | |
2567 core.String etag; | |
2568 core.List<core.int> get etagAsBytes { | |
2569 return convert.BASE64.decode(etag); | |
2570 } | |
2571 | |
2572 void set etagAsBytes(core.List<core.int> _bytes) { | |
2573 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); | |
2574 } | |
2575 /** List of values either allowed or disallowed. */ | |
2576 ListPolicy listPolicy; | |
2577 /** | |
2578 * Restores the default behavior of the constraint; independent of | |
2579 * `Constraint` type. | |
2580 */ | |
2581 RestoreDefault restoreDefault; | |
2582 /** | |
2583 * The time stamp the `Policy` was previously updated. This is set by the | |
2584 * server, not specified by the caller, and represents the last time a call to | |
2585 * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will | |
2586 * be ignored. | |
2587 */ | |
2588 core.String updateTime; | |
2589 /** Version of the `Policy`. Default version is 0; */ | |
2590 core.int version; | |
2591 | |
2592 OrgPolicy(); | |
2593 | |
2594 OrgPolicy.fromJson(core.Map _json) { | |
2595 if (_json.containsKey("booleanPolicy")) { | |
2596 booleanPolicy = new BooleanPolicy.fromJson(_json["booleanPolicy"]); | |
2597 } | |
2598 if (_json.containsKey("constraint")) { | |
2599 constraint = _json["constraint"]; | |
2600 } | |
2601 if (_json.containsKey("etag")) { | |
2602 etag = _json["etag"]; | |
2603 } | |
2604 if (_json.containsKey("listPolicy")) { | |
2605 listPolicy = new ListPolicy.fromJson(_json["listPolicy"]); | |
2606 } | |
2607 if (_json.containsKey("restoreDefault")) { | |
2608 restoreDefault = new RestoreDefault.fromJson(_json["restoreDefault"]); | |
2609 } | |
2610 if (_json.containsKey("updateTime")) { | |
2611 updateTime = _json["updateTime"]; | |
2612 } | |
2613 if (_json.containsKey("version")) { | |
2614 version = _json["version"]; | |
2615 } | |
2616 } | |
2617 | |
2618 core.Map toJson() { | |
2619 var _json = new core.Map(); | |
2620 if (booleanPolicy != null) { | |
2621 _json["booleanPolicy"] = (booleanPolicy).toJson(); | |
2622 } | |
2623 if (constraint != null) { | |
2624 _json["constraint"] = constraint; | |
2625 } | |
2626 if (etag != null) { | |
2627 _json["etag"] = etag; | |
2628 } | |
2629 if (listPolicy != null) { | |
2630 _json["listPolicy"] = (listPolicy).toJson(); | |
2631 } | |
2632 if (restoreDefault != null) { | |
2633 _json["restoreDefault"] = (restoreDefault).toJson(); | |
2634 } | |
2635 if (updateTime != null) { | |
2636 _json["updateTime"] = updateTime; | |
2637 } | |
2638 if (version != null) { | |
2639 _json["version"] = version; | |
2640 } | |
2641 return _json; | |
2642 } | |
2643 } | |
2644 | |
2645 /** | |
2646 * The root node in the resource hierarchy to which a particular entity's | 1439 * The root node in the resource hierarchy to which a particular entity's |
2647 * (e.g., company) resources belong. | 1440 * (e.g., company) resources belong. |
2648 */ | 1441 */ |
2649 class Organization { | 1442 class Organization { |
2650 /** | 1443 /** |
2651 * Timestamp when the Organization was created. Assigned by the server. | 1444 * Timestamp when the Organization was created. Assigned by the server. |
2652 * @OutputOnly | 1445 * @OutputOnly |
2653 */ | 1446 */ |
2654 core.String creationTime; | 1447 core.String creationTime; |
2655 /** | 1448 /** |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3083 if (id != null) { | 1876 if (id != null) { |
3084 _json["id"] = id; | 1877 _json["id"] = id; |
3085 } | 1878 } |
3086 if (type != null) { | 1879 if (type != null) { |
3087 _json["type"] = type; | 1880 _json["type"] = type; |
3088 } | 1881 } |
3089 return _json; | 1882 return _json; |
3090 } | 1883 } |
3091 } | 1884 } |
3092 | 1885 |
3093 /** | |
3094 * Ignores policies set above this resource and restores the | |
3095 * `constraint_default` enforcement behavior of the specific `Constraint` at | |
3096 * this resource. | |
3097 * | |
3098 * Suppose that `constraint_default` is set to `ALLOW` for the | |
3099 * `Constraint` `constraints/serviceuser.services`. Suppose that organization | |
3100 * foo.com sets a `Policy` at their Organization resource node that restricts | |
3101 * the allowed service activations to deny all service activations. They | |
3102 * could then set a `Policy` with the `policy_type` `restore_default` on | |
3103 * several experimental projects, restoring the `constraint_default` | |
3104 * enforcement of the `Constraint` for only those projects, allowing those | |
3105 * projects to have all services activated. | |
3106 */ | |
3107 class RestoreDefault { | |
3108 | |
3109 RestoreDefault(); | |
3110 | |
3111 RestoreDefault.fromJson(core.Map _json) { | |
3112 } | |
3113 | |
3114 core.Map toJson() { | |
3115 var _json = new core.Map(); | |
3116 return _json; | |
3117 } | |
3118 } | |
3119 | |
3120 /** Request message for `SetIamPolicy` method. */ | 1886 /** Request message for `SetIamPolicy` method. */ |
3121 class SetIamPolicyRequest { | 1887 class SetIamPolicyRequest { |
3122 /** | 1888 /** |
3123 * REQUIRED: The complete policy to be applied to the `resource`. The size of | 1889 * REQUIRED: The complete policy to be applied to the `resource`. The size of |
3124 * the policy is limited to a few 10s of KB. An empty policy is a | 1890 * the policy is limited to a few 10s of KB. An empty policy is a |
3125 * valid policy but certain Cloud Platform services (such as Projects) | 1891 * valid policy but certain Cloud Platform services (such as Projects) |
3126 * might reject them. | 1892 * might reject them. |
3127 */ | 1893 */ |
3128 Policy policy; | 1894 Policy policy; |
3129 /** | 1895 /** |
(...skipping 21 matching lines...) Expand all Loading... |
3151 if (policy != null) { | 1917 if (policy != null) { |
3152 _json["policy"] = (policy).toJson(); | 1918 _json["policy"] = (policy).toJson(); |
3153 } | 1919 } |
3154 if (updateMask != null) { | 1920 if (updateMask != null) { |
3155 _json["updateMask"] = updateMask; | 1921 _json["updateMask"] = updateMask; |
3156 } | 1922 } |
3157 return _json; | 1923 return _json; |
3158 } | 1924 } |
3159 } | 1925 } |
3160 | 1926 |
3161 /** The request sent to the SetOrgPolicyRequest method. */ | |
3162 class SetOrgPolicyRequest { | |
3163 /** `Policy` to set on the resource. */ | |
3164 OrgPolicy policy; | |
3165 | |
3166 SetOrgPolicyRequest(); | |
3167 | |
3168 SetOrgPolicyRequest.fromJson(core.Map _json) { | |
3169 if (_json.containsKey("policy")) { | |
3170 policy = new OrgPolicy.fromJson(_json["policy"]); | |
3171 } | |
3172 } | |
3173 | |
3174 core.Map toJson() { | |
3175 var _json = new core.Map(); | |
3176 if (policy != null) { | |
3177 _json["policy"] = (policy).toJson(); | |
3178 } | |
3179 return _json; | |
3180 } | |
3181 } | |
3182 | |
3183 /** Request message for `TestIamPermissions` method. */ | 1927 /** Request message for `TestIamPermissions` method. */ |
3184 class TestIamPermissionsRequest { | 1928 class TestIamPermissionsRequest { |
3185 /** | 1929 /** |
3186 * The set of permissions to check for the `resource`. Permissions with | 1930 * The set of permissions to check for the `resource`. Permissions with |
3187 * wildcards (such as '*' or 'storage.*') are not allowed. For more | 1931 * wildcards (such as '*' or 'storage.*') are not allowed. For more |
3188 * information see | 1932 * information see |
3189 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). | 1933 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
3190 */ | 1934 */ |
3191 core.List<core.String> permissions; | 1935 core.List<core.String> permissions; |
3192 | 1936 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3241 UndeleteProjectRequest(); | 1985 UndeleteProjectRequest(); |
3242 | 1986 |
3243 UndeleteProjectRequest.fromJson(core.Map _json) { | 1987 UndeleteProjectRequest.fromJson(core.Map _json) { |
3244 } | 1988 } |
3245 | 1989 |
3246 core.Map toJson() { | 1990 core.Map toJson() { |
3247 var _json = new core.Map(); | 1991 var _json = new core.Map(); |
3248 return _json; | 1992 return _json; |
3249 } | 1993 } |
3250 } | 1994 } |
OLD | NEW |