OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.cloudresourcemanager.v2beta1; |
| 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 cloudresourcemanager/v2beta1'; |
| 16 |
| 17 /** |
| 18 * The Google Cloud Resource Manager API provides methods for creating, reading, |
| 19 * and updating project metadata. |
| 20 */ |
| 21 class CloudresourcemanagerApi { |
| 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 /** View your data across Google Cloud Platform services */ |
| 26 static const CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/clo
ud-platform.read-only"; |
| 27 |
| 28 |
| 29 final commons.ApiRequester _requester; |
| 30 |
| 31 FoldersResourceApi get folders => new FoldersResourceApi(_requester); |
| 32 |
| 33 CloudresourcemanagerApi(http.Client client, {core.String rootUrl: "https://clo
udresourcemanager.googleapis.com/", core.String servicePath: ""}) : |
| 34 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 35 } |
| 36 |
| 37 |
| 38 class FoldersResourceApi { |
| 39 final commons.ApiRequester _requester; |
| 40 |
| 41 FoldersResourceApi(commons.ApiRequester client) : |
| 42 _requester = client; |
| 43 |
| 44 /** |
| 45 * Creates a Folder in the resource hierarchy. |
| 46 * Returns an Operation which can be used to track the progress of the |
| 47 * folder creation workflow. |
| 48 * Upon success the Operation.response field will be populated with the |
| 49 * created Folder. |
| 50 * |
| 51 * In order to succeed, the addition of this new Folder must not violate |
| 52 * the Folder naming, height or fanout constraints. |
| 53 * + The Folder's display_name must be distinct from all other Folder's that |
| 54 * share its parent. |
| 55 * + The addition of the Folder must not cause the active Folder hierarchy |
| 56 * to exceed a height of 4. Note, the full active + deleted Folder hierarchy |
| 57 * is allowed to reach a height of 8; this provides additional headroom when |
| 58 * moving folders that contain deleted folders. |
| 59 * + The addition of the Folder must not cause the total number of Folders |
| 60 * under its parent to exceed 100. |
| 61 * |
| 62 * If the operation fails due to a folder constraint violation, |
| 63 * a PreconditionFailure explaining the violation will be returned. |
| 64 * If the failure occurs synchronously then the PreconditionFailure |
| 65 * will be returned via the Status.details field and if it occurs |
| 66 * asynchronously then the PreconditionFailure will be returned |
| 67 * via the the Operation.error field. |
| 68 * |
| 69 * The caller must have `resourcemanager.folders.create` permission on the |
| 70 * identified parent. |
| 71 * |
| 72 * [request] - The metadata request object. |
| 73 * |
| 74 * Request parameters: |
| 75 * |
| 76 * [parent] - The resource name of the new Folder's parent. |
| 77 * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. |
| 78 * |
| 79 * Completes with a [Operation]. |
| 80 * |
| 81 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 82 * error. |
| 83 * |
| 84 * If the used [http.Client] completes with an error when making a REST call, |
| 85 * this method will complete with the same error. |
| 86 */ |
| 87 async.Future<Operation> create(Folder request, {core.String parent}) { |
| 88 var _url = null; |
| 89 var _queryParams = new core.Map(); |
| 90 var _uploadMedia = null; |
| 91 var _uploadOptions = null; |
| 92 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 93 var _body = null; |
| 94 |
| 95 if (request != null) { |
| 96 _body = convert.JSON.encode((request).toJson()); |
| 97 } |
| 98 if (parent != null) { |
| 99 _queryParams["parent"] = [parent]; |
| 100 } |
| 101 |
| 102 _url = 'v2beta1/folders'; |
| 103 |
| 104 var _response = _requester.request(_url, |
| 105 "POST", |
| 106 body: _body, |
| 107 queryParams: _queryParams, |
| 108 uploadOptions: _uploadOptions, |
| 109 uploadMedia: _uploadMedia, |
| 110 downloadOptions: _downloadOptions); |
| 111 return _response.then((data) => new Operation.fromJson(data)); |
| 112 } |
| 113 |
| 114 /** |
| 115 * Requests deletion of a Folder. The Folder is moved into the |
| 116 * [DELETE_REQUESTED] state immediately, and is deleted approximately 30 days |
| 117 * later. This method may only be called on an empty Folder in the [ACTIVE] |
| 118 * state, where a Folder is empty if it doesn't contain any Folders or |
| 119 * Projects in the [ACTIVE] state. |
| 120 * The caller must have `resourcemanager.folders.delete` permission on the |
| 121 * identified folder. |
| 122 * |
| 123 * Request parameters: |
| 124 * |
| 125 * [name] - the resource name of the Folder to be deleted. |
| 126 * Must be of the form `folders/{folder_id}`. |
| 127 * Value must have pattern "^folders/[^/]+$". |
| 128 * |
| 129 * Completes with a [Folder]. |
| 130 * |
| 131 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 132 * error. |
| 133 * |
| 134 * If the used [http.Client] completes with an error when making a REST call, |
| 135 * this method will complete with the same error. |
| 136 */ |
| 137 async.Future<Folder> delete(core.String name) { |
| 138 var _url = null; |
| 139 var _queryParams = new core.Map(); |
| 140 var _uploadMedia = null; |
| 141 var _uploadOptions = null; |
| 142 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 143 var _body = null; |
| 144 |
| 145 if (name == null) { |
| 146 throw new core.ArgumentError("Parameter name is required."); |
| 147 } |
| 148 |
| 149 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 150 |
| 151 var _response = _requester.request(_url, |
| 152 "DELETE", |
| 153 body: _body, |
| 154 queryParams: _queryParams, |
| 155 uploadOptions: _uploadOptions, |
| 156 uploadMedia: _uploadMedia, |
| 157 downloadOptions: _downloadOptions); |
| 158 return _response.then((data) => new Folder.fromJson(data)); |
| 159 } |
| 160 |
| 161 /** |
| 162 * Retrieves a Folder identified by the supplied resource name. |
| 163 * Valid Folder resource names have the format `folders/{folder_id}` |
| 164 * (for example, `folders/1234`). |
| 165 * The caller must have `resourcemanager.folders.get` permission on the |
| 166 * identified folder. |
| 167 * |
| 168 * Request parameters: |
| 169 * |
| 170 * [name] - The resource name of the Folder to retrieve. |
| 171 * Must be of the form `folders/{folder_id}`. |
| 172 * Value must have pattern "^folders/[^/]+$". |
| 173 * |
| 174 * Completes with a [Folder]. |
| 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<Folder> get(core.String name) { |
| 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 (name == null) { |
| 191 throw new core.ArgumentError("Parameter name is required."); |
| 192 } |
| 193 |
| 194 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 195 |
| 196 var _response = _requester.request(_url, |
| 197 "GET", |
| 198 body: _body, |
| 199 queryParams: _queryParams, |
| 200 uploadOptions: _uploadOptions, |
| 201 uploadMedia: _uploadMedia, |
| 202 downloadOptions: _downloadOptions); |
| 203 return _response.then((data) => new Folder.fromJson(data)); |
| 204 } |
| 205 |
| 206 /** |
| 207 * Gets the access control policy for a Folder. The returned policy may be |
| 208 * empty if no such policy or resource exists. The `resource` field should |
| 209 * be the Folder's resource name, e.g. "folders/1234". |
| 210 * The caller must have `resourcemanager.folders.getIamPolicy` permission |
| 211 * on the identified folder. |
| 212 * |
| 213 * [request] - The metadata request object. |
| 214 * |
| 215 * Request parameters: |
| 216 * |
| 217 * [resource] - REQUIRED: The resource for which the policy is being |
| 218 * requested. |
| 219 * See the operation documentation for the appropriate value for this field. |
| 220 * Value must have pattern "^folders/[^/]+$". |
| 221 * |
| 222 * Completes with a [Policy]. |
| 223 * |
| 224 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 225 * error. |
| 226 * |
| 227 * If the used [http.Client] completes with an error when making a REST call, |
| 228 * this method will complete with the same error. |
| 229 */ |
| 230 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { |
| 231 var _url = null; |
| 232 var _queryParams = new core.Map(); |
| 233 var _uploadMedia = null; |
| 234 var _uploadOptions = null; |
| 235 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 236 var _body = null; |
| 237 |
| 238 if (request != null) { |
| 239 _body = convert.JSON.encode((request).toJson()); |
| 240 } |
| 241 if (resource == null) { |
| 242 throw new core.ArgumentError("Parameter resource is required."); |
| 243 } |
| 244 |
| 245 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':g
etIamPolicy'; |
| 246 |
| 247 var _response = _requester.request(_url, |
| 248 "POST", |
| 249 body: _body, |
| 250 queryParams: _queryParams, |
| 251 uploadOptions: _uploadOptions, |
| 252 uploadMedia: _uploadMedia, |
| 253 downloadOptions: _downloadOptions); |
| 254 return _response.then((data) => new Policy.fromJson(data)); |
| 255 } |
| 256 |
| 257 /** |
| 258 * Lists the Folders that are direct descendants of supplied parent resource. |
| 259 * List provides a strongly consistent view of the Folders underneath |
| 260 * the specified parent resource. |
| 261 * List returns Folders sorted based upon the (ascending) lexical ordering |
| 262 * of their display_name. |
| 263 * The caller must have `resourcemanager.folders.list` permission on the |
| 264 * identified parent. |
| 265 * |
| 266 * Request parameters: |
| 267 * |
| 268 * [showDeleted] - Controls whether Folders in the [DELETE_REQUESTED} state |
| 269 * should |
| 270 * be returned. |
| 271 * |
| 272 * [pageToken] - A pagination token returned from a previous call to |
| 273 * `ListFolders` |
| 274 * that indicates where this listing should continue from. |
| 275 * This field is optional. |
| 276 * |
| 277 * [pageSize] - The maximum number of Folders to return in the response. |
| 278 * This field is optional. |
| 279 * |
| 280 * [parent] - The resource name of the Organization or Folder whose Folders |
| 281 * are |
| 282 * being listed. |
| 283 * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. |
| 284 * Access to this method is controlled by checking the |
| 285 * `resourcemanager.folders.list` permission on the `parent`. |
| 286 * |
| 287 * Completes with a [ListFoldersResponse]. |
| 288 * |
| 289 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 290 * error. |
| 291 * |
| 292 * If the used [http.Client] completes with an error when making a REST call, |
| 293 * this method will complete with the same error. |
| 294 */ |
| 295 async.Future<ListFoldersResponse> list({core.bool showDeleted, core.String pag
eToken, core.int pageSize, core.String parent}) { |
| 296 var _url = null; |
| 297 var _queryParams = new core.Map(); |
| 298 var _uploadMedia = null; |
| 299 var _uploadOptions = null; |
| 300 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 301 var _body = null; |
| 302 |
| 303 if (showDeleted != null) { |
| 304 _queryParams["showDeleted"] = ["${showDeleted}"]; |
| 305 } |
| 306 if (pageToken != null) { |
| 307 _queryParams["pageToken"] = [pageToken]; |
| 308 } |
| 309 if (pageSize != null) { |
| 310 _queryParams["pageSize"] = ["${pageSize}"]; |
| 311 } |
| 312 if (parent != null) { |
| 313 _queryParams["parent"] = [parent]; |
| 314 } |
| 315 |
| 316 _url = 'v2beta1/folders'; |
| 317 |
| 318 var _response = _requester.request(_url, |
| 319 "GET", |
| 320 body: _body, |
| 321 queryParams: _queryParams, |
| 322 uploadOptions: _uploadOptions, |
| 323 uploadMedia: _uploadMedia, |
| 324 downloadOptions: _downloadOptions); |
| 325 return _response.then((data) => new ListFoldersResponse.fromJson(data)); |
| 326 } |
| 327 |
| 328 /** |
| 329 * Moves a Folder under a new resource parent. |
| 330 * Returns an Operation which can be used to track the progress of the |
| 331 * folder move workflow. |
| 332 * Upon success the Operation.response field will be populated with the |
| 333 * moved Folder. |
| 334 * Upon failure, a FolderOperationError categorizing the failure cause will |
| 335 * be returned - if the failure occurs synchronously then the |
| 336 * FolderOperationError will be returned via the Status.details field |
| 337 * and if it occurs asynchronously then the FolderOperation will be returned |
| 338 * via the the Operation.error field. |
| 339 * In addition, the Operation.metadata field will be populated with a |
| 340 * FolderOperation message as an aid to stateless clients. |
| 341 * Folder moves will be rejected if they violate either the naming, height |
| 342 * or fanout constraints described in the [CreateFolder] documentation. |
| 343 * The caller must have `resourcemanager.folders.move` permission on the |
| 344 * folder's current and proposed new parent. |
| 345 * |
| 346 * [request] - The metadata request object. |
| 347 * |
| 348 * Request parameters: |
| 349 * |
| 350 * [name] - The resource name of the Folder to move. |
| 351 * Must be of the form folders/{folder_id} |
| 352 * Value must have pattern "^folders/[^/]+$". |
| 353 * |
| 354 * Completes with a [Operation]. |
| 355 * |
| 356 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 357 * error. |
| 358 * |
| 359 * If the used [http.Client] completes with an error when making a REST call, |
| 360 * this method will complete with the same error. |
| 361 */ |
| 362 async.Future<Operation> move(MoveFolderRequest request, core.String name) { |
| 363 var _url = null; |
| 364 var _queryParams = new core.Map(); |
| 365 var _uploadMedia = null; |
| 366 var _uploadOptions = null; |
| 367 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 368 var _body = null; |
| 369 |
| 370 if (request != null) { |
| 371 _body = convert.JSON.encode((request).toJson()); |
| 372 } |
| 373 if (name == null) { |
| 374 throw new core.ArgumentError("Parameter name is required."); |
| 375 } |
| 376 |
| 377 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':move'
; |
| 378 |
| 379 var _response = _requester.request(_url, |
| 380 "POST", |
| 381 body: _body, |
| 382 queryParams: _queryParams, |
| 383 uploadOptions: _uploadOptions, |
| 384 uploadMedia: _uploadMedia, |
| 385 downloadOptions: _downloadOptions); |
| 386 return _response.then((data) => new Operation.fromJson(data)); |
| 387 } |
| 388 |
| 389 /** |
| 390 * Updates a Folder, changing its display_name. |
| 391 * Changes to the folder display_name will be rejected if they violate either |
| 392 * the display_name formatting rules or naming constraints described in |
| 393 * the [CreateFolder] documentation. |
| 394 * + The Folder's display name must start and end with a letter or digit, |
| 395 * may contain letters, digits, spaces, hyphens and underscores and can be |
| 396 * no longer than 30 characters. This is captured by the regular expression: |
| 397 * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. |
| 398 * The caller must have `resourcemanager.folders.update` permission on the |
| 399 * identified folder. |
| 400 * |
| 401 * If the update fails due to the unique name constraint then a |
| 402 * PreconditionFailure explaining this violation will be returned |
| 403 * in the Status.details field. |
| 404 * |
| 405 * [request] - The metadata request object. |
| 406 * |
| 407 * Request parameters: |
| 408 * |
| 409 * [name] - Output only. The resource name of the Folder. |
| 410 * Its format is `folders/{folder_id}`, for example: "folders/1234". |
| 411 * Value must have pattern "^folders/[^/]+$". |
| 412 * |
| 413 * [updateMask] - Fields to be updated. |
| 414 * Only the `display_name` can be updated. |
| 415 * |
| 416 * Completes with a [Folder]. |
| 417 * |
| 418 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 419 * error. |
| 420 * |
| 421 * If the used [http.Client] completes with an error when making a REST call, |
| 422 * this method will complete with the same error. |
| 423 */ |
| 424 async.Future<Folder> patch(Folder request, core.String name, {core.String upda
teMask}) { |
| 425 var _url = null; |
| 426 var _queryParams = new core.Map(); |
| 427 var _uploadMedia = null; |
| 428 var _uploadOptions = null; |
| 429 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 430 var _body = null; |
| 431 |
| 432 if (request != null) { |
| 433 _body = convert.JSON.encode((request).toJson()); |
| 434 } |
| 435 if (name == null) { |
| 436 throw new core.ArgumentError("Parameter name is required."); |
| 437 } |
| 438 if (updateMask != null) { |
| 439 _queryParams["updateMask"] = [updateMask]; |
| 440 } |
| 441 |
| 442 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 443 |
| 444 var _response = _requester.request(_url, |
| 445 "PATCH", |
| 446 body: _body, |
| 447 queryParams: _queryParams, |
| 448 uploadOptions: _uploadOptions, |
| 449 uploadMedia: _uploadMedia, |
| 450 downloadOptions: _downloadOptions); |
| 451 return _response.then((data) => new Folder.fromJson(data)); |
| 452 } |
| 453 |
| 454 /** |
| 455 * Search for folders that match specific filter criteria. |
| 456 * Search provides an eventually consistent view of the folders a user has |
| 457 * access to which meet the specified filter criteria. |
| 458 * |
| 459 * This will only return folders on which the caller has the |
| 460 * permission `resourcemanager.folders.get`. |
| 461 * |
| 462 * [request] - The metadata request object. |
| 463 * |
| 464 * Request parameters: |
| 465 * |
| 466 * Completes with a [SearchFoldersResponse]. |
| 467 * |
| 468 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 469 * error. |
| 470 * |
| 471 * If the used [http.Client] completes with an error when making a REST call, |
| 472 * this method will complete with the same error. |
| 473 */ |
| 474 async.Future<SearchFoldersResponse> search(SearchFoldersRequest request) { |
| 475 var _url = null; |
| 476 var _queryParams = new core.Map(); |
| 477 var _uploadMedia = null; |
| 478 var _uploadOptions = null; |
| 479 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 480 var _body = null; |
| 481 |
| 482 if (request != null) { |
| 483 _body = convert.JSON.encode((request).toJson()); |
| 484 } |
| 485 |
| 486 _url = 'v2beta1/folders:search'; |
| 487 |
| 488 var _response = _requester.request(_url, |
| 489 "POST", |
| 490 body: _body, |
| 491 queryParams: _queryParams, |
| 492 uploadOptions: _uploadOptions, |
| 493 uploadMedia: _uploadMedia, |
| 494 downloadOptions: _downloadOptions); |
| 495 return _response.then((data) => new SearchFoldersResponse.fromJson(data)); |
| 496 } |
| 497 |
| 498 /** |
| 499 * Sets the access control policy on a Folder, replacing any existing policy. |
| 500 * The `resource` field should be the Folder's resource name, e.g. |
| 501 * "folders/1234". |
| 502 * The caller must have `resourcemanager.folders.setIamPolicy` permission |
| 503 * on the identified folder. |
| 504 * |
| 505 * [request] - The metadata request object. |
| 506 * |
| 507 * Request parameters: |
| 508 * |
| 509 * [resource] - REQUIRED: The resource for which the policy is being |
| 510 * specified. |
| 511 * See the operation documentation for the appropriate value for this field. |
| 512 * Value must have pattern "^folders/[^/]+$". |
| 513 * |
| 514 * Completes with a [Policy]. |
| 515 * |
| 516 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 517 * error. |
| 518 * |
| 519 * If the used [http.Client] completes with an error when making a REST call, |
| 520 * this method will complete with the same error. |
| 521 */ |
| 522 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { |
| 523 var _url = null; |
| 524 var _queryParams = new core.Map(); |
| 525 var _uploadMedia = null; |
| 526 var _uploadOptions = null; |
| 527 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 528 var _body = null; |
| 529 |
| 530 if (request != null) { |
| 531 _body = convert.JSON.encode((request).toJson()); |
| 532 } |
| 533 if (resource == null) { |
| 534 throw new core.ArgumentError("Parameter resource is required."); |
| 535 } |
| 536 |
| 537 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':s
etIamPolicy'; |
| 538 |
| 539 var _response = _requester.request(_url, |
| 540 "POST", |
| 541 body: _body, |
| 542 queryParams: _queryParams, |
| 543 uploadOptions: _uploadOptions, |
| 544 uploadMedia: _uploadMedia, |
| 545 downloadOptions: _downloadOptions); |
| 546 return _response.then((data) => new Policy.fromJson(data)); |
| 547 } |
| 548 |
| 549 /** |
| 550 * Returns permissions that a caller has on the specified Folder. |
| 551 * The `resource` field should be the Folder's resource name, |
| 552 * e.g. "folders/1234". |
| 553 * |
| 554 * There are no permissions required for making this API call. |
| 555 * |
| 556 * [request] - The metadata request object. |
| 557 * |
| 558 * Request parameters: |
| 559 * |
| 560 * [resource] - REQUIRED: The resource for which the policy detail is being |
| 561 * requested. |
| 562 * See the operation documentation for the appropriate value for this field. |
| 563 * Value must have pattern "^folders/[^/]+$". |
| 564 * |
| 565 * Completes with a [TestIamPermissionsResponse]. |
| 566 * |
| 567 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 568 * error. |
| 569 * |
| 570 * If the used [http.Client] completes with an error when making a REST call, |
| 571 * this method will complete with the same error. |
| 572 */ |
| 573 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { |
| 574 var _url = null; |
| 575 var _queryParams = new core.Map(); |
| 576 var _uploadMedia = null; |
| 577 var _uploadOptions = null; |
| 578 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 579 var _body = null; |
| 580 |
| 581 if (request != null) { |
| 582 _body = convert.JSON.encode((request).toJson()); |
| 583 } |
| 584 if (resource == null) { |
| 585 throw new core.ArgumentError("Parameter resource is required."); |
| 586 } |
| 587 |
| 588 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$resource') + ':t
estIamPermissions'; |
| 589 |
| 590 var _response = _requester.request(_url, |
| 591 "POST", |
| 592 body: _body, |
| 593 queryParams: _queryParams, |
| 594 uploadOptions: _uploadOptions, |
| 595 uploadMedia: _uploadMedia, |
| 596 downloadOptions: _downloadOptions); |
| 597 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); |
| 598 } |
| 599 |
| 600 /** |
| 601 * Cancels the deletion request for a Folder. This method may only be |
| 602 * called on a Folder in the [DELETE_REQUESTED] state. |
| 603 * In order to succeed, the Folder's parent must be in the [ACTIVE] state. |
| 604 * In addition, reintroducing the folder into the tree must not violate |
| 605 * folder naming, height and fanout constraints described in the |
| 606 * [CreateFolder] documentation. |
| 607 * The caller must have `resourcemanager.folders.undelete` permission on the |
| 608 * identified folder. |
| 609 * |
| 610 * [request] - The metadata request object. |
| 611 * |
| 612 * Request parameters: |
| 613 * |
| 614 * [name] - The resource name of the Folder to undelete. |
| 615 * Must be of the form `folders/{folder_id}`. |
| 616 * Value must have pattern "^folders/[^/]+$". |
| 617 * |
| 618 * Completes with a [Folder]. |
| 619 * |
| 620 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 621 * error. |
| 622 * |
| 623 * If the used [http.Client] completes with an error when making a REST call, |
| 624 * this method will complete with the same error. |
| 625 */ |
| 626 async.Future<Folder> undelete(UndeleteFolderRequest request, core.String name)
{ |
| 627 var _url = null; |
| 628 var _queryParams = new core.Map(); |
| 629 var _uploadMedia = null; |
| 630 var _uploadOptions = null; |
| 631 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 632 var _body = null; |
| 633 |
| 634 if (request != null) { |
| 635 _body = convert.JSON.encode((request).toJson()); |
| 636 } |
| 637 if (name == null) { |
| 638 throw new core.ArgumentError("Parameter name is required."); |
| 639 } |
| 640 |
| 641 _url = 'v2beta1/' + commons.Escaper.ecapeVariableReserved('$name') + ':undel
ete'; |
| 642 |
| 643 var _response = _requester.request(_url, |
| 644 "POST", |
| 645 body: _body, |
| 646 queryParams: _queryParams, |
| 647 uploadOptions: _uploadOptions, |
| 648 uploadMedia: _uploadMedia, |
| 649 downloadOptions: _downloadOptions); |
| 650 return _response.then((data) => new Folder.fromJson(data)); |
| 651 } |
| 652 |
| 653 } |
| 654 |
| 655 |
| 656 |
| 657 /** |
| 658 * Specifies the audit configuration for a service. |
| 659 * The configuration determines which permission types are logged, and what |
| 660 * identities, if any, are exempted from logging. |
| 661 * An AuditConfig must have one or more AuditLogConfigs. |
| 662 * |
| 663 * If there are AuditConfigs for both `allServices` and a specific service, |
| 664 * the union of the two AuditConfigs is used for that service: the log_types |
| 665 * specified in each AuditConfig are enabled, and the exempted_members in each |
| 666 * AuditConfig are exempted. |
| 667 * |
| 668 * Example Policy with multiple AuditConfigs: |
| 669 * |
| 670 * { |
| 671 * "audit_configs": [ |
| 672 * { |
| 673 * "service": "allServices" |
| 674 * "audit_log_configs": [ |
| 675 * { |
| 676 * "log_type": "DATA_READ", |
| 677 * "exempted_members": [ |
| 678 * "user:foo@gmail.com" |
| 679 * ] |
| 680 * }, |
| 681 * { |
| 682 * "log_type": "DATA_WRITE", |
| 683 * }, |
| 684 * { |
| 685 * "log_type": "ADMIN_READ", |
| 686 * } |
| 687 * ] |
| 688 * }, |
| 689 * { |
| 690 * "service": "fooservice.googleapis.com" |
| 691 * "audit_log_configs": [ |
| 692 * { |
| 693 * "log_type": "DATA_READ", |
| 694 * }, |
| 695 * { |
| 696 * "log_type": "DATA_WRITE", |
| 697 * "exempted_members": [ |
| 698 * "user:bar@gmail.com" |
| 699 * ] |
| 700 * } |
| 701 * ] |
| 702 * } |
| 703 * ] |
| 704 * } |
| 705 * |
| 706 * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 707 * logging. It also exempts foo@gmail.com from DATA_READ logging, and |
| 708 * bar@gmail.com from DATA_WRITE logging. |
| 709 */ |
| 710 class AuditConfig { |
| 711 /** |
| 712 * The configuration for logging of each type of permission. |
| 713 * Next ID: 4 |
| 714 */ |
| 715 core.List<AuditLogConfig> auditLogConfigs; |
| 716 /** |
| 717 * Specifies a service that will be enabled for audit logging. |
| 718 * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 719 * `allServices` is a special value that covers all services. |
| 720 */ |
| 721 core.String service; |
| 722 |
| 723 AuditConfig(); |
| 724 |
| 725 AuditConfig.fromJson(core.Map _json) { |
| 726 if (_json.containsKey("auditLogConfigs")) { |
| 727 auditLogConfigs = _json["auditLogConfigs"].map((value) => new AuditLogConf
ig.fromJson(value)).toList(); |
| 728 } |
| 729 if (_json.containsKey("service")) { |
| 730 service = _json["service"]; |
| 731 } |
| 732 } |
| 733 |
| 734 core.Map<core.String, core.Object> toJson() { |
| 735 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 736 if (auditLogConfigs != null) { |
| 737 _json["auditLogConfigs"] = auditLogConfigs.map((value) => (value).toJson()
).toList(); |
| 738 } |
| 739 if (service != null) { |
| 740 _json["service"] = service; |
| 741 } |
| 742 return _json; |
| 743 } |
| 744 } |
| 745 |
| 746 /** |
| 747 * Provides the configuration for logging a type of permissions. |
| 748 * Example: |
| 749 * |
| 750 * { |
| 751 * "audit_log_configs": [ |
| 752 * { |
| 753 * "log_type": "DATA_READ", |
| 754 * "exempted_members": [ |
| 755 * "user:foo@gmail.com" |
| 756 * ] |
| 757 * }, |
| 758 * { |
| 759 * "log_type": "DATA_WRITE", |
| 760 * } |
| 761 * ] |
| 762 * } |
| 763 * |
| 764 * This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 765 * foo@gmail.com from DATA_READ logging. |
| 766 */ |
| 767 class AuditLogConfig { |
| 768 /** |
| 769 * Specifies the identities that do not cause logging for this type of |
| 770 * permission. |
| 771 * Follows the same format of Binding.members. |
| 772 */ |
| 773 core.List<core.String> exemptedMembers; |
| 774 /** |
| 775 * The log type that this config enables. |
| 776 * Possible string values are: |
| 777 * - "LOG_TYPE_UNSPECIFIED" : Default case. Should never be this. |
| 778 * - "ADMIN_READ" : Admin reads. Example: CloudIAM getIamPolicy |
| 779 * - "DATA_WRITE" : Data writes. Example: CloudSQL Users create |
| 780 * - "DATA_READ" : Data reads. Example: CloudSQL Users list |
| 781 */ |
| 782 core.String logType; |
| 783 |
| 784 AuditLogConfig(); |
| 785 |
| 786 AuditLogConfig.fromJson(core.Map _json) { |
| 787 if (_json.containsKey("exemptedMembers")) { |
| 788 exemptedMembers = _json["exemptedMembers"]; |
| 789 } |
| 790 if (_json.containsKey("logType")) { |
| 791 logType = _json["logType"]; |
| 792 } |
| 793 } |
| 794 |
| 795 core.Map<core.String, core.Object> toJson() { |
| 796 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 797 if (exemptedMembers != null) { |
| 798 _json["exemptedMembers"] = exemptedMembers; |
| 799 } |
| 800 if (logType != null) { |
| 801 _json["logType"] = logType; |
| 802 } |
| 803 return _json; |
| 804 } |
| 805 } |
| 806 |
| 807 /** Associates `members` with a `role`. */ |
| 808 class Binding { |
| 809 /** |
| 810 * Specifies the identities requesting access for a Cloud Platform resource. |
| 811 * `members` can have the following values: |
| 812 * |
| 813 * * `allUsers`: A special identifier that represents anyone who is |
| 814 * on the internet; with or without a Google account. |
| 815 * |
| 816 * * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 817 * who is authenticated with a Google account or a service account. |
| 818 * |
| 819 * * `user:{emailid}`: An email address that represents a specific Google |
| 820 * account. For example, `alice@gmail.com` or `joe@example.com`. |
| 821 * |
| 822 * |
| 823 * * `serviceAccount:{emailid}`: An email address that represents a service |
| 824 * account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 825 * |
| 826 * * `group:{emailid}`: An email address that represents a Google group. |
| 827 * For example, `admins@example.com`. |
| 828 * |
| 829 * |
| 830 * * `domain:{domain}`: A Google Apps domain name that represents all the |
| 831 * users of that domain. For example, `google.com` or `example.com`. |
| 832 */ |
| 833 core.List<core.String> members; |
| 834 /** |
| 835 * Role that is assigned to `members`. |
| 836 * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
| 837 * Required |
| 838 */ |
| 839 core.String role; |
| 840 |
| 841 Binding(); |
| 842 |
| 843 Binding.fromJson(core.Map _json) { |
| 844 if (_json.containsKey("members")) { |
| 845 members = _json["members"]; |
| 846 } |
| 847 if (_json.containsKey("role")) { |
| 848 role = _json["role"]; |
| 849 } |
| 850 } |
| 851 |
| 852 core.Map<core.String, core.Object> toJson() { |
| 853 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 854 if (members != null) { |
| 855 _json["members"] = members; |
| 856 } |
| 857 if (role != null) { |
| 858 _json["role"] = role; |
| 859 } |
| 860 return _json; |
| 861 } |
| 862 } |
| 863 |
| 864 /** |
| 865 * A Folder in an Organization's resource hierarchy, used to |
| 866 * organize that Organization's resources. |
| 867 */ |
| 868 class Folder { |
| 869 /** |
| 870 * Output only. Timestamp when the Folder was created. Assigned by the server. |
| 871 */ |
| 872 core.String createTime; |
| 873 /** |
| 874 * The folder’s display name. |
| 875 * A folder’s display name must be unique amongst its siblings, e.g. |
| 876 * no two folders with the same parent can share the same display name. |
| 877 * The display name must start and end with a letter or digit, may contain |
| 878 * letters, digits, spaces, hyphens and underscores and can be no longer |
| 879 * than 30 characters. This is captured by the regular expression: |
| 880 * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. |
| 881 */ |
| 882 core.String displayName; |
| 883 /** |
| 884 * Output only. The lifecycle state of the folder. |
| 885 * Updates to the lifecycle_state must be performed via |
| 886 * [DeleteFolder] and [UndeleteFolder]. |
| 887 * Possible string values are: |
| 888 * - "LIFECYCLE_STATE_UNSPECIFIED" : Unspecified state. |
| 889 * - "ACTIVE" : The normal and active state. |
| 890 * - "DELETE_REQUESTED" : The folder has been marked for deletion by the user. |
| 891 */ |
| 892 core.String lifecycleState; |
| 893 /** |
| 894 * Output only. The resource name of the Folder. |
| 895 * Its format is `folders/{folder_id}`, for example: "folders/1234". |
| 896 */ |
| 897 core.String name; |
| 898 /** |
| 899 * The Folder’s parent's resource name. |
| 900 * Updates to the folder's parent must be performed via [MoveFolders]. |
| 901 */ |
| 902 core.String parent; |
| 903 |
| 904 Folder(); |
| 905 |
| 906 Folder.fromJson(core.Map _json) { |
| 907 if (_json.containsKey("createTime")) { |
| 908 createTime = _json["createTime"]; |
| 909 } |
| 910 if (_json.containsKey("displayName")) { |
| 911 displayName = _json["displayName"]; |
| 912 } |
| 913 if (_json.containsKey("lifecycleState")) { |
| 914 lifecycleState = _json["lifecycleState"]; |
| 915 } |
| 916 if (_json.containsKey("name")) { |
| 917 name = _json["name"]; |
| 918 } |
| 919 if (_json.containsKey("parent")) { |
| 920 parent = _json["parent"]; |
| 921 } |
| 922 } |
| 923 |
| 924 core.Map<core.String, core.Object> toJson() { |
| 925 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 926 if (createTime != null) { |
| 927 _json["createTime"] = createTime; |
| 928 } |
| 929 if (displayName != null) { |
| 930 _json["displayName"] = displayName; |
| 931 } |
| 932 if (lifecycleState != null) { |
| 933 _json["lifecycleState"] = lifecycleState; |
| 934 } |
| 935 if (name != null) { |
| 936 _json["name"] = name; |
| 937 } |
| 938 if (parent != null) { |
| 939 _json["parent"] = parent; |
| 940 } |
| 941 return _json; |
| 942 } |
| 943 } |
| 944 |
| 945 /** Metadata describing a long running folder operation */ |
| 946 class FolderOperation { |
| 947 /** |
| 948 * The resource name of the folder or organization we are either creating |
| 949 * the folder under or moving the folder to. |
| 950 */ |
| 951 core.String destinationParent; |
| 952 /** The display name of the folder. */ |
| 953 core.String displayName; |
| 954 /** |
| 955 * The type of this operation. |
| 956 * Possible string values are: |
| 957 * - "OPERATION_TYPE_UNSPECIFIED" : Operation type not specified. |
| 958 * - "CREATE" : A create folder operation. |
| 959 * - "MOVE" : A move folder operation. |
| 960 */ |
| 961 core.String operationType; |
| 962 /** |
| 963 * The resource name of the folder's parent. |
| 964 * Only applicable when the operation_type is MOVE. |
| 965 */ |
| 966 core.String sourceParent; |
| 967 |
| 968 FolderOperation(); |
| 969 |
| 970 FolderOperation.fromJson(core.Map _json) { |
| 971 if (_json.containsKey("destinationParent")) { |
| 972 destinationParent = _json["destinationParent"]; |
| 973 } |
| 974 if (_json.containsKey("displayName")) { |
| 975 displayName = _json["displayName"]; |
| 976 } |
| 977 if (_json.containsKey("operationType")) { |
| 978 operationType = _json["operationType"]; |
| 979 } |
| 980 if (_json.containsKey("sourceParent")) { |
| 981 sourceParent = _json["sourceParent"]; |
| 982 } |
| 983 } |
| 984 |
| 985 core.Map<core.String, core.Object> toJson() { |
| 986 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 987 if (destinationParent != null) { |
| 988 _json["destinationParent"] = destinationParent; |
| 989 } |
| 990 if (displayName != null) { |
| 991 _json["displayName"] = displayName; |
| 992 } |
| 993 if (operationType != null) { |
| 994 _json["operationType"] = operationType; |
| 995 } |
| 996 if (sourceParent != null) { |
| 997 _json["sourceParent"] = sourceParent; |
| 998 } |
| 999 return _json; |
| 1000 } |
| 1001 } |
| 1002 |
| 1003 /** A classification of the Folder Operation error. */ |
| 1004 class FolderOperationError { |
| 1005 /** |
| 1006 * The type of operation error experienced. |
| 1007 * Possible string values are: |
| 1008 * - "ERROR_TYPE_UNSPECIFIED" : The error type was unrecognized or |
| 1009 * unspecified. |
| 1010 * - "ACTIVE_FOLDER_HEIGHT_VIOLATION" : The attempted action would violate the |
| 1011 * max folder depth constraint. |
| 1012 * - "MAX_CHILD_FOLDERS_VIOLATION" : The attempted action would violate the |
| 1013 * max child folders constraint. |
| 1014 * - "FOLDER_NAME_UNIQUENESS_VIOLATION" : The attempted action would violate |
| 1015 * the locally-unique folder |
| 1016 * display_name constraint. |
| 1017 * - "RESOURCE_DELETED_VIOLATION" : The resource being moved has been deleted. |
| 1018 * - "PARENT_DELETED_VIOLATION" : The resource a folder was being added to has |
| 1019 * been deleted. |
| 1020 * - "CYCLE_INTRODUCED_VIOLATION" : The attempted action would introduce cycle |
| 1021 * in resource path. |
| 1022 * - "FOLDER_BEING_MOVED_VIOLATION" : The attempted action would move a folder |
| 1023 * that is already being moved. |
| 1024 * - "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" : The folder the caller is trying |
| 1025 * to delete contains active resources. |
| 1026 * - "DELETED_FOLDER_HEIGHT_VIOLATION" : The attempted action would violate |
| 1027 * the max deleted folder depth |
| 1028 * constraint. |
| 1029 */ |
| 1030 core.String errorMessageId; |
| 1031 |
| 1032 FolderOperationError(); |
| 1033 |
| 1034 FolderOperationError.fromJson(core.Map _json) { |
| 1035 if (_json.containsKey("errorMessageId")) { |
| 1036 errorMessageId = _json["errorMessageId"]; |
| 1037 } |
| 1038 } |
| 1039 |
| 1040 core.Map<core.String, core.Object> toJson() { |
| 1041 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1042 if (errorMessageId != null) { |
| 1043 _json["errorMessageId"] = errorMessageId; |
| 1044 } |
| 1045 return _json; |
| 1046 } |
| 1047 } |
| 1048 |
| 1049 /** Request message for `GetIamPolicy` method. */ |
| 1050 class GetIamPolicyRequest { |
| 1051 |
| 1052 GetIamPolicyRequest(); |
| 1053 |
| 1054 GetIamPolicyRequest.fromJson(core.Map _json) { |
| 1055 } |
| 1056 |
| 1057 core.Map<core.String, core.Object> toJson() { |
| 1058 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1059 return _json; |
| 1060 } |
| 1061 } |
| 1062 |
| 1063 /** The ListFolders response message. */ |
| 1064 class ListFoldersResponse { |
| 1065 /** |
| 1066 * A possibly paginated list of Folders that are direct descendants of |
| 1067 * the specified parent resource. |
| 1068 */ |
| 1069 core.List<Folder> folders; |
| 1070 /** |
| 1071 * A pagination token returned from a previous call to `ListFolders` |
| 1072 * that indicates from where listing should continue. |
| 1073 * This field is optional. |
| 1074 */ |
| 1075 core.String nextPageToken; |
| 1076 |
| 1077 ListFoldersResponse(); |
| 1078 |
| 1079 ListFoldersResponse.fromJson(core.Map _json) { |
| 1080 if (_json.containsKey("folders")) { |
| 1081 folders = _json["folders"].map((value) => new Folder.fromJson(value)).toLi
st(); |
| 1082 } |
| 1083 if (_json.containsKey("nextPageToken")) { |
| 1084 nextPageToken = _json["nextPageToken"]; |
| 1085 } |
| 1086 } |
| 1087 |
| 1088 core.Map<core.String, core.Object> toJson() { |
| 1089 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1090 if (folders != null) { |
| 1091 _json["folders"] = folders.map((value) => (value).toJson()).toList(); |
| 1092 } |
| 1093 if (nextPageToken != null) { |
| 1094 _json["nextPageToken"] = nextPageToken; |
| 1095 } |
| 1096 return _json; |
| 1097 } |
| 1098 } |
| 1099 |
| 1100 /** The MoveFolder request message. */ |
| 1101 class MoveFolderRequest { |
| 1102 /** |
| 1103 * The resource name of the Folder or Organization to reparent |
| 1104 * the folder under. |
| 1105 * Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. |
| 1106 */ |
| 1107 core.String destinationParent; |
| 1108 |
| 1109 MoveFolderRequest(); |
| 1110 |
| 1111 MoveFolderRequest.fromJson(core.Map _json) { |
| 1112 if (_json.containsKey("destinationParent")) { |
| 1113 destinationParent = _json["destinationParent"]; |
| 1114 } |
| 1115 } |
| 1116 |
| 1117 core.Map<core.String, core.Object> toJson() { |
| 1118 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1119 if (destinationParent != null) { |
| 1120 _json["destinationParent"] = destinationParent; |
| 1121 } |
| 1122 return _json; |
| 1123 } |
| 1124 } |
| 1125 |
| 1126 /** |
| 1127 * This resource represents a long-running operation that is the result of a |
| 1128 * network API call. |
| 1129 */ |
| 1130 class Operation { |
| 1131 /** |
| 1132 * If the value is `false`, it means the operation is still in progress. |
| 1133 * If true, the operation is completed, and either `error` or `response` is |
| 1134 * available. |
| 1135 */ |
| 1136 core.bool done; |
| 1137 /** The error result of the operation in case of failure or cancellation. */ |
| 1138 Status error; |
| 1139 /** |
| 1140 * Service-specific metadata associated with the operation. It typically |
| 1141 * contains progress information and common metadata such as create time. |
| 1142 * Some services might not provide such metadata. Any method that returns a |
| 1143 * long-running operation should document the metadata type, if any. |
| 1144 * |
| 1145 * The values for Object must be JSON objects. It can consist of `num`, |
| 1146 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1147 */ |
| 1148 core.Map<core.String, core.Object> metadata; |
| 1149 /** |
| 1150 * The server-assigned name, which is only unique within the same service that |
| 1151 * originally returns it. If you use the default HTTP mapping, the |
| 1152 * `name` should have the format of `operations/some/unique/name`. |
| 1153 */ |
| 1154 core.String name; |
| 1155 /** |
| 1156 * The normal response of the operation in case of success. If the original |
| 1157 * method returns no data on success, such as `Delete`, the response is |
| 1158 * `google.protobuf.Empty`. If the original method is standard |
| 1159 * `Get`/`Create`/`Update`, the response should be the resource. For other |
| 1160 * methods, the response should have the type `XxxResponse`, where `Xxx` |
| 1161 * is the original method name. For example, if the original method name |
| 1162 * is `TakeSnapshot()`, the inferred response type is |
| 1163 * `TakeSnapshotResponse`. |
| 1164 * |
| 1165 * The values for Object must be JSON objects. It can consist of `num`, |
| 1166 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1167 */ |
| 1168 core.Map<core.String, core.Object> response; |
| 1169 |
| 1170 Operation(); |
| 1171 |
| 1172 Operation.fromJson(core.Map _json) { |
| 1173 if (_json.containsKey("done")) { |
| 1174 done = _json["done"]; |
| 1175 } |
| 1176 if (_json.containsKey("error")) { |
| 1177 error = new Status.fromJson(_json["error"]); |
| 1178 } |
| 1179 if (_json.containsKey("metadata")) { |
| 1180 metadata = _json["metadata"]; |
| 1181 } |
| 1182 if (_json.containsKey("name")) { |
| 1183 name = _json["name"]; |
| 1184 } |
| 1185 if (_json.containsKey("response")) { |
| 1186 response = _json["response"]; |
| 1187 } |
| 1188 } |
| 1189 |
| 1190 core.Map<core.String, core.Object> toJson() { |
| 1191 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1192 if (done != null) { |
| 1193 _json["done"] = done; |
| 1194 } |
| 1195 if (error != null) { |
| 1196 _json["error"] = (error).toJson(); |
| 1197 } |
| 1198 if (metadata != null) { |
| 1199 _json["metadata"] = metadata; |
| 1200 } |
| 1201 if (name != null) { |
| 1202 _json["name"] = name; |
| 1203 } |
| 1204 if (response != null) { |
| 1205 _json["response"] = response; |
| 1206 } |
| 1207 return _json; |
| 1208 } |
| 1209 } |
| 1210 |
| 1211 /** |
| 1212 * Defines an Identity and Access Management (IAM) policy. It is used to |
| 1213 * specify access control policies for Cloud Platform resources. |
| 1214 * |
| 1215 * |
| 1216 * A `Policy` consists of a list of `bindings`. A `Binding` binds a list of |
| 1217 * `members` to a `role`, where the members can be user accounts, Google groups, |
| 1218 * Google domains, and service accounts. A `role` is a named list of permissions |
| 1219 * defined by IAM. |
| 1220 * |
| 1221 * **Example** |
| 1222 * |
| 1223 * { |
| 1224 * "bindings": [ |
| 1225 * { |
| 1226 * "role": "roles/owner", |
| 1227 * "members": [ |
| 1228 * "user:mike@example.com", |
| 1229 * "group:admins@example.com", |
| 1230 * "domain:google.com", |
| 1231 * "serviceAccount:my-other-app@appspot.gserviceaccount.com", |
| 1232 * ] |
| 1233 * }, |
| 1234 * { |
| 1235 * "role": "roles/viewer", |
| 1236 * "members": ["user:sean@example.com"] |
| 1237 * } |
| 1238 * ] |
| 1239 * } |
| 1240 * |
| 1241 * For a description of IAM and its features, see the |
| 1242 * [IAM developer's guide](https://cloud.google.com/iam). |
| 1243 */ |
| 1244 class Policy { |
| 1245 /** Specifies cloud audit logging configuration for this policy. */ |
| 1246 core.List<AuditConfig> auditConfigs; |
| 1247 /** |
| 1248 * Associates a list of `members` to a `role`. |
| 1249 * `bindings` with no members will result in an error. |
| 1250 */ |
| 1251 core.List<Binding> bindings; |
| 1252 /** |
| 1253 * `etag` is used for optimistic concurrency control as a way to help |
| 1254 * prevent simultaneous updates of a policy from overwriting each other. |
| 1255 * It is strongly suggested that systems make use of the `etag` in the |
| 1256 * read-modify-write cycle to perform policy updates in order to avoid race |
| 1257 * conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1258 * systems are expected to put that etag in the request to `setIamPolicy` to |
| 1259 * ensure that their change will be applied to the same version of the policy. |
| 1260 * |
| 1261 * If no `etag` is provided in the call to `setIamPolicy`, then the existing |
| 1262 * policy is overwritten blindly. |
| 1263 */ |
| 1264 core.String etag; |
| 1265 core.List<core.int> get etagAsBytes { |
| 1266 return convert.BASE64.decode(etag); |
| 1267 } |
| 1268 |
| 1269 void set etagAsBytes(core.List<core.int> _bytes) { |
| 1270 etag = convert.BASE64.encode(_bytes).replaceAll("/", "_").replaceAll("+", "-
"); |
| 1271 } |
| 1272 /** Version of the `Policy`. The default version is 0. */ |
| 1273 core.int version; |
| 1274 |
| 1275 Policy(); |
| 1276 |
| 1277 Policy.fromJson(core.Map _json) { |
| 1278 if (_json.containsKey("auditConfigs")) { |
| 1279 auditConfigs = _json["auditConfigs"].map((value) => new AuditConfig.fromJs
on(value)).toList(); |
| 1280 } |
| 1281 if (_json.containsKey("bindings")) { |
| 1282 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); |
| 1283 } |
| 1284 if (_json.containsKey("etag")) { |
| 1285 etag = _json["etag"]; |
| 1286 } |
| 1287 if (_json.containsKey("version")) { |
| 1288 version = _json["version"]; |
| 1289 } |
| 1290 } |
| 1291 |
| 1292 core.Map<core.String, core.Object> toJson() { |
| 1293 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1294 if (auditConfigs != null) { |
| 1295 _json["auditConfigs"] = auditConfigs.map((value) => (value).toJson()).toLi
st(); |
| 1296 } |
| 1297 if (bindings != null) { |
| 1298 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); |
| 1299 } |
| 1300 if (etag != null) { |
| 1301 _json["etag"] = etag; |
| 1302 } |
| 1303 if (version != null) { |
| 1304 _json["version"] = version; |
| 1305 } |
| 1306 return _json; |
| 1307 } |
| 1308 } |
| 1309 |
| 1310 /** |
| 1311 * A status object which is used as the `metadata` field for the Operation |
| 1312 * returned by CreateProject. It provides insight for when significant phases of |
| 1313 * Project creation have completed. |
| 1314 */ |
| 1315 class ProjectCreationStatus { |
| 1316 /** Creation time of the project creation workflow. */ |
| 1317 core.String createTime; |
| 1318 /** |
| 1319 * True if the project can be retrieved using GetProject. No other operations |
| 1320 * on the project are guaranteed to work until the project creation is |
| 1321 * complete. |
| 1322 */ |
| 1323 core.bool gettable; |
| 1324 /** True if the project creation process is complete. */ |
| 1325 core.bool ready; |
| 1326 |
| 1327 ProjectCreationStatus(); |
| 1328 |
| 1329 ProjectCreationStatus.fromJson(core.Map _json) { |
| 1330 if (_json.containsKey("createTime")) { |
| 1331 createTime = _json["createTime"]; |
| 1332 } |
| 1333 if (_json.containsKey("gettable")) { |
| 1334 gettable = _json["gettable"]; |
| 1335 } |
| 1336 if (_json.containsKey("ready")) { |
| 1337 ready = _json["ready"]; |
| 1338 } |
| 1339 } |
| 1340 |
| 1341 core.Map<core.String, core.Object> toJson() { |
| 1342 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1343 if (createTime != null) { |
| 1344 _json["createTime"] = createTime; |
| 1345 } |
| 1346 if (gettable != null) { |
| 1347 _json["gettable"] = gettable; |
| 1348 } |
| 1349 if (ready != null) { |
| 1350 _json["ready"] = ready; |
| 1351 } |
| 1352 return _json; |
| 1353 } |
| 1354 } |
| 1355 |
| 1356 /** The request message for searching folders. */ |
| 1357 class SearchFoldersRequest { |
| 1358 /** |
| 1359 * The maximum number of folders to return in the response. |
| 1360 * This field is optional. |
| 1361 */ |
| 1362 core.int pageSize; |
| 1363 /** |
| 1364 * A pagination token returned from a previous call to `SearchFolders` |
| 1365 * that indicates from where search should continue. |
| 1366 * This field is optional. |
| 1367 */ |
| 1368 core.String pageToken; |
| 1369 /** |
| 1370 * Search criteria used to select the Folders to return. |
| 1371 * If no search criteria is specified then all accessible folders will be |
| 1372 * returned. |
| 1373 * |
| 1374 * Query expressions can be used to restrict results based upon displayName, |
| 1375 * lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` |
| 1376 * can be used along with the suffix wildcard symbol `*`. |
| 1377 * |
| 1378 * Some example queries are: |
| 1379 * |Query|Description| |
| 1380 * |------|-----------| |
| 1381 * |displayName=Test*|Folders whose display name starts with "Test".| |
| 1382 * |lifecycleState=ACTIVE|Folders whose lifecycleState is ACTIVE.| |
| 1383 * |parent=folders/123|Folders whose parent is "folders/123".| |
| 1384 * |parent=folders/123 AND lifecycleState=ACTIVE|Active folders whose |
| 1385 * parent is "folders/123".| |
| 1386 */ |
| 1387 core.String query; |
| 1388 |
| 1389 SearchFoldersRequest(); |
| 1390 |
| 1391 SearchFoldersRequest.fromJson(core.Map _json) { |
| 1392 if (_json.containsKey("pageSize")) { |
| 1393 pageSize = _json["pageSize"]; |
| 1394 } |
| 1395 if (_json.containsKey("pageToken")) { |
| 1396 pageToken = _json["pageToken"]; |
| 1397 } |
| 1398 if (_json.containsKey("query")) { |
| 1399 query = _json["query"]; |
| 1400 } |
| 1401 } |
| 1402 |
| 1403 core.Map<core.String, core.Object> toJson() { |
| 1404 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1405 if (pageSize != null) { |
| 1406 _json["pageSize"] = pageSize; |
| 1407 } |
| 1408 if (pageToken != null) { |
| 1409 _json["pageToken"] = pageToken; |
| 1410 } |
| 1411 if (query != null) { |
| 1412 _json["query"] = query; |
| 1413 } |
| 1414 return _json; |
| 1415 } |
| 1416 } |
| 1417 |
| 1418 /** The response message for searching folders. */ |
| 1419 class SearchFoldersResponse { |
| 1420 /** |
| 1421 * A possibly paginated folder search results. |
| 1422 * the specified parent resource. |
| 1423 */ |
| 1424 core.List<Folder> folders; |
| 1425 /** |
| 1426 * A pagination token returned from a previous call to `SearchFolders` |
| 1427 * that indicates from where searching should continue. |
| 1428 * This field is optional. |
| 1429 */ |
| 1430 core.String nextPageToken; |
| 1431 |
| 1432 SearchFoldersResponse(); |
| 1433 |
| 1434 SearchFoldersResponse.fromJson(core.Map _json) { |
| 1435 if (_json.containsKey("folders")) { |
| 1436 folders = _json["folders"].map((value) => new Folder.fromJson(value)).toLi
st(); |
| 1437 } |
| 1438 if (_json.containsKey("nextPageToken")) { |
| 1439 nextPageToken = _json["nextPageToken"]; |
| 1440 } |
| 1441 } |
| 1442 |
| 1443 core.Map<core.String, core.Object> toJson() { |
| 1444 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1445 if (folders != null) { |
| 1446 _json["folders"] = folders.map((value) => (value).toJson()).toList(); |
| 1447 } |
| 1448 if (nextPageToken != null) { |
| 1449 _json["nextPageToken"] = nextPageToken; |
| 1450 } |
| 1451 return _json; |
| 1452 } |
| 1453 } |
| 1454 |
| 1455 /** Request message for `SetIamPolicy` method. */ |
| 1456 class SetIamPolicyRequest { |
| 1457 /** |
| 1458 * REQUIRED: The complete policy to be applied to the `resource`. The size of |
| 1459 * the policy is limited to a few 10s of KB. An empty policy is a |
| 1460 * valid policy but certain Cloud Platform services (such as Projects) |
| 1461 * might reject them. |
| 1462 */ |
| 1463 Policy policy; |
| 1464 /** |
| 1465 * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only |
| 1466 * the fields in the mask will be modified. If no mask is provided, the |
| 1467 * following default mask is used: |
| 1468 * paths: "bindings, etag" |
| 1469 * This field is only used by Cloud IAM. |
| 1470 */ |
| 1471 core.String updateMask; |
| 1472 |
| 1473 SetIamPolicyRequest(); |
| 1474 |
| 1475 SetIamPolicyRequest.fromJson(core.Map _json) { |
| 1476 if (_json.containsKey("policy")) { |
| 1477 policy = new Policy.fromJson(_json["policy"]); |
| 1478 } |
| 1479 if (_json.containsKey("updateMask")) { |
| 1480 updateMask = _json["updateMask"]; |
| 1481 } |
| 1482 } |
| 1483 |
| 1484 core.Map<core.String, core.Object> toJson() { |
| 1485 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1486 if (policy != null) { |
| 1487 _json["policy"] = (policy).toJson(); |
| 1488 } |
| 1489 if (updateMask != null) { |
| 1490 _json["updateMask"] = updateMask; |
| 1491 } |
| 1492 return _json; |
| 1493 } |
| 1494 } |
| 1495 |
| 1496 /** |
| 1497 * The `Status` type defines a logical error model that is suitable for |
| 1498 * different |
| 1499 * programming environments, including REST APIs and RPC APIs. It is used by |
| 1500 * [gRPC](https://github.com/grpc). The error model is designed to be: |
| 1501 * |
| 1502 * - Simple to use and understand for most users |
| 1503 * - Flexible enough to meet unexpected needs |
| 1504 * |
| 1505 * # Overview |
| 1506 * |
| 1507 * The `Status` message contains three pieces of data: error code, error |
| 1508 * message, |
| 1509 * and error details. The error code should be an enum value of |
| 1510 * google.rpc.Code, but it may accept additional error codes if needed. The |
| 1511 * error message should be a developer-facing English message that helps |
| 1512 * developers *understand* and *resolve* the error. If a localized user-facing |
| 1513 * error message is needed, put the localized message in the error details or |
| 1514 * localize it in the client. The optional error details may contain arbitrary |
| 1515 * information about the error. There is a predefined set of error detail types |
| 1516 * in the package `google.rpc` that can be used for common error conditions. |
| 1517 * |
| 1518 * # Language mapping |
| 1519 * |
| 1520 * The `Status` message is the logical representation of the error model, but it |
| 1521 * is not necessarily the actual wire format. When the `Status` message is |
| 1522 * exposed in different client libraries and different wire protocols, it can be |
| 1523 * mapped differently. For example, it will likely be mapped to some exceptions |
| 1524 * in Java, but more likely mapped to some error codes in C. |
| 1525 * |
| 1526 * # Other uses |
| 1527 * |
| 1528 * The error model and the `Status` message can be used in a variety of |
| 1529 * environments, either with or without APIs, to provide a |
| 1530 * consistent developer experience across different environments. |
| 1531 * |
| 1532 * Example uses of this error model include: |
| 1533 * |
| 1534 * - Partial errors. If a service needs to return partial errors to the client, |
| 1535 * it may embed the `Status` in the normal response to indicate the partial |
| 1536 * errors. |
| 1537 * |
| 1538 * - Workflow errors. A typical workflow has multiple steps. Each step may |
| 1539 * have a `Status` message for error reporting. |
| 1540 * |
| 1541 * - Batch operations. If a client uses batch request and batch response, the |
| 1542 * `Status` message should be used directly inside batch response, one for |
| 1543 * each error sub-response. |
| 1544 * |
| 1545 * - Asynchronous operations. If an API call embeds asynchronous operation |
| 1546 * results in its response, the status of those operations should be |
| 1547 * represented directly using the `Status` message. |
| 1548 * |
| 1549 * - Logging. If some API errors are stored in logs, the message `Status` could |
| 1550 * be used directly after any stripping needed for security/privacy reasons. |
| 1551 */ |
| 1552 class Status { |
| 1553 /** The status code, which should be an enum value of google.rpc.Code. */ |
| 1554 core.int code; |
| 1555 /** |
| 1556 * A list of messages that carry the error details. There will be a |
| 1557 * common set of message types for APIs to use. |
| 1558 * |
| 1559 * The values for Object must be JSON objects. It can consist of `num`, |
| 1560 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1561 */ |
| 1562 core.List<core.Map<core.String, core.Object>> details; |
| 1563 /** |
| 1564 * A developer-facing error message, which should be in English. Any |
| 1565 * user-facing error message should be localized and sent in the |
| 1566 * google.rpc.Status.details field, or localized by the client. |
| 1567 */ |
| 1568 core.String message; |
| 1569 |
| 1570 Status(); |
| 1571 |
| 1572 Status.fromJson(core.Map _json) { |
| 1573 if (_json.containsKey("code")) { |
| 1574 code = _json["code"]; |
| 1575 } |
| 1576 if (_json.containsKey("details")) { |
| 1577 details = _json["details"]; |
| 1578 } |
| 1579 if (_json.containsKey("message")) { |
| 1580 message = _json["message"]; |
| 1581 } |
| 1582 } |
| 1583 |
| 1584 core.Map<core.String, core.Object> toJson() { |
| 1585 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1586 if (code != null) { |
| 1587 _json["code"] = code; |
| 1588 } |
| 1589 if (details != null) { |
| 1590 _json["details"] = details; |
| 1591 } |
| 1592 if (message != null) { |
| 1593 _json["message"] = message; |
| 1594 } |
| 1595 return _json; |
| 1596 } |
| 1597 } |
| 1598 |
| 1599 /** Request message for `TestIamPermissions` method. */ |
| 1600 class TestIamPermissionsRequest { |
| 1601 /** |
| 1602 * The set of permissions to check for the `resource`. Permissions with |
| 1603 * wildcards (such as '*' or 'storage.*') are not allowed. For more |
| 1604 * information see |
| 1605 * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
| 1606 */ |
| 1607 core.List<core.String> permissions; |
| 1608 |
| 1609 TestIamPermissionsRequest(); |
| 1610 |
| 1611 TestIamPermissionsRequest.fromJson(core.Map _json) { |
| 1612 if (_json.containsKey("permissions")) { |
| 1613 permissions = _json["permissions"]; |
| 1614 } |
| 1615 } |
| 1616 |
| 1617 core.Map<core.String, core.Object> toJson() { |
| 1618 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1619 if (permissions != null) { |
| 1620 _json["permissions"] = permissions; |
| 1621 } |
| 1622 return _json; |
| 1623 } |
| 1624 } |
| 1625 |
| 1626 /** Response message for `TestIamPermissions` method. */ |
| 1627 class TestIamPermissionsResponse { |
| 1628 /** |
| 1629 * A subset of `TestPermissionsRequest.permissions` that the caller is |
| 1630 * allowed. |
| 1631 */ |
| 1632 core.List<core.String> permissions; |
| 1633 |
| 1634 TestIamPermissionsResponse(); |
| 1635 |
| 1636 TestIamPermissionsResponse.fromJson(core.Map _json) { |
| 1637 if (_json.containsKey("permissions")) { |
| 1638 permissions = _json["permissions"]; |
| 1639 } |
| 1640 } |
| 1641 |
| 1642 core.Map<core.String, core.Object> toJson() { |
| 1643 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1644 if (permissions != null) { |
| 1645 _json["permissions"] = permissions; |
| 1646 } |
| 1647 return _json; |
| 1648 } |
| 1649 } |
| 1650 |
| 1651 /** The UndeleteFolder request message. */ |
| 1652 class UndeleteFolderRequest { |
| 1653 |
| 1654 UndeleteFolderRequest(); |
| 1655 |
| 1656 UndeleteFolderRequest.fromJson(core.Map _json) { |
| 1657 } |
| 1658 |
| 1659 core.Map<core.String, core.Object> toJson() { |
| 1660 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 1661 return _json; |
| 1662 } |
| 1663 } |
OLD | NEW |