OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis_beta.cloudresourcemanager.v1beta1; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:crypto/crypto.dart' as crypto; |
| 11 import 'package:http/http.dart' as http; |
| 12 |
| 13 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 14 ApiRequestError, DetailedApiRequestError; |
| 15 |
| 16 const core.String USER_AGENT = 'dart-api-client cloudresourcemanager/v1beta1'; |
| 17 |
| 18 /** |
| 19 * The Google Cloud Resource Manager API provides methods for creating, reading, |
| 20 * and updating of project metadata. |
| 21 */ |
| 22 class CloudresourcemanagerApi { |
| 23 /** View and manage your data across Google Cloud Platform services */ |
| 24 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 25 |
| 26 |
| 27 final commons.ApiRequester _requester; |
| 28 |
| 29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| 30 |
| 31 CloudresourcemanagerApi(http.Client client, {core.String rootUrl: "https://clo
udresourcemanager.googleapis.com/", core.String servicePath: ""}) : |
| 32 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 33 } |
| 34 |
| 35 |
| 36 class ProjectsResourceApi { |
| 37 final commons.ApiRequester _requester; |
| 38 |
| 39 ProjectsResourceApi(commons.ApiRequester client) : |
| 40 _requester = client; |
| 41 |
| 42 /** |
| 43 * Creates a project resource. Initially, the project resource is owned by its |
| 44 * creator exclusively. The creator can later grant permission to others to |
| 45 * read or update the project. Several APIs are activated automatically for |
| 46 * the project, including Google Cloud Storage. |
| 47 * |
| 48 * [request] - The metadata request object. |
| 49 * |
| 50 * Request parameters: |
| 51 * |
| 52 * Completes with a [Project]. |
| 53 * |
| 54 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 55 * error. |
| 56 * |
| 57 * If the used [http.Client] completes with an error when making a REST call, |
| 58 * this method will complete with the same error. |
| 59 */ |
| 60 async.Future<Project> create(Project request) { |
| 61 var _url = null; |
| 62 var _queryParams = new core.Map(); |
| 63 var _uploadMedia = null; |
| 64 var _uploadOptions = null; |
| 65 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 66 var _body = null; |
| 67 |
| 68 if (request != null) { |
| 69 _body = convert.JSON.encode((request).toJson()); |
| 70 } |
| 71 |
| 72 _url = 'v1beta1/projects'; |
| 73 |
| 74 var _response = _requester.request(_url, |
| 75 "POST", |
| 76 body: _body, |
| 77 queryParams: _queryParams, |
| 78 uploadOptions: _uploadOptions, |
| 79 uploadMedia: _uploadMedia, |
| 80 downloadOptions: _downloadOptions); |
| 81 return _response.then((data) => new Project.fromJson(data)); |
| 82 } |
| 83 |
| 84 /** |
| 85 * Marks the project identified by the specified `project_id` (for example, |
| 86 * `my-project-123`) for deletion. This method will only affect the project if |
| 87 * the following criteria are met: + The project does not have a billing |
| 88 * account associated with it. + The project has a lifecycle state of |
| 89 * [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE
]. |
| 90 * This method changes the project's lifecycle state from |
| 91 * [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE
] |
| 92 * to [DELETE_REQUESTED] |
| 93 * [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUEST
ED]. |
| 94 * The deletion starts at an unspecified time, at which point the lifecycle |
| 95 * state changes to [DELETE_IN_PROGRESS] |
| 96 * [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROG
RESS]. |
| 97 * Until the deletion completes, you can check the lifecycle state checked by |
| 98 * retrieving the project with [GetProject] |
| 99 * [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject]
, |
| 100 * and the project remains visible to [ListProjects] |
| 101 * [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProject
s]. |
| 102 * However, you cannot update the project. After the deletion completes, the |
| 103 * project is not retrievable by the [GetProject] |
| 104 * [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] |
| 105 * and [ListProjects] |
| 106 * [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProject
s] |
| 107 * methods. The caller must have modify permissions for this project. |
| 108 * |
| 109 * Request parameters: |
| 110 * |
| 111 * [projectId] - The project ID (for example, `foo-bar-123`). Required. |
| 112 * |
| 113 * Completes with a [Empty]. |
| 114 * |
| 115 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 116 * error. |
| 117 * |
| 118 * If the used [http.Client] completes with an error when making a REST call, |
| 119 * this method will complete with the same error. |
| 120 */ |
| 121 async.Future<Empty> delete(core.String projectId) { |
| 122 var _url = null; |
| 123 var _queryParams = new core.Map(); |
| 124 var _uploadMedia = null; |
| 125 var _uploadOptions = null; |
| 126 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 127 var _body = null; |
| 128 |
| 129 if (projectId == null) { |
| 130 throw new core.ArgumentError("Parameter projectId is required."); |
| 131 } |
| 132 |
| 133 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); |
| 134 |
| 135 var _response = _requester.request(_url, |
| 136 "DELETE", |
| 137 body: _body, |
| 138 queryParams: _queryParams, |
| 139 uploadOptions: _uploadOptions, |
| 140 uploadMedia: _uploadMedia, |
| 141 downloadOptions: _downloadOptions); |
| 142 return _response.then((data) => new Empty.fromJson(data)); |
| 143 } |
| 144 |
| 145 /** |
| 146 * Retrieves the project identified by the specified `project_id` (for |
| 147 * example, `my-project-123`). The caller must have read permissions for this |
| 148 * project. |
| 149 * |
| 150 * Request parameters: |
| 151 * |
| 152 * [projectId] - The project ID (for example, `my-project-123`). Required. |
| 153 * |
| 154 * Completes with a [Project]. |
| 155 * |
| 156 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 157 * error. |
| 158 * |
| 159 * If the used [http.Client] completes with an error when making a REST call, |
| 160 * this method will complete with the same error. |
| 161 */ |
| 162 async.Future<Project> get(core.String projectId) { |
| 163 var _url = null; |
| 164 var _queryParams = new core.Map(); |
| 165 var _uploadMedia = null; |
| 166 var _uploadOptions = null; |
| 167 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 168 var _body = null; |
| 169 |
| 170 if (projectId == null) { |
| 171 throw new core.ArgumentError("Parameter projectId is required."); |
| 172 } |
| 173 |
| 174 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); |
| 175 |
| 176 var _response = _requester.request(_url, |
| 177 "GET", |
| 178 body: _body, |
| 179 queryParams: _queryParams, |
| 180 uploadOptions: _uploadOptions, |
| 181 uploadMedia: _uploadMedia, |
| 182 downloadOptions: _downloadOptions); |
| 183 return _response.then((data) => new Project.fromJson(data)); |
| 184 } |
| 185 |
| 186 /** |
| 187 * Returns the IAM access control policy for specified project. |
| 188 * |
| 189 * [request] - The metadata request object. |
| 190 * |
| 191 * Request parameters: |
| 192 * |
| 193 * [resource] - REQUIRED: The resource for which policy is being requested. |
| 194 * Resource is usually specified as a path, such as, projects/{project}. |
| 195 * |
| 196 * Completes with a [Policy]. |
| 197 * |
| 198 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 199 * error. |
| 200 * |
| 201 * If the used [http.Client] completes with an error when making a REST call, |
| 202 * this method will complete with the same error. |
| 203 */ |
| 204 async.Future<Policy> getIamPolicy(GetIamPolicyRequest request, core.String res
ource) { |
| 205 var _url = null; |
| 206 var _queryParams = new core.Map(); |
| 207 var _uploadMedia = null; |
| 208 var _uploadOptions = null; |
| 209 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 210 var _body = null; |
| 211 |
| 212 if (request != null) { |
| 213 _body = convert.JSON.encode((request).toJson()); |
| 214 } |
| 215 if (resource == null) { |
| 216 throw new core.ArgumentError("Parameter resource is required."); |
| 217 } |
| 218 |
| 219 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':
getIamPolicy'; |
| 220 |
| 221 var _response = _requester.request(_url, |
| 222 "POST", |
| 223 body: _body, |
| 224 queryParams: _queryParams, |
| 225 uploadOptions: _uploadOptions, |
| 226 uploadMedia: _uploadMedia, |
| 227 downloadOptions: _downloadOptions); |
| 228 return _response.then((data) => new Policy.fromJson(data)); |
| 229 } |
| 230 |
| 231 /** |
| 232 * Lists projects that are visible to the user and satisfy the specified |
| 233 * filter. This method returns projects in an unspecified order. New projects |
| 234 * do not necessarily appear at the end of the list. |
| 235 * |
| 236 * Request parameters: |
| 237 * |
| 238 * [pageToken] - A pagination token returned from a previous call to |
| 239 * ListProject that indicates from where listing should continue. Note: |
| 240 * pagination is not yet supported; the server ignores this field. Optional. |
| 241 * |
| 242 * [pageSize] - The maximum number of Projects to return in the response. The |
| 243 * server can return fewer projects than requested. If unspecified, server |
| 244 * picks an appropriate default. Note: pagination is not yet supported; the |
| 245 * server ignores this field. Optional. |
| 246 * |
| 247 * [filter] - An expression for filtering the results of the request. Filter |
| 248 * rules are case insensitive. The fields eligible for filtering are: + `name` |
| 249 * + `id` + labels.key where *key* is the name of a label Some examples of |
| 250 * using labels as filters: |Filter|Description| |------|-----------| |
| 251 * |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or |
| 252 * `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |
| 253 * |labels.color:*|The project has the label `color`.| |labels.color:red|The |
| 254 * project's label `color` has the value `red`.| |
| 255 * |labels.color:red label.size:big|The project's label `color` has the value |
| 256 * `red` and its label `size` has the value `big`. Optional. |
| 257 * |
| 258 * Completes with a [ListProjectsResponse]. |
| 259 * |
| 260 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 261 * error. |
| 262 * |
| 263 * If the used [http.Client] completes with an error when making a REST call, |
| 264 * this method will complete with the same error. |
| 265 */ |
| 266 async.Future<ListProjectsResponse> list({core.String pageToken, core.int pageS
ize, core.String filter}) { |
| 267 var _url = null; |
| 268 var _queryParams = new core.Map(); |
| 269 var _uploadMedia = null; |
| 270 var _uploadOptions = null; |
| 271 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 272 var _body = null; |
| 273 |
| 274 if (pageToken != null) { |
| 275 _queryParams["pageToken"] = [pageToken]; |
| 276 } |
| 277 if (pageSize != null) { |
| 278 _queryParams["pageSize"] = ["${pageSize}"]; |
| 279 } |
| 280 if (filter != null) { |
| 281 _queryParams["filter"] = [filter]; |
| 282 } |
| 283 |
| 284 _url = 'v1beta1/projects'; |
| 285 |
| 286 var _response = _requester.request(_url, |
| 287 "GET", |
| 288 body: _body, |
| 289 queryParams: _queryParams, |
| 290 uploadOptions: _uploadOptions, |
| 291 uploadMedia: _uploadMedia, |
| 292 downloadOptions: _downloadOptions); |
| 293 return _response.then((data) => new ListProjectsResponse.fromJson(data)); |
| 294 } |
| 295 |
| 296 /** |
| 297 * Sets the IAM access control policy for the specified project. We do not |
| 298 * currently support 'domain:' prefixed members in a Binding of a Policy. |
| 299 * Calling this method requires enabling the App Engine Admin API. |
| 300 * |
| 301 * [request] - The metadata request object. |
| 302 * |
| 303 * Request parameters: |
| 304 * |
| 305 * [resource] - REQUIRED: The resource for which policy is being specified. |
| 306 * Resource is usually specified as a path, such as, |
| 307 * projects/{project}/zones/{zone}/disks/{disk}. |
| 308 * |
| 309 * Completes with a [Policy]. |
| 310 * |
| 311 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 312 * error. |
| 313 * |
| 314 * If the used [http.Client] completes with an error when making a REST call, |
| 315 * this method will complete with the same error. |
| 316 */ |
| 317 async.Future<Policy> setIamPolicy(SetIamPolicyRequest request, core.String res
ource) { |
| 318 var _url = null; |
| 319 var _queryParams = new core.Map(); |
| 320 var _uploadMedia = null; |
| 321 var _uploadOptions = null; |
| 322 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 323 var _body = null; |
| 324 |
| 325 if (request != null) { |
| 326 _body = convert.JSON.encode((request).toJson()); |
| 327 } |
| 328 if (resource == null) { |
| 329 throw new core.ArgumentError("Parameter resource is required."); |
| 330 } |
| 331 |
| 332 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':
setIamPolicy'; |
| 333 |
| 334 var _response = _requester.request(_url, |
| 335 "POST", |
| 336 body: _body, |
| 337 queryParams: _queryParams, |
| 338 uploadOptions: _uploadOptions, |
| 339 uploadMedia: _uploadMedia, |
| 340 downloadOptions: _downloadOptions); |
| 341 return _response.then((data) => new Policy.fromJson(data)); |
| 342 } |
| 343 |
| 344 /** |
| 345 * Tests the specified permissions against the IAM access control policy for |
| 346 * the specified project. |
| 347 * |
| 348 * [request] - The metadata request object. |
| 349 * |
| 350 * Request parameters: |
| 351 * |
| 352 * [resource] - REQUIRED: The resource for which policy detail is being |
| 353 * requested. Resource is usually specified as a path, such as, |
| 354 * projects/{project}. |
| 355 * |
| 356 * Completes with a [TestIamPermissionsResponse]. |
| 357 * |
| 358 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 359 * error. |
| 360 * |
| 361 * If the used [http.Client] completes with an error when making a REST call, |
| 362 * this method will complete with the same error. |
| 363 */ |
| 364 async.Future<TestIamPermissionsResponse> testIamPermissions(TestIamPermissions
Request request, core.String resource) { |
| 365 var _url = null; |
| 366 var _queryParams = new core.Map(); |
| 367 var _uploadMedia = null; |
| 368 var _uploadOptions = null; |
| 369 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 370 var _body = null; |
| 371 |
| 372 if (request != null) { |
| 373 _body = convert.JSON.encode((request).toJson()); |
| 374 } |
| 375 if (resource == null) { |
| 376 throw new core.ArgumentError("Parameter resource is required."); |
| 377 } |
| 378 |
| 379 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$resource') + ':
testIamPermissions'; |
| 380 |
| 381 var _response = _requester.request(_url, |
| 382 "POST", |
| 383 body: _body, |
| 384 queryParams: _queryParams, |
| 385 uploadOptions: _uploadOptions, |
| 386 uploadMedia: _uploadMedia, |
| 387 downloadOptions: _downloadOptions); |
| 388 return _response.then((data) => new TestIamPermissionsResponse.fromJson(data
)); |
| 389 } |
| 390 |
| 391 /** |
| 392 * Restores the project identified by the specified `project_id` (for example, |
| 393 * `my-project-123`). You can only use this method for a project that has a |
| 394 * lifecycle state of [DELETE_REQUESTED] |
| 395 * [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUEST
ED]. |
| 396 * After deletion starts, as indicated by a lifecycle state of |
| 397 * [DELETE_IN_PROGRESS] |
| 398 * [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROG
RESS], |
| 399 * the project cannot be restored. The caller must have modify permissions for |
| 400 * this project. |
| 401 * |
| 402 * Request parameters: |
| 403 * |
| 404 * [projectId] - The project ID (for example, `foo-bar-123`). Required. |
| 405 * |
| 406 * Completes with a [Empty]. |
| 407 * |
| 408 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 409 * error. |
| 410 * |
| 411 * If the used [http.Client] completes with an error when making a REST call, |
| 412 * this method will complete with the same error. |
| 413 */ |
| 414 async.Future<Empty> undelete(core.String projectId) { |
| 415 var _url = null; |
| 416 var _queryParams = new core.Map(); |
| 417 var _uploadMedia = null; |
| 418 var _uploadOptions = null; |
| 419 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 420 var _body = null; |
| 421 |
| 422 if (projectId == null) { |
| 423 throw new core.ArgumentError("Parameter projectId is required."); |
| 424 } |
| 425 |
| 426 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '
:undelete'; |
| 427 |
| 428 var _response = _requester.request(_url, |
| 429 "POST", |
| 430 body: _body, |
| 431 queryParams: _queryParams, |
| 432 uploadOptions: _uploadOptions, |
| 433 uploadMedia: _uploadMedia, |
| 434 downloadOptions: _downloadOptions); |
| 435 return _response.then((data) => new Empty.fromJson(data)); |
| 436 } |
| 437 |
| 438 /** |
| 439 * Updates the attributes of the project identified by the specified |
| 440 * `project_id` (for example, `my-project-123`). The caller must have modify |
| 441 * permissions for this project. |
| 442 * |
| 443 * [request] - The metadata request object. |
| 444 * |
| 445 * Request parameters: |
| 446 * |
| 447 * [projectId] - The project ID (for example, `my-project-123`). Required. |
| 448 * |
| 449 * Completes with a [Project]. |
| 450 * |
| 451 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 452 * error. |
| 453 * |
| 454 * If the used [http.Client] completes with an error when making a REST call, |
| 455 * this method will complete with the same error. |
| 456 */ |
| 457 async.Future<Project> update(Project request, core.String projectId) { |
| 458 var _url = null; |
| 459 var _queryParams = new core.Map(); |
| 460 var _uploadMedia = null; |
| 461 var _uploadOptions = null; |
| 462 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 463 var _body = null; |
| 464 |
| 465 if (request != null) { |
| 466 _body = convert.JSON.encode((request).toJson()); |
| 467 } |
| 468 if (projectId == null) { |
| 469 throw new core.ArgumentError("Parameter projectId is required."); |
| 470 } |
| 471 |
| 472 _url = 'v1beta1/projects/' + commons.Escaper.ecapeVariable('$projectId'); |
| 473 |
| 474 var _response = _requester.request(_url, |
| 475 "PUT", |
| 476 body: _body, |
| 477 queryParams: _queryParams, |
| 478 uploadOptions: _uploadOptions, |
| 479 uploadMedia: _uploadMedia, |
| 480 downloadOptions: _downloadOptions); |
| 481 return _response.then((data) => new Project.fromJson(data)); |
| 482 } |
| 483 |
| 484 } |
| 485 |
| 486 |
| 487 |
| 488 /** Associates members with roles. See below for allowed formats of members. */ |
| 489 class Binding { |
| 490 /** |
| 491 * Format of member entries: 1. allUsers Matches any requesting principal |
| 492 * (users, service accounts or anonymous). 2. allAuthenticatedUsers Matches |
| 493 * any requesting authenticated principal (users or service accounts). 3. |
| 494 * user:{emailid} A google user account using an email address. For example |
| 495 * alice@gmail.com, joe@example.com 4. serviceAccount:{emailid} An service |
| 496 * account email. 5. group:{emailid} A google group with an email address. For |
| 497 * example auth-ti-cloud@google.com 6. domain:{domain} A Google Apps domain |
| 498 * name. For example google.com, example.com |
| 499 */ |
| 500 core.List<core.String> members; |
| 501 /** |
| 502 * The name of the role to which the members should be bound. Examples: |
| 503 * "roles/viewer", "roles/editor", "roles/owner". Required |
| 504 */ |
| 505 core.String role; |
| 506 |
| 507 Binding(); |
| 508 |
| 509 Binding.fromJson(core.Map _json) { |
| 510 if (_json.containsKey("members")) { |
| 511 members = _json["members"]; |
| 512 } |
| 513 if (_json.containsKey("role")) { |
| 514 role = _json["role"]; |
| 515 } |
| 516 } |
| 517 |
| 518 core.Map toJson() { |
| 519 var _json = new core.Map(); |
| 520 if (members != null) { |
| 521 _json["members"] = members; |
| 522 } |
| 523 if (role != null) { |
| 524 _json["role"] = role; |
| 525 } |
| 526 return _json; |
| 527 } |
| 528 } |
| 529 |
| 530 /** Write a Cloud Audit log */ |
| 531 class CloudAuditOptions { |
| 532 |
| 533 CloudAuditOptions(); |
| 534 |
| 535 CloudAuditOptions.fromJson(core.Map _json) { |
| 536 } |
| 537 |
| 538 core.Map toJson() { |
| 539 var _json = new core.Map(); |
| 540 return _json; |
| 541 } |
| 542 } |
| 543 |
| 544 /** A condition to be met. */ |
| 545 class Condition { |
| 546 /** |
| 547 * Trusted attributes supplied by the IAM system. |
| 548 * Possible string values are: |
| 549 * - "NO_ATTR" : A NO_ATTR. |
| 550 * - "AUTHORITY" : A AUTHORITY. |
| 551 * - "ATTRIBUTION" : A ATTRIBUTION. |
| 552 */ |
| 553 core.String iam; |
| 554 /** |
| 555 * An operator to apply the subject with. |
| 556 * Possible string values are: |
| 557 * - "NO_OP" : A NO_OP. |
| 558 * - "EQUALS" : A EQUALS. |
| 559 * - "NOT_EQUALS" : A NOT_EQUALS. |
| 560 * - "IN" : A IN. |
| 561 * - "NOT_IN" : A NOT_IN. |
| 562 * - "DISCHARGED" : A DISCHARGED. |
| 563 */ |
| 564 core.String op; |
| 565 /** Trusted attributes discharged by the service. */ |
| 566 core.String svc; |
| 567 /** |
| 568 * Trusted attributes supplied by any service that owns resources and uses the |
| 569 * IAM system for access control. |
| 570 * Possible string values are: |
| 571 * - "NO_ATTR" : A NO_ATTR. |
| 572 * - "REGION" : A REGION. |
| 573 * - "SERVICE" : A SERVICE. |
| 574 * - "NAME" : A NAME. |
| 575 * - "IP" : A IP. |
| 576 */ |
| 577 core.String sys; |
| 578 /** The object of the condition. Exactly one of these must be set. */ |
| 579 core.String value; |
| 580 /** The objects of the condition. This is mutually exclusive with 'value'. */ |
| 581 core.List<core.String> values; |
| 582 |
| 583 Condition(); |
| 584 |
| 585 Condition.fromJson(core.Map _json) { |
| 586 if (_json.containsKey("iam")) { |
| 587 iam = _json["iam"]; |
| 588 } |
| 589 if (_json.containsKey("op")) { |
| 590 op = _json["op"]; |
| 591 } |
| 592 if (_json.containsKey("svc")) { |
| 593 svc = _json["svc"]; |
| 594 } |
| 595 if (_json.containsKey("sys")) { |
| 596 sys = _json["sys"]; |
| 597 } |
| 598 if (_json.containsKey("value")) { |
| 599 value = _json["value"]; |
| 600 } |
| 601 if (_json.containsKey("values")) { |
| 602 values = _json["values"]; |
| 603 } |
| 604 } |
| 605 |
| 606 core.Map toJson() { |
| 607 var _json = new core.Map(); |
| 608 if (iam != null) { |
| 609 _json["iam"] = iam; |
| 610 } |
| 611 if (op != null) { |
| 612 _json["op"] = op; |
| 613 } |
| 614 if (svc != null) { |
| 615 _json["svc"] = svc; |
| 616 } |
| 617 if (sys != null) { |
| 618 _json["sys"] = sys; |
| 619 } |
| 620 if (value != null) { |
| 621 _json["value"] = value; |
| 622 } |
| 623 if (values != null) { |
| 624 _json["values"] = values; |
| 625 } |
| 626 return _json; |
| 627 } |
| 628 } |
| 629 |
| 630 /** Options for counters */ |
| 631 class CounterOptions { |
| 632 /** The field value to attribute. */ |
| 633 core.String field; |
| 634 /** The metric to update. */ |
| 635 core.String metric; |
| 636 |
| 637 CounterOptions(); |
| 638 |
| 639 CounterOptions.fromJson(core.Map _json) { |
| 640 if (_json.containsKey("field")) { |
| 641 field = _json["field"]; |
| 642 } |
| 643 if (_json.containsKey("metric")) { |
| 644 metric = _json["metric"]; |
| 645 } |
| 646 } |
| 647 |
| 648 core.Map toJson() { |
| 649 var _json = new core.Map(); |
| 650 if (field != null) { |
| 651 _json["field"] = field; |
| 652 } |
| 653 if (metric != null) { |
| 654 _json["metric"] = metric; |
| 655 } |
| 656 return _json; |
| 657 } |
| 658 } |
| 659 |
| 660 /** Write a Data Access (Gin) log */ |
| 661 class DataAccessOptions { |
| 662 |
| 663 DataAccessOptions(); |
| 664 |
| 665 DataAccessOptions.fromJson(core.Map _json) { |
| 666 } |
| 667 |
| 668 core.Map toJson() { |
| 669 var _json = new core.Map(); |
| 670 return _json; |
| 671 } |
| 672 } |
| 673 |
| 674 /** |
| 675 * A generic empty message that you can re-use to avoid defining duplicated |
| 676 * empty messages in your APIs. A typical example is to use it as the request or |
| 677 * the response type of an API method. For instance: service Foo { rpc |
| 678 * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON |
| 679 * representation for `Empty` is empty JSON object `{}`. |
| 680 */ |
| 681 class Empty { |
| 682 |
| 683 Empty(); |
| 684 |
| 685 Empty.fromJson(core.Map _json) { |
| 686 } |
| 687 |
| 688 core.Map toJson() { |
| 689 var _json = new core.Map(); |
| 690 return _json; |
| 691 } |
| 692 } |
| 693 |
| 694 /** Request message for `GetIamPolicy` method. */ |
| 695 class GetIamPolicyRequest { |
| 696 |
| 697 GetIamPolicyRequest(); |
| 698 |
| 699 GetIamPolicyRequest.fromJson(core.Map _json) { |
| 700 } |
| 701 |
| 702 core.Map toJson() { |
| 703 var _json = new core.Map(); |
| 704 return _json; |
| 705 } |
| 706 } |
| 707 |
| 708 /** |
| 709 * A page of the response received from the |
| 710 * [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperProjects
.ListProjects] |
| 711 * method. A paginated response where more pages are available has |
| 712 * `next_page_token` set. This token can be used in a subsequent request to |
| 713 * retrieve the next request page. |
| 714 */ |
| 715 class ListProjectsResponse { |
| 716 /** |
| 717 * Pagination token. If the result set is too large to fit in a single |
| 718 * response, this token is returned. It encodes the position of the current |
| 719 * result cursor. Feeding this value into a new list request with the |
| 720 * `page_token` parameter gives the next page of the results. When |
| 721 * `next_page_token` is not filled in, there is no next page and the list |
| 722 * returned is the last page in the result set. Pagination tokens have a |
| 723 * limited lifetime. Note: pagination is not yet supported; the server will |
| 724 * not set this field. |
| 725 */ |
| 726 core.String nextPageToken; |
| 727 /** |
| 728 * The list of projects that matched the list filter. This list can be |
| 729 * paginated. |
| 730 */ |
| 731 core.List<Project> projects; |
| 732 |
| 733 ListProjectsResponse(); |
| 734 |
| 735 ListProjectsResponse.fromJson(core.Map _json) { |
| 736 if (_json.containsKey("nextPageToken")) { |
| 737 nextPageToken = _json["nextPageToken"]; |
| 738 } |
| 739 if (_json.containsKey("projects")) { |
| 740 projects = _json["projects"].map((value) => new Project.fromJson(value)).t
oList(); |
| 741 } |
| 742 } |
| 743 |
| 744 core.Map toJson() { |
| 745 var _json = new core.Map(); |
| 746 if (nextPageToken != null) { |
| 747 _json["nextPageToken"] = nextPageToken; |
| 748 } |
| 749 if (projects != null) { |
| 750 _json["projects"] = projects.map((value) => (value).toJson()).toList(); |
| 751 } |
| 752 return _json; |
| 753 } |
| 754 } |
| 755 |
| 756 /** |
| 757 * Specifies what kind of log the caller must write Increment a streamz counter |
| 758 * with the specified metric and field names. Metric names should start with a |
| 759 * '/', generally be lowercase-only, and end in "_count". Field names should not |
| 760 * contain an initial slash. The actual exported metric names will have |
| 761 * "/iam/policy" prepended. Field names correspond to IAM request parameters and |
| 762 * field values are their respective values. At present only "iam_principal", |
| 763 * corresponding to IAMContext.principal, is supported. Examples: counter { |
| 764 * metric: "/debug_access_count" field: "iam_principal" } ==> increment counter |
| 765 * /iam/policy/backend_debug_access_count {iam_principal=[value of |
| 766 * IAMContext.principal]} At this time we do not support: * multiple field names |
| 767 * (though this may be supported in the future) * decrementing the counter * |
| 768 * incrementing it by anything other than 1 |
| 769 */ |
| 770 class LogConfig { |
| 771 /** Cloud audit options. */ |
| 772 CloudAuditOptions cloudAudit; |
| 773 /** Counter options. */ |
| 774 CounterOptions counter; |
| 775 /** Data access options. */ |
| 776 DataAccessOptions dataAccess; |
| 777 |
| 778 LogConfig(); |
| 779 |
| 780 LogConfig.fromJson(core.Map _json) { |
| 781 if (_json.containsKey("cloudAudit")) { |
| 782 cloudAudit = new CloudAuditOptions.fromJson(_json["cloudAudit"]); |
| 783 } |
| 784 if (_json.containsKey("counter")) { |
| 785 counter = new CounterOptions.fromJson(_json["counter"]); |
| 786 } |
| 787 if (_json.containsKey("dataAccess")) { |
| 788 dataAccess = new DataAccessOptions.fromJson(_json["dataAccess"]); |
| 789 } |
| 790 } |
| 791 |
| 792 core.Map toJson() { |
| 793 var _json = new core.Map(); |
| 794 if (cloudAudit != null) { |
| 795 _json["cloudAudit"] = (cloudAudit).toJson(); |
| 796 } |
| 797 if (counter != null) { |
| 798 _json["counter"] = (counter).toJson(); |
| 799 } |
| 800 if (dataAccess != null) { |
| 801 _json["dataAccess"] = (dataAccess).toJson(); |
| 802 } |
| 803 return _json; |
| 804 } |
| 805 } |
| 806 |
| 807 /** |
| 808 * # Overview The `Policy` defines an access control policy language. It is used |
| 809 * to define policies that are attached to resources like files, folders, VMs, |
| 810 * etc. # Policy structure A `Policy` consists of a list of bindings. A |
| 811 * `Binding` binds a set of members to a role, where the members include user |
| 812 * accounts, user groups, user domains, and service accounts. A 'role' is a |
| 813 * named set of permissions, defined by IAM. The definition of a role is outside |
| 814 * the policy. A permission check first determines the roles that include the |
| 815 * specified permission, and then determines if the principal specified is a |
| 816 * member of a binding to at least one of these roles. The membership check is |
| 817 * recursive when a group is bound to a role. Policy examples: ``` { "bindings": |
| 818 * [ { "role": "roles/owner", "members": [ "user:mike@example.com", |
| 819 * "group:admins@example.com", "domain:google.com", |
| 820 * "serviceAccount:frontend@example.iam.gserviceaccounts.com"] }, { "role": |
| 821 * "roles/viewer", "members": ["user:sean@example.com"] } ] } ``` |
| 822 */ |
| 823 class Policy { |
| 824 /** |
| 825 * It is an error to specify multiple bindings for the same role. It is an |
| 826 * error to specify a binding with no members. |
| 827 */ |
| 828 core.List<Binding> bindings; |
| 829 /** Can be used to perform a read-modify-write. */ |
| 830 core.String etag; |
| 831 core.List<core.int> get etagAsBytes { |
| 832 return crypto.CryptoUtils.base64StringToBytes(etag); |
| 833 } |
| 834 |
| 835 void set etagAsBytes(core.List<core.int> _bytes) { |
| 836 etag = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); |
| 837 } |
| 838 core.List<Rule> rules; |
| 839 /** |
| 840 * The policy language version. The version of the policy is represented by |
| 841 * the etag. The default version is 0. |
| 842 */ |
| 843 core.int version; |
| 844 |
| 845 Policy(); |
| 846 |
| 847 Policy.fromJson(core.Map _json) { |
| 848 if (_json.containsKey("bindings")) { |
| 849 bindings = _json["bindings"].map((value) => new Binding.fromJson(value)).t
oList(); |
| 850 } |
| 851 if (_json.containsKey("etag")) { |
| 852 etag = _json["etag"]; |
| 853 } |
| 854 if (_json.containsKey("rules")) { |
| 855 rules = _json["rules"].map((value) => new Rule.fromJson(value)).toList(); |
| 856 } |
| 857 if (_json.containsKey("version")) { |
| 858 version = _json["version"]; |
| 859 } |
| 860 } |
| 861 |
| 862 core.Map toJson() { |
| 863 var _json = new core.Map(); |
| 864 if (bindings != null) { |
| 865 _json["bindings"] = bindings.map((value) => (value).toJson()).toList(); |
| 866 } |
| 867 if (etag != null) { |
| 868 _json["etag"] = etag; |
| 869 } |
| 870 if (rules != null) { |
| 871 _json["rules"] = rules.map((value) => (value).toJson()).toList(); |
| 872 } |
| 873 if (version != null) { |
| 874 _json["version"] = version; |
| 875 } |
| 876 return _json; |
| 877 } |
| 878 } |
| 879 |
| 880 /** |
| 881 * A Project is a high-level Google Cloud Platform entity. It is a container for |
| 882 * ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources. |
| 883 */ |
| 884 class Project { |
| 885 /** Creation time. Read-only. */ |
| 886 core.String createTime; |
| 887 /** |
| 888 * The labels associated with this project. Label keys must be between 1 and |
| 889 * 63 characters long and must conform to the following regular expression: |
| 890 * \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be between 0 and 63 |
| 891 * characters long and must conform to the regular expression |
| 892 * (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels can be |
| 893 * associated with a given resource. Clients should store labels in a |
| 894 * representation such as JSON that does not depend on specific characters |
| 895 * being disallowed. Example: "environment" : "dev" Read-write. |
| 896 */ |
| 897 core.Map<core.String, core.String> labels; |
| 898 /** |
| 899 * The project lifecycle state. Read-only. |
| 900 * Possible string values are: |
| 901 * - "LIFECYCLE_STATE_UNSPECIFIED" : A LIFECYCLE_STATE_UNSPECIFIED. |
| 902 * - "ACTIVE" : A ACTIVE. |
| 903 * - "DELETE_REQUESTED" : A DELETE_REQUESTED. |
| 904 * - "DELETE_IN_PROGRESS" : A DELETE_IN_PROGRESS. |
| 905 */ |
| 906 core.String lifecycleState; |
| 907 /** |
| 908 * The user-assigned name of the project. This field is optional and can |
| 909 * remain unset. Allowed characters are: lowercase and uppercase letters, |
| 910 * numbers, hyphen, single-quote, double-quote, space, and exclamation point. |
| 911 * Example: My Project Read-write. |
| 912 */ |
| 913 core.String name; |
| 914 /** |
| 915 * The unique, user-assigned ID of the project. It must be 6 to 30 lowercase |
| 916 * letters, digits, or hyphens. It must start with a letter. Trailing hyphens |
| 917 * are prohibited. Example: tokyo-rain-123 Read-only after creation. |
| 918 */ |
| 919 core.String projectId; |
| 920 /** |
| 921 * The number uniquely identifying the project. Example: 415104041262 |
| 922 * Read-only. |
| 923 */ |
| 924 core.String projectNumber; |
| 925 |
| 926 Project(); |
| 927 |
| 928 Project.fromJson(core.Map _json) { |
| 929 if (_json.containsKey("createTime")) { |
| 930 createTime = _json["createTime"]; |
| 931 } |
| 932 if (_json.containsKey("labels")) { |
| 933 labels = _json["labels"]; |
| 934 } |
| 935 if (_json.containsKey("lifecycleState")) { |
| 936 lifecycleState = _json["lifecycleState"]; |
| 937 } |
| 938 if (_json.containsKey("name")) { |
| 939 name = _json["name"]; |
| 940 } |
| 941 if (_json.containsKey("projectId")) { |
| 942 projectId = _json["projectId"]; |
| 943 } |
| 944 if (_json.containsKey("projectNumber")) { |
| 945 projectNumber = _json["projectNumber"]; |
| 946 } |
| 947 } |
| 948 |
| 949 core.Map toJson() { |
| 950 var _json = new core.Map(); |
| 951 if (createTime != null) { |
| 952 _json["createTime"] = createTime; |
| 953 } |
| 954 if (labels != null) { |
| 955 _json["labels"] = labels; |
| 956 } |
| 957 if (lifecycleState != null) { |
| 958 _json["lifecycleState"] = lifecycleState; |
| 959 } |
| 960 if (name != null) { |
| 961 _json["name"] = name; |
| 962 } |
| 963 if (projectId != null) { |
| 964 _json["projectId"] = projectId; |
| 965 } |
| 966 if (projectNumber != null) { |
| 967 _json["projectNumber"] = projectNumber; |
| 968 } |
| 969 return _json; |
| 970 } |
| 971 } |
| 972 |
| 973 /** A rule to be applied in a Policy. */ |
| 974 class Rule { |
| 975 /** |
| 976 * Required |
| 977 * Possible string values are: |
| 978 * - "NO_ACTION" : A NO_ACTION. |
| 979 * - "ALLOW" : A ALLOW. |
| 980 * - "ALLOW_WITH_LOG" : A ALLOW_WITH_LOG. |
| 981 * - "DENY" : A DENY. |
| 982 * - "DENY_WITH_LOG" : A DENY_WITH_LOG. |
| 983 * - "LOG" : A LOG. |
| 984 */ |
| 985 core.String action; |
| 986 /** Additional restrictions that must be met */ |
| 987 core.List<Condition> conditions; |
| 988 /** Human-readable description of the rule. */ |
| 989 core.String description; |
| 990 /** |
| 991 * The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of |
| 992 * entries. |
| 993 */ |
| 994 core.List<core.String> in_; |
| 995 /** |
| 996 * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries |
| 997 * that match the LOG action. |
| 998 */ |
| 999 core.List<LogConfig> logConfig; |
| 1000 /** |
| 1001 * The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of |
| 1002 * entries. The formation for in and not_in entries is the same as members in |
| 1003 * a Binding above. |
| 1004 */ |
| 1005 core.List<core.String> notIn; |
| 1006 /** |
| 1007 * A permission is a string of form '..' (e.g., 'storage.buckets.list'). A |
| 1008 * value of '*' matches all permissions, and a verb part of '*' (e.g., |
| 1009 * 'storage.buckets.*') matches all verbs. |
| 1010 */ |
| 1011 core.List<core.String> permissions; |
| 1012 |
| 1013 Rule(); |
| 1014 |
| 1015 Rule.fromJson(core.Map _json) { |
| 1016 if (_json.containsKey("action")) { |
| 1017 action = _json["action"]; |
| 1018 } |
| 1019 if (_json.containsKey("conditions")) { |
| 1020 conditions = _json["conditions"].map((value) => new Condition.fromJson(val
ue)).toList(); |
| 1021 } |
| 1022 if (_json.containsKey("description")) { |
| 1023 description = _json["description"]; |
| 1024 } |
| 1025 if (_json.containsKey("in")) { |
| 1026 in_ = _json["in"]; |
| 1027 } |
| 1028 if (_json.containsKey("logConfig")) { |
| 1029 logConfig = _json["logConfig"].map((value) => new LogConfig.fromJson(value
)).toList(); |
| 1030 } |
| 1031 if (_json.containsKey("notIn")) { |
| 1032 notIn = _json["notIn"]; |
| 1033 } |
| 1034 if (_json.containsKey("permissions")) { |
| 1035 permissions = _json["permissions"]; |
| 1036 } |
| 1037 } |
| 1038 |
| 1039 core.Map toJson() { |
| 1040 var _json = new core.Map(); |
| 1041 if (action != null) { |
| 1042 _json["action"] = action; |
| 1043 } |
| 1044 if (conditions != null) { |
| 1045 _json["conditions"] = conditions.map((value) => (value).toJson()).toList()
; |
| 1046 } |
| 1047 if (description != null) { |
| 1048 _json["description"] = description; |
| 1049 } |
| 1050 if (in_ != null) { |
| 1051 _json["in"] = in_; |
| 1052 } |
| 1053 if (logConfig != null) { |
| 1054 _json["logConfig"] = logConfig.map((value) => (value).toJson()).toList(); |
| 1055 } |
| 1056 if (notIn != null) { |
| 1057 _json["notIn"] = notIn; |
| 1058 } |
| 1059 if (permissions != null) { |
| 1060 _json["permissions"] = permissions; |
| 1061 } |
| 1062 return _json; |
| 1063 } |
| 1064 } |
| 1065 |
| 1066 /** Request message for `SetIamPolicy` method. */ |
| 1067 class SetIamPolicyRequest { |
| 1068 /** |
| 1069 * REQUIRED: The complete policy to be applied to the 'resource'. The size of |
| 1070 * the policy is limited to a few 10s of KB. An empty policy is in general a |
| 1071 * valid policy but certain services (like Projects) might reject them. |
| 1072 */ |
| 1073 Policy policy; |
| 1074 |
| 1075 SetIamPolicyRequest(); |
| 1076 |
| 1077 SetIamPolicyRequest.fromJson(core.Map _json) { |
| 1078 if (_json.containsKey("policy")) { |
| 1079 policy = new Policy.fromJson(_json["policy"]); |
| 1080 } |
| 1081 } |
| 1082 |
| 1083 core.Map toJson() { |
| 1084 var _json = new core.Map(); |
| 1085 if (policy != null) { |
| 1086 _json["policy"] = (policy).toJson(); |
| 1087 } |
| 1088 return _json; |
| 1089 } |
| 1090 } |
| 1091 |
| 1092 /** Request message for `TestIamPermissions` method. */ |
| 1093 class TestIamPermissionsRequest { |
| 1094 /** |
| 1095 * The set of permissions to check for the 'resource'. Permissions with |
| 1096 * wildcards (such as '*' or 'storage.*') are not allowed. |
| 1097 */ |
| 1098 core.List<core.String> permissions; |
| 1099 |
| 1100 TestIamPermissionsRequest(); |
| 1101 |
| 1102 TestIamPermissionsRequest.fromJson(core.Map _json) { |
| 1103 if (_json.containsKey("permissions")) { |
| 1104 permissions = _json["permissions"]; |
| 1105 } |
| 1106 } |
| 1107 |
| 1108 core.Map toJson() { |
| 1109 var _json = new core.Map(); |
| 1110 if (permissions != null) { |
| 1111 _json["permissions"] = permissions; |
| 1112 } |
| 1113 return _json; |
| 1114 } |
| 1115 } |
| 1116 |
| 1117 /** Response message for `TestIamPermissions` method. */ |
| 1118 class TestIamPermissionsResponse { |
| 1119 /** |
| 1120 * A subset of `TestPermissionsRequest.permissions` that the caller is |
| 1121 * allowed. |
| 1122 */ |
| 1123 core.List<core.String> permissions; |
| 1124 |
| 1125 TestIamPermissionsResponse(); |
| 1126 |
| 1127 TestIamPermissionsResponse.fromJson(core.Map _json) { |
| 1128 if (_json.containsKey("permissions")) { |
| 1129 permissions = _json["permissions"]; |
| 1130 } |
| 1131 } |
| 1132 |
| 1133 core.Map toJson() { |
| 1134 var _json = new core.Map(); |
| 1135 if (permissions != null) { |
| 1136 _json["permissions"] = permissions; |
| 1137 } |
| 1138 return _json; |
| 1139 } |
| 1140 } |
OLD | NEW |