OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.cloudresourcemanager.v1beta1.test; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 |
| 12 import 'package:googleapis_beta/cloudresourcemanager/v1beta1.dart' as api; |
| 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 buildUnnamed2301() { |
| 55 var o = new core.List<core.String>(); |
| 56 o.add("foo"); |
| 57 o.add("foo"); |
| 58 return o; |
| 59 } |
| 60 |
| 61 checkUnnamed2301(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } |
| 66 |
| 67 core.int buildCounterBinding = 0; |
| 68 buildBinding() { |
| 69 var o = new api.Binding(); |
| 70 buildCounterBinding++; |
| 71 if (buildCounterBinding < 3) { |
| 72 o.members = buildUnnamed2301(); |
| 73 o.role = "foo"; |
| 74 } |
| 75 buildCounterBinding--; |
| 76 return o; |
| 77 } |
| 78 |
| 79 checkBinding(api.Binding o) { |
| 80 buildCounterBinding++; |
| 81 if (buildCounterBinding < 3) { |
| 82 checkUnnamed2301(o.members); |
| 83 unittest.expect(o.role, unittest.equals('foo')); |
| 84 } |
| 85 buildCounterBinding--; |
| 86 } |
| 87 |
| 88 core.int buildCounterCloudAuditOptions = 0; |
| 89 buildCloudAuditOptions() { |
| 90 var o = new api.CloudAuditOptions(); |
| 91 buildCounterCloudAuditOptions++; |
| 92 if (buildCounterCloudAuditOptions < 3) { |
| 93 } |
| 94 buildCounterCloudAuditOptions--; |
| 95 return o; |
| 96 } |
| 97 |
| 98 checkCloudAuditOptions(api.CloudAuditOptions o) { |
| 99 buildCounterCloudAuditOptions++; |
| 100 if (buildCounterCloudAuditOptions < 3) { |
| 101 } |
| 102 buildCounterCloudAuditOptions--; |
| 103 } |
| 104 |
| 105 buildUnnamed2302() { |
| 106 var o = new core.List<core.String>(); |
| 107 o.add("foo"); |
| 108 o.add("foo"); |
| 109 return o; |
| 110 } |
| 111 |
| 112 checkUnnamed2302(core.List<core.String> o) { |
| 113 unittest.expect(o, unittest.hasLength(2)); |
| 114 unittest.expect(o[0], unittest.equals('foo')); |
| 115 unittest.expect(o[1], unittest.equals('foo')); |
| 116 } |
| 117 |
| 118 core.int buildCounterCondition = 0; |
| 119 buildCondition() { |
| 120 var o = new api.Condition(); |
| 121 buildCounterCondition++; |
| 122 if (buildCounterCondition < 3) { |
| 123 o.iam = "foo"; |
| 124 o.op = "foo"; |
| 125 o.svc = "foo"; |
| 126 o.sys = "foo"; |
| 127 o.value = "foo"; |
| 128 o.values = buildUnnamed2302(); |
| 129 } |
| 130 buildCounterCondition--; |
| 131 return o; |
| 132 } |
| 133 |
| 134 checkCondition(api.Condition o) { |
| 135 buildCounterCondition++; |
| 136 if (buildCounterCondition < 3) { |
| 137 unittest.expect(o.iam, unittest.equals('foo')); |
| 138 unittest.expect(o.op, unittest.equals('foo')); |
| 139 unittest.expect(o.svc, unittest.equals('foo')); |
| 140 unittest.expect(o.sys, unittest.equals('foo')); |
| 141 unittest.expect(o.value, unittest.equals('foo')); |
| 142 checkUnnamed2302(o.values); |
| 143 } |
| 144 buildCounterCondition--; |
| 145 } |
| 146 |
| 147 core.int buildCounterCounterOptions = 0; |
| 148 buildCounterOptions() { |
| 149 var o = new api.CounterOptions(); |
| 150 buildCounterCounterOptions++; |
| 151 if (buildCounterCounterOptions < 3) { |
| 152 o.field = "foo"; |
| 153 o.metric = "foo"; |
| 154 } |
| 155 buildCounterCounterOptions--; |
| 156 return o; |
| 157 } |
| 158 |
| 159 checkCounterOptions(api.CounterOptions o) { |
| 160 buildCounterCounterOptions++; |
| 161 if (buildCounterCounterOptions < 3) { |
| 162 unittest.expect(o.field, unittest.equals('foo')); |
| 163 unittest.expect(o.metric, unittest.equals('foo')); |
| 164 } |
| 165 buildCounterCounterOptions--; |
| 166 } |
| 167 |
| 168 core.int buildCounterDataAccessOptions = 0; |
| 169 buildDataAccessOptions() { |
| 170 var o = new api.DataAccessOptions(); |
| 171 buildCounterDataAccessOptions++; |
| 172 if (buildCounterDataAccessOptions < 3) { |
| 173 } |
| 174 buildCounterDataAccessOptions--; |
| 175 return o; |
| 176 } |
| 177 |
| 178 checkDataAccessOptions(api.DataAccessOptions o) { |
| 179 buildCounterDataAccessOptions++; |
| 180 if (buildCounterDataAccessOptions < 3) { |
| 181 } |
| 182 buildCounterDataAccessOptions--; |
| 183 } |
| 184 |
| 185 core.int buildCounterEmpty = 0; |
| 186 buildEmpty() { |
| 187 var o = new api.Empty(); |
| 188 buildCounterEmpty++; |
| 189 if (buildCounterEmpty < 3) { |
| 190 } |
| 191 buildCounterEmpty--; |
| 192 return o; |
| 193 } |
| 194 |
| 195 checkEmpty(api.Empty o) { |
| 196 buildCounterEmpty++; |
| 197 if (buildCounterEmpty < 3) { |
| 198 } |
| 199 buildCounterEmpty--; |
| 200 } |
| 201 |
| 202 core.int buildCounterGetIamPolicyRequest = 0; |
| 203 buildGetIamPolicyRequest() { |
| 204 var o = new api.GetIamPolicyRequest(); |
| 205 buildCounterGetIamPolicyRequest++; |
| 206 if (buildCounterGetIamPolicyRequest < 3) { |
| 207 } |
| 208 buildCounterGetIamPolicyRequest--; |
| 209 return o; |
| 210 } |
| 211 |
| 212 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| 213 buildCounterGetIamPolicyRequest++; |
| 214 if (buildCounterGetIamPolicyRequest < 3) { |
| 215 } |
| 216 buildCounterGetIamPolicyRequest--; |
| 217 } |
| 218 |
| 219 buildUnnamed2303() { |
| 220 var o = new core.List<api.Project>(); |
| 221 o.add(buildProject()); |
| 222 o.add(buildProject()); |
| 223 return o; |
| 224 } |
| 225 |
| 226 checkUnnamed2303(core.List<api.Project> o) { |
| 227 unittest.expect(o, unittest.hasLength(2)); |
| 228 checkProject(o[0]); |
| 229 checkProject(o[1]); |
| 230 } |
| 231 |
| 232 core.int buildCounterListProjectsResponse = 0; |
| 233 buildListProjectsResponse() { |
| 234 var o = new api.ListProjectsResponse(); |
| 235 buildCounterListProjectsResponse++; |
| 236 if (buildCounterListProjectsResponse < 3) { |
| 237 o.nextPageToken = "foo"; |
| 238 o.projects = buildUnnamed2303(); |
| 239 } |
| 240 buildCounterListProjectsResponse--; |
| 241 return o; |
| 242 } |
| 243 |
| 244 checkListProjectsResponse(api.ListProjectsResponse o) { |
| 245 buildCounterListProjectsResponse++; |
| 246 if (buildCounterListProjectsResponse < 3) { |
| 247 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 248 checkUnnamed2303(o.projects); |
| 249 } |
| 250 buildCounterListProjectsResponse--; |
| 251 } |
| 252 |
| 253 core.int buildCounterLogConfig = 0; |
| 254 buildLogConfig() { |
| 255 var o = new api.LogConfig(); |
| 256 buildCounterLogConfig++; |
| 257 if (buildCounterLogConfig < 3) { |
| 258 o.cloudAudit = buildCloudAuditOptions(); |
| 259 o.counter = buildCounterOptions(); |
| 260 o.dataAccess = buildDataAccessOptions(); |
| 261 } |
| 262 buildCounterLogConfig--; |
| 263 return o; |
| 264 } |
| 265 |
| 266 checkLogConfig(api.LogConfig o) { |
| 267 buildCounterLogConfig++; |
| 268 if (buildCounterLogConfig < 3) { |
| 269 checkCloudAuditOptions(o.cloudAudit); |
| 270 checkCounterOptions(o.counter); |
| 271 checkDataAccessOptions(o.dataAccess); |
| 272 } |
| 273 buildCounterLogConfig--; |
| 274 } |
| 275 |
| 276 buildUnnamed2304() { |
| 277 var o = new core.List<api.Binding>(); |
| 278 o.add(buildBinding()); |
| 279 o.add(buildBinding()); |
| 280 return o; |
| 281 } |
| 282 |
| 283 checkUnnamed2304(core.List<api.Binding> o) { |
| 284 unittest.expect(o, unittest.hasLength(2)); |
| 285 checkBinding(o[0]); |
| 286 checkBinding(o[1]); |
| 287 } |
| 288 |
| 289 buildUnnamed2305() { |
| 290 var o = new core.List<api.Rule>(); |
| 291 o.add(buildRule()); |
| 292 o.add(buildRule()); |
| 293 return o; |
| 294 } |
| 295 |
| 296 checkUnnamed2305(core.List<api.Rule> o) { |
| 297 unittest.expect(o, unittest.hasLength(2)); |
| 298 checkRule(o[0]); |
| 299 checkRule(o[1]); |
| 300 } |
| 301 |
| 302 core.int buildCounterPolicy = 0; |
| 303 buildPolicy() { |
| 304 var o = new api.Policy(); |
| 305 buildCounterPolicy++; |
| 306 if (buildCounterPolicy < 3) { |
| 307 o.bindings = buildUnnamed2304(); |
| 308 o.etag = "foo"; |
| 309 o.rules = buildUnnamed2305(); |
| 310 o.version = 42; |
| 311 } |
| 312 buildCounterPolicy--; |
| 313 return o; |
| 314 } |
| 315 |
| 316 checkPolicy(api.Policy o) { |
| 317 buildCounterPolicy++; |
| 318 if (buildCounterPolicy < 3) { |
| 319 checkUnnamed2304(o.bindings); |
| 320 unittest.expect(o.etag, unittest.equals('foo')); |
| 321 checkUnnamed2305(o.rules); |
| 322 unittest.expect(o.version, unittest.equals(42)); |
| 323 } |
| 324 buildCounterPolicy--; |
| 325 } |
| 326 |
| 327 buildUnnamed2306() { |
| 328 var o = new core.Map<core.String, core.String>(); |
| 329 o["x"] = "foo"; |
| 330 o["y"] = "foo"; |
| 331 return o; |
| 332 } |
| 333 |
| 334 checkUnnamed2306(core.Map<core.String, core.String> o) { |
| 335 unittest.expect(o, unittest.hasLength(2)); |
| 336 unittest.expect(o["x"], unittest.equals('foo')); |
| 337 unittest.expect(o["y"], unittest.equals('foo')); |
| 338 } |
| 339 |
| 340 core.int buildCounterProject = 0; |
| 341 buildProject() { |
| 342 var o = new api.Project(); |
| 343 buildCounterProject++; |
| 344 if (buildCounterProject < 3) { |
| 345 o.createTime = "foo"; |
| 346 o.labels = buildUnnamed2306(); |
| 347 o.lifecycleState = "foo"; |
| 348 o.name = "foo"; |
| 349 o.projectId = "foo"; |
| 350 o.projectNumber = "foo"; |
| 351 } |
| 352 buildCounterProject--; |
| 353 return o; |
| 354 } |
| 355 |
| 356 checkProject(api.Project o) { |
| 357 buildCounterProject++; |
| 358 if (buildCounterProject < 3) { |
| 359 unittest.expect(o.createTime, unittest.equals('foo')); |
| 360 checkUnnamed2306(o.labels); |
| 361 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
| 362 unittest.expect(o.name, unittest.equals('foo')); |
| 363 unittest.expect(o.projectId, unittest.equals('foo')); |
| 364 unittest.expect(o.projectNumber, unittest.equals('foo')); |
| 365 } |
| 366 buildCounterProject--; |
| 367 } |
| 368 |
| 369 buildUnnamed2307() { |
| 370 var o = new core.List<api.Condition>(); |
| 371 o.add(buildCondition()); |
| 372 o.add(buildCondition()); |
| 373 return o; |
| 374 } |
| 375 |
| 376 checkUnnamed2307(core.List<api.Condition> o) { |
| 377 unittest.expect(o, unittest.hasLength(2)); |
| 378 checkCondition(o[0]); |
| 379 checkCondition(o[1]); |
| 380 } |
| 381 |
| 382 buildUnnamed2308() { |
| 383 var o = new core.List<core.String>(); |
| 384 o.add("foo"); |
| 385 o.add("foo"); |
| 386 return o; |
| 387 } |
| 388 |
| 389 checkUnnamed2308(core.List<core.String> o) { |
| 390 unittest.expect(o, unittest.hasLength(2)); |
| 391 unittest.expect(o[0], unittest.equals('foo')); |
| 392 unittest.expect(o[1], unittest.equals('foo')); |
| 393 } |
| 394 |
| 395 buildUnnamed2309() { |
| 396 var o = new core.List<api.LogConfig>(); |
| 397 o.add(buildLogConfig()); |
| 398 o.add(buildLogConfig()); |
| 399 return o; |
| 400 } |
| 401 |
| 402 checkUnnamed2309(core.List<api.LogConfig> o) { |
| 403 unittest.expect(o, unittest.hasLength(2)); |
| 404 checkLogConfig(o[0]); |
| 405 checkLogConfig(o[1]); |
| 406 } |
| 407 |
| 408 buildUnnamed2310() { |
| 409 var o = new core.List<core.String>(); |
| 410 o.add("foo"); |
| 411 o.add("foo"); |
| 412 return o; |
| 413 } |
| 414 |
| 415 checkUnnamed2310(core.List<core.String> o) { |
| 416 unittest.expect(o, unittest.hasLength(2)); |
| 417 unittest.expect(o[0], unittest.equals('foo')); |
| 418 unittest.expect(o[1], unittest.equals('foo')); |
| 419 } |
| 420 |
| 421 buildUnnamed2311() { |
| 422 var o = new core.List<core.String>(); |
| 423 o.add("foo"); |
| 424 o.add("foo"); |
| 425 return o; |
| 426 } |
| 427 |
| 428 checkUnnamed2311(core.List<core.String> o) { |
| 429 unittest.expect(o, unittest.hasLength(2)); |
| 430 unittest.expect(o[0], unittest.equals('foo')); |
| 431 unittest.expect(o[1], unittest.equals('foo')); |
| 432 } |
| 433 |
| 434 core.int buildCounterRule = 0; |
| 435 buildRule() { |
| 436 var o = new api.Rule(); |
| 437 buildCounterRule++; |
| 438 if (buildCounterRule < 3) { |
| 439 o.action = "foo"; |
| 440 o.conditions = buildUnnamed2307(); |
| 441 o.description = "foo"; |
| 442 o.in_ = buildUnnamed2308(); |
| 443 o.logConfig = buildUnnamed2309(); |
| 444 o.notIn = buildUnnamed2310(); |
| 445 o.permissions = buildUnnamed2311(); |
| 446 } |
| 447 buildCounterRule--; |
| 448 return o; |
| 449 } |
| 450 |
| 451 checkRule(api.Rule o) { |
| 452 buildCounterRule++; |
| 453 if (buildCounterRule < 3) { |
| 454 unittest.expect(o.action, unittest.equals('foo')); |
| 455 checkUnnamed2307(o.conditions); |
| 456 unittest.expect(o.description, unittest.equals('foo')); |
| 457 checkUnnamed2308(o.in_); |
| 458 checkUnnamed2309(o.logConfig); |
| 459 checkUnnamed2310(o.notIn); |
| 460 checkUnnamed2311(o.permissions); |
| 461 } |
| 462 buildCounterRule--; |
| 463 } |
| 464 |
| 465 core.int buildCounterSetIamPolicyRequest = 0; |
| 466 buildSetIamPolicyRequest() { |
| 467 var o = new api.SetIamPolicyRequest(); |
| 468 buildCounterSetIamPolicyRequest++; |
| 469 if (buildCounterSetIamPolicyRequest < 3) { |
| 470 o.policy = buildPolicy(); |
| 471 } |
| 472 buildCounterSetIamPolicyRequest--; |
| 473 return o; |
| 474 } |
| 475 |
| 476 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| 477 buildCounterSetIamPolicyRequest++; |
| 478 if (buildCounterSetIamPolicyRequest < 3) { |
| 479 checkPolicy(o.policy); |
| 480 } |
| 481 buildCounterSetIamPolicyRequest--; |
| 482 } |
| 483 |
| 484 buildUnnamed2312() { |
| 485 var o = new core.List<core.String>(); |
| 486 o.add("foo"); |
| 487 o.add("foo"); |
| 488 return o; |
| 489 } |
| 490 |
| 491 checkUnnamed2312(core.List<core.String> o) { |
| 492 unittest.expect(o, unittest.hasLength(2)); |
| 493 unittest.expect(o[0], unittest.equals('foo')); |
| 494 unittest.expect(o[1], unittest.equals('foo')); |
| 495 } |
| 496 |
| 497 core.int buildCounterTestIamPermissionsRequest = 0; |
| 498 buildTestIamPermissionsRequest() { |
| 499 var o = new api.TestIamPermissionsRequest(); |
| 500 buildCounterTestIamPermissionsRequest++; |
| 501 if (buildCounterTestIamPermissionsRequest < 3) { |
| 502 o.permissions = buildUnnamed2312(); |
| 503 } |
| 504 buildCounterTestIamPermissionsRequest--; |
| 505 return o; |
| 506 } |
| 507 |
| 508 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 509 buildCounterTestIamPermissionsRequest++; |
| 510 if (buildCounterTestIamPermissionsRequest < 3) { |
| 511 checkUnnamed2312(o.permissions); |
| 512 } |
| 513 buildCounterTestIamPermissionsRequest--; |
| 514 } |
| 515 |
| 516 buildUnnamed2313() { |
| 517 var o = new core.List<core.String>(); |
| 518 o.add("foo"); |
| 519 o.add("foo"); |
| 520 return o; |
| 521 } |
| 522 |
| 523 checkUnnamed2313(core.List<core.String> o) { |
| 524 unittest.expect(o, unittest.hasLength(2)); |
| 525 unittest.expect(o[0], unittest.equals('foo')); |
| 526 unittest.expect(o[1], unittest.equals('foo')); |
| 527 } |
| 528 |
| 529 core.int buildCounterTestIamPermissionsResponse = 0; |
| 530 buildTestIamPermissionsResponse() { |
| 531 var o = new api.TestIamPermissionsResponse(); |
| 532 buildCounterTestIamPermissionsResponse++; |
| 533 if (buildCounterTestIamPermissionsResponse < 3) { |
| 534 o.permissions = buildUnnamed2313(); |
| 535 } |
| 536 buildCounterTestIamPermissionsResponse--; |
| 537 return o; |
| 538 } |
| 539 |
| 540 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 541 buildCounterTestIamPermissionsResponse++; |
| 542 if (buildCounterTestIamPermissionsResponse < 3) { |
| 543 checkUnnamed2313(o.permissions); |
| 544 } |
| 545 buildCounterTestIamPermissionsResponse--; |
| 546 } |
| 547 |
| 548 |
| 549 main() { |
| 550 unittest.group("obj-schema-Binding", () { |
| 551 unittest.test("to-json--from-json", () { |
| 552 var o = buildBinding(); |
| 553 var od = new api.Binding.fromJson(o.toJson()); |
| 554 checkBinding(od); |
| 555 }); |
| 556 }); |
| 557 |
| 558 |
| 559 unittest.group("obj-schema-CloudAuditOptions", () { |
| 560 unittest.test("to-json--from-json", () { |
| 561 var o = buildCloudAuditOptions(); |
| 562 var od = new api.CloudAuditOptions.fromJson(o.toJson()); |
| 563 checkCloudAuditOptions(od); |
| 564 }); |
| 565 }); |
| 566 |
| 567 |
| 568 unittest.group("obj-schema-Condition", () { |
| 569 unittest.test("to-json--from-json", () { |
| 570 var o = buildCondition(); |
| 571 var od = new api.Condition.fromJson(o.toJson()); |
| 572 checkCondition(od); |
| 573 }); |
| 574 }); |
| 575 |
| 576 |
| 577 unittest.group("obj-schema-CounterOptions", () { |
| 578 unittest.test("to-json--from-json", () { |
| 579 var o = buildCounterOptions(); |
| 580 var od = new api.CounterOptions.fromJson(o.toJson()); |
| 581 checkCounterOptions(od); |
| 582 }); |
| 583 }); |
| 584 |
| 585 |
| 586 unittest.group("obj-schema-DataAccessOptions", () { |
| 587 unittest.test("to-json--from-json", () { |
| 588 var o = buildDataAccessOptions(); |
| 589 var od = new api.DataAccessOptions.fromJson(o.toJson()); |
| 590 checkDataAccessOptions(od); |
| 591 }); |
| 592 }); |
| 593 |
| 594 |
| 595 unittest.group("obj-schema-Empty", () { |
| 596 unittest.test("to-json--from-json", () { |
| 597 var o = buildEmpty(); |
| 598 var od = new api.Empty.fromJson(o.toJson()); |
| 599 checkEmpty(od); |
| 600 }); |
| 601 }); |
| 602 |
| 603 |
| 604 unittest.group("obj-schema-GetIamPolicyRequest", () { |
| 605 unittest.test("to-json--from-json", () { |
| 606 var o = buildGetIamPolicyRequest(); |
| 607 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
| 608 checkGetIamPolicyRequest(od); |
| 609 }); |
| 610 }); |
| 611 |
| 612 |
| 613 unittest.group("obj-schema-ListProjectsResponse", () { |
| 614 unittest.test("to-json--from-json", () { |
| 615 var o = buildListProjectsResponse(); |
| 616 var od = new api.ListProjectsResponse.fromJson(o.toJson()); |
| 617 checkListProjectsResponse(od); |
| 618 }); |
| 619 }); |
| 620 |
| 621 |
| 622 unittest.group("obj-schema-LogConfig", () { |
| 623 unittest.test("to-json--from-json", () { |
| 624 var o = buildLogConfig(); |
| 625 var od = new api.LogConfig.fromJson(o.toJson()); |
| 626 checkLogConfig(od); |
| 627 }); |
| 628 }); |
| 629 |
| 630 |
| 631 unittest.group("obj-schema-Policy", () { |
| 632 unittest.test("to-json--from-json", () { |
| 633 var o = buildPolicy(); |
| 634 var od = new api.Policy.fromJson(o.toJson()); |
| 635 checkPolicy(od); |
| 636 }); |
| 637 }); |
| 638 |
| 639 |
| 640 unittest.group("obj-schema-Project", () { |
| 641 unittest.test("to-json--from-json", () { |
| 642 var o = buildProject(); |
| 643 var od = new api.Project.fromJson(o.toJson()); |
| 644 checkProject(od); |
| 645 }); |
| 646 }); |
| 647 |
| 648 |
| 649 unittest.group("obj-schema-Rule", () { |
| 650 unittest.test("to-json--from-json", () { |
| 651 var o = buildRule(); |
| 652 var od = new api.Rule.fromJson(o.toJson()); |
| 653 checkRule(od); |
| 654 }); |
| 655 }); |
| 656 |
| 657 |
| 658 unittest.group("obj-schema-SetIamPolicyRequest", () { |
| 659 unittest.test("to-json--from-json", () { |
| 660 var o = buildSetIamPolicyRequest(); |
| 661 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); |
| 662 checkSetIamPolicyRequest(od); |
| 663 }); |
| 664 }); |
| 665 |
| 666 |
| 667 unittest.group("obj-schema-TestIamPermissionsRequest", () { |
| 668 unittest.test("to-json--from-json", () { |
| 669 var o = buildTestIamPermissionsRequest(); |
| 670 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| 671 checkTestIamPermissionsRequest(od); |
| 672 }); |
| 673 }); |
| 674 |
| 675 |
| 676 unittest.group("obj-schema-TestIamPermissionsResponse", () { |
| 677 unittest.test("to-json--from-json", () { |
| 678 var o = buildTestIamPermissionsResponse(); |
| 679 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| 680 checkTestIamPermissionsResponse(od); |
| 681 }); |
| 682 }); |
| 683 |
| 684 |
| 685 unittest.group("resource-ProjectsResourceApi", () { |
| 686 unittest.test("method--create", () { |
| 687 |
| 688 var mock = new HttpServerMock(); |
| 689 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 690 var arg_request = buildProject(); |
| 691 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 692 var obj = new api.Project.fromJson(json); |
| 693 checkProject(obj); |
| 694 |
| 695 var path = (req.url).path; |
| 696 var pathOffset = 0; |
| 697 var index; |
| 698 var subPart; |
| 699 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 700 pathOffset += 1; |
| 701 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); |
| 702 pathOffset += 16; |
| 703 |
| 704 var query = (req.url).query; |
| 705 var queryOffset = 0; |
| 706 var queryMap = {}; |
| 707 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 708 parseBool(n) { |
| 709 if (n == "true") return true; |
| 710 if (n == "false") return false; |
| 711 if (n == null) return null; |
| 712 throw new core.ArgumentError("Invalid boolean: $n"); |
| 713 } |
| 714 if (query.length > 0) { |
| 715 for (var part in query.split("&")) { |
| 716 var keyvalue = part.split("="); |
| 717 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 718 } |
| 719 } |
| 720 |
| 721 |
| 722 var h = { |
| 723 "content-type" : "application/json; charset=utf-8", |
| 724 }; |
| 725 var resp = convert.JSON.encode(buildProject()); |
| 726 return new async.Future.value(stringResponse(200, h, resp)); |
| 727 }), true); |
| 728 res.create(arg_request).then(unittest.expectAsync(((api.Project response)
{ |
| 729 checkProject(response); |
| 730 }))); |
| 731 }); |
| 732 |
| 733 unittest.test("method--delete", () { |
| 734 |
| 735 var mock = new HttpServerMock(); |
| 736 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 737 var arg_projectId = "foo"; |
| 738 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 739 var path = (req.url).path; |
| 740 var pathOffset = 0; |
| 741 var index; |
| 742 var subPart; |
| 743 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 744 pathOffset += 1; |
| 745 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 746 pathOffset += 17; |
| 747 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 748 pathOffset = path.length; |
| 749 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 750 |
| 751 var query = (req.url).query; |
| 752 var queryOffset = 0; |
| 753 var queryMap = {}; |
| 754 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 755 parseBool(n) { |
| 756 if (n == "true") return true; |
| 757 if (n == "false") return false; |
| 758 if (n == null) return null; |
| 759 throw new core.ArgumentError("Invalid boolean: $n"); |
| 760 } |
| 761 if (query.length > 0) { |
| 762 for (var part in query.split("&")) { |
| 763 var keyvalue = part.split("="); |
| 764 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 765 } |
| 766 } |
| 767 |
| 768 |
| 769 var h = { |
| 770 "content-type" : "application/json; charset=utf-8", |
| 771 }; |
| 772 var resp = convert.JSON.encode(buildEmpty()); |
| 773 return new async.Future.value(stringResponse(200, h, resp)); |
| 774 }), true); |
| 775 res.delete(arg_projectId).then(unittest.expectAsync(((api.Empty response)
{ |
| 776 checkEmpty(response); |
| 777 }))); |
| 778 }); |
| 779 |
| 780 unittest.test("method--get", () { |
| 781 |
| 782 var mock = new HttpServerMock(); |
| 783 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 784 var arg_projectId = "foo"; |
| 785 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 786 var path = (req.url).path; |
| 787 var pathOffset = 0; |
| 788 var index; |
| 789 var subPart; |
| 790 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 791 pathOffset += 1; |
| 792 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 793 pathOffset += 17; |
| 794 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 795 pathOffset = path.length; |
| 796 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 797 |
| 798 var query = (req.url).query; |
| 799 var queryOffset = 0; |
| 800 var queryMap = {}; |
| 801 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 802 parseBool(n) { |
| 803 if (n == "true") return true; |
| 804 if (n == "false") return false; |
| 805 if (n == null) return null; |
| 806 throw new core.ArgumentError("Invalid boolean: $n"); |
| 807 } |
| 808 if (query.length > 0) { |
| 809 for (var part in query.split("&")) { |
| 810 var keyvalue = part.split("="); |
| 811 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 812 } |
| 813 } |
| 814 |
| 815 |
| 816 var h = { |
| 817 "content-type" : "application/json; charset=utf-8", |
| 818 }; |
| 819 var resp = convert.JSON.encode(buildProject()); |
| 820 return new async.Future.value(stringResponse(200, h, resp)); |
| 821 }), true); |
| 822 res.get(arg_projectId).then(unittest.expectAsync(((api.Project response) { |
| 823 checkProject(response); |
| 824 }))); |
| 825 }); |
| 826 |
| 827 unittest.test("method--getIamPolicy", () { |
| 828 |
| 829 var mock = new HttpServerMock(); |
| 830 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 831 var arg_request = buildGetIamPolicyRequest(); |
| 832 var arg_resource = "foo"; |
| 833 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 834 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 835 checkGetIamPolicyRequest(obj); |
| 836 |
| 837 var path = (req.url).path; |
| 838 var pathOffset = 0; |
| 839 var index; |
| 840 var subPart; |
| 841 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 842 pathOffset += 1; |
| 843 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 844 pathOffset += 17; |
| 845 index = path.indexOf(":getIamPolicy", pathOffset); |
| 846 unittest.expect(index >= 0, unittest.isTrue); |
| 847 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 848 pathOffset = index; |
| 849 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 850 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":getIamPolicy")); |
| 851 pathOffset += 13; |
| 852 |
| 853 var query = (req.url).query; |
| 854 var queryOffset = 0; |
| 855 var queryMap = {}; |
| 856 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 857 parseBool(n) { |
| 858 if (n == "true") return true; |
| 859 if (n == "false") return false; |
| 860 if (n == null) return null; |
| 861 throw new core.ArgumentError("Invalid boolean: $n"); |
| 862 } |
| 863 if (query.length > 0) { |
| 864 for (var part in query.split("&")) { |
| 865 var keyvalue = part.split("="); |
| 866 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 867 } |
| 868 } |
| 869 |
| 870 |
| 871 var h = { |
| 872 "content-type" : "application/json; charset=utf-8", |
| 873 }; |
| 874 var resp = convert.JSON.encode(buildPolicy()); |
| 875 return new async.Future.value(stringResponse(200, h, resp)); |
| 876 }), true); |
| 877 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
| 878 checkPolicy(response); |
| 879 }))); |
| 880 }); |
| 881 |
| 882 unittest.test("method--list", () { |
| 883 |
| 884 var mock = new HttpServerMock(); |
| 885 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 886 var arg_pageToken = "foo"; |
| 887 var arg_pageSize = 42; |
| 888 var arg_filter = "foo"; |
| 889 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 890 var path = (req.url).path; |
| 891 var pathOffset = 0; |
| 892 var index; |
| 893 var subPart; |
| 894 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 895 pathOffset += 1; |
| 896 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); |
| 897 pathOffset += 16; |
| 898 |
| 899 var query = (req.url).query; |
| 900 var queryOffset = 0; |
| 901 var queryMap = {}; |
| 902 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 903 parseBool(n) { |
| 904 if (n == "true") return true; |
| 905 if (n == "false") return false; |
| 906 if (n == null) return null; |
| 907 throw new core.ArgumentError("Invalid boolean: $n"); |
| 908 } |
| 909 if (query.length > 0) { |
| 910 for (var part in query.split("&")) { |
| 911 var keyvalue = part.split("="); |
| 912 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 913 } |
| 914 } |
| 915 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 916 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 917 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 918 |
| 919 |
| 920 var h = { |
| 921 "content-type" : "application/json; charset=utf-8", |
| 922 }; |
| 923 var resp = convert.JSON.encode(buildListProjectsResponse()); |
| 924 return new async.Future.value(stringResponse(200, h, resp)); |
| 925 }), true); |
| 926 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize, filter: arg_fil
ter).then(unittest.expectAsync(((api.ListProjectsResponse response) { |
| 927 checkListProjectsResponse(response); |
| 928 }))); |
| 929 }); |
| 930 |
| 931 unittest.test("method--setIamPolicy", () { |
| 932 |
| 933 var mock = new HttpServerMock(); |
| 934 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 935 var arg_request = buildSetIamPolicyRequest(); |
| 936 var arg_resource = "foo"; |
| 937 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 938 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 939 checkSetIamPolicyRequest(obj); |
| 940 |
| 941 var path = (req.url).path; |
| 942 var pathOffset = 0; |
| 943 var index; |
| 944 var subPart; |
| 945 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 946 pathOffset += 1; |
| 947 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 948 pathOffset += 17; |
| 949 index = path.indexOf(":setIamPolicy", pathOffset); |
| 950 unittest.expect(index >= 0, unittest.isTrue); |
| 951 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 952 pathOffset = index; |
| 953 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 954 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":setIamPolicy")); |
| 955 pathOffset += 13; |
| 956 |
| 957 var query = (req.url).query; |
| 958 var queryOffset = 0; |
| 959 var queryMap = {}; |
| 960 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 961 parseBool(n) { |
| 962 if (n == "true") return true; |
| 963 if (n == "false") return false; |
| 964 if (n == null) return null; |
| 965 throw new core.ArgumentError("Invalid boolean: $n"); |
| 966 } |
| 967 if (query.length > 0) { |
| 968 for (var part in query.split("&")) { |
| 969 var keyvalue = part.split("="); |
| 970 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 971 } |
| 972 } |
| 973 |
| 974 |
| 975 var h = { |
| 976 "content-type" : "application/json; charset=utf-8", |
| 977 }; |
| 978 var resp = convert.JSON.encode(buildPolicy()); |
| 979 return new async.Future.value(stringResponse(200, h, resp)); |
| 980 }), true); |
| 981 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
| 982 checkPolicy(response); |
| 983 }))); |
| 984 }); |
| 985 |
| 986 unittest.test("method--testIamPermissions", () { |
| 987 |
| 988 var mock = new HttpServerMock(); |
| 989 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 990 var arg_request = buildTestIamPermissionsRequest(); |
| 991 var arg_resource = "foo"; |
| 992 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 993 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 994 checkTestIamPermissionsRequest(obj); |
| 995 |
| 996 var path = (req.url).path; |
| 997 var pathOffset = 0; |
| 998 var index; |
| 999 var subPart; |
| 1000 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1001 pathOffset += 1; |
| 1002 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 1003 pathOffset += 17; |
| 1004 index = path.indexOf(":testIamPermissions", pathOffset); |
| 1005 unittest.expect(index >= 0, unittest.isTrue); |
| 1006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1007 pathOffset = index; |
| 1008 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 1009 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals(":testIamPermissions")); |
| 1010 pathOffset += 19; |
| 1011 |
| 1012 var query = (req.url).query; |
| 1013 var queryOffset = 0; |
| 1014 var queryMap = {}; |
| 1015 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1016 parseBool(n) { |
| 1017 if (n == "true") return true; |
| 1018 if (n == "false") return false; |
| 1019 if (n == null) return null; |
| 1020 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1021 } |
| 1022 if (query.length > 0) { |
| 1023 for (var part in query.split("&")) { |
| 1024 var keyvalue = part.split("="); |
| 1025 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1026 } |
| 1027 } |
| 1028 |
| 1029 |
| 1030 var h = { |
| 1031 "content-type" : "application/json; charset=utf-8", |
| 1032 }; |
| 1033 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1034 return new async.Future.value(stringResponse(200, h, resp)); |
| 1035 }), true); |
| 1036 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { |
| 1037 checkTestIamPermissionsResponse(response); |
| 1038 }))); |
| 1039 }); |
| 1040 |
| 1041 unittest.test("method--undelete", () { |
| 1042 |
| 1043 var mock = new HttpServerMock(); |
| 1044 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1045 var arg_projectId = "foo"; |
| 1046 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1047 var path = (req.url).path; |
| 1048 var pathOffset = 0; |
| 1049 var index; |
| 1050 var subPart; |
| 1051 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1052 pathOffset += 1; |
| 1053 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 1054 pathOffset += 17; |
| 1055 index = path.indexOf(":undelete", pathOffset); |
| 1056 unittest.expect(index >= 0, unittest.isTrue); |
| 1057 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1058 pathOffset = index; |
| 1059 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1060 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als(":undelete")); |
| 1061 pathOffset += 9; |
| 1062 |
| 1063 var query = (req.url).query; |
| 1064 var queryOffset = 0; |
| 1065 var queryMap = {}; |
| 1066 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1067 parseBool(n) { |
| 1068 if (n == "true") return true; |
| 1069 if (n == "false") return false; |
| 1070 if (n == null) return null; |
| 1071 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1072 } |
| 1073 if (query.length > 0) { |
| 1074 for (var part in query.split("&")) { |
| 1075 var keyvalue = part.split("="); |
| 1076 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1077 } |
| 1078 } |
| 1079 |
| 1080 |
| 1081 var h = { |
| 1082 "content-type" : "application/json; charset=utf-8", |
| 1083 }; |
| 1084 var resp = convert.JSON.encode(buildEmpty()); |
| 1085 return new async.Future.value(stringResponse(200, h, resp)); |
| 1086 }), true); |
| 1087 res.undelete(arg_projectId).then(unittest.expectAsync(((api.Empty response
) { |
| 1088 checkEmpty(response); |
| 1089 }))); |
| 1090 }); |
| 1091 |
| 1092 unittest.test("method--update", () { |
| 1093 |
| 1094 var mock = new HttpServerMock(); |
| 1095 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1096 var arg_request = buildProject(); |
| 1097 var arg_projectId = "foo"; |
| 1098 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1099 var obj = new api.Project.fromJson(json); |
| 1100 checkProject(obj); |
| 1101 |
| 1102 var path = (req.url).path; |
| 1103 var pathOffset = 0; |
| 1104 var index; |
| 1105 var subPart; |
| 1106 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1107 pathOffset += 1; |
| 1108 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 1109 pathOffset += 17; |
| 1110 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1111 pathOffset = path.length; |
| 1112 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1113 |
| 1114 var query = (req.url).query; |
| 1115 var queryOffset = 0; |
| 1116 var queryMap = {}; |
| 1117 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1118 parseBool(n) { |
| 1119 if (n == "true") return true; |
| 1120 if (n == "false") return false; |
| 1121 if (n == null) return null; |
| 1122 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1123 } |
| 1124 if (query.length > 0) { |
| 1125 for (var part in query.split("&")) { |
| 1126 var keyvalue = part.split("="); |
| 1127 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1128 } |
| 1129 } |
| 1130 |
| 1131 |
| 1132 var h = { |
| 1133 "content-type" : "application/json; charset=utf-8", |
| 1134 }; |
| 1135 var resp = convert.JSON.encode(buildProject()); |
| 1136 return new async.Future.value(stringResponse(200, h, resp)); |
| 1137 }), true); |
| 1138 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { |
| 1139 checkProject(response); |
| 1140 }))); |
| 1141 }); |
| 1142 |
| 1143 }); |
| 1144 |
| 1145 |
| 1146 } |
| 1147 |
OLD | NEW |