| OLD | NEW |
| (Empty) |
| 1 // This is a generated file (see the discoveryapis_generator project). | |
| 2 | |
| 3 library googleapis_beta.autoscaler.v1beta2; | |
| 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 autoscaler/v1beta2'; | |
| 16 | |
| 17 /** | |
| 18 * The Google Compute Engine Autoscaler API provides autoscaling for groups of | |
| 19 * Cloud VMs. | |
| 20 */ | |
| 21 class AutoscalerApi { | |
| 22 /** View and manage your Google Compute Engine resources */ | |
| 23 static const ComputeScope = "https://www.googleapis.com/auth/compute"; | |
| 24 | |
| 25 /** View your Google Compute Engine resources */ | |
| 26 static const ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.r
eadonly"; | |
| 27 | |
| 28 | |
| 29 final commons.ApiRequester _requester; | |
| 30 | |
| 31 AutoscalersResourceApi get autoscalers => new AutoscalersResourceApi(_requeste
r); | |
| 32 ZoneOperationsResourceApi get zoneOperations => new ZoneOperationsResourceApi(
_requester); | |
| 33 ZonesResourceApi get zones => new ZonesResourceApi(_requester); | |
| 34 | |
| 35 AutoscalerApi(http.Client client, {core.String rootUrl: "https://www.googleapi
s.com/", core.String servicePath: "autoscaler/v1beta2/"}) : | |
| 36 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | |
| 37 } | |
| 38 | |
| 39 | |
| 40 class AutoscalersResourceApi { | |
| 41 final commons.ApiRequester _requester; | |
| 42 | |
| 43 AutoscalersResourceApi(commons.ApiRequester client) : | |
| 44 _requester = client; | |
| 45 | |
| 46 /** | |
| 47 * Deletes the specified Autoscaler resource. | |
| 48 * | |
| 49 * Request parameters: | |
| 50 * | |
| 51 * [project] - Project ID of Autoscaler resource. | |
| 52 * | |
| 53 * [zone] - Zone name of Autoscaler resource. | |
| 54 * | |
| 55 * [autoscaler] - Name of the Autoscaler resource. | |
| 56 * | |
| 57 * Completes with a [Operation]. | |
| 58 * | |
| 59 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 60 * error. | |
| 61 * | |
| 62 * If the used [http.Client] completes with an error when making a REST call, | |
| 63 * this method will complete with the same error. | |
| 64 */ | |
| 65 async.Future<Operation> delete(core.String project, core.String zone, core.Str
ing autoscaler) { | |
| 66 var _url = null; | |
| 67 var _queryParams = new core.Map(); | |
| 68 var _uploadMedia = null; | |
| 69 var _uploadOptions = null; | |
| 70 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 71 var _body = null; | |
| 72 | |
| 73 if (project == null) { | |
| 74 throw new core.ArgumentError("Parameter project is required."); | |
| 75 } | |
| 76 if (zone == null) { | |
| 77 throw new core.ArgumentError("Parameter zone is required."); | |
| 78 } | |
| 79 if (autoscaler == null) { | |
| 80 throw new core.ArgumentError("Parameter autoscaler is required."); | |
| 81 } | |
| 82 | |
| 83 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers/' + commons.Escaper.ecap
eVariable('$autoscaler'); | |
| 84 | |
| 85 var _response = _requester.request(_url, | |
| 86 "DELETE", | |
| 87 body: _body, | |
| 88 queryParams: _queryParams, | |
| 89 uploadOptions: _uploadOptions, | |
| 90 uploadMedia: _uploadMedia, | |
| 91 downloadOptions: _downloadOptions); | |
| 92 return _response.then((data) => new Operation.fromJson(data)); | |
| 93 } | |
| 94 | |
| 95 /** | |
| 96 * Gets the specified Autoscaler resource. | |
| 97 * | |
| 98 * Request parameters: | |
| 99 * | |
| 100 * [project] - Project ID of Autoscaler resource. | |
| 101 * | |
| 102 * [zone] - Zone name of Autoscaler resource. | |
| 103 * | |
| 104 * [autoscaler] - Name of the Autoscaler resource. | |
| 105 * | |
| 106 * Completes with a [Autoscaler]. | |
| 107 * | |
| 108 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 109 * error. | |
| 110 * | |
| 111 * If the used [http.Client] completes with an error when making a REST call, | |
| 112 * this method will complete with the same error. | |
| 113 */ | |
| 114 async.Future<Autoscaler> get(core.String project, core.String zone, core.Strin
g autoscaler) { | |
| 115 var _url = null; | |
| 116 var _queryParams = new core.Map(); | |
| 117 var _uploadMedia = null; | |
| 118 var _uploadOptions = null; | |
| 119 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 120 var _body = null; | |
| 121 | |
| 122 if (project == null) { | |
| 123 throw new core.ArgumentError("Parameter project is required."); | |
| 124 } | |
| 125 if (zone == null) { | |
| 126 throw new core.ArgumentError("Parameter zone is required."); | |
| 127 } | |
| 128 if (autoscaler == null) { | |
| 129 throw new core.ArgumentError("Parameter autoscaler is required."); | |
| 130 } | |
| 131 | |
| 132 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers/' + commons.Escaper.ecap
eVariable('$autoscaler'); | |
| 133 | |
| 134 var _response = _requester.request(_url, | |
| 135 "GET", | |
| 136 body: _body, | |
| 137 queryParams: _queryParams, | |
| 138 uploadOptions: _uploadOptions, | |
| 139 uploadMedia: _uploadMedia, | |
| 140 downloadOptions: _downloadOptions); | |
| 141 return _response.then((data) => new Autoscaler.fromJson(data)); | |
| 142 } | |
| 143 | |
| 144 /** | |
| 145 * Adds new Autoscaler resource. | |
| 146 * | |
| 147 * [request] - The metadata request object. | |
| 148 * | |
| 149 * Request parameters: | |
| 150 * | |
| 151 * [project] - Project ID of Autoscaler resource. | |
| 152 * | |
| 153 * [zone] - Zone name of Autoscaler resource. | |
| 154 * | |
| 155 * Completes with a [Operation]. | |
| 156 * | |
| 157 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 158 * error. | |
| 159 * | |
| 160 * If the used [http.Client] completes with an error when making a REST call, | |
| 161 * this method will complete with the same error. | |
| 162 */ | |
| 163 async.Future<Operation> insert(Autoscaler request, core.String project, core.S
tring zone) { | |
| 164 var _url = null; | |
| 165 var _queryParams = new core.Map(); | |
| 166 var _uploadMedia = null; | |
| 167 var _uploadOptions = null; | |
| 168 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 169 var _body = null; | |
| 170 | |
| 171 if (request != null) { | |
| 172 _body = convert.JSON.encode((request).toJson()); | |
| 173 } | |
| 174 if (project == null) { | |
| 175 throw new core.ArgumentError("Parameter project is required."); | |
| 176 } | |
| 177 if (zone == null) { | |
| 178 throw new core.ArgumentError("Parameter zone is required."); | |
| 179 } | |
| 180 | |
| 181 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers'; | |
| 182 | |
| 183 var _response = _requester.request(_url, | |
| 184 "POST", | |
| 185 body: _body, | |
| 186 queryParams: _queryParams, | |
| 187 uploadOptions: _uploadOptions, | |
| 188 uploadMedia: _uploadMedia, | |
| 189 downloadOptions: _downloadOptions); | |
| 190 return _response.then((data) => new Operation.fromJson(data)); | |
| 191 } | |
| 192 | |
| 193 /** | |
| 194 * Lists all Autoscaler resources in this zone. | |
| 195 * | |
| 196 * Request parameters: | |
| 197 * | |
| 198 * [project] - Project ID of Autoscaler resource. | |
| 199 * | |
| 200 * [zone] - Zone name of Autoscaler resource. | |
| 201 * | |
| 202 * [filter] - null | |
| 203 * | |
| 204 * [maxResults] - null | |
| 205 * Value must be between "0" and "500". | |
| 206 * | |
| 207 * [pageToken] - null | |
| 208 * | |
| 209 * Completes with a [AutoscalerListResponse]. | |
| 210 * | |
| 211 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 212 * error. | |
| 213 * | |
| 214 * If the used [http.Client] completes with an error when making a REST call, | |
| 215 * this method will complete with the same error. | |
| 216 */ | |
| 217 async.Future<AutoscalerListResponse> list(core.String project, core.String zon
e, {core.String filter, core.int maxResults, core.String pageToken}) { | |
| 218 var _url = null; | |
| 219 var _queryParams = new core.Map(); | |
| 220 var _uploadMedia = null; | |
| 221 var _uploadOptions = null; | |
| 222 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 223 var _body = null; | |
| 224 | |
| 225 if (project == null) { | |
| 226 throw new core.ArgumentError("Parameter project is required."); | |
| 227 } | |
| 228 if (zone == null) { | |
| 229 throw new core.ArgumentError("Parameter zone is required."); | |
| 230 } | |
| 231 if (filter != null) { | |
| 232 _queryParams["filter"] = [filter]; | |
| 233 } | |
| 234 if (maxResults != null) { | |
| 235 _queryParams["maxResults"] = ["${maxResults}"]; | |
| 236 } | |
| 237 if (pageToken != null) { | |
| 238 _queryParams["pageToken"] = [pageToken]; | |
| 239 } | |
| 240 | |
| 241 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers'; | |
| 242 | |
| 243 var _response = _requester.request(_url, | |
| 244 "GET", | |
| 245 body: _body, | |
| 246 queryParams: _queryParams, | |
| 247 uploadOptions: _uploadOptions, | |
| 248 uploadMedia: _uploadMedia, | |
| 249 downloadOptions: _downloadOptions); | |
| 250 return _response.then((data) => new AutoscalerListResponse.fromJson(data)); | |
| 251 } | |
| 252 | |
| 253 /** | |
| 254 * Update the entire content of the Autoscaler resource. This method supports | |
| 255 * patch semantics. | |
| 256 * | |
| 257 * [request] - The metadata request object. | |
| 258 * | |
| 259 * Request parameters: | |
| 260 * | |
| 261 * [project] - Project ID of Autoscaler resource. | |
| 262 * | |
| 263 * [zone] - Zone name of Autoscaler resource. | |
| 264 * | |
| 265 * [autoscaler] - Name of the Autoscaler resource. | |
| 266 * | |
| 267 * Completes with a [Operation]. | |
| 268 * | |
| 269 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 270 * error. | |
| 271 * | |
| 272 * If the used [http.Client] completes with an error when making a REST call, | |
| 273 * this method will complete with the same error. | |
| 274 */ | |
| 275 async.Future<Operation> patch(Autoscaler request, core.String project, core.St
ring zone, core.String autoscaler) { | |
| 276 var _url = null; | |
| 277 var _queryParams = new core.Map(); | |
| 278 var _uploadMedia = null; | |
| 279 var _uploadOptions = null; | |
| 280 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 281 var _body = null; | |
| 282 | |
| 283 if (request != null) { | |
| 284 _body = convert.JSON.encode((request).toJson()); | |
| 285 } | |
| 286 if (project == null) { | |
| 287 throw new core.ArgumentError("Parameter project is required."); | |
| 288 } | |
| 289 if (zone == null) { | |
| 290 throw new core.ArgumentError("Parameter zone is required."); | |
| 291 } | |
| 292 if (autoscaler == null) { | |
| 293 throw new core.ArgumentError("Parameter autoscaler is required."); | |
| 294 } | |
| 295 | |
| 296 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers/' + commons.Escaper.ecap
eVariable('$autoscaler'); | |
| 297 | |
| 298 var _response = _requester.request(_url, | |
| 299 "PATCH", | |
| 300 body: _body, | |
| 301 queryParams: _queryParams, | |
| 302 uploadOptions: _uploadOptions, | |
| 303 uploadMedia: _uploadMedia, | |
| 304 downloadOptions: _downloadOptions); | |
| 305 return _response.then((data) => new Operation.fromJson(data)); | |
| 306 } | |
| 307 | |
| 308 /** | |
| 309 * Update the entire content of the Autoscaler resource. | |
| 310 * | |
| 311 * [request] - The metadata request object. | |
| 312 * | |
| 313 * Request parameters: | |
| 314 * | |
| 315 * [project] - Project ID of Autoscaler resource. | |
| 316 * | |
| 317 * [zone] - Zone name of Autoscaler resource. | |
| 318 * | |
| 319 * [autoscaler] - Name of the Autoscaler resource. | |
| 320 * | |
| 321 * Completes with a [Operation]. | |
| 322 * | |
| 323 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 324 * error. | |
| 325 * | |
| 326 * If the used [http.Client] completes with an error when making a REST call, | |
| 327 * this method will complete with the same error. | |
| 328 */ | |
| 329 async.Future<Operation> update(Autoscaler request, core.String project, core.S
tring zone, core.String autoscaler) { | |
| 330 var _url = null; | |
| 331 var _queryParams = new core.Map(); | |
| 332 var _uploadMedia = null; | |
| 333 var _uploadOptions = null; | |
| 334 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 335 var _body = null; | |
| 336 | |
| 337 if (request != null) { | |
| 338 _body = convert.JSON.encode((request).toJson()); | |
| 339 } | |
| 340 if (project == null) { | |
| 341 throw new core.ArgumentError("Parameter project is required."); | |
| 342 } | |
| 343 if (zone == null) { | |
| 344 throw new core.ArgumentError("Parameter zone is required."); | |
| 345 } | |
| 346 if (autoscaler == null) { | |
| 347 throw new core.ArgumentError("Parameter autoscaler is required."); | |
| 348 } | |
| 349 | |
| 350 _url = 'projects/' + commons.Escaper.ecapeVariable('$project') + '/zones/' +
commons.Escaper.ecapeVariable('$zone') + '/autoscalers/' + commons.Escaper.ecap
eVariable('$autoscaler'); | |
| 351 | |
| 352 var _response = _requester.request(_url, | |
| 353 "PUT", | |
| 354 body: _body, | |
| 355 queryParams: _queryParams, | |
| 356 uploadOptions: _uploadOptions, | |
| 357 uploadMedia: _uploadMedia, | |
| 358 downloadOptions: _downloadOptions); | |
| 359 return _response.then((data) => new Operation.fromJson(data)); | |
| 360 } | |
| 361 | |
| 362 } | |
| 363 | |
| 364 | |
| 365 class ZoneOperationsResourceApi { | |
| 366 final commons.ApiRequester _requester; | |
| 367 | |
| 368 ZoneOperationsResourceApi(commons.ApiRequester client) : | |
| 369 _requester = client; | |
| 370 | |
| 371 /** | |
| 372 * Deletes the specified zone-specific operation resource. | |
| 373 * | |
| 374 * Request parameters: | |
| 375 * | |
| 376 * [project] - null | |
| 377 * Value must have pattern | |
| 378 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". | |
| 379 * | |
| 380 * [zone] - null | |
| 381 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". | |
| 382 * | |
| 383 * [operation] - null | |
| 384 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". | |
| 385 * | |
| 386 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 387 * error. | |
| 388 * | |
| 389 * If the used [http.Client] completes with an error when making a REST call, | |
| 390 * this method will complete with the same error. | |
| 391 */ | |
| 392 async.Future delete(core.String project, core.String zone, core.String operati
on) { | |
| 393 var _url = null; | |
| 394 var _queryParams = new core.Map(); | |
| 395 var _uploadMedia = null; | |
| 396 var _uploadOptions = null; | |
| 397 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 398 var _body = null; | |
| 399 | |
| 400 if (project == null) { | |
| 401 throw new core.ArgumentError("Parameter project is required."); | |
| 402 } | |
| 403 if (zone == null) { | |
| 404 throw new core.ArgumentError("Parameter zone is required."); | |
| 405 } | |
| 406 if (operation == null) { | |
| 407 throw new core.ArgumentError("Parameter operation is required."); | |
| 408 } | |
| 409 | |
| 410 _downloadOptions = null; | |
| 411 | |
| 412 _url = commons.Escaper.ecapeVariable('$project') + '/zones/' + commons.Escap
er.ecapeVariable('$zone') + '/operations/' + commons.Escaper.ecapeVariable('$ope
ration'); | |
| 413 | |
| 414 var _response = _requester.request(_url, | |
| 415 "DELETE", | |
| 416 body: _body, | |
| 417 queryParams: _queryParams, | |
| 418 uploadOptions: _uploadOptions, | |
| 419 uploadMedia: _uploadMedia, | |
| 420 downloadOptions: _downloadOptions); | |
| 421 return _response.then((data) => null); | |
| 422 } | |
| 423 | |
| 424 /** | |
| 425 * Retrieves the specified zone-specific operation resource. | |
| 426 * | |
| 427 * Request parameters: | |
| 428 * | |
| 429 * [project] - null | |
| 430 * Value must have pattern | |
| 431 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". | |
| 432 * | |
| 433 * [zone] - null | |
| 434 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". | |
| 435 * | |
| 436 * [operation] - null | |
| 437 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". | |
| 438 * | |
| 439 * Completes with a [Operation]. | |
| 440 * | |
| 441 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 442 * error. | |
| 443 * | |
| 444 * If the used [http.Client] completes with an error when making a REST call, | |
| 445 * this method will complete with the same error. | |
| 446 */ | |
| 447 async.Future<Operation> get(core.String project, core.String zone, core.String
operation) { | |
| 448 var _url = null; | |
| 449 var _queryParams = new core.Map(); | |
| 450 var _uploadMedia = null; | |
| 451 var _uploadOptions = null; | |
| 452 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 453 var _body = null; | |
| 454 | |
| 455 if (project == null) { | |
| 456 throw new core.ArgumentError("Parameter project is required."); | |
| 457 } | |
| 458 if (zone == null) { | |
| 459 throw new core.ArgumentError("Parameter zone is required."); | |
| 460 } | |
| 461 if (operation == null) { | |
| 462 throw new core.ArgumentError("Parameter operation is required."); | |
| 463 } | |
| 464 | |
| 465 _url = commons.Escaper.ecapeVariable('$project') + '/zones/' + commons.Escap
er.ecapeVariable('$zone') + '/operations/' + commons.Escaper.ecapeVariable('$ope
ration'); | |
| 466 | |
| 467 var _response = _requester.request(_url, | |
| 468 "GET", | |
| 469 body: _body, | |
| 470 queryParams: _queryParams, | |
| 471 uploadOptions: _uploadOptions, | |
| 472 uploadMedia: _uploadMedia, | |
| 473 downloadOptions: _downloadOptions); | |
| 474 return _response.then((data) => new Operation.fromJson(data)); | |
| 475 } | |
| 476 | |
| 477 /** | |
| 478 * Retrieves the list of operation resources contained within the specified | |
| 479 * zone. | |
| 480 * | |
| 481 * Request parameters: | |
| 482 * | |
| 483 * [project] - null | |
| 484 * Value must have pattern | |
| 485 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". | |
| 486 * | |
| 487 * [zone] - null | |
| 488 * Value must have pattern "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?". | |
| 489 * | |
| 490 * [filter] - null | |
| 491 * | |
| 492 * [maxResults] - null | |
| 493 * Value must be between "0" and "500". | |
| 494 * | |
| 495 * [pageToken] - null | |
| 496 * | |
| 497 * Completes with a [OperationList]. | |
| 498 * | |
| 499 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 500 * error. | |
| 501 * | |
| 502 * If the used [http.Client] completes with an error when making a REST call, | |
| 503 * this method will complete with the same error. | |
| 504 */ | |
| 505 async.Future<OperationList> list(core.String project, core.String zone, {core.
String filter, core.int maxResults, core.String pageToken}) { | |
| 506 var _url = null; | |
| 507 var _queryParams = new core.Map(); | |
| 508 var _uploadMedia = null; | |
| 509 var _uploadOptions = null; | |
| 510 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 511 var _body = null; | |
| 512 | |
| 513 if (project == null) { | |
| 514 throw new core.ArgumentError("Parameter project is required."); | |
| 515 } | |
| 516 if (zone == null) { | |
| 517 throw new core.ArgumentError("Parameter zone is required."); | |
| 518 } | |
| 519 if (filter != null) { | |
| 520 _queryParams["filter"] = [filter]; | |
| 521 } | |
| 522 if (maxResults != null) { | |
| 523 _queryParams["maxResults"] = ["${maxResults}"]; | |
| 524 } | |
| 525 if (pageToken != null) { | |
| 526 _queryParams["pageToken"] = [pageToken]; | |
| 527 } | |
| 528 | |
| 529 _url = commons.Escaper.ecapeVariable('$project') + '/zones/' + commons.Escap
er.ecapeVariable('$zone') + '/operations'; | |
| 530 | |
| 531 var _response = _requester.request(_url, | |
| 532 "GET", | |
| 533 body: _body, | |
| 534 queryParams: _queryParams, | |
| 535 uploadOptions: _uploadOptions, | |
| 536 uploadMedia: _uploadMedia, | |
| 537 downloadOptions: _downloadOptions); | |
| 538 return _response.then((data) => new OperationList.fromJson(data)); | |
| 539 } | |
| 540 | |
| 541 } | |
| 542 | |
| 543 | |
| 544 class ZonesResourceApi { | |
| 545 final commons.ApiRequester _requester; | |
| 546 | |
| 547 ZonesResourceApi(commons.ApiRequester client) : | |
| 548 _requester = client; | |
| 549 | |
| 550 /** | |
| 551 * Request parameters: | |
| 552 * | |
| 553 * [filter] - null | |
| 554 * | |
| 555 * [maxResults] - null | |
| 556 * Value must be between "0" and "500". | |
| 557 * | |
| 558 * [pageToken] - null | |
| 559 * | |
| 560 * [project] - null | |
| 561 * Value must have pattern | |
| 562 * "(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{
1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))". | |
| 563 * | |
| 564 * Completes with a [ZoneList]. | |
| 565 * | |
| 566 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | |
| 567 * error. | |
| 568 * | |
| 569 * If the used [http.Client] completes with an error when making a REST call, | |
| 570 * this method will complete with the same error. | |
| 571 */ | |
| 572 async.Future<ZoneList> list({core.String filter, core.int maxResults, core.Str
ing pageToken, core.String project}) { | |
| 573 var _url = null; | |
| 574 var _queryParams = new core.Map(); | |
| 575 var _uploadMedia = null; | |
| 576 var _uploadOptions = null; | |
| 577 var _downloadOptions = commons.DownloadOptions.Metadata; | |
| 578 var _body = null; | |
| 579 | |
| 580 if (filter != null) { | |
| 581 _queryParams["filter"] = [filter]; | |
| 582 } | |
| 583 if (maxResults != null) { | |
| 584 _queryParams["maxResults"] = ["${maxResults}"]; | |
| 585 } | |
| 586 if (pageToken != null) { | |
| 587 _queryParams["pageToken"] = [pageToken]; | |
| 588 } | |
| 589 if (project != null) { | |
| 590 _queryParams["project"] = [project]; | |
| 591 } | |
| 592 | |
| 593 _url = 'zones'; | |
| 594 | |
| 595 var _response = _requester.request(_url, | |
| 596 "GET", | |
| 597 body: _body, | |
| 598 queryParams: _queryParams, | |
| 599 uploadOptions: _uploadOptions, | |
| 600 uploadMedia: _uploadMedia, | |
| 601 downloadOptions: _downloadOptions); | |
| 602 return _response.then((data) => new ZoneList.fromJson(data)); | |
| 603 } | |
| 604 | |
| 605 } | |
| 606 | |
| 607 | |
| 608 | |
| 609 /** Cloud Autoscaler resource. */ | |
| 610 class Autoscaler { | |
| 611 /** Configuration parameters for autoscaling algorithm. */ | |
| 612 AutoscalingPolicy autoscalingPolicy; | |
| 613 /** [Output Only] Creation timestamp in RFC3339 text format. */ | |
| 614 core.String creationTimestamp; | |
| 615 /** | |
| 616 * An optional textual description of the resource provided by the client. | |
| 617 */ | |
| 618 core.String description; | |
| 619 /** | |
| 620 * [Output Only] Unique identifier for the resource; defined by the server. | |
| 621 */ | |
| 622 core.String id; | |
| 623 /** Type of resource. */ | |
| 624 core.String kind; | |
| 625 /** Name of the Autoscaler resource. Must be unique per project and zone. */ | |
| 626 core.String name; | |
| 627 /** [Output Only] A self-link to the Autoscaler configuration resource. */ | |
| 628 core.String selfLink; | |
| 629 /** | |
| 630 * URL to the entity which will be autoscaled. Currently the only supported | |
| 631 * value is ReplicaPool?s URL. Note: it is illegal to specify multiple | |
| 632 * Autoscalers for the same target. | |
| 633 */ | |
| 634 core.String target; | |
| 635 | |
| 636 Autoscaler(); | |
| 637 | |
| 638 Autoscaler.fromJson(core.Map _json) { | |
| 639 if (_json.containsKey("autoscalingPolicy")) { | |
| 640 autoscalingPolicy = new AutoscalingPolicy.fromJson(_json["autoscalingPolic
y"]); | |
| 641 } | |
| 642 if (_json.containsKey("creationTimestamp")) { | |
| 643 creationTimestamp = _json["creationTimestamp"]; | |
| 644 } | |
| 645 if (_json.containsKey("description")) { | |
| 646 description = _json["description"]; | |
| 647 } | |
| 648 if (_json.containsKey("id")) { | |
| 649 id = _json["id"]; | |
| 650 } | |
| 651 if (_json.containsKey("kind")) { | |
| 652 kind = _json["kind"]; | |
| 653 } | |
| 654 if (_json.containsKey("name")) { | |
| 655 name = _json["name"]; | |
| 656 } | |
| 657 if (_json.containsKey("selfLink")) { | |
| 658 selfLink = _json["selfLink"]; | |
| 659 } | |
| 660 if (_json.containsKey("target")) { | |
| 661 target = _json["target"]; | |
| 662 } | |
| 663 } | |
| 664 | |
| 665 core.Map toJson() { | |
| 666 var _json = new core.Map(); | |
| 667 if (autoscalingPolicy != null) { | |
| 668 _json["autoscalingPolicy"] = (autoscalingPolicy).toJson(); | |
| 669 } | |
| 670 if (creationTimestamp != null) { | |
| 671 _json["creationTimestamp"] = creationTimestamp; | |
| 672 } | |
| 673 if (description != null) { | |
| 674 _json["description"] = description; | |
| 675 } | |
| 676 if (id != null) { | |
| 677 _json["id"] = id; | |
| 678 } | |
| 679 if (kind != null) { | |
| 680 _json["kind"] = kind; | |
| 681 } | |
| 682 if (name != null) { | |
| 683 _json["name"] = name; | |
| 684 } | |
| 685 if (selfLink != null) { | |
| 686 _json["selfLink"] = selfLink; | |
| 687 } | |
| 688 if (target != null) { | |
| 689 _json["target"] = target; | |
| 690 } | |
| 691 return _json; | |
| 692 } | |
| 693 } | |
| 694 | |
| 695 class AutoscalerListResponse { | |
| 696 /** Autoscaler resources. */ | |
| 697 core.List<Autoscaler> items; | |
| 698 /** Type of resource. */ | |
| 699 core.String kind; | |
| 700 /** [Output only] A token used to continue a truncated list request. */ | |
| 701 core.String nextPageToken; | |
| 702 | |
| 703 AutoscalerListResponse(); | |
| 704 | |
| 705 AutoscalerListResponse.fromJson(core.Map _json) { | |
| 706 if (_json.containsKey("items")) { | |
| 707 items = _json["items"].map((value) => new Autoscaler.fromJson(value)).toLi
st(); | |
| 708 } | |
| 709 if (_json.containsKey("kind")) { | |
| 710 kind = _json["kind"]; | |
| 711 } | |
| 712 if (_json.containsKey("nextPageToken")) { | |
| 713 nextPageToken = _json["nextPageToken"]; | |
| 714 } | |
| 715 } | |
| 716 | |
| 717 core.Map toJson() { | |
| 718 var _json = new core.Map(); | |
| 719 if (items != null) { | |
| 720 _json["items"] = items.map((value) => (value).toJson()).toList(); | |
| 721 } | |
| 722 if (kind != null) { | |
| 723 _json["kind"] = kind; | |
| 724 } | |
| 725 if (nextPageToken != null) { | |
| 726 _json["nextPageToken"] = nextPageToken; | |
| 727 } | |
| 728 return _json; | |
| 729 } | |
| 730 } | |
| 731 | |
| 732 /** Cloud Autoscaler policy. */ | |
| 733 class AutoscalingPolicy { | |
| 734 /** | |
| 735 * The number of seconds that the Autoscaler should wait between two | |
| 736 * succeeding changes to the number of virtual machines. You should define an | |
| 737 * interval that is at least as long as the initialization time of a virtual | |
| 738 * machine and the time it may take for replica pool to create the virtual | |
| 739 * machine. The default is 60 seconds. | |
| 740 */ | |
| 741 core.int coolDownPeriodSec; | |
| 742 /** Configuration parameters of CPU based autoscaling policy. */ | |
| 743 AutoscalingPolicyCpuUtilization cpuUtilization; | |
| 744 /** Configuration parameters of autoscaling based on custom metric. */ | |
| 745 core.List<AutoscalingPolicyCustomMetricUtilization> customMetricUtilizations; | |
| 746 /** Configuration parameters of autoscaling based on load balancer. */ | |
| 747 AutoscalingPolicyLoadBalancingUtilization loadBalancingUtilization; | |
| 748 /** The maximum number of replicas that the Autoscaler can scale up to. */ | |
| 749 core.int maxNumReplicas; | |
| 750 /** The minimum number of replicas that the Autoscaler can scale down to. */ | |
| 751 core.int minNumReplicas; | |
| 752 | |
| 753 AutoscalingPolicy(); | |
| 754 | |
| 755 AutoscalingPolicy.fromJson(core.Map _json) { | |
| 756 if (_json.containsKey("coolDownPeriodSec")) { | |
| 757 coolDownPeriodSec = _json["coolDownPeriodSec"]; | |
| 758 } | |
| 759 if (_json.containsKey("cpuUtilization")) { | |
| 760 cpuUtilization = new AutoscalingPolicyCpuUtilization.fromJson(_json["cpuUt
ilization"]); | |
| 761 } | |
| 762 if (_json.containsKey("customMetricUtilizations")) { | |
| 763 customMetricUtilizations = _json["customMetricUtilizations"].map((value) =
> new AutoscalingPolicyCustomMetricUtilization.fromJson(value)).toList(); | |
| 764 } | |
| 765 if (_json.containsKey("loadBalancingUtilization")) { | |
| 766 loadBalancingUtilization = new AutoscalingPolicyLoadBalancingUtilization.f
romJson(_json["loadBalancingUtilization"]); | |
| 767 } | |
| 768 if (_json.containsKey("maxNumReplicas")) { | |
| 769 maxNumReplicas = _json["maxNumReplicas"]; | |
| 770 } | |
| 771 if (_json.containsKey("minNumReplicas")) { | |
| 772 minNumReplicas = _json["minNumReplicas"]; | |
| 773 } | |
| 774 } | |
| 775 | |
| 776 core.Map toJson() { | |
| 777 var _json = new core.Map(); | |
| 778 if (coolDownPeriodSec != null) { | |
| 779 _json["coolDownPeriodSec"] = coolDownPeriodSec; | |
| 780 } | |
| 781 if (cpuUtilization != null) { | |
| 782 _json["cpuUtilization"] = (cpuUtilization).toJson(); | |
| 783 } | |
| 784 if (customMetricUtilizations != null) { | |
| 785 _json["customMetricUtilizations"] = customMetricUtilizations.map((value) =
> (value).toJson()).toList(); | |
| 786 } | |
| 787 if (loadBalancingUtilization != null) { | |
| 788 _json["loadBalancingUtilization"] = (loadBalancingUtilization).toJson(); | |
| 789 } | |
| 790 if (maxNumReplicas != null) { | |
| 791 _json["maxNumReplicas"] = maxNumReplicas; | |
| 792 } | |
| 793 if (minNumReplicas != null) { | |
| 794 _json["minNumReplicas"] = minNumReplicas; | |
| 795 } | |
| 796 return _json; | |
| 797 } | |
| 798 } | |
| 799 | |
| 800 /** CPU utilization policy. */ | |
| 801 class AutoscalingPolicyCpuUtilization { | |
| 802 /** | |
| 803 * The target utilization that the Autoscaler should maintain. It is | |
| 804 * represented as a fraction of used cores. For example: 6 cores used in | |
| 805 * 8-core VM are represented here as 0.75. Must be a float value between (0, | |
| 806 * 1]. If not defined, the default is 0.8. | |
| 807 */ | |
| 808 core.double utilizationTarget; | |
| 809 | |
| 810 AutoscalingPolicyCpuUtilization(); | |
| 811 | |
| 812 AutoscalingPolicyCpuUtilization.fromJson(core.Map _json) { | |
| 813 if (_json.containsKey("utilizationTarget")) { | |
| 814 utilizationTarget = _json["utilizationTarget"]; | |
| 815 } | |
| 816 } | |
| 817 | |
| 818 core.Map toJson() { | |
| 819 var _json = new core.Map(); | |
| 820 if (utilizationTarget != null) { | |
| 821 _json["utilizationTarget"] = utilizationTarget; | |
| 822 } | |
| 823 return _json; | |
| 824 } | |
| 825 } | |
| 826 | |
| 827 /** Custom utilization metric policy. */ | |
| 828 class AutoscalingPolicyCustomMetricUtilization { | |
| 829 /** | |
| 830 * Identifier of the metric. It should be a Cloud Monitoring metric. The | |
| 831 * metric can not have negative values. The metric should be an utilization | |
| 832 * metric (increasing number of VMs handling requests x times should reduce | |
| 833 * average value of the metric roughly x times). For example you could use: | |
| 834 * compute.googleapis.com/instance/network/received_bytes_count. | |
| 835 */ | |
| 836 core.String metric; | |
| 837 /** | |
| 838 * Target value of the metric which Autoscaler should maintain. Must be a | |
| 839 * positive value. | |
| 840 */ | |
| 841 core.double utilizationTarget; | |
| 842 /** Defines type in which utilization_target is expressed. */ | |
| 843 core.String utilizationTargetType; | |
| 844 | |
| 845 AutoscalingPolicyCustomMetricUtilization(); | |
| 846 | |
| 847 AutoscalingPolicyCustomMetricUtilization.fromJson(core.Map _json) { | |
| 848 if (_json.containsKey("metric")) { | |
| 849 metric = _json["metric"]; | |
| 850 } | |
| 851 if (_json.containsKey("utilizationTarget")) { | |
| 852 utilizationTarget = _json["utilizationTarget"]; | |
| 853 } | |
| 854 if (_json.containsKey("utilizationTargetType")) { | |
| 855 utilizationTargetType = _json["utilizationTargetType"]; | |
| 856 } | |
| 857 } | |
| 858 | |
| 859 core.Map toJson() { | |
| 860 var _json = new core.Map(); | |
| 861 if (metric != null) { | |
| 862 _json["metric"] = metric; | |
| 863 } | |
| 864 if (utilizationTarget != null) { | |
| 865 _json["utilizationTarget"] = utilizationTarget; | |
| 866 } | |
| 867 if (utilizationTargetType != null) { | |
| 868 _json["utilizationTargetType"] = utilizationTargetType; | |
| 869 } | |
| 870 return _json; | |
| 871 } | |
| 872 } | |
| 873 | |
| 874 /** Load balancing utilization policy. */ | |
| 875 class AutoscalingPolicyLoadBalancingUtilization { | |
| 876 /** | |
| 877 * Fraction of backend capacity utilization (set in HTTP load balancing | |
| 878 * configuration) that Autoscaler should maintain. Must be a positive float | |
| 879 * value. If not defined, the default is 0.8. For example if your | |
| 880 * maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set | |
| 881 * at 10 and you would like to keep number of instances such that each | |
| 882 * instance receives 7 QPS on average, set this to 0.7. | |
| 883 */ | |
| 884 core.double utilizationTarget; | |
| 885 | |
| 886 AutoscalingPolicyLoadBalancingUtilization(); | |
| 887 | |
| 888 AutoscalingPolicyLoadBalancingUtilization.fromJson(core.Map _json) { | |
| 889 if (_json.containsKey("utilizationTarget")) { | |
| 890 utilizationTarget = _json["utilizationTarget"]; | |
| 891 } | |
| 892 } | |
| 893 | |
| 894 core.Map toJson() { | |
| 895 var _json = new core.Map(); | |
| 896 if (utilizationTarget != null) { | |
| 897 _json["utilizationTarget"] = utilizationTarget; | |
| 898 } | |
| 899 return _json; | |
| 900 } | |
| 901 } | |
| 902 | |
| 903 class DeprecationStatus { | |
| 904 core.String deleted; | |
| 905 core.String deprecated; | |
| 906 core.String obsolete; | |
| 907 core.String replacement; | |
| 908 core.String state; | |
| 909 | |
| 910 DeprecationStatus(); | |
| 911 | |
| 912 DeprecationStatus.fromJson(core.Map _json) { | |
| 913 if (_json.containsKey("deleted")) { | |
| 914 deleted = _json["deleted"]; | |
| 915 } | |
| 916 if (_json.containsKey("deprecated")) { | |
| 917 deprecated = _json["deprecated"]; | |
| 918 } | |
| 919 if (_json.containsKey("obsolete")) { | |
| 920 obsolete = _json["obsolete"]; | |
| 921 } | |
| 922 if (_json.containsKey("replacement")) { | |
| 923 replacement = _json["replacement"]; | |
| 924 } | |
| 925 if (_json.containsKey("state")) { | |
| 926 state = _json["state"]; | |
| 927 } | |
| 928 } | |
| 929 | |
| 930 core.Map toJson() { | |
| 931 var _json = new core.Map(); | |
| 932 if (deleted != null) { | |
| 933 _json["deleted"] = deleted; | |
| 934 } | |
| 935 if (deprecated != null) { | |
| 936 _json["deprecated"] = deprecated; | |
| 937 } | |
| 938 if (obsolete != null) { | |
| 939 _json["obsolete"] = obsolete; | |
| 940 } | |
| 941 if (replacement != null) { | |
| 942 _json["replacement"] = replacement; | |
| 943 } | |
| 944 if (state != null) { | |
| 945 _json["state"] = state; | |
| 946 } | |
| 947 return _json; | |
| 948 } | |
| 949 } | |
| 950 | |
| 951 class OperationErrorErrors { | |
| 952 core.String code; | |
| 953 core.String location; | |
| 954 core.String message; | |
| 955 | |
| 956 OperationErrorErrors(); | |
| 957 | |
| 958 OperationErrorErrors.fromJson(core.Map _json) { | |
| 959 if (_json.containsKey("code")) { | |
| 960 code = _json["code"]; | |
| 961 } | |
| 962 if (_json.containsKey("location")) { | |
| 963 location = _json["location"]; | |
| 964 } | |
| 965 if (_json.containsKey("message")) { | |
| 966 message = _json["message"]; | |
| 967 } | |
| 968 } | |
| 969 | |
| 970 core.Map toJson() { | |
| 971 var _json = new core.Map(); | |
| 972 if (code != null) { | |
| 973 _json["code"] = code; | |
| 974 } | |
| 975 if (location != null) { | |
| 976 _json["location"] = location; | |
| 977 } | |
| 978 if (message != null) { | |
| 979 _json["message"] = message; | |
| 980 } | |
| 981 return _json; | |
| 982 } | |
| 983 } | |
| 984 | |
| 985 class OperationError { | |
| 986 core.List<OperationErrorErrors> errors; | |
| 987 | |
| 988 OperationError(); | |
| 989 | |
| 990 OperationError.fromJson(core.Map _json) { | |
| 991 if (_json.containsKey("errors")) { | |
| 992 errors = _json["errors"].map((value) => new OperationErrorErrors.fromJson(
value)).toList(); | |
| 993 } | |
| 994 } | |
| 995 | |
| 996 core.Map toJson() { | |
| 997 var _json = new core.Map(); | |
| 998 if (errors != null) { | |
| 999 _json["errors"] = errors.map((value) => (value).toJson()).toList(); | |
| 1000 } | |
| 1001 return _json; | |
| 1002 } | |
| 1003 } | |
| 1004 | |
| 1005 class OperationWarningsData { | |
| 1006 core.String key; | |
| 1007 core.String value; | |
| 1008 | |
| 1009 OperationWarningsData(); | |
| 1010 | |
| 1011 OperationWarningsData.fromJson(core.Map _json) { | |
| 1012 if (_json.containsKey("key")) { | |
| 1013 key = _json["key"]; | |
| 1014 } | |
| 1015 if (_json.containsKey("value")) { | |
| 1016 value = _json["value"]; | |
| 1017 } | |
| 1018 } | |
| 1019 | |
| 1020 core.Map toJson() { | |
| 1021 var _json = new core.Map(); | |
| 1022 if (key != null) { | |
| 1023 _json["key"] = key; | |
| 1024 } | |
| 1025 if (value != null) { | |
| 1026 _json["value"] = value; | |
| 1027 } | |
| 1028 return _json; | |
| 1029 } | |
| 1030 } | |
| 1031 | |
| 1032 class OperationWarnings { | |
| 1033 core.String code; | |
| 1034 core.List<OperationWarningsData> data; | |
| 1035 core.String message; | |
| 1036 | |
| 1037 OperationWarnings(); | |
| 1038 | |
| 1039 OperationWarnings.fromJson(core.Map _json) { | |
| 1040 if (_json.containsKey("code")) { | |
| 1041 code = _json["code"]; | |
| 1042 } | |
| 1043 if (_json.containsKey("data")) { | |
| 1044 data = _json["data"].map((value) => new OperationWarningsData.fromJson(val
ue)).toList(); | |
| 1045 } | |
| 1046 if (_json.containsKey("message")) { | |
| 1047 message = _json["message"]; | |
| 1048 } | |
| 1049 } | |
| 1050 | |
| 1051 core.Map toJson() { | |
| 1052 var _json = new core.Map(); | |
| 1053 if (code != null) { | |
| 1054 _json["code"] = code; | |
| 1055 } | |
| 1056 if (data != null) { | |
| 1057 _json["data"] = data.map((value) => (value).toJson()).toList(); | |
| 1058 } | |
| 1059 if (message != null) { | |
| 1060 _json["message"] = message; | |
| 1061 } | |
| 1062 return _json; | |
| 1063 } | |
| 1064 } | |
| 1065 | |
| 1066 class Operation { | |
| 1067 core.String clientOperationId; | |
| 1068 core.String creationTimestamp; | |
| 1069 core.String description; | |
| 1070 core.String endTime; | |
| 1071 OperationError error; | |
| 1072 core.String httpErrorMessage; | |
| 1073 core.int httpErrorStatusCode; | |
| 1074 core.String id; | |
| 1075 core.String insertTime; | |
| 1076 /** | |
| 1077 * [Output Only] Type of the resource. Always compute#operation for Operation | |
| 1078 * resources. | |
| 1079 */ | |
| 1080 core.String kind; | |
| 1081 core.String name; | |
| 1082 core.String operationType; | |
| 1083 core.int progress; | |
| 1084 core.String region; | |
| 1085 core.String selfLink; | |
| 1086 core.String startTime; | |
| 1087 core.String status; | |
| 1088 core.String statusMessage; | |
| 1089 core.String targetId; | |
| 1090 core.String targetLink; | |
| 1091 core.String user; | |
| 1092 core.List<OperationWarnings> warnings; | |
| 1093 core.String zone; | |
| 1094 | |
| 1095 Operation(); | |
| 1096 | |
| 1097 Operation.fromJson(core.Map _json) { | |
| 1098 if (_json.containsKey("clientOperationId")) { | |
| 1099 clientOperationId = _json["clientOperationId"]; | |
| 1100 } | |
| 1101 if (_json.containsKey("creationTimestamp")) { | |
| 1102 creationTimestamp = _json["creationTimestamp"]; | |
| 1103 } | |
| 1104 if (_json.containsKey("description")) { | |
| 1105 description = _json["description"]; | |
| 1106 } | |
| 1107 if (_json.containsKey("endTime")) { | |
| 1108 endTime = _json["endTime"]; | |
| 1109 } | |
| 1110 if (_json.containsKey("error")) { | |
| 1111 error = new OperationError.fromJson(_json["error"]); | |
| 1112 } | |
| 1113 if (_json.containsKey("httpErrorMessage")) { | |
| 1114 httpErrorMessage = _json["httpErrorMessage"]; | |
| 1115 } | |
| 1116 if (_json.containsKey("httpErrorStatusCode")) { | |
| 1117 httpErrorStatusCode = _json["httpErrorStatusCode"]; | |
| 1118 } | |
| 1119 if (_json.containsKey("id")) { | |
| 1120 id = _json["id"]; | |
| 1121 } | |
| 1122 if (_json.containsKey("insertTime")) { | |
| 1123 insertTime = _json["insertTime"]; | |
| 1124 } | |
| 1125 if (_json.containsKey("kind")) { | |
| 1126 kind = _json["kind"]; | |
| 1127 } | |
| 1128 if (_json.containsKey("name")) { | |
| 1129 name = _json["name"]; | |
| 1130 } | |
| 1131 if (_json.containsKey("operationType")) { | |
| 1132 operationType = _json["operationType"]; | |
| 1133 } | |
| 1134 if (_json.containsKey("progress")) { | |
| 1135 progress = _json["progress"]; | |
| 1136 } | |
| 1137 if (_json.containsKey("region")) { | |
| 1138 region = _json["region"]; | |
| 1139 } | |
| 1140 if (_json.containsKey("selfLink")) { | |
| 1141 selfLink = _json["selfLink"]; | |
| 1142 } | |
| 1143 if (_json.containsKey("startTime")) { | |
| 1144 startTime = _json["startTime"]; | |
| 1145 } | |
| 1146 if (_json.containsKey("status")) { | |
| 1147 status = _json["status"]; | |
| 1148 } | |
| 1149 if (_json.containsKey("statusMessage")) { | |
| 1150 statusMessage = _json["statusMessage"]; | |
| 1151 } | |
| 1152 if (_json.containsKey("targetId")) { | |
| 1153 targetId = _json["targetId"]; | |
| 1154 } | |
| 1155 if (_json.containsKey("targetLink")) { | |
| 1156 targetLink = _json["targetLink"]; | |
| 1157 } | |
| 1158 if (_json.containsKey("user")) { | |
| 1159 user = _json["user"]; | |
| 1160 } | |
| 1161 if (_json.containsKey("warnings")) { | |
| 1162 warnings = _json["warnings"].map((value) => new OperationWarnings.fromJson
(value)).toList(); | |
| 1163 } | |
| 1164 if (_json.containsKey("zone")) { | |
| 1165 zone = _json["zone"]; | |
| 1166 } | |
| 1167 } | |
| 1168 | |
| 1169 core.Map toJson() { | |
| 1170 var _json = new core.Map(); | |
| 1171 if (clientOperationId != null) { | |
| 1172 _json["clientOperationId"] = clientOperationId; | |
| 1173 } | |
| 1174 if (creationTimestamp != null) { | |
| 1175 _json["creationTimestamp"] = creationTimestamp; | |
| 1176 } | |
| 1177 if (description != null) { | |
| 1178 _json["description"] = description; | |
| 1179 } | |
| 1180 if (endTime != null) { | |
| 1181 _json["endTime"] = endTime; | |
| 1182 } | |
| 1183 if (error != null) { | |
| 1184 _json["error"] = (error).toJson(); | |
| 1185 } | |
| 1186 if (httpErrorMessage != null) { | |
| 1187 _json["httpErrorMessage"] = httpErrorMessage; | |
| 1188 } | |
| 1189 if (httpErrorStatusCode != null) { | |
| 1190 _json["httpErrorStatusCode"] = httpErrorStatusCode; | |
| 1191 } | |
| 1192 if (id != null) { | |
| 1193 _json["id"] = id; | |
| 1194 } | |
| 1195 if (insertTime != null) { | |
| 1196 _json["insertTime"] = insertTime; | |
| 1197 } | |
| 1198 if (kind != null) { | |
| 1199 _json["kind"] = kind; | |
| 1200 } | |
| 1201 if (name != null) { | |
| 1202 _json["name"] = name; | |
| 1203 } | |
| 1204 if (operationType != null) { | |
| 1205 _json["operationType"] = operationType; | |
| 1206 } | |
| 1207 if (progress != null) { | |
| 1208 _json["progress"] = progress; | |
| 1209 } | |
| 1210 if (region != null) { | |
| 1211 _json["region"] = region; | |
| 1212 } | |
| 1213 if (selfLink != null) { | |
| 1214 _json["selfLink"] = selfLink; | |
| 1215 } | |
| 1216 if (startTime != null) { | |
| 1217 _json["startTime"] = startTime; | |
| 1218 } | |
| 1219 if (status != null) { | |
| 1220 _json["status"] = status; | |
| 1221 } | |
| 1222 if (statusMessage != null) { | |
| 1223 _json["statusMessage"] = statusMessage; | |
| 1224 } | |
| 1225 if (targetId != null) { | |
| 1226 _json["targetId"] = targetId; | |
| 1227 } | |
| 1228 if (targetLink != null) { | |
| 1229 _json["targetLink"] = targetLink; | |
| 1230 } | |
| 1231 if (user != null) { | |
| 1232 _json["user"] = user; | |
| 1233 } | |
| 1234 if (warnings != null) { | |
| 1235 _json["warnings"] = warnings.map((value) => (value).toJson()).toList(); | |
| 1236 } | |
| 1237 if (zone != null) { | |
| 1238 _json["zone"] = zone; | |
| 1239 } | |
| 1240 return _json; | |
| 1241 } | |
| 1242 } | |
| 1243 | |
| 1244 class OperationList { | |
| 1245 core.String id; | |
| 1246 core.List<Operation> items; | |
| 1247 /** | |
| 1248 * [Output Only] Type of resource. Always compute#operations for Operations | |
| 1249 * resource. | |
| 1250 */ | |
| 1251 core.String kind; | |
| 1252 core.String nextPageToken; | |
| 1253 core.String selfLink; | |
| 1254 | |
| 1255 OperationList(); | |
| 1256 | |
| 1257 OperationList.fromJson(core.Map _json) { | |
| 1258 if (_json.containsKey("id")) { | |
| 1259 id = _json["id"]; | |
| 1260 } | |
| 1261 if (_json.containsKey("items")) { | |
| 1262 items = _json["items"].map((value) => new Operation.fromJson(value)).toLis
t(); | |
| 1263 } | |
| 1264 if (_json.containsKey("kind")) { | |
| 1265 kind = _json["kind"]; | |
| 1266 } | |
| 1267 if (_json.containsKey("nextPageToken")) { | |
| 1268 nextPageToken = _json["nextPageToken"]; | |
| 1269 } | |
| 1270 if (_json.containsKey("selfLink")) { | |
| 1271 selfLink = _json["selfLink"]; | |
| 1272 } | |
| 1273 } | |
| 1274 | |
| 1275 core.Map toJson() { | |
| 1276 var _json = new core.Map(); | |
| 1277 if (id != null) { | |
| 1278 _json["id"] = id; | |
| 1279 } | |
| 1280 if (items != null) { | |
| 1281 _json["items"] = items.map((value) => (value).toJson()).toList(); | |
| 1282 } | |
| 1283 if (kind != null) { | |
| 1284 _json["kind"] = kind; | |
| 1285 } | |
| 1286 if (nextPageToken != null) { | |
| 1287 _json["nextPageToken"] = nextPageToken; | |
| 1288 } | |
| 1289 if (selfLink != null) { | |
| 1290 _json["selfLink"] = selfLink; | |
| 1291 } | |
| 1292 return _json; | |
| 1293 } | |
| 1294 } | |
| 1295 | |
| 1296 class Zone { | |
| 1297 core.String creationTimestamp; | |
| 1298 DeprecationStatus deprecated; | |
| 1299 core.String description; | |
| 1300 core.String id; | |
| 1301 /** [Output Only] Type of the resource. Always compute#zone for zones. */ | |
| 1302 core.String kind; | |
| 1303 core.String name; | |
| 1304 core.String region; | |
| 1305 core.String selfLink; | |
| 1306 core.String status; | |
| 1307 | |
| 1308 Zone(); | |
| 1309 | |
| 1310 Zone.fromJson(core.Map _json) { | |
| 1311 if (_json.containsKey("creationTimestamp")) { | |
| 1312 creationTimestamp = _json["creationTimestamp"]; | |
| 1313 } | |
| 1314 if (_json.containsKey("deprecated")) { | |
| 1315 deprecated = new DeprecationStatus.fromJson(_json["deprecated"]); | |
| 1316 } | |
| 1317 if (_json.containsKey("description")) { | |
| 1318 description = _json["description"]; | |
| 1319 } | |
| 1320 if (_json.containsKey("id")) { | |
| 1321 id = _json["id"]; | |
| 1322 } | |
| 1323 if (_json.containsKey("kind")) { | |
| 1324 kind = _json["kind"]; | |
| 1325 } | |
| 1326 if (_json.containsKey("name")) { | |
| 1327 name = _json["name"]; | |
| 1328 } | |
| 1329 if (_json.containsKey("region")) { | |
| 1330 region = _json["region"]; | |
| 1331 } | |
| 1332 if (_json.containsKey("selfLink")) { | |
| 1333 selfLink = _json["selfLink"]; | |
| 1334 } | |
| 1335 if (_json.containsKey("status")) { | |
| 1336 status = _json["status"]; | |
| 1337 } | |
| 1338 } | |
| 1339 | |
| 1340 core.Map toJson() { | |
| 1341 var _json = new core.Map(); | |
| 1342 if (creationTimestamp != null) { | |
| 1343 _json["creationTimestamp"] = creationTimestamp; | |
| 1344 } | |
| 1345 if (deprecated != null) { | |
| 1346 _json["deprecated"] = (deprecated).toJson(); | |
| 1347 } | |
| 1348 if (description != null) { | |
| 1349 _json["description"] = description; | |
| 1350 } | |
| 1351 if (id != null) { | |
| 1352 _json["id"] = id; | |
| 1353 } | |
| 1354 if (kind != null) { | |
| 1355 _json["kind"] = kind; | |
| 1356 } | |
| 1357 if (name != null) { | |
| 1358 _json["name"] = name; | |
| 1359 } | |
| 1360 if (region != null) { | |
| 1361 _json["region"] = region; | |
| 1362 } | |
| 1363 if (selfLink != null) { | |
| 1364 _json["selfLink"] = selfLink; | |
| 1365 } | |
| 1366 if (status != null) { | |
| 1367 _json["status"] = status; | |
| 1368 } | |
| 1369 return _json; | |
| 1370 } | |
| 1371 } | |
| 1372 | |
| 1373 class ZoneList { | |
| 1374 core.String id; | |
| 1375 core.List<Zone> items; | |
| 1376 /** Type of resource. */ | |
| 1377 core.String kind; | |
| 1378 core.String nextPageToken; | |
| 1379 /** [Output Only] Server-defined URL for this resource. */ | |
| 1380 core.String selfLink; | |
| 1381 | |
| 1382 ZoneList(); | |
| 1383 | |
| 1384 ZoneList.fromJson(core.Map _json) { | |
| 1385 if (_json.containsKey("id")) { | |
| 1386 id = _json["id"]; | |
| 1387 } | |
| 1388 if (_json.containsKey("items")) { | |
| 1389 items = _json["items"].map((value) => new Zone.fromJson(value)).toList(); | |
| 1390 } | |
| 1391 if (_json.containsKey("kind")) { | |
| 1392 kind = _json["kind"]; | |
| 1393 } | |
| 1394 if (_json.containsKey("nextPageToken")) { | |
| 1395 nextPageToken = _json["nextPageToken"]; | |
| 1396 } | |
| 1397 if (_json.containsKey("selfLink")) { | |
| 1398 selfLink = _json["selfLink"]; | |
| 1399 } | |
| 1400 } | |
| 1401 | |
| 1402 core.Map toJson() { | |
| 1403 var _json = new core.Map(); | |
| 1404 if (id != null) { | |
| 1405 _json["id"] = id; | |
| 1406 } | |
| 1407 if (items != null) { | |
| 1408 _json["items"] = items.map((value) => (value).toJson()).toList(); | |
| 1409 } | |
| 1410 if (kind != null) { | |
| 1411 _json["kind"] = kind; | |
| 1412 } | |
| 1413 if (nextPageToken != null) { | |
| 1414 _json["nextPageToken"] = nextPageToken; | |
| 1415 } | |
| 1416 if (selfLink != null) { | |
| 1417 _json["selfLink"] = selfLink; | |
| 1418 } | |
| 1419 return _json; | |
| 1420 } | |
| 1421 } | |
| OLD | NEW |