| OLD | NEW |
| 1 library googleapis_beta.sqladmin.v1beta4.test; | 1 library googleapis_beta.sqladmin.v1beta4.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | 4 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
| 7 | 6 |
| 8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
| 11 | 9 |
| 12 import 'package:googleapis_beta/sqladmin/v1beta4.dart' as api; | 10 import 'package:googleapis_beta/sqladmin/v1beta4.dart' as api; |
| 13 | 11 |
| 14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 13 core.Function _callback; |
| 16 core.bool _expectJson; | 14 core.bool _expectJson; |
| 17 | 15 |
| 18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 17 _callback = callback; |
| 20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
| 21 } | 19 } |
| 22 | 20 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { | 22 if (_expectJson) { |
| 25 return request.finalize() | 23 return request |
| 24 .finalize() |
| 26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
| 27 .join('') | 26 .join('') |
| 28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); | 29 return _callback(request, null); |
| 31 } else { | 30 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } | 32 } |
| 34 }); | 33 }); |
| 35 } else { | 34 } else { |
| 36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
| 37 if (stream == null) { | 36 if (stream == null) { |
| 38 return _callback(request, []); | 37 return _callback(request, []); |
| 39 } else { | 38 } else { |
| 40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 40 return _callback(request, data); |
| 42 }); | 41 }); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
| 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 51 } |
| 53 | 52 |
| 54 core.int buildCounterAclEntry = 0; | 53 core.int buildCounterAclEntry = 0; |
| 55 buildAclEntry() { | 54 buildAclEntry() { |
| 56 var o = new api.AclEntry(); | 55 var o = new api.AclEntry(); |
| 57 buildCounterAclEntry++; | 56 buildCounterAclEntry++; |
| 58 if (buildCounterAclEntry < 3) { | 57 if (buildCounterAclEntry < 3) { |
| 59 o.expirationTime = core.DateTime.parse("2002-02-27T14:01:02"); | 58 o.expirationTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 60 o.kind = "foo"; | 59 o.kind = "foo"; |
| 61 o.name = "foo"; | 60 o.name = "foo"; |
| 62 o.value = "foo"; | 61 o.value = "foo"; |
| 63 } | 62 } |
| 64 buildCounterAclEntry--; | 63 buildCounterAclEntry--; |
| 65 return o; | 64 return o; |
| 66 } | 65 } |
| 67 | 66 |
| 68 checkAclEntry(api.AclEntry o) { | 67 checkAclEntry(api.AclEntry o) { |
| 69 buildCounterAclEntry++; | 68 buildCounterAclEntry++; |
| 70 if (buildCounterAclEntry < 3) { | 69 if (buildCounterAclEntry < 3) { |
| 71 unittest.expect(o.expirationTime, unittest.equals(core.DateTime.parse("2002-
02-27T14:01:02"))); | 70 unittest.expect(o.expirationTime, |
| 71 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 72 unittest.expect(o.kind, unittest.equals('foo')); | 72 unittest.expect(o.kind, unittest.equals('foo')); |
| 73 unittest.expect(o.name, unittest.equals('foo')); | 73 unittest.expect(o.name, unittest.equals('foo')); |
| 74 unittest.expect(o.value, unittest.equals('foo')); | 74 unittest.expect(o.value, unittest.equals('foo')); |
| 75 } | 75 } |
| 76 buildCounterAclEntry--; | 76 buildCounterAclEntry--; |
| 77 } | 77 } |
| 78 | 78 |
| 79 core.int buildCounterBackupConfiguration = 0; | 79 core.int buildCounterBackupConfiguration = 0; |
| 80 buildBackupConfiguration() { | 80 buildBackupConfiguration() { |
| 81 var o = new api.BackupConfiguration(); | 81 var o = new api.BackupConfiguration(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 o.windowStartTime = core.DateTime.parse("2002-02-27T14:01:02"); | 120 o.windowStartTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 121 } | 121 } |
| 122 buildCounterBackupRun--; | 122 buildCounterBackupRun--; |
| 123 return o; | 123 return o; |
| 124 } | 124 } |
| 125 | 125 |
| 126 checkBackupRun(api.BackupRun o) { | 126 checkBackupRun(api.BackupRun o) { |
| 127 buildCounterBackupRun++; | 127 buildCounterBackupRun++; |
| 128 if (buildCounterBackupRun < 3) { | 128 if (buildCounterBackupRun < 3) { |
| 129 unittest.expect(o.description, unittest.equals('foo')); | 129 unittest.expect(o.description, unittest.equals('foo')); |
| 130 unittest.expect(o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 130 unittest.expect( |
| 131 unittest.expect(o.enqueuedTime, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); | 131 o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 132 unittest.expect(o.enqueuedTime, |
| 133 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 132 checkOperationError(o.error); | 134 checkOperationError(o.error); |
| 133 unittest.expect(o.id, unittest.equals('foo')); | 135 unittest.expect(o.id, unittest.equals('foo')); |
| 134 unittest.expect(o.instance, unittest.equals('foo')); | 136 unittest.expect(o.instance, unittest.equals('foo')); |
| 135 unittest.expect(o.kind, unittest.equals('foo')); | 137 unittest.expect(o.kind, unittest.equals('foo')); |
| 136 unittest.expect(o.selfLink, unittest.equals('foo')); | 138 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 137 unittest.expect(o.startTime, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 139 unittest.expect(o.startTime, |
| 140 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 138 unittest.expect(o.status, unittest.equals('foo')); | 141 unittest.expect(o.status, unittest.equals('foo')); |
| 139 unittest.expect(o.type, unittest.equals('foo')); | 142 unittest.expect(o.type, unittest.equals('foo')); |
| 140 unittest.expect(o.windowStartTime, unittest.equals(core.DateTime.parse("2002
-02-27T14:01:02"))); | 143 unittest.expect(o.windowStartTime, |
| 144 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 141 } | 145 } |
| 142 buildCounterBackupRun--; | 146 buildCounterBackupRun--; |
| 143 } | 147 } |
| 144 | 148 |
| 145 buildUnnamed3394() { | 149 buildUnnamed3399() { |
| 146 var o = new core.List<api.BackupRun>(); | 150 var o = new core.List<api.BackupRun>(); |
| 147 o.add(buildBackupRun()); | 151 o.add(buildBackupRun()); |
| 148 o.add(buildBackupRun()); | 152 o.add(buildBackupRun()); |
| 149 return o; | 153 return o; |
| 150 } | 154 } |
| 151 | 155 |
| 152 checkUnnamed3394(core.List<api.BackupRun> o) { | 156 checkUnnamed3399(core.List<api.BackupRun> o) { |
| 153 unittest.expect(o, unittest.hasLength(2)); | 157 unittest.expect(o, unittest.hasLength(2)); |
| 154 checkBackupRun(o[0]); | 158 checkBackupRun(o[0]); |
| 155 checkBackupRun(o[1]); | 159 checkBackupRun(o[1]); |
| 156 } | 160 } |
| 157 | 161 |
| 158 core.int buildCounterBackupRunsListResponse = 0; | 162 core.int buildCounterBackupRunsListResponse = 0; |
| 159 buildBackupRunsListResponse() { | 163 buildBackupRunsListResponse() { |
| 160 var o = new api.BackupRunsListResponse(); | 164 var o = new api.BackupRunsListResponse(); |
| 161 buildCounterBackupRunsListResponse++; | 165 buildCounterBackupRunsListResponse++; |
| 162 if (buildCounterBackupRunsListResponse < 3) { | 166 if (buildCounterBackupRunsListResponse < 3) { |
| 163 o.items = buildUnnamed3394(); | 167 o.items = buildUnnamed3399(); |
| 164 o.kind = "foo"; | 168 o.kind = "foo"; |
| 165 o.nextPageToken = "foo"; | 169 o.nextPageToken = "foo"; |
| 166 } | 170 } |
| 167 buildCounterBackupRunsListResponse--; | 171 buildCounterBackupRunsListResponse--; |
| 168 return o; | 172 return o; |
| 169 } | 173 } |
| 170 | 174 |
| 171 checkBackupRunsListResponse(api.BackupRunsListResponse o) { | 175 checkBackupRunsListResponse(api.BackupRunsListResponse o) { |
| 172 buildCounterBackupRunsListResponse++; | 176 buildCounterBackupRunsListResponse++; |
| 173 if (buildCounterBackupRunsListResponse < 3) { | 177 if (buildCounterBackupRunsListResponse < 3) { |
| 174 checkUnnamed3394(o.items); | 178 checkUnnamed3399(o.items); |
| 175 unittest.expect(o.kind, unittest.equals('foo')); | 179 unittest.expect(o.kind, unittest.equals('foo')); |
| 176 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 180 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 177 } | 181 } |
| 178 buildCounterBackupRunsListResponse--; | 182 buildCounterBackupRunsListResponse--; |
| 179 } | 183 } |
| 180 | 184 |
| 181 core.int buildCounterBinLogCoordinates = 0; | 185 core.int buildCounterBinLogCoordinates = 0; |
| 182 buildBinLogCoordinates() { | 186 buildBinLogCoordinates() { |
| 183 var o = new api.BinLogCoordinates(); | 187 var o = new api.BinLogCoordinates(); |
| 184 buildCounterBinLogCoordinates++; | 188 buildCounterBinLogCoordinates++; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 296 |
| 293 checkDatabaseInstanceFailoverReplica(api.DatabaseInstanceFailoverReplica o) { | 297 checkDatabaseInstanceFailoverReplica(api.DatabaseInstanceFailoverReplica o) { |
| 294 buildCounterDatabaseInstanceFailoverReplica++; | 298 buildCounterDatabaseInstanceFailoverReplica++; |
| 295 if (buildCounterDatabaseInstanceFailoverReplica < 3) { | 299 if (buildCounterDatabaseInstanceFailoverReplica < 3) { |
| 296 unittest.expect(o.available, unittest.isTrue); | 300 unittest.expect(o.available, unittest.isTrue); |
| 297 unittest.expect(o.name, unittest.equals('foo')); | 301 unittest.expect(o.name, unittest.equals('foo')); |
| 298 } | 302 } |
| 299 buildCounterDatabaseInstanceFailoverReplica--; | 303 buildCounterDatabaseInstanceFailoverReplica--; |
| 300 } | 304 } |
| 301 | 305 |
| 302 buildUnnamed3395() { | 306 buildUnnamed3400() { |
| 303 var o = new core.List<api.IpMapping>(); | 307 var o = new core.List<api.IpMapping>(); |
| 304 o.add(buildIpMapping()); | 308 o.add(buildIpMapping()); |
| 305 o.add(buildIpMapping()); | 309 o.add(buildIpMapping()); |
| 306 return o; | 310 return o; |
| 307 } | 311 } |
| 308 | 312 |
| 309 checkUnnamed3395(core.List<api.IpMapping> o) { | 313 checkUnnamed3400(core.List<api.IpMapping> o) { |
| 310 unittest.expect(o, unittest.hasLength(2)); | 314 unittest.expect(o, unittest.hasLength(2)); |
| 311 checkIpMapping(o[0]); | 315 checkIpMapping(o[0]); |
| 312 checkIpMapping(o[1]); | 316 checkIpMapping(o[1]); |
| 313 } | 317 } |
| 314 | 318 |
| 315 buildUnnamed3396() { | 319 buildUnnamed3401() { |
| 316 var o = new core.List<core.String>(); | 320 var o = new core.List<core.String>(); |
| 317 o.add("foo"); | 321 o.add("foo"); |
| 318 o.add("foo"); | 322 o.add("foo"); |
| 319 return o; | 323 return o; |
| 320 } | 324 } |
| 321 | 325 |
| 322 checkUnnamed3396(core.List<core.String> o) { | 326 checkUnnamed3401(core.List<core.String> o) { |
| 323 unittest.expect(o, unittest.hasLength(2)); | 327 unittest.expect(o, unittest.hasLength(2)); |
| 324 unittest.expect(o[0], unittest.equals('foo')); | 328 unittest.expect(o[0], unittest.equals('foo')); |
| 325 unittest.expect(o[1], unittest.equals('foo')); | 329 unittest.expect(o[1], unittest.equals('foo')); |
| 326 } | 330 } |
| 327 | 331 |
| 328 buildUnnamed3397() { | 332 buildUnnamed3402() { |
| 329 var o = new core.List<core.String>(); | 333 var o = new core.List<core.String>(); |
| 330 o.add("foo"); | 334 o.add("foo"); |
| 331 o.add("foo"); | 335 o.add("foo"); |
| 332 return o; | 336 return o; |
| 333 } | 337 } |
| 334 | 338 |
| 335 checkUnnamed3397(core.List<core.String> o) { | 339 checkUnnamed3402(core.List<core.String> o) { |
| 336 unittest.expect(o, unittest.hasLength(2)); | 340 unittest.expect(o, unittest.hasLength(2)); |
| 337 unittest.expect(o[0], unittest.equals('foo')); | 341 unittest.expect(o[0], unittest.equals('foo')); |
| 338 unittest.expect(o[1], unittest.equals('foo')); | 342 unittest.expect(o[1], unittest.equals('foo')); |
| 339 } | 343 } |
| 340 | 344 |
| 341 core.int buildCounterDatabaseInstance = 0; | 345 core.int buildCounterDatabaseInstance = 0; |
| 342 buildDatabaseInstance() { | 346 buildDatabaseInstance() { |
| 343 var o = new api.DatabaseInstance(); | 347 var o = new api.DatabaseInstance(); |
| 344 buildCounterDatabaseInstance++; | 348 buildCounterDatabaseInstance++; |
| 345 if (buildCounterDatabaseInstance < 3) { | 349 if (buildCounterDatabaseInstance < 3) { |
| 346 o.backendType = "foo"; | 350 o.backendType = "foo"; |
| 347 o.connectionName = "foo"; | 351 o.connectionName = "foo"; |
| 348 o.currentDiskSize = "foo"; | 352 o.currentDiskSize = "foo"; |
| 349 o.databaseVersion = "foo"; | 353 o.databaseVersion = "foo"; |
| 350 o.etag = "foo"; | 354 o.etag = "foo"; |
| 351 o.failoverReplica = buildDatabaseInstanceFailoverReplica(); | 355 o.failoverReplica = buildDatabaseInstanceFailoverReplica(); |
| 352 o.gceZone = "foo"; | 356 o.gceZone = "foo"; |
| 353 o.instanceType = "foo"; | 357 o.instanceType = "foo"; |
| 354 o.ipAddresses = buildUnnamed3395(); | 358 o.ipAddresses = buildUnnamed3400(); |
| 355 o.ipv6Address = "foo"; | 359 o.ipv6Address = "foo"; |
| 356 o.kind = "foo"; | 360 o.kind = "foo"; |
| 357 o.masterInstanceName = "foo"; | 361 o.masterInstanceName = "foo"; |
| 358 o.maxDiskSize = "foo"; | 362 o.maxDiskSize = "foo"; |
| 359 o.name = "foo"; | 363 o.name = "foo"; |
| 360 o.onPremisesConfiguration = buildOnPremisesConfiguration(); | 364 o.onPremisesConfiguration = buildOnPremisesConfiguration(); |
| 361 o.project = "foo"; | 365 o.project = "foo"; |
| 362 o.region = "foo"; | 366 o.region = "foo"; |
| 363 o.replicaConfiguration = buildReplicaConfiguration(); | 367 o.replicaConfiguration = buildReplicaConfiguration(); |
| 364 o.replicaNames = buildUnnamed3396(); | 368 o.replicaNames = buildUnnamed3401(); |
| 365 o.selfLink = "foo"; | 369 o.selfLink = "foo"; |
| 366 o.serverCaCert = buildSslCert(); | 370 o.serverCaCert = buildSslCert(); |
| 367 o.serviceAccountEmailAddress = "foo"; | 371 o.serviceAccountEmailAddress = "foo"; |
| 368 o.settings = buildSettings(); | 372 o.settings = buildSettings(); |
| 369 o.state = "foo"; | 373 o.state = "foo"; |
| 370 o.suspensionReason = buildUnnamed3397(); | 374 o.suspensionReason = buildUnnamed3402(); |
| 371 } | 375 } |
| 372 buildCounterDatabaseInstance--; | 376 buildCounterDatabaseInstance--; |
| 373 return o; | 377 return o; |
| 374 } | 378 } |
| 375 | 379 |
| 376 checkDatabaseInstance(api.DatabaseInstance o) { | 380 checkDatabaseInstance(api.DatabaseInstance o) { |
| 377 buildCounterDatabaseInstance++; | 381 buildCounterDatabaseInstance++; |
| 378 if (buildCounterDatabaseInstance < 3) { | 382 if (buildCounterDatabaseInstance < 3) { |
| 379 unittest.expect(o.backendType, unittest.equals('foo')); | 383 unittest.expect(o.backendType, unittest.equals('foo')); |
| 380 unittest.expect(o.connectionName, unittest.equals('foo')); | 384 unittest.expect(o.connectionName, unittest.equals('foo')); |
| 381 unittest.expect(o.currentDiskSize, unittest.equals('foo')); | 385 unittest.expect(o.currentDiskSize, unittest.equals('foo')); |
| 382 unittest.expect(o.databaseVersion, unittest.equals('foo')); | 386 unittest.expect(o.databaseVersion, unittest.equals('foo')); |
| 383 unittest.expect(o.etag, unittest.equals('foo')); | 387 unittest.expect(o.etag, unittest.equals('foo')); |
| 384 checkDatabaseInstanceFailoverReplica(o.failoverReplica); | 388 checkDatabaseInstanceFailoverReplica(o.failoverReplica); |
| 385 unittest.expect(o.gceZone, unittest.equals('foo')); | 389 unittest.expect(o.gceZone, unittest.equals('foo')); |
| 386 unittest.expect(o.instanceType, unittest.equals('foo')); | 390 unittest.expect(o.instanceType, unittest.equals('foo')); |
| 387 checkUnnamed3395(o.ipAddresses); | 391 checkUnnamed3400(o.ipAddresses); |
| 388 unittest.expect(o.ipv6Address, unittest.equals('foo')); | 392 unittest.expect(o.ipv6Address, unittest.equals('foo')); |
| 389 unittest.expect(o.kind, unittest.equals('foo')); | 393 unittest.expect(o.kind, unittest.equals('foo')); |
| 390 unittest.expect(o.masterInstanceName, unittest.equals('foo')); | 394 unittest.expect(o.masterInstanceName, unittest.equals('foo')); |
| 391 unittest.expect(o.maxDiskSize, unittest.equals('foo')); | 395 unittest.expect(o.maxDiskSize, unittest.equals('foo')); |
| 392 unittest.expect(o.name, unittest.equals('foo')); | 396 unittest.expect(o.name, unittest.equals('foo')); |
| 393 checkOnPremisesConfiguration(o.onPremisesConfiguration); | 397 checkOnPremisesConfiguration(o.onPremisesConfiguration); |
| 394 unittest.expect(o.project, unittest.equals('foo')); | 398 unittest.expect(o.project, unittest.equals('foo')); |
| 395 unittest.expect(o.region, unittest.equals('foo')); | 399 unittest.expect(o.region, unittest.equals('foo')); |
| 396 checkReplicaConfiguration(o.replicaConfiguration); | 400 checkReplicaConfiguration(o.replicaConfiguration); |
| 397 checkUnnamed3396(o.replicaNames); | 401 checkUnnamed3401(o.replicaNames); |
| 398 unittest.expect(o.selfLink, unittest.equals('foo')); | 402 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 399 checkSslCert(o.serverCaCert); | 403 checkSslCert(o.serverCaCert); |
| 400 unittest.expect(o.serviceAccountEmailAddress, unittest.equals('foo')); | 404 unittest.expect(o.serviceAccountEmailAddress, unittest.equals('foo')); |
| 401 checkSettings(o.settings); | 405 checkSettings(o.settings); |
| 402 unittest.expect(o.state, unittest.equals('foo')); | 406 unittest.expect(o.state, unittest.equals('foo')); |
| 403 checkUnnamed3397(o.suspensionReason); | 407 checkUnnamed3402(o.suspensionReason); |
| 404 } | 408 } |
| 405 buildCounterDatabaseInstance--; | 409 buildCounterDatabaseInstance--; |
| 406 } | 410 } |
| 407 | 411 |
| 408 buildUnnamed3398() { | 412 buildUnnamed3403() { |
| 409 var o = new core.List<api.Database>(); | 413 var o = new core.List<api.Database>(); |
| 410 o.add(buildDatabase()); | 414 o.add(buildDatabase()); |
| 411 o.add(buildDatabase()); | 415 o.add(buildDatabase()); |
| 412 return o; | 416 return o; |
| 413 } | 417 } |
| 414 | 418 |
| 415 checkUnnamed3398(core.List<api.Database> o) { | 419 checkUnnamed3403(core.List<api.Database> o) { |
| 416 unittest.expect(o, unittest.hasLength(2)); | 420 unittest.expect(o, unittest.hasLength(2)); |
| 417 checkDatabase(o[0]); | 421 checkDatabase(o[0]); |
| 418 checkDatabase(o[1]); | 422 checkDatabase(o[1]); |
| 419 } | 423 } |
| 420 | 424 |
| 421 core.int buildCounterDatabasesListResponse = 0; | 425 core.int buildCounterDatabasesListResponse = 0; |
| 422 buildDatabasesListResponse() { | 426 buildDatabasesListResponse() { |
| 423 var o = new api.DatabasesListResponse(); | 427 var o = new api.DatabasesListResponse(); |
| 424 buildCounterDatabasesListResponse++; | 428 buildCounterDatabasesListResponse++; |
| 425 if (buildCounterDatabasesListResponse < 3) { | 429 if (buildCounterDatabasesListResponse < 3) { |
| 426 o.items = buildUnnamed3398(); | 430 o.items = buildUnnamed3403(); |
| 427 o.kind = "foo"; | 431 o.kind = "foo"; |
| 428 } | 432 } |
| 429 buildCounterDatabasesListResponse--; | 433 buildCounterDatabasesListResponse--; |
| 430 return o; | 434 return o; |
| 431 } | 435 } |
| 432 | 436 |
| 433 checkDatabasesListResponse(api.DatabasesListResponse o) { | 437 checkDatabasesListResponse(api.DatabasesListResponse o) { |
| 434 buildCounterDatabasesListResponse++; | 438 buildCounterDatabasesListResponse++; |
| 435 if (buildCounterDatabasesListResponse < 3) { | 439 if (buildCounterDatabasesListResponse < 3) { |
| 436 checkUnnamed3398(o.items); | 440 checkUnnamed3403(o.items); |
| 437 unittest.expect(o.kind, unittest.equals('foo')); | 441 unittest.expect(o.kind, unittest.equals('foo')); |
| 438 } | 442 } |
| 439 buildCounterDatabasesListResponse--; | 443 buildCounterDatabasesListResponse--; |
| 440 } | 444 } |
| 441 | 445 |
| 442 core.int buildCounterExportContextCsvExportOptions = 0; | 446 core.int buildCounterExportContextCsvExportOptions = 0; |
| 443 buildExportContextCsvExportOptions() { | 447 buildExportContextCsvExportOptions() { |
| 444 var o = new api.ExportContextCsvExportOptions(); | 448 var o = new api.ExportContextCsvExportOptions(); |
| 445 buildCounterExportContextCsvExportOptions++; | 449 buildCounterExportContextCsvExportOptions++; |
| 446 if (buildCounterExportContextCsvExportOptions < 3) { | 450 if (buildCounterExportContextCsvExportOptions < 3) { |
| 447 o.selectQuery = "foo"; | 451 o.selectQuery = "foo"; |
| 448 } | 452 } |
| 449 buildCounterExportContextCsvExportOptions--; | 453 buildCounterExportContextCsvExportOptions--; |
| 450 return o; | 454 return o; |
| 451 } | 455 } |
| 452 | 456 |
| 453 checkExportContextCsvExportOptions(api.ExportContextCsvExportOptions o) { | 457 checkExportContextCsvExportOptions(api.ExportContextCsvExportOptions o) { |
| 454 buildCounterExportContextCsvExportOptions++; | 458 buildCounterExportContextCsvExportOptions++; |
| 455 if (buildCounterExportContextCsvExportOptions < 3) { | 459 if (buildCounterExportContextCsvExportOptions < 3) { |
| 456 unittest.expect(o.selectQuery, unittest.equals('foo')); | 460 unittest.expect(o.selectQuery, unittest.equals('foo')); |
| 457 } | 461 } |
| 458 buildCounterExportContextCsvExportOptions--; | 462 buildCounterExportContextCsvExportOptions--; |
| 459 } | 463 } |
| 460 | 464 |
| 461 buildUnnamed3399() { | 465 buildUnnamed3404() { |
| 462 var o = new core.List<core.String>(); | 466 var o = new core.List<core.String>(); |
| 463 o.add("foo"); | 467 o.add("foo"); |
| 464 o.add("foo"); | 468 o.add("foo"); |
| 465 return o; | 469 return o; |
| 466 } | 470 } |
| 467 | 471 |
| 468 checkUnnamed3399(core.List<core.String> o) { | 472 checkUnnamed3404(core.List<core.String> o) { |
| 469 unittest.expect(o, unittest.hasLength(2)); | 473 unittest.expect(o, unittest.hasLength(2)); |
| 470 unittest.expect(o[0], unittest.equals('foo')); | 474 unittest.expect(o[0], unittest.equals('foo')); |
| 471 unittest.expect(o[1], unittest.equals('foo')); | 475 unittest.expect(o[1], unittest.equals('foo')); |
| 472 } | 476 } |
| 473 | 477 |
| 474 buildUnnamed3400() { | 478 buildUnnamed3405() { |
| 475 var o = new core.List<core.String>(); | 479 var o = new core.List<core.String>(); |
| 476 o.add("foo"); | 480 o.add("foo"); |
| 477 o.add("foo"); | 481 o.add("foo"); |
| 478 return o; | 482 return o; |
| 479 } | 483 } |
| 480 | 484 |
| 481 checkUnnamed3400(core.List<core.String> o) { | 485 checkUnnamed3405(core.List<core.String> o) { |
| 482 unittest.expect(o, unittest.hasLength(2)); | 486 unittest.expect(o, unittest.hasLength(2)); |
| 483 unittest.expect(o[0], unittest.equals('foo')); | 487 unittest.expect(o[0], unittest.equals('foo')); |
| 484 unittest.expect(o[1], unittest.equals('foo')); | 488 unittest.expect(o[1], unittest.equals('foo')); |
| 485 } | 489 } |
| 486 | 490 |
| 487 core.int buildCounterExportContextSqlExportOptions = 0; | 491 core.int buildCounterExportContextSqlExportOptions = 0; |
| 488 buildExportContextSqlExportOptions() { | 492 buildExportContextSqlExportOptions() { |
| 489 var o = new api.ExportContextSqlExportOptions(); | 493 var o = new api.ExportContextSqlExportOptions(); |
| 490 buildCounterExportContextSqlExportOptions++; | 494 buildCounterExportContextSqlExportOptions++; |
| 491 if (buildCounterExportContextSqlExportOptions < 3) { | 495 if (buildCounterExportContextSqlExportOptions < 3) { |
| 492 o.schemaOnly = true; | 496 o.schemaOnly = true; |
| 493 o.tables = buildUnnamed3400(); | 497 o.tables = buildUnnamed3405(); |
| 494 } | 498 } |
| 495 buildCounterExportContextSqlExportOptions--; | 499 buildCounterExportContextSqlExportOptions--; |
| 496 return o; | 500 return o; |
| 497 } | 501 } |
| 498 | 502 |
| 499 checkExportContextSqlExportOptions(api.ExportContextSqlExportOptions o) { | 503 checkExportContextSqlExportOptions(api.ExportContextSqlExportOptions o) { |
| 500 buildCounterExportContextSqlExportOptions++; | 504 buildCounterExportContextSqlExportOptions++; |
| 501 if (buildCounterExportContextSqlExportOptions < 3) { | 505 if (buildCounterExportContextSqlExportOptions < 3) { |
| 502 unittest.expect(o.schemaOnly, unittest.isTrue); | 506 unittest.expect(o.schemaOnly, unittest.isTrue); |
| 503 checkUnnamed3400(o.tables); | 507 checkUnnamed3405(o.tables); |
| 504 } | 508 } |
| 505 buildCounterExportContextSqlExportOptions--; | 509 buildCounterExportContextSqlExportOptions--; |
| 506 } | 510 } |
| 507 | 511 |
| 508 core.int buildCounterExportContext = 0; | 512 core.int buildCounterExportContext = 0; |
| 509 buildExportContext() { | 513 buildExportContext() { |
| 510 var o = new api.ExportContext(); | 514 var o = new api.ExportContext(); |
| 511 buildCounterExportContext++; | 515 buildCounterExportContext++; |
| 512 if (buildCounterExportContext < 3) { | 516 if (buildCounterExportContext < 3) { |
| 513 o.csvExportOptions = buildExportContextCsvExportOptions(); | 517 o.csvExportOptions = buildExportContextCsvExportOptions(); |
| 514 o.databases = buildUnnamed3399(); | 518 o.databases = buildUnnamed3404(); |
| 515 o.fileType = "foo"; | 519 o.fileType = "foo"; |
| 516 o.kind = "foo"; | 520 o.kind = "foo"; |
| 517 o.sqlExportOptions = buildExportContextSqlExportOptions(); | 521 o.sqlExportOptions = buildExportContextSqlExportOptions(); |
| 518 o.uri = "foo"; | 522 o.uri = "foo"; |
| 519 } | 523 } |
| 520 buildCounterExportContext--; | 524 buildCounterExportContext--; |
| 521 return o; | 525 return o; |
| 522 } | 526 } |
| 523 | 527 |
| 524 checkExportContext(api.ExportContext o) { | 528 checkExportContext(api.ExportContext o) { |
| 525 buildCounterExportContext++; | 529 buildCounterExportContext++; |
| 526 if (buildCounterExportContext < 3) { | 530 if (buildCounterExportContext < 3) { |
| 527 checkExportContextCsvExportOptions(o.csvExportOptions); | 531 checkExportContextCsvExportOptions(o.csvExportOptions); |
| 528 checkUnnamed3399(o.databases); | 532 checkUnnamed3404(o.databases); |
| 529 unittest.expect(o.fileType, unittest.equals('foo')); | 533 unittest.expect(o.fileType, unittest.equals('foo')); |
| 530 unittest.expect(o.kind, unittest.equals('foo')); | 534 unittest.expect(o.kind, unittest.equals('foo')); |
| 531 checkExportContextSqlExportOptions(o.sqlExportOptions); | 535 checkExportContextSqlExportOptions(o.sqlExportOptions); |
| 532 unittest.expect(o.uri, unittest.equals('foo')); | 536 unittest.expect(o.uri, unittest.equals('foo')); |
| 533 } | 537 } |
| 534 buildCounterExportContext--; | 538 buildCounterExportContext--; |
| 535 } | 539 } |
| 536 | 540 |
| 537 core.int buildCounterFailoverContext = 0; | 541 core.int buildCounterFailoverContext = 0; |
| 538 buildFailoverContext() { | 542 buildFailoverContext() { |
| 539 var o = new api.FailoverContext(); | 543 var o = new api.FailoverContext(); |
| 540 buildCounterFailoverContext++; | 544 buildCounterFailoverContext++; |
| 541 if (buildCounterFailoverContext < 3) { | 545 if (buildCounterFailoverContext < 3) { |
| 542 o.kind = "foo"; | 546 o.kind = "foo"; |
| 543 o.settingsVersion = "foo"; | 547 o.settingsVersion = "foo"; |
| 544 } | 548 } |
| 545 buildCounterFailoverContext--; | 549 buildCounterFailoverContext--; |
| 546 return o; | 550 return o; |
| 547 } | 551 } |
| 548 | 552 |
| 549 checkFailoverContext(api.FailoverContext o) { | 553 checkFailoverContext(api.FailoverContext o) { |
| 550 buildCounterFailoverContext++; | 554 buildCounterFailoverContext++; |
| 551 if (buildCounterFailoverContext < 3) { | 555 if (buildCounterFailoverContext < 3) { |
| 552 unittest.expect(o.kind, unittest.equals('foo')); | 556 unittest.expect(o.kind, unittest.equals('foo')); |
| 553 unittest.expect(o.settingsVersion, unittest.equals('foo')); | 557 unittest.expect(o.settingsVersion, unittest.equals('foo')); |
| 554 } | 558 } |
| 555 buildCounterFailoverContext--; | 559 buildCounterFailoverContext--; |
| 556 } | 560 } |
| 557 | 561 |
| 558 buildUnnamed3401() { | 562 buildUnnamed3406() { |
| 559 var o = new core.List<core.String>(); | 563 var o = new core.List<core.String>(); |
| 560 o.add("foo"); | 564 o.add("foo"); |
| 561 o.add("foo"); | 565 o.add("foo"); |
| 562 return o; | 566 return o; |
| 563 } | 567 } |
| 564 | 568 |
| 565 checkUnnamed3401(core.List<core.String> o) { | 569 checkUnnamed3406(core.List<core.String> o) { |
| 566 unittest.expect(o, unittest.hasLength(2)); | 570 unittest.expect(o, unittest.hasLength(2)); |
| 567 unittest.expect(o[0], unittest.equals('foo')); | 571 unittest.expect(o[0], unittest.equals('foo')); |
| 568 unittest.expect(o[1], unittest.equals('foo')); | 572 unittest.expect(o[1], unittest.equals('foo')); |
| 569 } | 573 } |
| 570 | 574 |
| 571 buildUnnamed3402() { | 575 buildUnnamed3407() { |
| 572 var o = new core.List<core.String>(); | 576 var o = new core.List<core.String>(); |
| 573 o.add("foo"); | 577 o.add("foo"); |
| 574 o.add("foo"); | 578 o.add("foo"); |
| 575 return o; | 579 return o; |
| 576 } | 580 } |
| 577 | 581 |
| 578 checkUnnamed3402(core.List<core.String> o) { | 582 checkUnnamed3407(core.List<core.String> o) { |
| 579 unittest.expect(o, unittest.hasLength(2)); | 583 unittest.expect(o, unittest.hasLength(2)); |
| 580 unittest.expect(o[0], unittest.equals('foo')); | 584 unittest.expect(o[0], unittest.equals('foo')); |
| 581 unittest.expect(o[1], unittest.equals('foo')); | 585 unittest.expect(o[1], unittest.equals('foo')); |
| 582 } | 586 } |
| 583 | 587 |
| 584 core.int buildCounterFlag = 0; | 588 core.int buildCounterFlag = 0; |
| 585 buildFlag() { | 589 buildFlag() { |
| 586 var o = new api.Flag(); | 590 var o = new api.Flag(); |
| 587 buildCounterFlag++; | 591 buildCounterFlag++; |
| 588 if (buildCounterFlag < 3) { | 592 if (buildCounterFlag < 3) { |
| 589 o.allowedStringValues = buildUnnamed3401(); | 593 o.allowedStringValues = buildUnnamed3406(); |
| 590 o.appliesTo = buildUnnamed3402(); | 594 o.appliesTo = buildUnnamed3407(); |
| 591 o.kind = "foo"; | 595 o.kind = "foo"; |
| 592 o.maxValue = "foo"; | 596 o.maxValue = "foo"; |
| 593 o.minValue = "foo"; | 597 o.minValue = "foo"; |
| 594 o.name = "foo"; | 598 o.name = "foo"; |
| 595 o.requiresRestart = true; | 599 o.requiresRestart = true; |
| 596 o.type = "foo"; | 600 o.type = "foo"; |
| 597 } | 601 } |
| 598 buildCounterFlag--; | 602 buildCounterFlag--; |
| 599 return o; | 603 return o; |
| 600 } | 604 } |
| 601 | 605 |
| 602 checkFlag(api.Flag o) { | 606 checkFlag(api.Flag o) { |
| 603 buildCounterFlag++; | 607 buildCounterFlag++; |
| 604 if (buildCounterFlag < 3) { | 608 if (buildCounterFlag < 3) { |
| 605 checkUnnamed3401(o.allowedStringValues); | 609 checkUnnamed3406(o.allowedStringValues); |
| 606 checkUnnamed3402(o.appliesTo); | 610 checkUnnamed3407(o.appliesTo); |
| 607 unittest.expect(o.kind, unittest.equals('foo')); | 611 unittest.expect(o.kind, unittest.equals('foo')); |
| 608 unittest.expect(o.maxValue, unittest.equals('foo')); | 612 unittest.expect(o.maxValue, unittest.equals('foo')); |
| 609 unittest.expect(o.minValue, unittest.equals('foo')); | 613 unittest.expect(o.minValue, unittest.equals('foo')); |
| 610 unittest.expect(o.name, unittest.equals('foo')); | 614 unittest.expect(o.name, unittest.equals('foo')); |
| 611 unittest.expect(o.requiresRestart, unittest.isTrue); | 615 unittest.expect(o.requiresRestart, unittest.isTrue); |
| 612 unittest.expect(o.type, unittest.equals('foo')); | 616 unittest.expect(o.type, unittest.equals('foo')); |
| 613 } | 617 } |
| 614 buildCounterFlag--; | 618 buildCounterFlag--; |
| 615 } | 619 } |
| 616 | 620 |
| 617 buildUnnamed3403() { | 621 buildUnnamed3408() { |
| 618 var o = new core.List<api.Flag>(); | 622 var o = new core.List<api.Flag>(); |
| 619 o.add(buildFlag()); | 623 o.add(buildFlag()); |
| 620 o.add(buildFlag()); | 624 o.add(buildFlag()); |
| 621 return o; | 625 return o; |
| 622 } | 626 } |
| 623 | 627 |
| 624 checkUnnamed3403(core.List<api.Flag> o) { | 628 checkUnnamed3408(core.List<api.Flag> o) { |
| 625 unittest.expect(o, unittest.hasLength(2)); | 629 unittest.expect(o, unittest.hasLength(2)); |
| 626 checkFlag(o[0]); | 630 checkFlag(o[0]); |
| 627 checkFlag(o[1]); | 631 checkFlag(o[1]); |
| 628 } | 632 } |
| 629 | 633 |
| 630 core.int buildCounterFlagsListResponse = 0; | 634 core.int buildCounterFlagsListResponse = 0; |
| 631 buildFlagsListResponse() { | 635 buildFlagsListResponse() { |
| 632 var o = new api.FlagsListResponse(); | 636 var o = new api.FlagsListResponse(); |
| 633 buildCounterFlagsListResponse++; | 637 buildCounterFlagsListResponse++; |
| 634 if (buildCounterFlagsListResponse < 3) { | 638 if (buildCounterFlagsListResponse < 3) { |
| 635 o.items = buildUnnamed3403(); | 639 o.items = buildUnnamed3408(); |
| 636 o.kind = "foo"; | 640 o.kind = "foo"; |
| 637 } | 641 } |
| 638 buildCounterFlagsListResponse--; | 642 buildCounterFlagsListResponse--; |
| 639 return o; | 643 return o; |
| 640 } | 644 } |
| 641 | 645 |
| 642 checkFlagsListResponse(api.FlagsListResponse o) { | 646 checkFlagsListResponse(api.FlagsListResponse o) { |
| 643 buildCounterFlagsListResponse++; | 647 buildCounterFlagsListResponse++; |
| 644 if (buildCounterFlagsListResponse < 3) { | 648 if (buildCounterFlagsListResponse < 3) { |
| 645 checkUnnamed3403(o.items); | 649 checkUnnamed3408(o.items); |
| 646 unittest.expect(o.kind, unittest.equals('foo')); | 650 unittest.expect(o.kind, unittest.equals('foo')); |
| 647 } | 651 } |
| 648 buildCounterFlagsListResponse--; | 652 buildCounterFlagsListResponse--; |
| 649 } | 653 } |
| 650 | 654 |
| 651 buildUnnamed3404() { | 655 buildUnnamed3409() { |
| 652 var o = new core.List<core.String>(); | 656 var o = new core.List<core.String>(); |
| 653 o.add("foo"); | 657 o.add("foo"); |
| 654 o.add("foo"); | 658 o.add("foo"); |
| 655 return o; | 659 return o; |
| 656 } | 660 } |
| 657 | 661 |
| 658 checkUnnamed3404(core.List<core.String> o) { | 662 checkUnnamed3409(core.List<core.String> o) { |
| 659 unittest.expect(o, unittest.hasLength(2)); | 663 unittest.expect(o, unittest.hasLength(2)); |
| 660 unittest.expect(o[0], unittest.equals('foo')); | 664 unittest.expect(o[0], unittest.equals('foo')); |
| 661 unittest.expect(o[1], unittest.equals('foo')); | 665 unittest.expect(o[1], unittest.equals('foo')); |
| 662 } | 666 } |
| 663 | 667 |
| 664 core.int buildCounterImportContextCsvImportOptions = 0; | 668 core.int buildCounterImportContextCsvImportOptions = 0; |
| 665 buildImportContextCsvImportOptions() { | 669 buildImportContextCsvImportOptions() { |
| 666 var o = new api.ImportContextCsvImportOptions(); | 670 var o = new api.ImportContextCsvImportOptions(); |
| 667 buildCounterImportContextCsvImportOptions++; | 671 buildCounterImportContextCsvImportOptions++; |
| 668 if (buildCounterImportContextCsvImportOptions < 3) { | 672 if (buildCounterImportContextCsvImportOptions < 3) { |
| 669 o.columns = buildUnnamed3404(); | 673 o.columns = buildUnnamed3409(); |
| 670 o.table = "foo"; | 674 o.table = "foo"; |
| 671 } | 675 } |
| 672 buildCounterImportContextCsvImportOptions--; | 676 buildCounterImportContextCsvImportOptions--; |
| 673 return o; | 677 return o; |
| 674 } | 678 } |
| 675 | 679 |
| 676 checkImportContextCsvImportOptions(api.ImportContextCsvImportOptions o) { | 680 checkImportContextCsvImportOptions(api.ImportContextCsvImportOptions o) { |
| 677 buildCounterImportContextCsvImportOptions++; | 681 buildCounterImportContextCsvImportOptions++; |
| 678 if (buildCounterImportContextCsvImportOptions < 3) { | 682 if (buildCounterImportContextCsvImportOptions < 3) { |
| 679 checkUnnamed3404(o.columns); | 683 checkUnnamed3409(o.columns); |
| 680 unittest.expect(o.table, unittest.equals('foo')); | 684 unittest.expect(o.table, unittest.equals('foo')); |
| 681 } | 685 } |
| 682 buildCounterImportContextCsvImportOptions--; | 686 buildCounterImportContextCsvImportOptions--; |
| 683 } | 687 } |
| 684 | 688 |
| 685 core.int buildCounterImportContext = 0; | 689 core.int buildCounterImportContext = 0; |
| 686 buildImportContext() { | 690 buildImportContext() { |
| 687 var o = new api.ImportContext(); | 691 var o = new api.ImportContext(); |
| 688 buildCounterImportContext++; | 692 buildCounterImportContext++; |
| 689 if (buildCounterImportContext < 3) { | 693 if (buildCounterImportContext < 3) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 } | 784 } |
| 781 | 785 |
| 782 checkInstancesImportRequest(api.InstancesImportRequest o) { | 786 checkInstancesImportRequest(api.InstancesImportRequest o) { |
| 783 buildCounterInstancesImportRequest++; | 787 buildCounterInstancesImportRequest++; |
| 784 if (buildCounterInstancesImportRequest < 3) { | 788 if (buildCounterInstancesImportRequest < 3) { |
| 785 checkImportContext(o.importContext); | 789 checkImportContext(o.importContext); |
| 786 } | 790 } |
| 787 buildCounterInstancesImportRequest--; | 791 buildCounterInstancesImportRequest--; |
| 788 } | 792 } |
| 789 | 793 |
| 790 buildUnnamed3405() { | 794 buildUnnamed3410() { |
| 791 var o = new core.List<api.DatabaseInstance>(); | 795 var o = new core.List<api.DatabaseInstance>(); |
| 792 o.add(buildDatabaseInstance()); | 796 o.add(buildDatabaseInstance()); |
| 793 o.add(buildDatabaseInstance()); | 797 o.add(buildDatabaseInstance()); |
| 794 return o; | 798 return o; |
| 795 } | 799 } |
| 796 | 800 |
| 797 checkUnnamed3405(core.List<api.DatabaseInstance> o) { | 801 checkUnnamed3410(core.List<api.DatabaseInstance> o) { |
| 798 unittest.expect(o, unittest.hasLength(2)); | 802 unittest.expect(o, unittest.hasLength(2)); |
| 799 checkDatabaseInstance(o[0]); | 803 checkDatabaseInstance(o[0]); |
| 800 checkDatabaseInstance(o[1]); | 804 checkDatabaseInstance(o[1]); |
| 801 } | 805 } |
| 802 | 806 |
| 803 core.int buildCounterInstancesListResponse = 0; | 807 core.int buildCounterInstancesListResponse = 0; |
| 804 buildInstancesListResponse() { | 808 buildInstancesListResponse() { |
| 805 var o = new api.InstancesListResponse(); | 809 var o = new api.InstancesListResponse(); |
| 806 buildCounterInstancesListResponse++; | 810 buildCounterInstancesListResponse++; |
| 807 if (buildCounterInstancesListResponse < 3) { | 811 if (buildCounterInstancesListResponse < 3) { |
| 808 o.items = buildUnnamed3405(); | 812 o.items = buildUnnamed3410(); |
| 809 o.kind = "foo"; | 813 o.kind = "foo"; |
| 810 o.nextPageToken = "foo"; | 814 o.nextPageToken = "foo"; |
| 811 } | 815 } |
| 812 buildCounterInstancesListResponse--; | 816 buildCounterInstancesListResponse--; |
| 813 return o; | 817 return o; |
| 814 } | 818 } |
| 815 | 819 |
| 816 checkInstancesListResponse(api.InstancesListResponse o) { | 820 checkInstancesListResponse(api.InstancesListResponse o) { |
| 817 buildCounterInstancesListResponse++; | 821 buildCounterInstancesListResponse++; |
| 818 if (buildCounterInstancesListResponse < 3) { | 822 if (buildCounterInstancesListResponse < 3) { |
| 819 checkUnnamed3405(o.items); | 823 checkUnnamed3410(o.items); |
| 820 unittest.expect(o.kind, unittest.equals('foo')); | 824 unittest.expect(o.kind, unittest.equals('foo')); |
| 821 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 825 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 822 } | 826 } |
| 823 buildCounterInstancesListResponse--; | 827 buildCounterInstancesListResponse--; |
| 824 } | 828 } |
| 825 | 829 |
| 826 core.int buildCounterInstancesRestoreBackupRequest = 0; | 830 core.int buildCounterInstancesRestoreBackupRequest = 0; |
| 827 buildInstancesRestoreBackupRequest() { | 831 buildInstancesRestoreBackupRequest() { |
| 828 var o = new api.InstancesRestoreBackupRequest(); | 832 var o = new api.InstancesRestoreBackupRequest(); |
| 829 buildCounterInstancesRestoreBackupRequest++; | 833 buildCounterInstancesRestoreBackupRequest++; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 854 } | 858 } |
| 855 | 859 |
| 856 checkInstancesTruncateLogRequest(api.InstancesTruncateLogRequest o) { | 860 checkInstancesTruncateLogRequest(api.InstancesTruncateLogRequest o) { |
| 857 buildCounterInstancesTruncateLogRequest++; | 861 buildCounterInstancesTruncateLogRequest++; |
| 858 if (buildCounterInstancesTruncateLogRequest < 3) { | 862 if (buildCounterInstancesTruncateLogRequest < 3) { |
| 859 checkTruncateLogContext(o.truncateLogContext); | 863 checkTruncateLogContext(o.truncateLogContext); |
| 860 } | 864 } |
| 861 buildCounterInstancesTruncateLogRequest--; | 865 buildCounterInstancesTruncateLogRequest--; |
| 862 } | 866 } |
| 863 | 867 |
| 864 buildUnnamed3406() { | 868 buildUnnamed3411() { |
| 865 var o = new core.List<api.AclEntry>(); | 869 var o = new core.List<api.AclEntry>(); |
| 866 o.add(buildAclEntry()); | 870 o.add(buildAclEntry()); |
| 867 o.add(buildAclEntry()); | 871 o.add(buildAclEntry()); |
| 868 return o; | 872 return o; |
| 869 } | 873 } |
| 870 | 874 |
| 871 checkUnnamed3406(core.List<api.AclEntry> o) { | 875 checkUnnamed3411(core.List<api.AclEntry> o) { |
| 872 unittest.expect(o, unittest.hasLength(2)); | 876 unittest.expect(o, unittest.hasLength(2)); |
| 873 checkAclEntry(o[0]); | 877 checkAclEntry(o[0]); |
| 874 checkAclEntry(o[1]); | 878 checkAclEntry(o[1]); |
| 875 } | 879 } |
| 876 | 880 |
| 877 core.int buildCounterIpConfiguration = 0; | 881 core.int buildCounterIpConfiguration = 0; |
| 878 buildIpConfiguration() { | 882 buildIpConfiguration() { |
| 879 var o = new api.IpConfiguration(); | 883 var o = new api.IpConfiguration(); |
| 880 buildCounterIpConfiguration++; | 884 buildCounterIpConfiguration++; |
| 881 if (buildCounterIpConfiguration < 3) { | 885 if (buildCounterIpConfiguration < 3) { |
| 882 o.authorizedNetworks = buildUnnamed3406(); | 886 o.authorizedNetworks = buildUnnamed3411(); |
| 883 o.ipv4Enabled = true; | 887 o.ipv4Enabled = true; |
| 884 o.requireSsl = true; | 888 o.requireSsl = true; |
| 885 } | 889 } |
| 886 buildCounterIpConfiguration--; | 890 buildCounterIpConfiguration--; |
| 887 return o; | 891 return o; |
| 888 } | 892 } |
| 889 | 893 |
| 890 checkIpConfiguration(api.IpConfiguration o) { | 894 checkIpConfiguration(api.IpConfiguration o) { |
| 891 buildCounterIpConfiguration++; | 895 buildCounterIpConfiguration++; |
| 892 if (buildCounterIpConfiguration < 3) { | 896 if (buildCounterIpConfiguration < 3) { |
| 893 checkUnnamed3406(o.authorizedNetworks); | 897 checkUnnamed3411(o.authorizedNetworks); |
| 894 unittest.expect(o.ipv4Enabled, unittest.isTrue); | 898 unittest.expect(o.ipv4Enabled, unittest.isTrue); |
| 895 unittest.expect(o.requireSsl, unittest.isTrue); | 899 unittest.expect(o.requireSsl, unittest.isTrue); |
| 896 } | 900 } |
| 897 buildCounterIpConfiguration--; | 901 buildCounterIpConfiguration--; |
| 898 } | 902 } |
| 899 | 903 |
| 900 core.int buildCounterIpMapping = 0; | 904 core.int buildCounterIpMapping = 0; |
| 901 buildIpMapping() { | 905 buildIpMapping() { |
| 902 var o = new api.IpMapping(); | 906 var o = new api.IpMapping(); |
| 903 buildCounterIpMapping++; | 907 buildCounterIpMapping++; |
| 904 if (buildCounterIpMapping < 3) { | 908 if (buildCounterIpMapping < 3) { |
| 905 o.ipAddress = "foo"; | 909 o.ipAddress = "foo"; |
| 906 o.timeToRetire = core.DateTime.parse("2002-02-27T14:01:02"); | 910 o.timeToRetire = core.DateTime.parse("2002-02-27T14:01:02"); |
| 907 o.type = "foo"; | 911 o.type = "foo"; |
| 908 } | 912 } |
| 909 buildCounterIpMapping--; | 913 buildCounterIpMapping--; |
| 910 return o; | 914 return o; |
| 911 } | 915 } |
| 912 | 916 |
| 913 checkIpMapping(api.IpMapping o) { | 917 checkIpMapping(api.IpMapping o) { |
| 914 buildCounterIpMapping++; | 918 buildCounterIpMapping++; |
| 915 if (buildCounterIpMapping < 3) { | 919 if (buildCounterIpMapping < 3) { |
| 916 unittest.expect(o.ipAddress, unittest.equals('foo')); | 920 unittest.expect(o.ipAddress, unittest.equals('foo')); |
| 917 unittest.expect(o.timeToRetire, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); | 921 unittest.expect(o.timeToRetire, |
| 922 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 918 unittest.expect(o.type, unittest.equals('foo')); | 923 unittest.expect(o.type, unittest.equals('foo')); |
| 919 } | 924 } |
| 920 buildCounterIpMapping--; | 925 buildCounterIpMapping--; |
| 921 } | 926 } |
| 922 | 927 |
| 923 core.int buildCounterLocationPreference = 0; | 928 core.int buildCounterLocationPreference = 0; |
| 924 buildLocationPreference() { | 929 buildLocationPreference() { |
| 925 var o = new api.LocationPreference(); | 930 var o = new api.LocationPreference(); |
| 926 buildCounterLocationPreference++; | 931 buildCounterLocationPreference++; |
| 927 if (buildCounterLocationPreference < 3) { | 932 if (buildCounterLocationPreference < 3) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 o.targetProject = "foo"; | 1054 o.targetProject = "foo"; |
| 1050 o.user = "foo"; | 1055 o.user = "foo"; |
| 1051 } | 1056 } |
| 1052 buildCounterOperation--; | 1057 buildCounterOperation--; |
| 1053 return o; | 1058 return o; |
| 1054 } | 1059 } |
| 1055 | 1060 |
| 1056 checkOperation(api.Operation o) { | 1061 checkOperation(api.Operation o) { |
| 1057 buildCounterOperation++; | 1062 buildCounterOperation++; |
| 1058 if (buildCounterOperation < 3) { | 1063 if (buildCounterOperation < 3) { |
| 1059 unittest.expect(o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 1064 unittest.expect( |
| 1065 o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1060 checkOperationErrors(o.error); | 1066 checkOperationErrors(o.error); |
| 1061 checkExportContext(o.exportContext); | 1067 checkExportContext(o.exportContext); |
| 1062 checkImportContext(o.importContext); | 1068 checkImportContext(o.importContext); |
| 1063 unittest.expect(o.insertTime, unittest.equals(core.DateTime.parse("2002-02-2
7T14:01:02"))); | 1069 unittest.expect(o.insertTime, |
| 1070 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1064 unittest.expect(o.kind, unittest.equals('foo')); | 1071 unittest.expect(o.kind, unittest.equals('foo')); |
| 1065 unittest.expect(o.name, unittest.equals('foo')); | 1072 unittest.expect(o.name, unittest.equals('foo')); |
| 1066 unittest.expect(o.operationType, unittest.equals('foo')); | 1073 unittest.expect(o.operationType, unittest.equals('foo')); |
| 1067 unittest.expect(o.selfLink, unittest.equals('foo')); | 1074 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 1068 unittest.expect(o.startTime, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 1075 unittest.expect(o.startTime, |
| 1076 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1069 unittest.expect(o.status, unittest.equals('foo')); | 1077 unittest.expect(o.status, unittest.equals('foo')); |
| 1070 unittest.expect(o.targetId, unittest.equals('foo')); | 1078 unittest.expect(o.targetId, unittest.equals('foo')); |
| 1071 unittest.expect(o.targetLink, unittest.equals('foo')); | 1079 unittest.expect(o.targetLink, unittest.equals('foo')); |
| 1072 unittest.expect(o.targetProject, unittest.equals('foo')); | 1080 unittest.expect(o.targetProject, unittest.equals('foo')); |
| 1073 unittest.expect(o.user, unittest.equals('foo')); | 1081 unittest.expect(o.user, unittest.equals('foo')); |
| 1074 } | 1082 } |
| 1075 buildCounterOperation--; | 1083 buildCounterOperation--; |
| 1076 } | 1084 } |
| 1077 | 1085 |
| 1078 core.int buildCounterOperationError = 0; | 1086 core.int buildCounterOperationError = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1091 checkOperationError(api.OperationError o) { | 1099 checkOperationError(api.OperationError o) { |
| 1092 buildCounterOperationError++; | 1100 buildCounterOperationError++; |
| 1093 if (buildCounterOperationError < 3) { | 1101 if (buildCounterOperationError < 3) { |
| 1094 unittest.expect(o.code, unittest.equals('foo')); | 1102 unittest.expect(o.code, unittest.equals('foo')); |
| 1095 unittest.expect(o.kind, unittest.equals('foo')); | 1103 unittest.expect(o.kind, unittest.equals('foo')); |
| 1096 unittest.expect(o.message, unittest.equals('foo')); | 1104 unittest.expect(o.message, unittest.equals('foo')); |
| 1097 } | 1105 } |
| 1098 buildCounterOperationError--; | 1106 buildCounterOperationError--; |
| 1099 } | 1107 } |
| 1100 | 1108 |
| 1101 buildUnnamed3407() { | 1109 buildUnnamed3412() { |
| 1102 var o = new core.List<api.OperationError>(); | 1110 var o = new core.List<api.OperationError>(); |
| 1103 o.add(buildOperationError()); | 1111 o.add(buildOperationError()); |
| 1104 o.add(buildOperationError()); | 1112 o.add(buildOperationError()); |
| 1105 return o; | 1113 return o; |
| 1106 } | 1114 } |
| 1107 | 1115 |
| 1108 checkUnnamed3407(core.List<api.OperationError> o) { | 1116 checkUnnamed3412(core.List<api.OperationError> o) { |
| 1109 unittest.expect(o, unittest.hasLength(2)); | 1117 unittest.expect(o, unittest.hasLength(2)); |
| 1110 checkOperationError(o[0]); | 1118 checkOperationError(o[0]); |
| 1111 checkOperationError(o[1]); | 1119 checkOperationError(o[1]); |
| 1112 } | 1120 } |
| 1113 | 1121 |
| 1114 core.int buildCounterOperationErrors = 0; | 1122 core.int buildCounterOperationErrors = 0; |
| 1115 buildOperationErrors() { | 1123 buildOperationErrors() { |
| 1116 var o = new api.OperationErrors(); | 1124 var o = new api.OperationErrors(); |
| 1117 buildCounterOperationErrors++; | 1125 buildCounterOperationErrors++; |
| 1118 if (buildCounterOperationErrors < 3) { | 1126 if (buildCounterOperationErrors < 3) { |
| 1119 o.errors = buildUnnamed3407(); | 1127 o.errors = buildUnnamed3412(); |
| 1120 o.kind = "foo"; | 1128 o.kind = "foo"; |
| 1121 } | 1129 } |
| 1122 buildCounterOperationErrors--; | 1130 buildCounterOperationErrors--; |
| 1123 return o; | 1131 return o; |
| 1124 } | 1132 } |
| 1125 | 1133 |
| 1126 checkOperationErrors(api.OperationErrors o) { | 1134 checkOperationErrors(api.OperationErrors o) { |
| 1127 buildCounterOperationErrors++; | 1135 buildCounterOperationErrors++; |
| 1128 if (buildCounterOperationErrors < 3) { | 1136 if (buildCounterOperationErrors < 3) { |
| 1129 checkUnnamed3407(o.errors); | 1137 checkUnnamed3412(o.errors); |
| 1130 unittest.expect(o.kind, unittest.equals('foo')); | 1138 unittest.expect(o.kind, unittest.equals('foo')); |
| 1131 } | 1139 } |
| 1132 buildCounterOperationErrors--; | 1140 buildCounterOperationErrors--; |
| 1133 } | 1141 } |
| 1134 | 1142 |
| 1135 buildUnnamed3408() { | 1143 buildUnnamed3413() { |
| 1136 var o = new core.List<api.Operation>(); | 1144 var o = new core.List<api.Operation>(); |
| 1137 o.add(buildOperation()); | 1145 o.add(buildOperation()); |
| 1138 o.add(buildOperation()); | 1146 o.add(buildOperation()); |
| 1139 return o; | 1147 return o; |
| 1140 } | 1148 } |
| 1141 | 1149 |
| 1142 checkUnnamed3408(core.List<api.Operation> o) { | 1150 checkUnnamed3413(core.List<api.Operation> o) { |
| 1143 unittest.expect(o, unittest.hasLength(2)); | 1151 unittest.expect(o, unittest.hasLength(2)); |
| 1144 checkOperation(o[0]); | 1152 checkOperation(o[0]); |
| 1145 checkOperation(o[1]); | 1153 checkOperation(o[1]); |
| 1146 } | 1154 } |
| 1147 | 1155 |
| 1148 core.int buildCounterOperationsListResponse = 0; | 1156 core.int buildCounterOperationsListResponse = 0; |
| 1149 buildOperationsListResponse() { | 1157 buildOperationsListResponse() { |
| 1150 var o = new api.OperationsListResponse(); | 1158 var o = new api.OperationsListResponse(); |
| 1151 buildCounterOperationsListResponse++; | 1159 buildCounterOperationsListResponse++; |
| 1152 if (buildCounterOperationsListResponse < 3) { | 1160 if (buildCounterOperationsListResponse < 3) { |
| 1153 o.items = buildUnnamed3408(); | 1161 o.items = buildUnnamed3413(); |
| 1154 o.kind = "foo"; | 1162 o.kind = "foo"; |
| 1155 o.nextPageToken = "foo"; | 1163 o.nextPageToken = "foo"; |
| 1156 } | 1164 } |
| 1157 buildCounterOperationsListResponse--; | 1165 buildCounterOperationsListResponse--; |
| 1158 return o; | 1166 return o; |
| 1159 } | 1167 } |
| 1160 | 1168 |
| 1161 checkOperationsListResponse(api.OperationsListResponse o) { | 1169 checkOperationsListResponse(api.OperationsListResponse o) { |
| 1162 buildCounterOperationsListResponse++; | 1170 buildCounterOperationsListResponse++; |
| 1163 if (buildCounterOperationsListResponse < 3) { | 1171 if (buildCounterOperationsListResponse < 3) { |
| 1164 checkUnnamed3408(o.items); | 1172 checkUnnamed3413(o.items); |
| 1165 unittest.expect(o.kind, unittest.equals('foo')); | 1173 unittest.expect(o.kind, unittest.equals('foo')); |
| 1166 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 1174 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1167 } | 1175 } |
| 1168 buildCounterOperationsListResponse--; | 1176 buildCounterOperationsListResponse--; |
| 1169 } | 1177 } |
| 1170 | 1178 |
| 1171 core.int buildCounterReplicaConfiguration = 0; | 1179 core.int buildCounterReplicaConfiguration = 0; |
| 1172 buildReplicaConfiguration() { | 1180 buildReplicaConfiguration() { |
| 1173 var o = new api.ReplicaConfiguration(); | 1181 var o = new api.ReplicaConfiguration(); |
| 1174 buildCounterReplicaConfiguration++; | 1182 buildCounterReplicaConfiguration++; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 checkRestoreBackupContext(api.RestoreBackupContext o) { | 1215 checkRestoreBackupContext(api.RestoreBackupContext o) { |
| 1208 buildCounterRestoreBackupContext++; | 1216 buildCounterRestoreBackupContext++; |
| 1209 if (buildCounterRestoreBackupContext < 3) { | 1217 if (buildCounterRestoreBackupContext < 3) { |
| 1210 unittest.expect(o.backupRunId, unittest.equals('foo')); | 1218 unittest.expect(o.backupRunId, unittest.equals('foo')); |
| 1211 unittest.expect(o.instanceId, unittest.equals('foo')); | 1219 unittest.expect(o.instanceId, unittest.equals('foo')); |
| 1212 unittest.expect(o.kind, unittest.equals('foo')); | 1220 unittest.expect(o.kind, unittest.equals('foo')); |
| 1213 } | 1221 } |
| 1214 buildCounterRestoreBackupContext--; | 1222 buildCounterRestoreBackupContext--; |
| 1215 } | 1223 } |
| 1216 | 1224 |
| 1217 buildUnnamed3409() { | 1225 buildUnnamed3414() { |
| 1218 var o = new core.List<core.String>(); | 1226 var o = new core.List<core.String>(); |
| 1219 o.add("foo"); | 1227 o.add("foo"); |
| 1220 o.add("foo"); | 1228 o.add("foo"); |
| 1221 return o; | 1229 return o; |
| 1222 } | 1230 } |
| 1223 | 1231 |
| 1224 checkUnnamed3409(core.List<core.String> o) { | 1232 checkUnnamed3414(core.List<core.String> o) { |
| 1225 unittest.expect(o, unittest.hasLength(2)); | 1233 unittest.expect(o, unittest.hasLength(2)); |
| 1226 unittest.expect(o[0], unittest.equals('foo')); | 1234 unittest.expect(o[0], unittest.equals('foo')); |
| 1227 unittest.expect(o[1], unittest.equals('foo')); | 1235 unittest.expect(o[1], unittest.equals('foo')); |
| 1228 } | 1236 } |
| 1229 | 1237 |
| 1230 buildUnnamed3410() { | 1238 buildUnnamed3415() { |
| 1231 var o = new core.List<api.DatabaseFlags>(); | 1239 var o = new core.List<api.DatabaseFlags>(); |
| 1232 o.add(buildDatabaseFlags()); | 1240 o.add(buildDatabaseFlags()); |
| 1233 o.add(buildDatabaseFlags()); | 1241 o.add(buildDatabaseFlags()); |
| 1234 return o; | 1242 return o; |
| 1235 } | 1243 } |
| 1236 | 1244 |
| 1237 checkUnnamed3410(core.List<api.DatabaseFlags> o) { | 1245 checkUnnamed3415(core.List<api.DatabaseFlags> o) { |
| 1238 unittest.expect(o, unittest.hasLength(2)); | 1246 unittest.expect(o, unittest.hasLength(2)); |
| 1239 checkDatabaseFlags(o[0]); | 1247 checkDatabaseFlags(o[0]); |
| 1240 checkDatabaseFlags(o[1]); | 1248 checkDatabaseFlags(o[1]); |
| 1241 } | 1249 } |
| 1242 | 1250 |
| 1243 buildUnnamed3411() { | 1251 buildUnnamed3416() { |
| 1244 var o = new core.Map<core.String, core.String>(); | 1252 var o = new core.Map<core.String, core.String>(); |
| 1245 o["x"] = "foo"; | 1253 o["x"] = "foo"; |
| 1246 o["y"] = "foo"; | 1254 o["y"] = "foo"; |
| 1247 return o; | 1255 return o; |
| 1248 } | 1256 } |
| 1249 | 1257 |
| 1250 checkUnnamed3411(core.Map<core.String, core.String> o) { | 1258 checkUnnamed3416(core.Map<core.String, core.String> o) { |
| 1251 unittest.expect(o, unittest.hasLength(2)); | 1259 unittest.expect(o, unittest.hasLength(2)); |
| 1252 unittest.expect(o["x"], unittest.equals('foo')); | 1260 unittest.expect(o["x"], unittest.equals('foo')); |
| 1253 unittest.expect(o["y"], unittest.equals('foo')); | 1261 unittest.expect(o["y"], unittest.equals('foo')); |
| 1254 } | 1262 } |
| 1255 | 1263 |
| 1256 core.int buildCounterSettings = 0; | 1264 core.int buildCounterSettings = 0; |
| 1257 buildSettings() { | 1265 buildSettings() { |
| 1258 var o = new api.Settings(); | 1266 var o = new api.Settings(); |
| 1259 buildCounterSettings++; | 1267 buildCounterSettings++; |
| 1260 if (buildCounterSettings < 3) { | 1268 if (buildCounterSettings < 3) { |
| 1261 o.activationPolicy = "foo"; | 1269 o.activationPolicy = "foo"; |
| 1262 o.authorizedGaeApplications = buildUnnamed3409(); | 1270 o.authorizedGaeApplications = buildUnnamed3414(); |
| 1263 o.availabilityType = "foo"; | 1271 o.availabilityType = "foo"; |
| 1264 o.backupConfiguration = buildBackupConfiguration(); | 1272 o.backupConfiguration = buildBackupConfiguration(); |
| 1265 o.crashSafeReplicationEnabled = true; | 1273 o.crashSafeReplicationEnabled = true; |
| 1266 o.dataDiskSizeGb = "foo"; | 1274 o.dataDiskSizeGb = "foo"; |
| 1267 o.dataDiskType = "foo"; | 1275 o.dataDiskType = "foo"; |
| 1268 o.databaseFlags = buildUnnamed3410(); | 1276 o.databaseFlags = buildUnnamed3415(); |
| 1269 o.databaseReplicationEnabled = true; | 1277 o.databaseReplicationEnabled = true; |
| 1270 o.ipConfiguration = buildIpConfiguration(); | 1278 o.ipConfiguration = buildIpConfiguration(); |
| 1271 o.kind = "foo"; | 1279 o.kind = "foo"; |
| 1272 o.locationPreference = buildLocationPreference(); | 1280 o.locationPreference = buildLocationPreference(); |
| 1273 o.maintenanceWindow = buildMaintenanceWindow(); | 1281 o.maintenanceWindow = buildMaintenanceWindow(); |
| 1274 o.pricingPlan = "foo"; | 1282 o.pricingPlan = "foo"; |
| 1275 o.replicationType = "foo"; | 1283 o.replicationType = "foo"; |
| 1276 o.settingsVersion = "foo"; | 1284 o.settingsVersion = "foo"; |
| 1277 o.storageAutoResize = true; | 1285 o.storageAutoResize = true; |
| 1278 o.storageAutoResizeLimit = "foo"; | 1286 o.storageAutoResizeLimit = "foo"; |
| 1279 o.tier = "foo"; | 1287 o.tier = "foo"; |
| 1280 o.userLabels = buildUnnamed3411(); | 1288 o.userLabels = buildUnnamed3416(); |
| 1281 } | 1289 } |
| 1282 buildCounterSettings--; | 1290 buildCounterSettings--; |
| 1283 return o; | 1291 return o; |
| 1284 } | 1292 } |
| 1285 | 1293 |
| 1286 checkSettings(api.Settings o) { | 1294 checkSettings(api.Settings o) { |
| 1287 buildCounterSettings++; | 1295 buildCounterSettings++; |
| 1288 if (buildCounterSettings < 3) { | 1296 if (buildCounterSettings < 3) { |
| 1289 unittest.expect(o.activationPolicy, unittest.equals('foo')); | 1297 unittest.expect(o.activationPolicy, unittest.equals('foo')); |
| 1290 checkUnnamed3409(o.authorizedGaeApplications); | 1298 checkUnnamed3414(o.authorizedGaeApplications); |
| 1291 unittest.expect(o.availabilityType, unittest.equals('foo')); | 1299 unittest.expect(o.availabilityType, unittest.equals('foo')); |
| 1292 checkBackupConfiguration(o.backupConfiguration); | 1300 checkBackupConfiguration(o.backupConfiguration); |
| 1293 unittest.expect(o.crashSafeReplicationEnabled, unittest.isTrue); | 1301 unittest.expect(o.crashSafeReplicationEnabled, unittest.isTrue); |
| 1294 unittest.expect(o.dataDiskSizeGb, unittest.equals('foo')); | 1302 unittest.expect(o.dataDiskSizeGb, unittest.equals('foo')); |
| 1295 unittest.expect(o.dataDiskType, unittest.equals('foo')); | 1303 unittest.expect(o.dataDiskType, unittest.equals('foo')); |
| 1296 checkUnnamed3410(o.databaseFlags); | 1304 checkUnnamed3415(o.databaseFlags); |
| 1297 unittest.expect(o.databaseReplicationEnabled, unittest.isTrue); | 1305 unittest.expect(o.databaseReplicationEnabled, unittest.isTrue); |
| 1298 checkIpConfiguration(o.ipConfiguration); | 1306 checkIpConfiguration(o.ipConfiguration); |
| 1299 unittest.expect(o.kind, unittest.equals('foo')); | 1307 unittest.expect(o.kind, unittest.equals('foo')); |
| 1300 checkLocationPreference(o.locationPreference); | 1308 checkLocationPreference(o.locationPreference); |
| 1301 checkMaintenanceWindow(o.maintenanceWindow); | 1309 checkMaintenanceWindow(o.maintenanceWindow); |
| 1302 unittest.expect(o.pricingPlan, unittest.equals('foo')); | 1310 unittest.expect(o.pricingPlan, unittest.equals('foo')); |
| 1303 unittest.expect(o.replicationType, unittest.equals('foo')); | 1311 unittest.expect(o.replicationType, unittest.equals('foo')); |
| 1304 unittest.expect(o.settingsVersion, unittest.equals('foo')); | 1312 unittest.expect(o.settingsVersion, unittest.equals('foo')); |
| 1305 unittest.expect(o.storageAutoResize, unittest.isTrue); | 1313 unittest.expect(o.storageAutoResize, unittest.isTrue); |
| 1306 unittest.expect(o.storageAutoResizeLimit, unittest.equals('foo')); | 1314 unittest.expect(o.storageAutoResizeLimit, unittest.equals('foo')); |
| 1307 unittest.expect(o.tier, unittest.equals('foo')); | 1315 unittest.expect(o.tier, unittest.equals('foo')); |
| 1308 checkUnnamed3411(o.userLabels); | 1316 checkUnnamed3416(o.userLabels); |
| 1309 } | 1317 } |
| 1310 buildCounterSettings--; | 1318 buildCounterSettings--; |
| 1311 } | 1319 } |
| 1312 | 1320 |
| 1313 core.int buildCounterSslCert = 0; | 1321 core.int buildCounterSslCert = 0; |
| 1314 buildSslCert() { | 1322 buildSslCert() { |
| 1315 var o = new api.SslCert(); | 1323 var o = new api.SslCert(); |
| 1316 buildCounterSslCert++; | 1324 buildCounterSslCert++; |
| 1317 if (buildCounterSslCert < 3) { | 1325 if (buildCounterSslCert < 3) { |
| 1318 o.cert = "foo"; | 1326 o.cert = "foo"; |
| 1319 o.certSerialNumber = "foo"; | 1327 o.certSerialNumber = "foo"; |
| 1320 o.commonName = "foo"; | 1328 o.commonName = "foo"; |
| 1321 o.createTime = core.DateTime.parse("2002-02-27T14:01:02"); | 1329 o.createTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1322 o.expirationTime = core.DateTime.parse("2002-02-27T14:01:02"); | 1330 o.expirationTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1323 o.instance = "foo"; | 1331 o.instance = "foo"; |
| 1324 o.kind = "foo"; | 1332 o.kind = "foo"; |
| 1325 o.selfLink = "foo"; | 1333 o.selfLink = "foo"; |
| 1326 o.sha1Fingerprint = "foo"; | 1334 o.sha1Fingerprint = "foo"; |
| 1327 } | 1335 } |
| 1328 buildCounterSslCert--; | 1336 buildCounterSslCert--; |
| 1329 return o; | 1337 return o; |
| 1330 } | 1338 } |
| 1331 | 1339 |
| 1332 checkSslCert(api.SslCert o) { | 1340 checkSslCert(api.SslCert o) { |
| 1333 buildCounterSslCert++; | 1341 buildCounterSslCert++; |
| 1334 if (buildCounterSslCert < 3) { | 1342 if (buildCounterSslCert < 3) { |
| 1335 unittest.expect(o.cert, unittest.equals('foo')); | 1343 unittest.expect(o.cert, unittest.equals('foo')); |
| 1336 unittest.expect(o.certSerialNumber, unittest.equals('foo')); | 1344 unittest.expect(o.certSerialNumber, unittest.equals('foo')); |
| 1337 unittest.expect(o.commonName, unittest.equals('foo')); | 1345 unittest.expect(o.commonName, unittest.equals('foo')); |
| 1338 unittest.expect(o.createTime, unittest.equals(core.DateTime.parse("2002-02-2
7T14:01:02"))); | 1346 unittest.expect(o.createTime, |
| 1339 unittest.expect(o.expirationTime, unittest.equals(core.DateTime.parse("2002-
02-27T14:01:02"))); | 1347 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1348 unittest.expect(o.expirationTime, |
| 1349 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1340 unittest.expect(o.instance, unittest.equals('foo')); | 1350 unittest.expect(o.instance, unittest.equals('foo')); |
| 1341 unittest.expect(o.kind, unittest.equals('foo')); | 1351 unittest.expect(o.kind, unittest.equals('foo')); |
| 1342 unittest.expect(o.selfLink, unittest.equals('foo')); | 1352 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 1343 unittest.expect(o.sha1Fingerprint, unittest.equals('foo')); | 1353 unittest.expect(o.sha1Fingerprint, unittest.equals('foo')); |
| 1344 } | 1354 } |
| 1345 buildCounterSslCert--; | 1355 buildCounterSslCert--; |
| 1346 } | 1356 } |
| 1347 | 1357 |
| 1348 core.int buildCounterSslCertDetail = 0; | 1358 core.int buildCounterSslCertDetail = 0; |
| 1349 buildSslCertDetail() { | 1359 buildSslCertDetail() { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 buildCounterSslCertsInsertResponse++; | 1432 buildCounterSslCertsInsertResponse++; |
| 1423 if (buildCounterSslCertsInsertResponse < 3) { | 1433 if (buildCounterSslCertsInsertResponse < 3) { |
| 1424 checkSslCertDetail(o.clientCert); | 1434 checkSslCertDetail(o.clientCert); |
| 1425 unittest.expect(o.kind, unittest.equals('foo')); | 1435 unittest.expect(o.kind, unittest.equals('foo')); |
| 1426 checkOperation(o.operation); | 1436 checkOperation(o.operation); |
| 1427 checkSslCert(o.serverCaCert); | 1437 checkSslCert(o.serverCaCert); |
| 1428 } | 1438 } |
| 1429 buildCounterSslCertsInsertResponse--; | 1439 buildCounterSslCertsInsertResponse--; |
| 1430 } | 1440 } |
| 1431 | 1441 |
| 1432 buildUnnamed3412() { | 1442 buildUnnamed3417() { |
| 1433 var o = new core.List<api.SslCert>(); | 1443 var o = new core.List<api.SslCert>(); |
| 1434 o.add(buildSslCert()); | 1444 o.add(buildSslCert()); |
| 1435 o.add(buildSslCert()); | 1445 o.add(buildSslCert()); |
| 1436 return o; | 1446 return o; |
| 1437 } | 1447 } |
| 1438 | 1448 |
| 1439 checkUnnamed3412(core.List<api.SslCert> o) { | 1449 checkUnnamed3417(core.List<api.SslCert> o) { |
| 1440 unittest.expect(o, unittest.hasLength(2)); | 1450 unittest.expect(o, unittest.hasLength(2)); |
| 1441 checkSslCert(o[0]); | 1451 checkSslCert(o[0]); |
| 1442 checkSslCert(o[1]); | 1452 checkSslCert(o[1]); |
| 1443 } | 1453 } |
| 1444 | 1454 |
| 1445 core.int buildCounterSslCertsListResponse = 0; | 1455 core.int buildCounterSslCertsListResponse = 0; |
| 1446 buildSslCertsListResponse() { | 1456 buildSslCertsListResponse() { |
| 1447 var o = new api.SslCertsListResponse(); | 1457 var o = new api.SslCertsListResponse(); |
| 1448 buildCounterSslCertsListResponse++; | 1458 buildCounterSslCertsListResponse++; |
| 1449 if (buildCounterSslCertsListResponse < 3) { | 1459 if (buildCounterSslCertsListResponse < 3) { |
| 1450 o.items = buildUnnamed3412(); | 1460 o.items = buildUnnamed3417(); |
| 1451 o.kind = "foo"; | 1461 o.kind = "foo"; |
| 1452 } | 1462 } |
| 1453 buildCounterSslCertsListResponse--; | 1463 buildCounterSslCertsListResponse--; |
| 1454 return o; | 1464 return o; |
| 1455 } | 1465 } |
| 1456 | 1466 |
| 1457 checkSslCertsListResponse(api.SslCertsListResponse o) { | 1467 checkSslCertsListResponse(api.SslCertsListResponse o) { |
| 1458 buildCounterSslCertsListResponse++; | 1468 buildCounterSslCertsListResponse++; |
| 1459 if (buildCounterSslCertsListResponse < 3) { | 1469 if (buildCounterSslCertsListResponse < 3) { |
| 1460 checkUnnamed3412(o.items); | 1470 checkUnnamed3417(o.items); |
| 1461 unittest.expect(o.kind, unittest.equals('foo')); | 1471 unittest.expect(o.kind, unittest.equals('foo')); |
| 1462 } | 1472 } |
| 1463 buildCounterSslCertsListResponse--; | 1473 buildCounterSslCertsListResponse--; |
| 1464 } | 1474 } |
| 1465 | 1475 |
| 1466 buildUnnamed3413() { | 1476 buildUnnamed3418() { |
| 1467 var o = new core.List<core.String>(); | 1477 var o = new core.List<core.String>(); |
| 1468 o.add("foo"); | 1478 o.add("foo"); |
| 1469 o.add("foo"); | 1479 o.add("foo"); |
| 1470 return o; | 1480 return o; |
| 1471 } | 1481 } |
| 1472 | 1482 |
| 1473 checkUnnamed3413(core.List<core.String> o) { | 1483 checkUnnamed3418(core.List<core.String> o) { |
| 1474 unittest.expect(o, unittest.hasLength(2)); | 1484 unittest.expect(o, unittest.hasLength(2)); |
| 1475 unittest.expect(o[0], unittest.equals('foo')); | 1485 unittest.expect(o[0], unittest.equals('foo')); |
| 1476 unittest.expect(o[1], unittest.equals('foo')); | 1486 unittest.expect(o[1], unittest.equals('foo')); |
| 1477 } | 1487 } |
| 1478 | 1488 |
| 1479 core.int buildCounterTier = 0; | 1489 core.int buildCounterTier = 0; |
| 1480 buildTier() { | 1490 buildTier() { |
| 1481 var o = new api.Tier(); | 1491 var o = new api.Tier(); |
| 1482 buildCounterTier++; | 1492 buildCounterTier++; |
| 1483 if (buildCounterTier < 3) { | 1493 if (buildCounterTier < 3) { |
| 1484 o.DiskQuota = "foo"; | 1494 o.DiskQuota = "foo"; |
| 1485 o.RAM = "foo"; | 1495 o.RAM = "foo"; |
| 1486 o.kind = "foo"; | 1496 o.kind = "foo"; |
| 1487 o.region = buildUnnamed3413(); | 1497 o.region = buildUnnamed3418(); |
| 1488 o.tier = "foo"; | 1498 o.tier = "foo"; |
| 1489 } | 1499 } |
| 1490 buildCounterTier--; | 1500 buildCounterTier--; |
| 1491 return o; | 1501 return o; |
| 1492 } | 1502 } |
| 1493 | 1503 |
| 1494 checkTier(api.Tier o) { | 1504 checkTier(api.Tier o) { |
| 1495 buildCounterTier++; | 1505 buildCounterTier++; |
| 1496 if (buildCounterTier < 3) { | 1506 if (buildCounterTier < 3) { |
| 1497 unittest.expect(o.DiskQuota, unittest.equals('foo')); | 1507 unittest.expect(o.DiskQuota, unittest.equals('foo')); |
| 1498 unittest.expect(o.RAM, unittest.equals('foo')); | 1508 unittest.expect(o.RAM, unittest.equals('foo')); |
| 1499 unittest.expect(o.kind, unittest.equals('foo')); | 1509 unittest.expect(o.kind, unittest.equals('foo')); |
| 1500 checkUnnamed3413(o.region); | 1510 checkUnnamed3418(o.region); |
| 1501 unittest.expect(o.tier, unittest.equals('foo')); | 1511 unittest.expect(o.tier, unittest.equals('foo')); |
| 1502 } | 1512 } |
| 1503 buildCounterTier--; | 1513 buildCounterTier--; |
| 1504 } | 1514 } |
| 1505 | 1515 |
| 1506 buildUnnamed3414() { | 1516 buildUnnamed3419() { |
| 1507 var o = new core.List<api.Tier>(); | 1517 var o = new core.List<api.Tier>(); |
| 1508 o.add(buildTier()); | 1518 o.add(buildTier()); |
| 1509 o.add(buildTier()); | 1519 o.add(buildTier()); |
| 1510 return o; | 1520 return o; |
| 1511 } | 1521 } |
| 1512 | 1522 |
| 1513 checkUnnamed3414(core.List<api.Tier> o) { | 1523 checkUnnamed3419(core.List<api.Tier> o) { |
| 1514 unittest.expect(o, unittest.hasLength(2)); | 1524 unittest.expect(o, unittest.hasLength(2)); |
| 1515 checkTier(o[0]); | 1525 checkTier(o[0]); |
| 1516 checkTier(o[1]); | 1526 checkTier(o[1]); |
| 1517 } | 1527 } |
| 1518 | 1528 |
| 1519 core.int buildCounterTiersListResponse = 0; | 1529 core.int buildCounterTiersListResponse = 0; |
| 1520 buildTiersListResponse() { | 1530 buildTiersListResponse() { |
| 1521 var o = new api.TiersListResponse(); | 1531 var o = new api.TiersListResponse(); |
| 1522 buildCounterTiersListResponse++; | 1532 buildCounterTiersListResponse++; |
| 1523 if (buildCounterTiersListResponse < 3) { | 1533 if (buildCounterTiersListResponse < 3) { |
| 1524 o.items = buildUnnamed3414(); | 1534 o.items = buildUnnamed3419(); |
| 1525 o.kind = "foo"; | 1535 o.kind = "foo"; |
| 1526 } | 1536 } |
| 1527 buildCounterTiersListResponse--; | 1537 buildCounterTiersListResponse--; |
| 1528 return o; | 1538 return o; |
| 1529 } | 1539 } |
| 1530 | 1540 |
| 1531 checkTiersListResponse(api.TiersListResponse o) { | 1541 checkTiersListResponse(api.TiersListResponse o) { |
| 1532 buildCounterTiersListResponse++; | 1542 buildCounterTiersListResponse++; |
| 1533 if (buildCounterTiersListResponse < 3) { | 1543 if (buildCounterTiersListResponse < 3) { |
| 1534 checkUnnamed3414(o.items); | 1544 checkUnnamed3419(o.items); |
| 1535 unittest.expect(o.kind, unittest.equals('foo')); | 1545 unittest.expect(o.kind, unittest.equals('foo')); |
| 1536 } | 1546 } |
| 1537 buildCounterTiersListResponse--; | 1547 buildCounterTiersListResponse--; |
| 1538 } | 1548 } |
| 1539 | 1549 |
| 1540 core.int buildCounterTruncateLogContext = 0; | 1550 core.int buildCounterTruncateLogContext = 0; |
| 1541 buildTruncateLogContext() { | 1551 buildTruncateLogContext() { |
| 1542 var o = new api.TruncateLogContext(); | 1552 var o = new api.TruncateLogContext(); |
| 1543 buildCounterTruncateLogContext++; | 1553 buildCounterTruncateLogContext++; |
| 1544 if (buildCounterTruncateLogContext < 3) { | 1554 if (buildCounterTruncateLogContext < 3) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 unittest.expect(o.host, unittest.equals('foo')); | 1592 unittest.expect(o.host, unittest.equals('foo')); |
| 1583 unittest.expect(o.instance, unittest.equals('foo')); | 1593 unittest.expect(o.instance, unittest.equals('foo')); |
| 1584 unittest.expect(o.kind, unittest.equals('foo')); | 1594 unittest.expect(o.kind, unittest.equals('foo')); |
| 1585 unittest.expect(o.name, unittest.equals('foo')); | 1595 unittest.expect(o.name, unittest.equals('foo')); |
| 1586 unittest.expect(o.password, unittest.equals('foo')); | 1596 unittest.expect(o.password, unittest.equals('foo')); |
| 1587 unittest.expect(o.project, unittest.equals('foo')); | 1597 unittest.expect(o.project, unittest.equals('foo')); |
| 1588 } | 1598 } |
| 1589 buildCounterUser--; | 1599 buildCounterUser--; |
| 1590 } | 1600 } |
| 1591 | 1601 |
| 1592 buildUnnamed3415() { | 1602 buildUnnamed3420() { |
| 1593 var o = new core.List<api.User>(); | 1603 var o = new core.List<api.User>(); |
| 1594 o.add(buildUser()); | 1604 o.add(buildUser()); |
| 1595 o.add(buildUser()); | 1605 o.add(buildUser()); |
| 1596 return o; | 1606 return o; |
| 1597 } | 1607 } |
| 1598 | 1608 |
| 1599 checkUnnamed3415(core.List<api.User> o) { | 1609 checkUnnamed3420(core.List<api.User> o) { |
| 1600 unittest.expect(o, unittest.hasLength(2)); | 1610 unittest.expect(o, unittest.hasLength(2)); |
| 1601 checkUser(o[0]); | 1611 checkUser(o[0]); |
| 1602 checkUser(o[1]); | 1612 checkUser(o[1]); |
| 1603 } | 1613 } |
| 1604 | 1614 |
| 1605 core.int buildCounterUsersListResponse = 0; | 1615 core.int buildCounterUsersListResponse = 0; |
| 1606 buildUsersListResponse() { | 1616 buildUsersListResponse() { |
| 1607 var o = new api.UsersListResponse(); | 1617 var o = new api.UsersListResponse(); |
| 1608 buildCounterUsersListResponse++; | 1618 buildCounterUsersListResponse++; |
| 1609 if (buildCounterUsersListResponse < 3) { | 1619 if (buildCounterUsersListResponse < 3) { |
| 1610 o.items = buildUnnamed3415(); | 1620 o.items = buildUnnamed3420(); |
| 1611 o.kind = "foo"; | 1621 o.kind = "foo"; |
| 1612 o.nextPageToken = "foo"; | 1622 o.nextPageToken = "foo"; |
| 1613 } | 1623 } |
| 1614 buildCounterUsersListResponse--; | 1624 buildCounterUsersListResponse--; |
| 1615 return o; | 1625 return o; |
| 1616 } | 1626 } |
| 1617 | 1627 |
| 1618 checkUsersListResponse(api.UsersListResponse o) { | 1628 checkUsersListResponse(api.UsersListResponse o) { |
| 1619 buildCounterUsersListResponse++; | 1629 buildCounterUsersListResponse++; |
| 1620 if (buildCounterUsersListResponse < 3) { | 1630 if (buildCounterUsersListResponse < 3) { |
| 1621 checkUnnamed3415(o.items); | 1631 checkUnnamed3420(o.items); |
| 1622 unittest.expect(o.kind, unittest.equals('foo')); | 1632 unittest.expect(o.kind, unittest.equals('foo')); |
| 1623 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 1633 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1624 } | 1634 } |
| 1625 buildCounterUsersListResponse--; | 1635 buildCounterUsersListResponse--; |
| 1626 } | 1636 } |
| 1627 | 1637 |
| 1628 | |
| 1629 main() { | 1638 main() { |
| 1630 unittest.group("obj-schema-AclEntry", () { | 1639 unittest.group("obj-schema-AclEntry", () { |
| 1631 unittest.test("to-json--from-json", () { | 1640 unittest.test("to-json--from-json", () { |
| 1632 var o = buildAclEntry(); | 1641 var o = buildAclEntry(); |
| 1633 var od = new api.AclEntry.fromJson(o.toJson()); | 1642 var od = new api.AclEntry.fromJson(o.toJson()); |
| 1634 checkAclEntry(od); | 1643 checkAclEntry(od); |
| 1635 }); | 1644 }); |
| 1636 }); | 1645 }); |
| 1637 | 1646 |
| 1638 | |
| 1639 unittest.group("obj-schema-BackupConfiguration", () { | 1647 unittest.group("obj-schema-BackupConfiguration", () { |
| 1640 unittest.test("to-json--from-json", () { | 1648 unittest.test("to-json--from-json", () { |
| 1641 var o = buildBackupConfiguration(); | 1649 var o = buildBackupConfiguration(); |
| 1642 var od = new api.BackupConfiguration.fromJson(o.toJson()); | 1650 var od = new api.BackupConfiguration.fromJson(o.toJson()); |
| 1643 checkBackupConfiguration(od); | 1651 checkBackupConfiguration(od); |
| 1644 }); | 1652 }); |
| 1645 }); | 1653 }); |
| 1646 | 1654 |
| 1647 | |
| 1648 unittest.group("obj-schema-BackupRun", () { | 1655 unittest.group("obj-schema-BackupRun", () { |
| 1649 unittest.test("to-json--from-json", () { | 1656 unittest.test("to-json--from-json", () { |
| 1650 var o = buildBackupRun(); | 1657 var o = buildBackupRun(); |
| 1651 var od = new api.BackupRun.fromJson(o.toJson()); | 1658 var od = new api.BackupRun.fromJson(o.toJson()); |
| 1652 checkBackupRun(od); | 1659 checkBackupRun(od); |
| 1653 }); | 1660 }); |
| 1654 }); | 1661 }); |
| 1655 | 1662 |
| 1656 | |
| 1657 unittest.group("obj-schema-BackupRunsListResponse", () { | 1663 unittest.group("obj-schema-BackupRunsListResponse", () { |
| 1658 unittest.test("to-json--from-json", () { | 1664 unittest.test("to-json--from-json", () { |
| 1659 var o = buildBackupRunsListResponse(); | 1665 var o = buildBackupRunsListResponse(); |
| 1660 var od = new api.BackupRunsListResponse.fromJson(o.toJson()); | 1666 var od = new api.BackupRunsListResponse.fromJson(o.toJson()); |
| 1661 checkBackupRunsListResponse(od); | 1667 checkBackupRunsListResponse(od); |
| 1662 }); | 1668 }); |
| 1663 }); | 1669 }); |
| 1664 | 1670 |
| 1665 | |
| 1666 unittest.group("obj-schema-BinLogCoordinates", () { | 1671 unittest.group("obj-schema-BinLogCoordinates", () { |
| 1667 unittest.test("to-json--from-json", () { | 1672 unittest.test("to-json--from-json", () { |
| 1668 var o = buildBinLogCoordinates(); | 1673 var o = buildBinLogCoordinates(); |
| 1669 var od = new api.BinLogCoordinates.fromJson(o.toJson()); | 1674 var od = new api.BinLogCoordinates.fromJson(o.toJson()); |
| 1670 checkBinLogCoordinates(od); | 1675 checkBinLogCoordinates(od); |
| 1671 }); | 1676 }); |
| 1672 }); | 1677 }); |
| 1673 | 1678 |
| 1674 | |
| 1675 unittest.group("obj-schema-CloneContext", () { | 1679 unittest.group("obj-schema-CloneContext", () { |
| 1676 unittest.test("to-json--from-json", () { | 1680 unittest.test("to-json--from-json", () { |
| 1677 var o = buildCloneContext(); | 1681 var o = buildCloneContext(); |
| 1678 var od = new api.CloneContext.fromJson(o.toJson()); | 1682 var od = new api.CloneContext.fromJson(o.toJson()); |
| 1679 checkCloneContext(od); | 1683 checkCloneContext(od); |
| 1680 }); | 1684 }); |
| 1681 }); | 1685 }); |
| 1682 | 1686 |
| 1683 | |
| 1684 unittest.group("obj-schema-Database", () { | 1687 unittest.group("obj-schema-Database", () { |
| 1685 unittest.test("to-json--from-json", () { | 1688 unittest.test("to-json--from-json", () { |
| 1686 var o = buildDatabase(); | 1689 var o = buildDatabase(); |
| 1687 var od = new api.Database.fromJson(o.toJson()); | 1690 var od = new api.Database.fromJson(o.toJson()); |
| 1688 checkDatabase(od); | 1691 checkDatabase(od); |
| 1689 }); | 1692 }); |
| 1690 }); | 1693 }); |
| 1691 | 1694 |
| 1692 | |
| 1693 unittest.group("obj-schema-DatabaseFlags", () { | 1695 unittest.group("obj-schema-DatabaseFlags", () { |
| 1694 unittest.test("to-json--from-json", () { | 1696 unittest.test("to-json--from-json", () { |
| 1695 var o = buildDatabaseFlags(); | 1697 var o = buildDatabaseFlags(); |
| 1696 var od = new api.DatabaseFlags.fromJson(o.toJson()); | 1698 var od = new api.DatabaseFlags.fromJson(o.toJson()); |
| 1697 checkDatabaseFlags(od); | 1699 checkDatabaseFlags(od); |
| 1698 }); | 1700 }); |
| 1699 }); | 1701 }); |
| 1700 | 1702 |
| 1701 | |
| 1702 unittest.group("obj-schema-DatabaseInstanceFailoverReplica", () { | 1703 unittest.group("obj-schema-DatabaseInstanceFailoverReplica", () { |
| 1703 unittest.test("to-json--from-json", () { | 1704 unittest.test("to-json--from-json", () { |
| 1704 var o = buildDatabaseInstanceFailoverReplica(); | 1705 var o = buildDatabaseInstanceFailoverReplica(); |
| 1705 var od = new api.DatabaseInstanceFailoverReplica.fromJson(o.toJson()); | 1706 var od = new api.DatabaseInstanceFailoverReplica.fromJson(o.toJson()); |
| 1706 checkDatabaseInstanceFailoverReplica(od); | 1707 checkDatabaseInstanceFailoverReplica(od); |
| 1707 }); | 1708 }); |
| 1708 }); | 1709 }); |
| 1709 | 1710 |
| 1710 | |
| 1711 unittest.group("obj-schema-DatabaseInstance", () { | 1711 unittest.group("obj-schema-DatabaseInstance", () { |
| 1712 unittest.test("to-json--from-json", () { | 1712 unittest.test("to-json--from-json", () { |
| 1713 var o = buildDatabaseInstance(); | 1713 var o = buildDatabaseInstance(); |
| 1714 var od = new api.DatabaseInstance.fromJson(o.toJson()); | 1714 var od = new api.DatabaseInstance.fromJson(o.toJson()); |
| 1715 checkDatabaseInstance(od); | 1715 checkDatabaseInstance(od); |
| 1716 }); | 1716 }); |
| 1717 }); | 1717 }); |
| 1718 | 1718 |
| 1719 | |
| 1720 unittest.group("obj-schema-DatabasesListResponse", () { | 1719 unittest.group("obj-schema-DatabasesListResponse", () { |
| 1721 unittest.test("to-json--from-json", () { | 1720 unittest.test("to-json--from-json", () { |
| 1722 var o = buildDatabasesListResponse(); | 1721 var o = buildDatabasesListResponse(); |
| 1723 var od = new api.DatabasesListResponse.fromJson(o.toJson()); | 1722 var od = new api.DatabasesListResponse.fromJson(o.toJson()); |
| 1724 checkDatabasesListResponse(od); | 1723 checkDatabasesListResponse(od); |
| 1725 }); | 1724 }); |
| 1726 }); | 1725 }); |
| 1727 | 1726 |
| 1728 | |
| 1729 unittest.group("obj-schema-ExportContextCsvExportOptions", () { | 1727 unittest.group("obj-schema-ExportContextCsvExportOptions", () { |
| 1730 unittest.test("to-json--from-json", () { | 1728 unittest.test("to-json--from-json", () { |
| 1731 var o = buildExportContextCsvExportOptions(); | 1729 var o = buildExportContextCsvExportOptions(); |
| 1732 var od = new api.ExportContextCsvExportOptions.fromJson(o.toJson()); | 1730 var od = new api.ExportContextCsvExportOptions.fromJson(o.toJson()); |
| 1733 checkExportContextCsvExportOptions(od); | 1731 checkExportContextCsvExportOptions(od); |
| 1734 }); | 1732 }); |
| 1735 }); | 1733 }); |
| 1736 | 1734 |
| 1737 | |
| 1738 unittest.group("obj-schema-ExportContextSqlExportOptions", () { | 1735 unittest.group("obj-schema-ExportContextSqlExportOptions", () { |
| 1739 unittest.test("to-json--from-json", () { | 1736 unittest.test("to-json--from-json", () { |
| 1740 var o = buildExportContextSqlExportOptions(); | 1737 var o = buildExportContextSqlExportOptions(); |
| 1741 var od = new api.ExportContextSqlExportOptions.fromJson(o.toJson()); | 1738 var od = new api.ExportContextSqlExportOptions.fromJson(o.toJson()); |
| 1742 checkExportContextSqlExportOptions(od); | 1739 checkExportContextSqlExportOptions(od); |
| 1743 }); | 1740 }); |
| 1744 }); | 1741 }); |
| 1745 | 1742 |
| 1746 | |
| 1747 unittest.group("obj-schema-ExportContext", () { | 1743 unittest.group("obj-schema-ExportContext", () { |
| 1748 unittest.test("to-json--from-json", () { | 1744 unittest.test("to-json--from-json", () { |
| 1749 var o = buildExportContext(); | 1745 var o = buildExportContext(); |
| 1750 var od = new api.ExportContext.fromJson(o.toJson()); | 1746 var od = new api.ExportContext.fromJson(o.toJson()); |
| 1751 checkExportContext(od); | 1747 checkExportContext(od); |
| 1752 }); | 1748 }); |
| 1753 }); | 1749 }); |
| 1754 | 1750 |
| 1755 | |
| 1756 unittest.group("obj-schema-FailoverContext", () { | 1751 unittest.group("obj-schema-FailoverContext", () { |
| 1757 unittest.test("to-json--from-json", () { | 1752 unittest.test("to-json--from-json", () { |
| 1758 var o = buildFailoverContext(); | 1753 var o = buildFailoverContext(); |
| 1759 var od = new api.FailoverContext.fromJson(o.toJson()); | 1754 var od = new api.FailoverContext.fromJson(o.toJson()); |
| 1760 checkFailoverContext(od); | 1755 checkFailoverContext(od); |
| 1761 }); | 1756 }); |
| 1762 }); | 1757 }); |
| 1763 | 1758 |
| 1764 | |
| 1765 unittest.group("obj-schema-Flag", () { | 1759 unittest.group("obj-schema-Flag", () { |
| 1766 unittest.test("to-json--from-json", () { | 1760 unittest.test("to-json--from-json", () { |
| 1767 var o = buildFlag(); | 1761 var o = buildFlag(); |
| 1768 var od = new api.Flag.fromJson(o.toJson()); | 1762 var od = new api.Flag.fromJson(o.toJson()); |
| 1769 checkFlag(od); | 1763 checkFlag(od); |
| 1770 }); | 1764 }); |
| 1771 }); | 1765 }); |
| 1772 | 1766 |
| 1773 | |
| 1774 unittest.group("obj-schema-FlagsListResponse", () { | 1767 unittest.group("obj-schema-FlagsListResponse", () { |
| 1775 unittest.test("to-json--from-json", () { | 1768 unittest.test("to-json--from-json", () { |
| 1776 var o = buildFlagsListResponse(); | 1769 var o = buildFlagsListResponse(); |
| 1777 var od = new api.FlagsListResponse.fromJson(o.toJson()); | 1770 var od = new api.FlagsListResponse.fromJson(o.toJson()); |
| 1778 checkFlagsListResponse(od); | 1771 checkFlagsListResponse(od); |
| 1779 }); | 1772 }); |
| 1780 }); | 1773 }); |
| 1781 | 1774 |
| 1782 | |
| 1783 unittest.group("obj-schema-ImportContextCsvImportOptions", () { | 1775 unittest.group("obj-schema-ImportContextCsvImportOptions", () { |
| 1784 unittest.test("to-json--from-json", () { | 1776 unittest.test("to-json--from-json", () { |
| 1785 var o = buildImportContextCsvImportOptions(); | 1777 var o = buildImportContextCsvImportOptions(); |
| 1786 var od = new api.ImportContextCsvImportOptions.fromJson(o.toJson()); | 1778 var od = new api.ImportContextCsvImportOptions.fromJson(o.toJson()); |
| 1787 checkImportContextCsvImportOptions(od); | 1779 checkImportContextCsvImportOptions(od); |
| 1788 }); | 1780 }); |
| 1789 }); | 1781 }); |
| 1790 | 1782 |
| 1791 | |
| 1792 unittest.group("obj-schema-ImportContext", () { | 1783 unittest.group("obj-schema-ImportContext", () { |
| 1793 unittest.test("to-json--from-json", () { | 1784 unittest.test("to-json--from-json", () { |
| 1794 var o = buildImportContext(); | 1785 var o = buildImportContext(); |
| 1795 var od = new api.ImportContext.fromJson(o.toJson()); | 1786 var od = new api.ImportContext.fromJson(o.toJson()); |
| 1796 checkImportContext(od); | 1787 checkImportContext(od); |
| 1797 }); | 1788 }); |
| 1798 }); | 1789 }); |
| 1799 | 1790 |
| 1800 | |
| 1801 unittest.group("obj-schema-InstancesCloneRequest", () { | 1791 unittest.group("obj-schema-InstancesCloneRequest", () { |
| 1802 unittest.test("to-json--from-json", () { | 1792 unittest.test("to-json--from-json", () { |
| 1803 var o = buildInstancesCloneRequest(); | 1793 var o = buildInstancesCloneRequest(); |
| 1804 var od = new api.InstancesCloneRequest.fromJson(o.toJson()); | 1794 var od = new api.InstancesCloneRequest.fromJson(o.toJson()); |
| 1805 checkInstancesCloneRequest(od); | 1795 checkInstancesCloneRequest(od); |
| 1806 }); | 1796 }); |
| 1807 }); | 1797 }); |
| 1808 | 1798 |
| 1809 | |
| 1810 unittest.group("obj-schema-InstancesExportRequest", () { | 1799 unittest.group("obj-schema-InstancesExportRequest", () { |
| 1811 unittest.test("to-json--from-json", () { | 1800 unittest.test("to-json--from-json", () { |
| 1812 var o = buildInstancesExportRequest(); | 1801 var o = buildInstancesExportRequest(); |
| 1813 var od = new api.InstancesExportRequest.fromJson(o.toJson()); | 1802 var od = new api.InstancesExportRequest.fromJson(o.toJson()); |
| 1814 checkInstancesExportRequest(od); | 1803 checkInstancesExportRequest(od); |
| 1815 }); | 1804 }); |
| 1816 }); | 1805 }); |
| 1817 | 1806 |
| 1818 | |
| 1819 unittest.group("obj-schema-InstancesFailoverRequest", () { | 1807 unittest.group("obj-schema-InstancesFailoverRequest", () { |
| 1820 unittest.test("to-json--from-json", () { | 1808 unittest.test("to-json--from-json", () { |
| 1821 var o = buildInstancesFailoverRequest(); | 1809 var o = buildInstancesFailoverRequest(); |
| 1822 var od = new api.InstancesFailoverRequest.fromJson(o.toJson()); | 1810 var od = new api.InstancesFailoverRequest.fromJson(o.toJson()); |
| 1823 checkInstancesFailoverRequest(od); | 1811 checkInstancesFailoverRequest(od); |
| 1824 }); | 1812 }); |
| 1825 }); | 1813 }); |
| 1826 | 1814 |
| 1827 | |
| 1828 unittest.group("obj-schema-InstancesImportRequest", () { | 1815 unittest.group("obj-schema-InstancesImportRequest", () { |
| 1829 unittest.test("to-json--from-json", () { | 1816 unittest.test("to-json--from-json", () { |
| 1830 var o = buildInstancesImportRequest(); | 1817 var o = buildInstancesImportRequest(); |
| 1831 var od = new api.InstancesImportRequest.fromJson(o.toJson()); | 1818 var od = new api.InstancesImportRequest.fromJson(o.toJson()); |
| 1832 checkInstancesImportRequest(od); | 1819 checkInstancesImportRequest(od); |
| 1833 }); | 1820 }); |
| 1834 }); | 1821 }); |
| 1835 | 1822 |
| 1836 | |
| 1837 unittest.group("obj-schema-InstancesListResponse", () { | 1823 unittest.group("obj-schema-InstancesListResponse", () { |
| 1838 unittest.test("to-json--from-json", () { | 1824 unittest.test("to-json--from-json", () { |
| 1839 var o = buildInstancesListResponse(); | 1825 var o = buildInstancesListResponse(); |
| 1840 var od = new api.InstancesListResponse.fromJson(o.toJson()); | 1826 var od = new api.InstancesListResponse.fromJson(o.toJson()); |
| 1841 checkInstancesListResponse(od); | 1827 checkInstancesListResponse(od); |
| 1842 }); | 1828 }); |
| 1843 }); | 1829 }); |
| 1844 | 1830 |
| 1845 | |
| 1846 unittest.group("obj-schema-InstancesRestoreBackupRequest", () { | 1831 unittest.group("obj-schema-InstancesRestoreBackupRequest", () { |
| 1847 unittest.test("to-json--from-json", () { | 1832 unittest.test("to-json--from-json", () { |
| 1848 var o = buildInstancesRestoreBackupRequest(); | 1833 var o = buildInstancesRestoreBackupRequest(); |
| 1849 var od = new api.InstancesRestoreBackupRequest.fromJson(o.toJson()); | 1834 var od = new api.InstancesRestoreBackupRequest.fromJson(o.toJson()); |
| 1850 checkInstancesRestoreBackupRequest(od); | 1835 checkInstancesRestoreBackupRequest(od); |
| 1851 }); | 1836 }); |
| 1852 }); | 1837 }); |
| 1853 | 1838 |
| 1854 | |
| 1855 unittest.group("obj-schema-InstancesTruncateLogRequest", () { | 1839 unittest.group("obj-schema-InstancesTruncateLogRequest", () { |
| 1856 unittest.test("to-json--from-json", () { | 1840 unittest.test("to-json--from-json", () { |
| 1857 var o = buildInstancesTruncateLogRequest(); | 1841 var o = buildInstancesTruncateLogRequest(); |
| 1858 var od = new api.InstancesTruncateLogRequest.fromJson(o.toJson()); | 1842 var od = new api.InstancesTruncateLogRequest.fromJson(o.toJson()); |
| 1859 checkInstancesTruncateLogRequest(od); | 1843 checkInstancesTruncateLogRequest(od); |
| 1860 }); | 1844 }); |
| 1861 }); | 1845 }); |
| 1862 | 1846 |
| 1863 | |
| 1864 unittest.group("obj-schema-IpConfiguration", () { | 1847 unittest.group("obj-schema-IpConfiguration", () { |
| 1865 unittest.test("to-json--from-json", () { | 1848 unittest.test("to-json--from-json", () { |
| 1866 var o = buildIpConfiguration(); | 1849 var o = buildIpConfiguration(); |
| 1867 var od = new api.IpConfiguration.fromJson(o.toJson()); | 1850 var od = new api.IpConfiguration.fromJson(o.toJson()); |
| 1868 checkIpConfiguration(od); | 1851 checkIpConfiguration(od); |
| 1869 }); | 1852 }); |
| 1870 }); | 1853 }); |
| 1871 | 1854 |
| 1872 | |
| 1873 unittest.group("obj-schema-IpMapping", () { | 1855 unittest.group("obj-schema-IpMapping", () { |
| 1874 unittest.test("to-json--from-json", () { | 1856 unittest.test("to-json--from-json", () { |
| 1875 var o = buildIpMapping(); | 1857 var o = buildIpMapping(); |
| 1876 var od = new api.IpMapping.fromJson(o.toJson()); | 1858 var od = new api.IpMapping.fromJson(o.toJson()); |
| 1877 checkIpMapping(od); | 1859 checkIpMapping(od); |
| 1878 }); | 1860 }); |
| 1879 }); | 1861 }); |
| 1880 | 1862 |
| 1881 | |
| 1882 unittest.group("obj-schema-LocationPreference", () { | 1863 unittest.group("obj-schema-LocationPreference", () { |
| 1883 unittest.test("to-json--from-json", () { | 1864 unittest.test("to-json--from-json", () { |
| 1884 var o = buildLocationPreference(); | 1865 var o = buildLocationPreference(); |
| 1885 var od = new api.LocationPreference.fromJson(o.toJson()); | 1866 var od = new api.LocationPreference.fromJson(o.toJson()); |
| 1886 checkLocationPreference(od); | 1867 checkLocationPreference(od); |
| 1887 }); | 1868 }); |
| 1888 }); | 1869 }); |
| 1889 | 1870 |
| 1890 | |
| 1891 unittest.group("obj-schema-MaintenanceWindow", () { | 1871 unittest.group("obj-schema-MaintenanceWindow", () { |
| 1892 unittest.test("to-json--from-json", () { | 1872 unittest.test("to-json--from-json", () { |
| 1893 var o = buildMaintenanceWindow(); | 1873 var o = buildMaintenanceWindow(); |
| 1894 var od = new api.MaintenanceWindow.fromJson(o.toJson()); | 1874 var od = new api.MaintenanceWindow.fromJson(o.toJson()); |
| 1895 checkMaintenanceWindow(od); | 1875 checkMaintenanceWindow(od); |
| 1896 }); | 1876 }); |
| 1897 }); | 1877 }); |
| 1898 | 1878 |
| 1899 | |
| 1900 unittest.group("obj-schema-MySqlReplicaConfiguration", () { | 1879 unittest.group("obj-schema-MySqlReplicaConfiguration", () { |
| 1901 unittest.test("to-json--from-json", () { | 1880 unittest.test("to-json--from-json", () { |
| 1902 var o = buildMySqlReplicaConfiguration(); | 1881 var o = buildMySqlReplicaConfiguration(); |
| 1903 var od = new api.MySqlReplicaConfiguration.fromJson(o.toJson()); | 1882 var od = new api.MySqlReplicaConfiguration.fromJson(o.toJson()); |
| 1904 checkMySqlReplicaConfiguration(od); | 1883 checkMySqlReplicaConfiguration(od); |
| 1905 }); | 1884 }); |
| 1906 }); | 1885 }); |
| 1907 | 1886 |
| 1908 | |
| 1909 unittest.group("obj-schema-OnPremisesConfiguration", () { | 1887 unittest.group("obj-schema-OnPremisesConfiguration", () { |
| 1910 unittest.test("to-json--from-json", () { | 1888 unittest.test("to-json--from-json", () { |
| 1911 var o = buildOnPremisesConfiguration(); | 1889 var o = buildOnPremisesConfiguration(); |
| 1912 var od = new api.OnPremisesConfiguration.fromJson(o.toJson()); | 1890 var od = new api.OnPremisesConfiguration.fromJson(o.toJson()); |
| 1913 checkOnPremisesConfiguration(od); | 1891 checkOnPremisesConfiguration(od); |
| 1914 }); | 1892 }); |
| 1915 }); | 1893 }); |
| 1916 | 1894 |
| 1917 | |
| 1918 unittest.group("obj-schema-Operation", () { | 1895 unittest.group("obj-schema-Operation", () { |
| 1919 unittest.test("to-json--from-json", () { | 1896 unittest.test("to-json--from-json", () { |
| 1920 var o = buildOperation(); | 1897 var o = buildOperation(); |
| 1921 var od = new api.Operation.fromJson(o.toJson()); | 1898 var od = new api.Operation.fromJson(o.toJson()); |
| 1922 checkOperation(od); | 1899 checkOperation(od); |
| 1923 }); | 1900 }); |
| 1924 }); | 1901 }); |
| 1925 | 1902 |
| 1926 | |
| 1927 unittest.group("obj-schema-OperationError", () { | 1903 unittest.group("obj-schema-OperationError", () { |
| 1928 unittest.test("to-json--from-json", () { | 1904 unittest.test("to-json--from-json", () { |
| 1929 var o = buildOperationError(); | 1905 var o = buildOperationError(); |
| 1930 var od = new api.OperationError.fromJson(o.toJson()); | 1906 var od = new api.OperationError.fromJson(o.toJson()); |
| 1931 checkOperationError(od); | 1907 checkOperationError(od); |
| 1932 }); | 1908 }); |
| 1933 }); | 1909 }); |
| 1934 | 1910 |
| 1935 | |
| 1936 unittest.group("obj-schema-OperationErrors", () { | 1911 unittest.group("obj-schema-OperationErrors", () { |
| 1937 unittest.test("to-json--from-json", () { | 1912 unittest.test("to-json--from-json", () { |
| 1938 var o = buildOperationErrors(); | 1913 var o = buildOperationErrors(); |
| 1939 var od = new api.OperationErrors.fromJson(o.toJson()); | 1914 var od = new api.OperationErrors.fromJson(o.toJson()); |
| 1940 checkOperationErrors(od); | 1915 checkOperationErrors(od); |
| 1941 }); | 1916 }); |
| 1942 }); | 1917 }); |
| 1943 | 1918 |
| 1944 | |
| 1945 unittest.group("obj-schema-OperationsListResponse", () { | 1919 unittest.group("obj-schema-OperationsListResponse", () { |
| 1946 unittest.test("to-json--from-json", () { | 1920 unittest.test("to-json--from-json", () { |
| 1947 var o = buildOperationsListResponse(); | 1921 var o = buildOperationsListResponse(); |
| 1948 var od = new api.OperationsListResponse.fromJson(o.toJson()); | 1922 var od = new api.OperationsListResponse.fromJson(o.toJson()); |
| 1949 checkOperationsListResponse(od); | 1923 checkOperationsListResponse(od); |
| 1950 }); | 1924 }); |
| 1951 }); | 1925 }); |
| 1952 | 1926 |
| 1953 | |
| 1954 unittest.group("obj-schema-ReplicaConfiguration", () { | 1927 unittest.group("obj-schema-ReplicaConfiguration", () { |
| 1955 unittest.test("to-json--from-json", () { | 1928 unittest.test("to-json--from-json", () { |
| 1956 var o = buildReplicaConfiguration(); | 1929 var o = buildReplicaConfiguration(); |
| 1957 var od = new api.ReplicaConfiguration.fromJson(o.toJson()); | 1930 var od = new api.ReplicaConfiguration.fromJson(o.toJson()); |
| 1958 checkReplicaConfiguration(od); | 1931 checkReplicaConfiguration(od); |
| 1959 }); | 1932 }); |
| 1960 }); | 1933 }); |
| 1961 | 1934 |
| 1962 | |
| 1963 unittest.group("obj-schema-RestoreBackupContext", () { | 1935 unittest.group("obj-schema-RestoreBackupContext", () { |
| 1964 unittest.test("to-json--from-json", () { | 1936 unittest.test("to-json--from-json", () { |
| 1965 var o = buildRestoreBackupContext(); | 1937 var o = buildRestoreBackupContext(); |
| 1966 var od = new api.RestoreBackupContext.fromJson(o.toJson()); | 1938 var od = new api.RestoreBackupContext.fromJson(o.toJson()); |
| 1967 checkRestoreBackupContext(od); | 1939 checkRestoreBackupContext(od); |
| 1968 }); | 1940 }); |
| 1969 }); | 1941 }); |
| 1970 | 1942 |
| 1971 | |
| 1972 unittest.group("obj-schema-Settings", () { | 1943 unittest.group("obj-schema-Settings", () { |
| 1973 unittest.test("to-json--from-json", () { | 1944 unittest.test("to-json--from-json", () { |
| 1974 var o = buildSettings(); | 1945 var o = buildSettings(); |
| 1975 var od = new api.Settings.fromJson(o.toJson()); | 1946 var od = new api.Settings.fromJson(o.toJson()); |
| 1976 checkSettings(od); | 1947 checkSettings(od); |
| 1977 }); | 1948 }); |
| 1978 }); | 1949 }); |
| 1979 | 1950 |
| 1980 | |
| 1981 unittest.group("obj-schema-SslCert", () { | 1951 unittest.group("obj-schema-SslCert", () { |
| 1982 unittest.test("to-json--from-json", () { | 1952 unittest.test("to-json--from-json", () { |
| 1983 var o = buildSslCert(); | 1953 var o = buildSslCert(); |
| 1984 var od = new api.SslCert.fromJson(o.toJson()); | 1954 var od = new api.SslCert.fromJson(o.toJson()); |
| 1985 checkSslCert(od); | 1955 checkSslCert(od); |
| 1986 }); | 1956 }); |
| 1987 }); | 1957 }); |
| 1988 | 1958 |
| 1989 | |
| 1990 unittest.group("obj-schema-SslCertDetail", () { | 1959 unittest.group("obj-schema-SslCertDetail", () { |
| 1991 unittest.test("to-json--from-json", () { | 1960 unittest.test("to-json--from-json", () { |
| 1992 var o = buildSslCertDetail(); | 1961 var o = buildSslCertDetail(); |
| 1993 var od = new api.SslCertDetail.fromJson(o.toJson()); | 1962 var od = new api.SslCertDetail.fromJson(o.toJson()); |
| 1994 checkSslCertDetail(od); | 1963 checkSslCertDetail(od); |
| 1995 }); | 1964 }); |
| 1996 }); | 1965 }); |
| 1997 | 1966 |
| 1998 | |
| 1999 unittest.group("obj-schema-SslCertsCreateEphemeralRequest", () { | 1967 unittest.group("obj-schema-SslCertsCreateEphemeralRequest", () { |
| 2000 unittest.test("to-json--from-json", () { | 1968 unittest.test("to-json--from-json", () { |
| 2001 var o = buildSslCertsCreateEphemeralRequest(); | 1969 var o = buildSslCertsCreateEphemeralRequest(); |
| 2002 var od = new api.SslCertsCreateEphemeralRequest.fromJson(o.toJson()); | 1970 var od = new api.SslCertsCreateEphemeralRequest.fromJson(o.toJson()); |
| 2003 checkSslCertsCreateEphemeralRequest(od); | 1971 checkSslCertsCreateEphemeralRequest(od); |
| 2004 }); | 1972 }); |
| 2005 }); | 1973 }); |
| 2006 | 1974 |
| 2007 | |
| 2008 unittest.group("obj-schema-SslCertsInsertRequest", () { | 1975 unittest.group("obj-schema-SslCertsInsertRequest", () { |
| 2009 unittest.test("to-json--from-json", () { | 1976 unittest.test("to-json--from-json", () { |
| 2010 var o = buildSslCertsInsertRequest(); | 1977 var o = buildSslCertsInsertRequest(); |
| 2011 var od = new api.SslCertsInsertRequest.fromJson(o.toJson()); | 1978 var od = new api.SslCertsInsertRequest.fromJson(o.toJson()); |
| 2012 checkSslCertsInsertRequest(od); | 1979 checkSslCertsInsertRequest(od); |
| 2013 }); | 1980 }); |
| 2014 }); | 1981 }); |
| 2015 | 1982 |
| 2016 | |
| 2017 unittest.group("obj-schema-SslCertsInsertResponse", () { | 1983 unittest.group("obj-schema-SslCertsInsertResponse", () { |
| 2018 unittest.test("to-json--from-json", () { | 1984 unittest.test("to-json--from-json", () { |
| 2019 var o = buildSslCertsInsertResponse(); | 1985 var o = buildSslCertsInsertResponse(); |
| 2020 var od = new api.SslCertsInsertResponse.fromJson(o.toJson()); | 1986 var od = new api.SslCertsInsertResponse.fromJson(o.toJson()); |
| 2021 checkSslCertsInsertResponse(od); | 1987 checkSslCertsInsertResponse(od); |
| 2022 }); | 1988 }); |
| 2023 }); | 1989 }); |
| 2024 | 1990 |
| 2025 | |
| 2026 unittest.group("obj-schema-SslCertsListResponse", () { | 1991 unittest.group("obj-schema-SslCertsListResponse", () { |
| 2027 unittest.test("to-json--from-json", () { | 1992 unittest.test("to-json--from-json", () { |
| 2028 var o = buildSslCertsListResponse(); | 1993 var o = buildSslCertsListResponse(); |
| 2029 var od = new api.SslCertsListResponse.fromJson(o.toJson()); | 1994 var od = new api.SslCertsListResponse.fromJson(o.toJson()); |
| 2030 checkSslCertsListResponse(od); | 1995 checkSslCertsListResponse(od); |
| 2031 }); | 1996 }); |
| 2032 }); | 1997 }); |
| 2033 | 1998 |
| 2034 | |
| 2035 unittest.group("obj-schema-Tier", () { | 1999 unittest.group("obj-schema-Tier", () { |
| 2036 unittest.test("to-json--from-json", () { | 2000 unittest.test("to-json--from-json", () { |
| 2037 var o = buildTier(); | 2001 var o = buildTier(); |
| 2038 var od = new api.Tier.fromJson(o.toJson()); | 2002 var od = new api.Tier.fromJson(o.toJson()); |
| 2039 checkTier(od); | 2003 checkTier(od); |
| 2040 }); | 2004 }); |
| 2041 }); | 2005 }); |
| 2042 | 2006 |
| 2043 | |
| 2044 unittest.group("obj-schema-TiersListResponse", () { | 2007 unittest.group("obj-schema-TiersListResponse", () { |
| 2045 unittest.test("to-json--from-json", () { | 2008 unittest.test("to-json--from-json", () { |
| 2046 var o = buildTiersListResponse(); | 2009 var o = buildTiersListResponse(); |
| 2047 var od = new api.TiersListResponse.fromJson(o.toJson()); | 2010 var od = new api.TiersListResponse.fromJson(o.toJson()); |
| 2048 checkTiersListResponse(od); | 2011 checkTiersListResponse(od); |
| 2049 }); | 2012 }); |
| 2050 }); | 2013 }); |
| 2051 | 2014 |
| 2052 | |
| 2053 unittest.group("obj-schema-TruncateLogContext", () { | 2015 unittest.group("obj-schema-TruncateLogContext", () { |
| 2054 unittest.test("to-json--from-json", () { | 2016 unittest.test("to-json--from-json", () { |
| 2055 var o = buildTruncateLogContext(); | 2017 var o = buildTruncateLogContext(); |
| 2056 var od = new api.TruncateLogContext.fromJson(o.toJson()); | 2018 var od = new api.TruncateLogContext.fromJson(o.toJson()); |
| 2057 checkTruncateLogContext(od); | 2019 checkTruncateLogContext(od); |
| 2058 }); | 2020 }); |
| 2059 }); | 2021 }); |
| 2060 | 2022 |
| 2061 | |
| 2062 unittest.group("obj-schema-User", () { | 2023 unittest.group("obj-schema-User", () { |
| 2063 unittest.test("to-json--from-json", () { | 2024 unittest.test("to-json--from-json", () { |
| 2064 var o = buildUser(); | 2025 var o = buildUser(); |
| 2065 var od = new api.User.fromJson(o.toJson()); | 2026 var od = new api.User.fromJson(o.toJson()); |
| 2066 checkUser(od); | 2027 checkUser(od); |
| 2067 }); | 2028 }); |
| 2068 }); | 2029 }); |
| 2069 | 2030 |
| 2070 | |
| 2071 unittest.group("obj-schema-UsersListResponse", () { | 2031 unittest.group("obj-schema-UsersListResponse", () { |
| 2072 unittest.test("to-json--from-json", () { | 2032 unittest.test("to-json--from-json", () { |
| 2073 var o = buildUsersListResponse(); | 2033 var o = buildUsersListResponse(); |
| 2074 var od = new api.UsersListResponse.fromJson(o.toJson()); | 2034 var od = new api.UsersListResponse.fromJson(o.toJson()); |
| 2075 checkUsersListResponse(od); | 2035 checkUsersListResponse(od); |
| 2076 }); | 2036 }); |
| 2077 }); | 2037 }); |
| 2078 | 2038 |
| 2079 | |
| 2080 unittest.group("resource-BackupRunsResourceApi", () { | 2039 unittest.group("resource-BackupRunsResourceApi", () { |
| 2081 unittest.test("method--delete", () { | 2040 unittest.test("method--delete", () { |
| 2082 | |
| 2083 var mock = new HttpServerMock(); | 2041 var mock = new HttpServerMock(); |
| 2084 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 2042 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
| 2085 var arg_project = "foo"; | 2043 var arg_project = "foo"; |
| 2086 var arg_instance = "foo"; | 2044 var arg_instance = "foo"; |
| 2087 var arg_id = "foo"; | 2045 var arg_id = "foo"; |
| 2088 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2046 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2089 var path = (req.url).path; | 2047 var path = (req.url).path; |
| 2090 var pathOffset = 0; | 2048 var pathOffset = 0; |
| 2091 var index; | 2049 var index; |
| 2092 var subPart; | 2050 var subPart; |
| 2093 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2051 unittest.expect( |
| 2052 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2094 pathOffset += 1; | 2053 pathOffset += 1; |
| 2095 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2054 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2055 unittest.equals("sql/v1beta4/")); |
| 2096 pathOffset += 12; | 2056 pathOffset += 12; |
| 2097 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2057 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2058 unittest.equals("projects/")); |
| 2098 pathOffset += 9; | 2059 pathOffset += 9; |
| 2099 index = path.indexOf("/instances/", pathOffset); | 2060 index = path.indexOf("/instances/", pathOffset); |
| 2100 unittest.expect(index >= 0, unittest.isTrue); | 2061 unittest.expect(index >= 0, unittest.isTrue); |
| 2101 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2062 subPart = |
| 2063 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2102 pathOffset = index; | 2064 pathOffset = index; |
| 2103 unittest.expect(subPart, unittest.equals("$arg_project")); | 2065 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2104 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2066 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2067 unittest.equals("/instances/")); |
| 2105 pathOffset += 11; | 2068 pathOffset += 11; |
| 2106 index = path.indexOf("/backupRuns/", pathOffset); | 2069 index = path.indexOf("/backupRuns/", pathOffset); |
| 2107 unittest.expect(index >= 0, unittest.isTrue); | 2070 unittest.expect(index >= 0, unittest.isTrue); |
| 2108 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2071 subPart = |
| 2072 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2109 pathOffset = index; | 2073 pathOffset = index; |
| 2110 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2074 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2111 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/backupRuns/")); | 2075 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2076 unittest.equals("/backupRuns/")); |
| 2112 pathOffset += 12; | 2077 pathOffset += 12; |
| 2113 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2078 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2114 pathOffset = path.length; | 2079 pathOffset = path.length; |
| 2115 unittest.expect(subPart, unittest.equals("$arg_id")); | 2080 unittest.expect(subPart, unittest.equals("$arg_id")); |
| 2116 | 2081 |
| 2117 var query = (req.url).query; | 2082 var query = (req.url).query; |
| 2118 var queryOffset = 0; | 2083 var queryOffset = 0; |
| 2119 var queryMap = {}; | 2084 var queryMap = {}; |
| 2120 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2085 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2121 parseBool(n) { | 2086 parseBool(n) { |
| 2122 if (n == "true") return true; | 2087 if (n == "true") return true; |
| 2123 if (n == "false") return false; | 2088 if (n == "false") return false; |
| 2124 if (n == null) return null; | 2089 if (n == null) return null; |
| 2125 throw new core.ArgumentError("Invalid boolean: $n"); | 2090 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2126 } | 2091 } |
| 2092 |
| 2127 if (query.length > 0) { | 2093 if (query.length > 0) { |
| 2128 for (var part in query.split("&")) { | 2094 for (var part in query.split("&")) { |
| 2129 var keyvalue = part.split("="); | 2095 var keyvalue = part.split("="); |
| 2130 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2096 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2097 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2131 } | 2098 } |
| 2132 } | 2099 } |
| 2133 | 2100 |
| 2134 | |
| 2135 var h = { | 2101 var h = { |
| 2136 "content-type" : "application/json; charset=utf-8", | 2102 "content-type": "application/json; charset=utf-8", |
| 2137 }; | 2103 }; |
| 2138 var resp = convert.JSON.encode(buildOperation()); | 2104 var resp = convert.JSON.encode(buildOperation()); |
| 2139 return new async.Future.value(stringResponse(200, h, resp)); | 2105 return new async.Future.value(stringResponse(200, h, resp)); |
| 2140 }), true); | 2106 }), true); |
| 2141 res.delete(arg_project, arg_instance, arg_id).then(unittest.expectAsync1((
(api.Operation response) { | 2107 res |
| 2108 .delete(arg_project, arg_instance, arg_id) |
| 2109 .then(unittest.expectAsync1(((api.Operation response) { |
| 2142 checkOperation(response); | 2110 checkOperation(response); |
| 2143 }))); | 2111 }))); |
| 2144 }); | 2112 }); |
| 2145 | 2113 |
| 2146 unittest.test("method--get", () { | 2114 unittest.test("method--get", () { |
| 2147 | |
| 2148 var mock = new HttpServerMock(); | 2115 var mock = new HttpServerMock(); |
| 2149 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 2116 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
| 2150 var arg_project = "foo"; | 2117 var arg_project = "foo"; |
| 2151 var arg_instance = "foo"; | 2118 var arg_instance = "foo"; |
| 2152 var arg_id = "foo"; | 2119 var arg_id = "foo"; |
| 2153 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2120 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2154 var path = (req.url).path; | 2121 var path = (req.url).path; |
| 2155 var pathOffset = 0; | 2122 var pathOffset = 0; |
| 2156 var index; | 2123 var index; |
| 2157 var subPart; | 2124 var subPart; |
| 2158 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2125 unittest.expect( |
| 2126 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2159 pathOffset += 1; | 2127 pathOffset += 1; |
| 2160 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2128 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2129 unittest.equals("sql/v1beta4/")); |
| 2161 pathOffset += 12; | 2130 pathOffset += 12; |
| 2162 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2131 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2132 unittest.equals("projects/")); |
| 2163 pathOffset += 9; | 2133 pathOffset += 9; |
| 2164 index = path.indexOf("/instances/", pathOffset); | 2134 index = path.indexOf("/instances/", pathOffset); |
| 2165 unittest.expect(index >= 0, unittest.isTrue); | 2135 unittest.expect(index >= 0, unittest.isTrue); |
| 2166 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2136 subPart = |
| 2137 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2167 pathOffset = index; | 2138 pathOffset = index; |
| 2168 unittest.expect(subPart, unittest.equals("$arg_project")); | 2139 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2169 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2140 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2141 unittest.equals("/instances/")); |
| 2170 pathOffset += 11; | 2142 pathOffset += 11; |
| 2171 index = path.indexOf("/backupRuns/", pathOffset); | 2143 index = path.indexOf("/backupRuns/", pathOffset); |
| 2172 unittest.expect(index >= 0, unittest.isTrue); | 2144 unittest.expect(index >= 0, unittest.isTrue); |
| 2173 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2145 subPart = |
| 2146 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2174 pathOffset = index; | 2147 pathOffset = index; |
| 2175 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2148 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2176 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/backupRuns/")); | 2149 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2150 unittest.equals("/backupRuns/")); |
| 2177 pathOffset += 12; | 2151 pathOffset += 12; |
| 2178 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2152 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2179 pathOffset = path.length; | 2153 pathOffset = path.length; |
| 2180 unittest.expect(subPart, unittest.equals("$arg_id")); | 2154 unittest.expect(subPart, unittest.equals("$arg_id")); |
| 2181 | 2155 |
| 2182 var query = (req.url).query; | 2156 var query = (req.url).query; |
| 2183 var queryOffset = 0; | 2157 var queryOffset = 0; |
| 2184 var queryMap = {}; | 2158 var queryMap = {}; |
| 2185 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2159 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2186 parseBool(n) { | 2160 parseBool(n) { |
| 2187 if (n == "true") return true; | 2161 if (n == "true") return true; |
| 2188 if (n == "false") return false; | 2162 if (n == "false") return false; |
| 2189 if (n == null) return null; | 2163 if (n == null) return null; |
| 2190 throw new core.ArgumentError("Invalid boolean: $n"); | 2164 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2191 } | 2165 } |
| 2166 |
| 2192 if (query.length > 0) { | 2167 if (query.length > 0) { |
| 2193 for (var part in query.split("&")) { | 2168 for (var part in query.split("&")) { |
| 2194 var keyvalue = part.split("="); | 2169 var keyvalue = part.split("="); |
| 2195 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2170 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2171 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2196 } | 2172 } |
| 2197 } | 2173 } |
| 2198 | 2174 |
| 2199 | |
| 2200 var h = { | 2175 var h = { |
| 2201 "content-type" : "application/json; charset=utf-8", | 2176 "content-type": "application/json; charset=utf-8", |
| 2202 }; | 2177 }; |
| 2203 var resp = convert.JSON.encode(buildBackupRun()); | 2178 var resp = convert.JSON.encode(buildBackupRun()); |
| 2204 return new async.Future.value(stringResponse(200, h, resp)); | 2179 return new async.Future.value(stringResponse(200, h, resp)); |
| 2205 }), true); | 2180 }), true); |
| 2206 res.get(arg_project, arg_instance, arg_id).then(unittest.expectAsync1(((ap
i.BackupRun response) { | 2181 res |
| 2182 .get(arg_project, arg_instance, arg_id) |
| 2183 .then(unittest.expectAsync1(((api.BackupRun response) { |
| 2207 checkBackupRun(response); | 2184 checkBackupRun(response); |
| 2208 }))); | 2185 }))); |
| 2209 }); | 2186 }); |
| 2210 | 2187 |
| 2211 unittest.test("method--insert", () { | 2188 unittest.test("method--insert", () { |
| 2212 | |
| 2213 var mock = new HttpServerMock(); | 2189 var mock = new HttpServerMock(); |
| 2214 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 2190 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
| 2215 var arg_request = buildBackupRun(); | 2191 var arg_request = buildBackupRun(); |
| 2216 var arg_project = "foo"; | 2192 var arg_project = "foo"; |
| 2217 var arg_instance = "foo"; | 2193 var arg_instance = "foo"; |
| 2218 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2194 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2219 var obj = new api.BackupRun.fromJson(json); | 2195 var obj = new api.BackupRun.fromJson(json); |
| 2220 checkBackupRun(obj); | 2196 checkBackupRun(obj); |
| 2221 | 2197 |
| 2222 var path = (req.url).path; | 2198 var path = (req.url).path; |
| 2223 var pathOffset = 0; | 2199 var pathOffset = 0; |
| 2224 var index; | 2200 var index; |
| 2225 var subPart; | 2201 var subPart; |
| 2226 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2202 unittest.expect( |
| 2203 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2227 pathOffset += 1; | 2204 pathOffset += 1; |
| 2228 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2205 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2206 unittest.equals("sql/v1beta4/")); |
| 2229 pathOffset += 12; | 2207 pathOffset += 12; |
| 2230 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2208 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2209 unittest.equals("projects/")); |
| 2231 pathOffset += 9; | 2210 pathOffset += 9; |
| 2232 index = path.indexOf("/instances/", pathOffset); | 2211 index = path.indexOf("/instances/", pathOffset); |
| 2233 unittest.expect(index >= 0, unittest.isTrue); | 2212 unittest.expect(index >= 0, unittest.isTrue); |
| 2234 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2213 subPart = |
| 2214 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2235 pathOffset = index; | 2215 pathOffset = index; |
| 2236 unittest.expect(subPart, unittest.equals("$arg_project")); | 2216 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2237 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2217 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2218 unittest.equals("/instances/")); |
| 2238 pathOffset += 11; | 2219 pathOffset += 11; |
| 2239 index = path.indexOf("/backupRuns", pathOffset); | 2220 index = path.indexOf("/backupRuns", pathOffset); |
| 2240 unittest.expect(index >= 0, unittest.isTrue); | 2221 unittest.expect(index >= 0, unittest.isTrue); |
| 2241 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2222 subPart = |
| 2223 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2242 pathOffset = index; | 2224 pathOffset = index; |
| 2243 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2225 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2244 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/backupRuns")); | 2226 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2227 unittest.equals("/backupRuns")); |
| 2245 pathOffset += 11; | 2228 pathOffset += 11; |
| 2246 | 2229 |
| 2247 var query = (req.url).query; | 2230 var query = (req.url).query; |
| 2248 var queryOffset = 0; | 2231 var queryOffset = 0; |
| 2249 var queryMap = {}; | 2232 var queryMap = {}; |
| 2250 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2233 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2251 parseBool(n) { | 2234 parseBool(n) { |
| 2252 if (n == "true") return true; | 2235 if (n == "true") return true; |
| 2253 if (n == "false") return false; | 2236 if (n == "false") return false; |
| 2254 if (n == null) return null; | 2237 if (n == null) return null; |
| 2255 throw new core.ArgumentError("Invalid boolean: $n"); | 2238 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2256 } | 2239 } |
| 2240 |
| 2257 if (query.length > 0) { | 2241 if (query.length > 0) { |
| 2258 for (var part in query.split("&")) { | 2242 for (var part in query.split("&")) { |
| 2259 var keyvalue = part.split("="); | 2243 var keyvalue = part.split("="); |
| 2260 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2244 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2245 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2261 } | 2246 } |
| 2262 } | 2247 } |
| 2263 | 2248 |
| 2264 | |
| 2265 var h = { | 2249 var h = { |
| 2266 "content-type" : "application/json; charset=utf-8", | 2250 "content-type": "application/json; charset=utf-8", |
| 2267 }; | 2251 }; |
| 2268 var resp = convert.JSON.encode(buildOperation()); | 2252 var resp = convert.JSON.encode(buildOperation()); |
| 2269 return new async.Future.value(stringResponse(200, h, resp)); | 2253 return new async.Future.value(stringResponse(200, h, resp)); |
| 2270 }), true); | 2254 }), true); |
| 2271 res.insert(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 2255 res |
| 2256 .insert(arg_request, arg_project, arg_instance) |
| 2257 .then(unittest.expectAsync1(((api.Operation response) { |
| 2272 checkOperation(response); | 2258 checkOperation(response); |
| 2273 }))); | 2259 }))); |
| 2274 }); | 2260 }); |
| 2275 | 2261 |
| 2276 unittest.test("method--list", () { | 2262 unittest.test("method--list", () { |
| 2277 | |
| 2278 var mock = new HttpServerMock(); | 2263 var mock = new HttpServerMock(); |
| 2279 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 2264 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
| 2280 var arg_project = "foo"; | 2265 var arg_project = "foo"; |
| 2281 var arg_instance = "foo"; | 2266 var arg_instance = "foo"; |
| 2282 var arg_maxResults = 42; | 2267 var arg_maxResults = 42; |
| 2283 var arg_pageToken = "foo"; | 2268 var arg_pageToken = "foo"; |
| 2284 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2269 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2285 var path = (req.url).path; | 2270 var path = (req.url).path; |
| 2286 var pathOffset = 0; | 2271 var pathOffset = 0; |
| 2287 var index; | 2272 var index; |
| 2288 var subPart; | 2273 var subPart; |
| 2289 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2274 unittest.expect( |
| 2275 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2290 pathOffset += 1; | 2276 pathOffset += 1; |
| 2291 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2277 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2278 unittest.equals("sql/v1beta4/")); |
| 2292 pathOffset += 12; | 2279 pathOffset += 12; |
| 2293 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2280 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2281 unittest.equals("projects/")); |
| 2294 pathOffset += 9; | 2282 pathOffset += 9; |
| 2295 index = path.indexOf("/instances/", pathOffset); | 2283 index = path.indexOf("/instances/", pathOffset); |
| 2296 unittest.expect(index >= 0, unittest.isTrue); | 2284 unittest.expect(index >= 0, unittest.isTrue); |
| 2297 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2285 subPart = |
| 2286 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2298 pathOffset = index; | 2287 pathOffset = index; |
| 2299 unittest.expect(subPart, unittest.equals("$arg_project")); | 2288 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2300 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2289 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2290 unittest.equals("/instances/")); |
| 2301 pathOffset += 11; | 2291 pathOffset += 11; |
| 2302 index = path.indexOf("/backupRuns", pathOffset); | 2292 index = path.indexOf("/backupRuns", pathOffset); |
| 2303 unittest.expect(index >= 0, unittest.isTrue); | 2293 unittest.expect(index >= 0, unittest.isTrue); |
| 2304 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2294 subPart = |
| 2295 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2305 pathOffset = index; | 2296 pathOffset = index; |
| 2306 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2297 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2307 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/backupRuns")); | 2298 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2299 unittest.equals("/backupRuns")); |
| 2308 pathOffset += 11; | 2300 pathOffset += 11; |
| 2309 | 2301 |
| 2310 var query = (req.url).query; | 2302 var query = (req.url).query; |
| 2311 var queryOffset = 0; | 2303 var queryOffset = 0; |
| 2312 var queryMap = {}; | 2304 var queryMap = {}; |
| 2313 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2305 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2314 parseBool(n) { | 2306 parseBool(n) { |
| 2315 if (n == "true") return true; | 2307 if (n == "true") return true; |
| 2316 if (n == "false") return false; | 2308 if (n == "false") return false; |
| 2317 if (n == null) return null; | 2309 if (n == null) return null; |
| 2318 throw new core.ArgumentError("Invalid boolean: $n"); | 2310 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2319 } | 2311 } |
| 2312 |
| 2320 if (query.length > 0) { | 2313 if (query.length > 0) { |
| 2321 for (var part in query.split("&")) { | 2314 for (var part in query.split("&")) { |
| 2322 var keyvalue = part.split("="); | 2315 var keyvalue = part.split("="); |
| 2323 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2316 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2317 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2324 } | 2318 } |
| 2325 } | 2319 } |
| 2326 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 2320 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 2327 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2321 unittest.equals(arg_maxResults)); |
| 2328 | 2322 unittest.expect( |
| 2323 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 2329 | 2324 |
| 2330 var h = { | 2325 var h = { |
| 2331 "content-type" : "application/json; charset=utf-8", | 2326 "content-type": "application/json; charset=utf-8", |
| 2332 }; | 2327 }; |
| 2333 var resp = convert.JSON.encode(buildBackupRunsListResponse()); | 2328 var resp = convert.JSON.encode(buildBackupRunsListResponse()); |
| 2334 return new async.Future.value(stringResponse(200, h, resp)); | 2329 return new async.Future.value(stringResponse(200, h, resp)); |
| 2335 }), true); | 2330 }), true); |
| 2336 res.list(arg_project, arg_instance, maxResults: arg_maxResults, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.BackupRunsListResponse response
) { | 2331 res |
| 2332 .list(arg_project, arg_instance, |
| 2333 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 2334 .then(unittest.expectAsync1(((api.BackupRunsListResponse response) { |
| 2337 checkBackupRunsListResponse(response); | 2335 checkBackupRunsListResponse(response); |
| 2338 }))); | 2336 }))); |
| 2339 }); | 2337 }); |
| 2340 | |
| 2341 }); | 2338 }); |
| 2342 | 2339 |
| 2343 | |
| 2344 unittest.group("resource-DatabasesResourceApi", () { | 2340 unittest.group("resource-DatabasesResourceApi", () { |
| 2345 unittest.test("method--delete", () { | 2341 unittest.test("method--delete", () { |
| 2346 | |
| 2347 var mock = new HttpServerMock(); | 2342 var mock = new HttpServerMock(); |
| 2348 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2343 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2349 var arg_project = "foo"; | 2344 var arg_project = "foo"; |
| 2350 var arg_instance = "foo"; | 2345 var arg_instance = "foo"; |
| 2351 var arg_database = "foo"; | 2346 var arg_database = "foo"; |
| 2352 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2347 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2353 var path = (req.url).path; | 2348 var path = (req.url).path; |
| 2354 var pathOffset = 0; | 2349 var pathOffset = 0; |
| 2355 var index; | 2350 var index; |
| 2356 var subPart; | 2351 var subPart; |
| 2357 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2352 unittest.expect( |
| 2353 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2358 pathOffset += 1; | 2354 pathOffset += 1; |
| 2359 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2355 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2356 unittest.equals("sql/v1beta4/")); |
| 2360 pathOffset += 12; | 2357 pathOffset += 12; |
| 2361 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2358 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2359 unittest.equals("projects/")); |
| 2362 pathOffset += 9; | 2360 pathOffset += 9; |
| 2363 index = path.indexOf("/instances/", pathOffset); | 2361 index = path.indexOf("/instances/", pathOffset); |
| 2364 unittest.expect(index >= 0, unittest.isTrue); | 2362 unittest.expect(index >= 0, unittest.isTrue); |
| 2365 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2363 subPart = |
| 2364 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2366 pathOffset = index; | 2365 pathOffset = index; |
| 2367 unittest.expect(subPart, unittest.equals("$arg_project")); | 2366 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2368 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2367 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2368 unittest.equals("/instances/")); |
| 2369 pathOffset += 11; | 2369 pathOffset += 11; |
| 2370 index = path.indexOf("/databases/", pathOffset); | 2370 index = path.indexOf("/databases/", pathOffset); |
| 2371 unittest.expect(index >= 0, unittest.isTrue); | 2371 unittest.expect(index >= 0, unittest.isTrue); |
| 2372 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2372 subPart = |
| 2373 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2373 pathOffset = index; | 2374 pathOffset = index; |
| 2374 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2375 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2375 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/databases/")); | 2376 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2377 unittest.equals("/databases/")); |
| 2376 pathOffset += 11; | 2378 pathOffset += 11; |
| 2377 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2379 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2378 pathOffset = path.length; | 2380 pathOffset = path.length; |
| 2379 unittest.expect(subPart, unittest.equals("$arg_database")); | 2381 unittest.expect(subPart, unittest.equals("$arg_database")); |
| 2380 | 2382 |
| 2381 var query = (req.url).query; | 2383 var query = (req.url).query; |
| 2382 var queryOffset = 0; | 2384 var queryOffset = 0; |
| 2383 var queryMap = {}; | 2385 var queryMap = {}; |
| 2384 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2386 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2385 parseBool(n) { | 2387 parseBool(n) { |
| 2386 if (n == "true") return true; | 2388 if (n == "true") return true; |
| 2387 if (n == "false") return false; | 2389 if (n == "false") return false; |
| 2388 if (n == null) return null; | 2390 if (n == null) return null; |
| 2389 throw new core.ArgumentError("Invalid boolean: $n"); | 2391 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2390 } | 2392 } |
| 2393 |
| 2391 if (query.length > 0) { | 2394 if (query.length > 0) { |
| 2392 for (var part in query.split("&")) { | 2395 for (var part in query.split("&")) { |
| 2393 var keyvalue = part.split("="); | 2396 var keyvalue = part.split("="); |
| 2394 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2397 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2398 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2395 } | 2399 } |
| 2396 } | 2400 } |
| 2397 | 2401 |
| 2398 | |
| 2399 var h = { | 2402 var h = { |
| 2400 "content-type" : "application/json; charset=utf-8", | 2403 "content-type": "application/json; charset=utf-8", |
| 2401 }; | 2404 }; |
| 2402 var resp = convert.JSON.encode(buildOperation()); | 2405 var resp = convert.JSON.encode(buildOperation()); |
| 2403 return new async.Future.value(stringResponse(200, h, resp)); | 2406 return new async.Future.value(stringResponse(200, h, resp)); |
| 2404 }), true); | 2407 }), true); |
| 2405 res.delete(arg_project, arg_instance, arg_database).then(unittest.expectAs
ync1(((api.Operation response) { | 2408 res |
| 2409 .delete(arg_project, arg_instance, arg_database) |
| 2410 .then(unittest.expectAsync1(((api.Operation response) { |
| 2406 checkOperation(response); | 2411 checkOperation(response); |
| 2407 }))); | 2412 }))); |
| 2408 }); | 2413 }); |
| 2409 | 2414 |
| 2410 unittest.test("method--get", () { | 2415 unittest.test("method--get", () { |
| 2411 | |
| 2412 var mock = new HttpServerMock(); | 2416 var mock = new HttpServerMock(); |
| 2413 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2417 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2414 var arg_project = "foo"; | 2418 var arg_project = "foo"; |
| 2415 var arg_instance = "foo"; | 2419 var arg_instance = "foo"; |
| 2416 var arg_database = "foo"; | 2420 var arg_database = "foo"; |
| 2417 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2421 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2418 var path = (req.url).path; | 2422 var path = (req.url).path; |
| 2419 var pathOffset = 0; | 2423 var pathOffset = 0; |
| 2420 var index; | 2424 var index; |
| 2421 var subPart; | 2425 var subPart; |
| 2422 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2426 unittest.expect( |
| 2427 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2423 pathOffset += 1; | 2428 pathOffset += 1; |
| 2424 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2429 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2430 unittest.equals("sql/v1beta4/")); |
| 2425 pathOffset += 12; | 2431 pathOffset += 12; |
| 2426 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2432 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2433 unittest.equals("projects/")); |
| 2427 pathOffset += 9; | 2434 pathOffset += 9; |
| 2428 index = path.indexOf("/instances/", pathOffset); | 2435 index = path.indexOf("/instances/", pathOffset); |
| 2429 unittest.expect(index >= 0, unittest.isTrue); | 2436 unittest.expect(index >= 0, unittest.isTrue); |
| 2430 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2437 subPart = |
| 2438 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2431 pathOffset = index; | 2439 pathOffset = index; |
| 2432 unittest.expect(subPart, unittest.equals("$arg_project")); | 2440 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2433 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2441 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2442 unittest.equals("/instances/")); |
| 2434 pathOffset += 11; | 2443 pathOffset += 11; |
| 2435 index = path.indexOf("/databases/", pathOffset); | 2444 index = path.indexOf("/databases/", pathOffset); |
| 2436 unittest.expect(index >= 0, unittest.isTrue); | 2445 unittest.expect(index >= 0, unittest.isTrue); |
| 2437 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2446 subPart = |
| 2447 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2438 pathOffset = index; | 2448 pathOffset = index; |
| 2439 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2449 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2440 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/databases/")); | 2450 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2451 unittest.equals("/databases/")); |
| 2441 pathOffset += 11; | 2452 pathOffset += 11; |
| 2442 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2453 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2443 pathOffset = path.length; | 2454 pathOffset = path.length; |
| 2444 unittest.expect(subPart, unittest.equals("$arg_database")); | 2455 unittest.expect(subPart, unittest.equals("$arg_database")); |
| 2445 | 2456 |
| 2446 var query = (req.url).query; | 2457 var query = (req.url).query; |
| 2447 var queryOffset = 0; | 2458 var queryOffset = 0; |
| 2448 var queryMap = {}; | 2459 var queryMap = {}; |
| 2449 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2450 parseBool(n) { | 2461 parseBool(n) { |
| 2451 if (n == "true") return true; | 2462 if (n == "true") return true; |
| 2452 if (n == "false") return false; | 2463 if (n == "false") return false; |
| 2453 if (n == null) return null; | 2464 if (n == null) return null; |
| 2454 throw new core.ArgumentError("Invalid boolean: $n"); | 2465 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2455 } | 2466 } |
| 2467 |
| 2456 if (query.length > 0) { | 2468 if (query.length > 0) { |
| 2457 for (var part in query.split("&")) { | 2469 for (var part in query.split("&")) { |
| 2458 var keyvalue = part.split("="); | 2470 var keyvalue = part.split("="); |
| 2459 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2471 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2472 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2460 } | 2473 } |
| 2461 } | 2474 } |
| 2462 | 2475 |
| 2463 | |
| 2464 var h = { | 2476 var h = { |
| 2465 "content-type" : "application/json; charset=utf-8", | 2477 "content-type": "application/json; charset=utf-8", |
| 2466 }; | 2478 }; |
| 2467 var resp = convert.JSON.encode(buildDatabase()); | 2479 var resp = convert.JSON.encode(buildDatabase()); |
| 2468 return new async.Future.value(stringResponse(200, h, resp)); | 2480 return new async.Future.value(stringResponse(200, h, resp)); |
| 2469 }), true); | 2481 }), true); |
| 2470 res.get(arg_project, arg_instance, arg_database).then(unittest.expectAsync
1(((api.Database response) { | 2482 res |
| 2483 .get(arg_project, arg_instance, arg_database) |
| 2484 .then(unittest.expectAsync1(((api.Database response) { |
| 2471 checkDatabase(response); | 2485 checkDatabase(response); |
| 2472 }))); | 2486 }))); |
| 2473 }); | 2487 }); |
| 2474 | 2488 |
| 2475 unittest.test("method--insert", () { | 2489 unittest.test("method--insert", () { |
| 2476 | |
| 2477 var mock = new HttpServerMock(); | 2490 var mock = new HttpServerMock(); |
| 2478 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2491 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2479 var arg_request = buildDatabase(); | 2492 var arg_request = buildDatabase(); |
| 2480 var arg_project = "foo"; | 2493 var arg_project = "foo"; |
| 2481 var arg_instance = "foo"; | 2494 var arg_instance = "foo"; |
| 2482 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2495 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2483 var obj = new api.Database.fromJson(json); | 2496 var obj = new api.Database.fromJson(json); |
| 2484 checkDatabase(obj); | 2497 checkDatabase(obj); |
| 2485 | 2498 |
| 2486 var path = (req.url).path; | 2499 var path = (req.url).path; |
| 2487 var pathOffset = 0; | 2500 var pathOffset = 0; |
| 2488 var index; | 2501 var index; |
| 2489 var subPart; | 2502 var subPart; |
| 2490 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2503 unittest.expect( |
| 2504 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2491 pathOffset += 1; | 2505 pathOffset += 1; |
| 2492 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2506 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2507 unittest.equals("sql/v1beta4/")); |
| 2493 pathOffset += 12; | 2508 pathOffset += 12; |
| 2494 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2509 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2510 unittest.equals("projects/")); |
| 2495 pathOffset += 9; | 2511 pathOffset += 9; |
| 2496 index = path.indexOf("/instances/", pathOffset); | 2512 index = path.indexOf("/instances/", pathOffset); |
| 2497 unittest.expect(index >= 0, unittest.isTrue); | 2513 unittest.expect(index >= 0, unittest.isTrue); |
| 2498 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2514 subPart = |
| 2515 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2499 pathOffset = index; | 2516 pathOffset = index; |
| 2500 unittest.expect(subPart, unittest.equals("$arg_project")); | 2517 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2501 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2518 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2519 unittest.equals("/instances/")); |
| 2502 pathOffset += 11; | 2520 pathOffset += 11; |
| 2503 index = path.indexOf("/databases", pathOffset); | 2521 index = path.indexOf("/databases", pathOffset); |
| 2504 unittest.expect(index >= 0, unittest.isTrue); | 2522 unittest.expect(index >= 0, unittest.isTrue); |
| 2505 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2523 subPart = |
| 2524 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2506 pathOffset = index; | 2525 pathOffset = index; |
| 2507 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2526 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2508 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/databases")); | 2527 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2528 unittest.equals("/databases")); |
| 2509 pathOffset += 10; | 2529 pathOffset += 10; |
| 2510 | 2530 |
| 2511 var query = (req.url).query; | 2531 var query = (req.url).query; |
| 2512 var queryOffset = 0; | 2532 var queryOffset = 0; |
| 2513 var queryMap = {}; | 2533 var queryMap = {}; |
| 2514 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2534 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2515 parseBool(n) { | 2535 parseBool(n) { |
| 2516 if (n == "true") return true; | 2536 if (n == "true") return true; |
| 2517 if (n == "false") return false; | 2537 if (n == "false") return false; |
| 2518 if (n == null) return null; | 2538 if (n == null) return null; |
| 2519 throw new core.ArgumentError("Invalid boolean: $n"); | 2539 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2520 } | 2540 } |
| 2541 |
| 2521 if (query.length > 0) { | 2542 if (query.length > 0) { |
| 2522 for (var part in query.split("&")) { | 2543 for (var part in query.split("&")) { |
| 2523 var keyvalue = part.split("="); | 2544 var keyvalue = part.split("="); |
| 2524 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2545 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2546 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2525 } | 2547 } |
| 2526 } | 2548 } |
| 2527 | 2549 |
| 2528 | |
| 2529 var h = { | 2550 var h = { |
| 2530 "content-type" : "application/json; charset=utf-8", | 2551 "content-type": "application/json; charset=utf-8", |
| 2531 }; | 2552 }; |
| 2532 var resp = convert.JSON.encode(buildOperation()); | 2553 var resp = convert.JSON.encode(buildOperation()); |
| 2533 return new async.Future.value(stringResponse(200, h, resp)); | 2554 return new async.Future.value(stringResponse(200, h, resp)); |
| 2534 }), true); | 2555 }), true); |
| 2535 res.insert(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 2556 res |
| 2557 .insert(arg_request, arg_project, arg_instance) |
| 2558 .then(unittest.expectAsync1(((api.Operation response) { |
| 2536 checkOperation(response); | 2559 checkOperation(response); |
| 2537 }))); | 2560 }))); |
| 2538 }); | 2561 }); |
| 2539 | 2562 |
| 2540 unittest.test("method--list", () { | 2563 unittest.test("method--list", () { |
| 2541 | |
| 2542 var mock = new HttpServerMock(); | 2564 var mock = new HttpServerMock(); |
| 2543 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2565 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2544 var arg_project = "foo"; | 2566 var arg_project = "foo"; |
| 2545 var arg_instance = "foo"; | 2567 var arg_instance = "foo"; |
| 2546 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2568 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2547 var path = (req.url).path; | 2569 var path = (req.url).path; |
| 2548 var pathOffset = 0; | 2570 var pathOffset = 0; |
| 2549 var index; | 2571 var index; |
| 2550 var subPart; | 2572 var subPart; |
| 2551 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2573 unittest.expect( |
| 2574 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2552 pathOffset += 1; | 2575 pathOffset += 1; |
| 2553 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2576 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2577 unittest.equals("sql/v1beta4/")); |
| 2554 pathOffset += 12; | 2578 pathOffset += 12; |
| 2555 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2579 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2580 unittest.equals("projects/")); |
| 2556 pathOffset += 9; | 2581 pathOffset += 9; |
| 2557 index = path.indexOf("/instances/", pathOffset); | 2582 index = path.indexOf("/instances/", pathOffset); |
| 2558 unittest.expect(index >= 0, unittest.isTrue); | 2583 unittest.expect(index >= 0, unittest.isTrue); |
| 2559 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2584 subPart = |
| 2585 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2560 pathOffset = index; | 2586 pathOffset = index; |
| 2561 unittest.expect(subPart, unittest.equals("$arg_project")); | 2587 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2562 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2588 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2589 unittest.equals("/instances/")); |
| 2563 pathOffset += 11; | 2590 pathOffset += 11; |
| 2564 index = path.indexOf("/databases", pathOffset); | 2591 index = path.indexOf("/databases", pathOffset); |
| 2565 unittest.expect(index >= 0, unittest.isTrue); | 2592 unittest.expect(index >= 0, unittest.isTrue); |
| 2566 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2593 subPart = |
| 2594 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2567 pathOffset = index; | 2595 pathOffset = index; |
| 2568 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2596 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2569 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/databases")); | 2597 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2598 unittest.equals("/databases")); |
| 2570 pathOffset += 10; | 2599 pathOffset += 10; |
| 2571 | 2600 |
| 2572 var query = (req.url).query; | 2601 var query = (req.url).query; |
| 2573 var queryOffset = 0; | 2602 var queryOffset = 0; |
| 2574 var queryMap = {}; | 2603 var queryMap = {}; |
| 2575 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2604 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2576 parseBool(n) { | 2605 parseBool(n) { |
| 2577 if (n == "true") return true; | 2606 if (n == "true") return true; |
| 2578 if (n == "false") return false; | 2607 if (n == "false") return false; |
| 2579 if (n == null) return null; | 2608 if (n == null) return null; |
| 2580 throw new core.ArgumentError("Invalid boolean: $n"); | 2609 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2581 } | 2610 } |
| 2611 |
| 2582 if (query.length > 0) { | 2612 if (query.length > 0) { |
| 2583 for (var part in query.split("&")) { | 2613 for (var part in query.split("&")) { |
| 2584 var keyvalue = part.split("="); | 2614 var keyvalue = part.split("="); |
| 2585 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2615 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2616 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2586 } | 2617 } |
| 2587 } | 2618 } |
| 2588 | 2619 |
| 2589 | |
| 2590 var h = { | 2620 var h = { |
| 2591 "content-type" : "application/json; charset=utf-8", | 2621 "content-type": "application/json; charset=utf-8", |
| 2592 }; | 2622 }; |
| 2593 var resp = convert.JSON.encode(buildDatabasesListResponse()); | 2623 var resp = convert.JSON.encode(buildDatabasesListResponse()); |
| 2594 return new async.Future.value(stringResponse(200, h, resp)); | 2624 return new async.Future.value(stringResponse(200, h, resp)); |
| 2595 }), true); | 2625 }), true); |
| 2596 res.list(arg_project, arg_instance).then(unittest.expectAsync1(((api.Datab
asesListResponse response) { | 2626 res |
| 2627 .list(arg_project, arg_instance) |
| 2628 .then(unittest.expectAsync1(((api.DatabasesListResponse response) { |
| 2597 checkDatabasesListResponse(response); | 2629 checkDatabasesListResponse(response); |
| 2598 }))); | 2630 }))); |
| 2599 }); | 2631 }); |
| 2600 | 2632 |
| 2601 unittest.test("method--patch", () { | 2633 unittest.test("method--patch", () { |
| 2602 | |
| 2603 var mock = new HttpServerMock(); | 2634 var mock = new HttpServerMock(); |
| 2604 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2635 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2605 var arg_request = buildDatabase(); | 2636 var arg_request = buildDatabase(); |
| 2606 var arg_project = "foo"; | 2637 var arg_project = "foo"; |
| 2607 var arg_instance = "foo"; | 2638 var arg_instance = "foo"; |
| 2608 var arg_database = "foo"; | 2639 var arg_database = "foo"; |
| 2609 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2640 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2610 var obj = new api.Database.fromJson(json); | 2641 var obj = new api.Database.fromJson(json); |
| 2611 checkDatabase(obj); | 2642 checkDatabase(obj); |
| 2612 | 2643 |
| 2613 var path = (req.url).path; | 2644 var path = (req.url).path; |
| 2614 var pathOffset = 0; | 2645 var pathOffset = 0; |
| 2615 var index; | 2646 var index; |
| 2616 var subPart; | 2647 var subPart; |
| 2617 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2648 unittest.expect( |
| 2649 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2618 pathOffset += 1; | 2650 pathOffset += 1; |
| 2619 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2651 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2652 unittest.equals("sql/v1beta4/")); |
| 2620 pathOffset += 12; | 2653 pathOffset += 12; |
| 2621 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2654 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2655 unittest.equals("projects/")); |
| 2622 pathOffset += 9; | 2656 pathOffset += 9; |
| 2623 index = path.indexOf("/instances/", pathOffset); | 2657 index = path.indexOf("/instances/", pathOffset); |
| 2624 unittest.expect(index >= 0, unittest.isTrue); | 2658 unittest.expect(index >= 0, unittest.isTrue); |
| 2625 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2659 subPart = |
| 2660 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2626 pathOffset = index; | 2661 pathOffset = index; |
| 2627 unittest.expect(subPart, unittest.equals("$arg_project")); | 2662 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2628 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2663 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2664 unittest.equals("/instances/")); |
| 2629 pathOffset += 11; | 2665 pathOffset += 11; |
| 2630 index = path.indexOf("/databases/", pathOffset); | 2666 index = path.indexOf("/databases/", pathOffset); |
| 2631 unittest.expect(index >= 0, unittest.isTrue); | 2667 unittest.expect(index >= 0, unittest.isTrue); |
| 2632 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2668 subPart = |
| 2669 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2633 pathOffset = index; | 2670 pathOffset = index; |
| 2634 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2671 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2635 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/databases/")); | 2672 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2673 unittest.equals("/databases/")); |
| 2636 pathOffset += 11; | 2674 pathOffset += 11; |
| 2637 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2675 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2638 pathOffset = path.length; | 2676 pathOffset = path.length; |
| 2639 unittest.expect(subPart, unittest.equals("$arg_database")); | 2677 unittest.expect(subPart, unittest.equals("$arg_database")); |
| 2640 | 2678 |
| 2641 var query = (req.url).query; | 2679 var query = (req.url).query; |
| 2642 var queryOffset = 0; | 2680 var queryOffset = 0; |
| 2643 var queryMap = {}; | 2681 var queryMap = {}; |
| 2644 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2682 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2645 parseBool(n) { | 2683 parseBool(n) { |
| 2646 if (n == "true") return true; | 2684 if (n == "true") return true; |
| 2647 if (n == "false") return false; | 2685 if (n == "false") return false; |
| 2648 if (n == null) return null; | 2686 if (n == null) return null; |
| 2649 throw new core.ArgumentError("Invalid boolean: $n"); | 2687 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2650 } | 2688 } |
| 2689 |
| 2651 if (query.length > 0) { | 2690 if (query.length > 0) { |
| 2652 for (var part in query.split("&")) { | 2691 for (var part in query.split("&")) { |
| 2653 var keyvalue = part.split("="); | 2692 var keyvalue = part.split("="); |
| 2654 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2694 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2655 } | 2695 } |
| 2656 } | 2696 } |
| 2657 | 2697 |
| 2658 | |
| 2659 var h = { | 2698 var h = { |
| 2660 "content-type" : "application/json; charset=utf-8", | 2699 "content-type": "application/json; charset=utf-8", |
| 2661 }; | 2700 }; |
| 2662 var resp = convert.JSON.encode(buildOperation()); | 2701 var resp = convert.JSON.encode(buildOperation()); |
| 2663 return new async.Future.value(stringResponse(200, h, resp)); | 2702 return new async.Future.value(stringResponse(200, h, resp)); |
| 2664 }), true); | 2703 }), true); |
| 2665 res.patch(arg_request, arg_project, arg_instance, arg_database).then(unitt
est.expectAsync1(((api.Operation response) { | 2704 res |
| 2705 .patch(arg_request, arg_project, arg_instance, arg_database) |
| 2706 .then(unittest.expectAsync1(((api.Operation response) { |
| 2666 checkOperation(response); | 2707 checkOperation(response); |
| 2667 }))); | 2708 }))); |
| 2668 }); | 2709 }); |
| 2669 | 2710 |
| 2670 unittest.test("method--update", () { | 2711 unittest.test("method--update", () { |
| 2671 | |
| 2672 var mock = new HttpServerMock(); | 2712 var mock = new HttpServerMock(); |
| 2673 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; | 2713 api.DatabasesResourceApi res = new api.SqladminApi(mock).databases; |
| 2674 var arg_request = buildDatabase(); | 2714 var arg_request = buildDatabase(); |
| 2675 var arg_project = "foo"; | 2715 var arg_project = "foo"; |
| 2676 var arg_instance = "foo"; | 2716 var arg_instance = "foo"; |
| 2677 var arg_database = "foo"; | 2717 var arg_database = "foo"; |
| 2678 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2718 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2679 var obj = new api.Database.fromJson(json); | 2719 var obj = new api.Database.fromJson(json); |
| 2680 checkDatabase(obj); | 2720 checkDatabase(obj); |
| 2681 | 2721 |
| 2682 var path = (req.url).path; | 2722 var path = (req.url).path; |
| 2683 var pathOffset = 0; | 2723 var pathOffset = 0; |
| 2684 var index; | 2724 var index; |
| 2685 var subPart; | 2725 var subPart; |
| 2686 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2726 unittest.expect( |
| 2727 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2687 pathOffset += 1; | 2728 pathOffset += 1; |
| 2688 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2729 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2730 unittest.equals("sql/v1beta4/")); |
| 2689 pathOffset += 12; | 2731 pathOffset += 12; |
| 2690 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2732 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2733 unittest.equals("projects/")); |
| 2691 pathOffset += 9; | 2734 pathOffset += 9; |
| 2692 index = path.indexOf("/instances/", pathOffset); | 2735 index = path.indexOf("/instances/", pathOffset); |
| 2693 unittest.expect(index >= 0, unittest.isTrue); | 2736 unittest.expect(index >= 0, unittest.isTrue); |
| 2694 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2737 subPart = |
| 2738 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2695 pathOffset = index; | 2739 pathOffset = index; |
| 2696 unittest.expect(subPart, unittest.equals("$arg_project")); | 2740 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2697 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2741 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2742 unittest.equals("/instances/")); |
| 2698 pathOffset += 11; | 2743 pathOffset += 11; |
| 2699 index = path.indexOf("/databases/", pathOffset); | 2744 index = path.indexOf("/databases/", pathOffset); |
| 2700 unittest.expect(index >= 0, unittest.isTrue); | 2745 unittest.expect(index >= 0, unittest.isTrue); |
| 2701 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2746 subPart = |
| 2747 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2702 pathOffset = index; | 2748 pathOffset = index; |
| 2703 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2749 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2704 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/databases/")); | 2750 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2751 unittest.equals("/databases/")); |
| 2705 pathOffset += 11; | 2752 pathOffset += 11; |
| 2706 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2753 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2707 pathOffset = path.length; | 2754 pathOffset = path.length; |
| 2708 unittest.expect(subPart, unittest.equals("$arg_database")); | 2755 unittest.expect(subPart, unittest.equals("$arg_database")); |
| 2709 | 2756 |
| 2710 var query = (req.url).query; | 2757 var query = (req.url).query; |
| 2711 var queryOffset = 0; | 2758 var queryOffset = 0; |
| 2712 var queryMap = {}; | 2759 var queryMap = {}; |
| 2713 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2760 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2714 parseBool(n) { | 2761 parseBool(n) { |
| 2715 if (n == "true") return true; | 2762 if (n == "true") return true; |
| 2716 if (n == "false") return false; | 2763 if (n == "false") return false; |
| 2717 if (n == null) return null; | 2764 if (n == null) return null; |
| 2718 throw new core.ArgumentError("Invalid boolean: $n"); | 2765 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2719 } | 2766 } |
| 2767 |
| 2720 if (query.length > 0) { | 2768 if (query.length > 0) { |
| 2721 for (var part in query.split("&")) { | 2769 for (var part in query.split("&")) { |
| 2722 var keyvalue = part.split("="); | 2770 var keyvalue = part.split("="); |
| 2723 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2771 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2772 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2724 } | 2773 } |
| 2725 } | 2774 } |
| 2726 | 2775 |
| 2727 | |
| 2728 var h = { | 2776 var h = { |
| 2729 "content-type" : "application/json; charset=utf-8", | 2777 "content-type": "application/json; charset=utf-8", |
| 2730 }; | 2778 }; |
| 2731 var resp = convert.JSON.encode(buildOperation()); | 2779 var resp = convert.JSON.encode(buildOperation()); |
| 2732 return new async.Future.value(stringResponse(200, h, resp)); | 2780 return new async.Future.value(stringResponse(200, h, resp)); |
| 2733 }), true); | 2781 }), true); |
| 2734 res.update(arg_request, arg_project, arg_instance, arg_database).then(unit
test.expectAsync1(((api.Operation response) { | 2782 res |
| 2783 .update(arg_request, arg_project, arg_instance, arg_database) |
| 2784 .then(unittest.expectAsync1(((api.Operation response) { |
| 2735 checkOperation(response); | 2785 checkOperation(response); |
| 2736 }))); | 2786 }))); |
| 2737 }); | 2787 }); |
| 2738 | |
| 2739 }); | 2788 }); |
| 2740 | 2789 |
| 2741 | |
| 2742 unittest.group("resource-FlagsResourceApi", () { | 2790 unittest.group("resource-FlagsResourceApi", () { |
| 2743 unittest.test("method--list", () { | 2791 unittest.test("method--list", () { |
| 2744 | |
| 2745 var mock = new HttpServerMock(); | 2792 var mock = new HttpServerMock(); |
| 2746 api.FlagsResourceApi res = new api.SqladminApi(mock).flags; | 2793 api.FlagsResourceApi res = new api.SqladminApi(mock).flags; |
| 2747 var arg_databaseVersion = "foo"; | 2794 var arg_databaseVersion = "foo"; |
| 2748 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2795 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2749 var path = (req.url).path; | 2796 var path = (req.url).path; |
| 2750 var pathOffset = 0; | 2797 var pathOffset = 0; |
| 2751 var index; | 2798 var index; |
| 2752 var subPart; | 2799 var subPart; |
| 2753 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2800 unittest.expect( |
| 2801 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2754 pathOffset += 1; | 2802 pathOffset += 1; |
| 2755 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2803 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2804 unittest.equals("sql/v1beta4/")); |
| 2756 pathOffset += 12; | 2805 pathOffset += 12; |
| 2757 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("flags")); | 2806 unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| 2807 unittest.equals("flags")); |
| 2758 pathOffset += 5; | 2808 pathOffset += 5; |
| 2759 | 2809 |
| 2760 var query = (req.url).query; | 2810 var query = (req.url).query; |
| 2761 var queryOffset = 0; | 2811 var queryOffset = 0; |
| 2762 var queryMap = {}; | 2812 var queryMap = {}; |
| 2763 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2813 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2764 parseBool(n) { | 2814 parseBool(n) { |
| 2765 if (n == "true") return true; | 2815 if (n == "true") return true; |
| 2766 if (n == "false") return false; | 2816 if (n == "false") return false; |
| 2767 if (n == null) return null; | 2817 if (n == null) return null; |
| 2768 throw new core.ArgumentError("Invalid boolean: $n"); | 2818 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2769 } | 2819 } |
| 2820 |
| 2770 if (query.length > 0) { | 2821 if (query.length > 0) { |
| 2771 for (var part in query.split("&")) { | 2822 for (var part in query.split("&")) { |
| 2772 var keyvalue = part.split("="); | 2823 var keyvalue = part.split("="); |
| 2773 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2824 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2825 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2774 } | 2826 } |
| 2775 } | 2827 } |
| 2776 unittest.expect(queryMap["databaseVersion"].first, unittest.equals(arg_d
atabaseVersion)); | 2828 unittest.expect(queryMap["databaseVersion"].first, |
| 2777 | 2829 unittest.equals(arg_databaseVersion)); |
| 2778 | 2830 |
| 2779 var h = { | 2831 var h = { |
| 2780 "content-type" : "application/json; charset=utf-8", | 2832 "content-type": "application/json; charset=utf-8", |
| 2781 }; | 2833 }; |
| 2782 var resp = convert.JSON.encode(buildFlagsListResponse()); | 2834 var resp = convert.JSON.encode(buildFlagsListResponse()); |
| 2783 return new async.Future.value(stringResponse(200, h, resp)); | 2835 return new async.Future.value(stringResponse(200, h, resp)); |
| 2784 }), true); | 2836 }), true); |
| 2785 res.list(databaseVersion: arg_databaseVersion).then(unittest.expectAsync1(
((api.FlagsListResponse response) { | 2837 res |
| 2838 .list(databaseVersion: arg_databaseVersion) |
| 2839 .then(unittest.expectAsync1(((api.FlagsListResponse response) { |
| 2786 checkFlagsListResponse(response); | 2840 checkFlagsListResponse(response); |
| 2787 }))); | 2841 }))); |
| 2788 }); | 2842 }); |
| 2789 | |
| 2790 }); | 2843 }); |
| 2791 | 2844 |
| 2792 | |
| 2793 unittest.group("resource-InstancesResourceApi", () { | 2845 unittest.group("resource-InstancesResourceApi", () { |
| 2794 unittest.test("method--clone", () { | 2846 unittest.test("method--clone", () { |
| 2795 | |
| 2796 var mock = new HttpServerMock(); | 2847 var mock = new HttpServerMock(); |
| 2797 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2848 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 2798 var arg_request = buildInstancesCloneRequest(); | 2849 var arg_request = buildInstancesCloneRequest(); |
| 2799 var arg_project = "foo"; | 2850 var arg_project = "foo"; |
| 2800 var arg_instance = "foo"; | 2851 var arg_instance = "foo"; |
| 2801 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2852 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2802 var obj = new api.InstancesCloneRequest.fromJson(json); | 2853 var obj = new api.InstancesCloneRequest.fromJson(json); |
| 2803 checkInstancesCloneRequest(obj); | 2854 checkInstancesCloneRequest(obj); |
| 2804 | 2855 |
| 2805 var path = (req.url).path; | 2856 var path = (req.url).path; |
| 2806 var pathOffset = 0; | 2857 var pathOffset = 0; |
| 2807 var index; | 2858 var index; |
| 2808 var subPart; | 2859 var subPart; |
| 2809 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2860 unittest.expect( |
| 2861 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2810 pathOffset += 1; | 2862 pathOffset += 1; |
| 2811 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2863 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2864 unittest.equals("sql/v1beta4/")); |
| 2812 pathOffset += 12; | 2865 pathOffset += 12; |
| 2813 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2866 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2867 unittest.equals("projects/")); |
| 2814 pathOffset += 9; | 2868 pathOffset += 9; |
| 2815 index = path.indexOf("/instances/", pathOffset); | 2869 index = path.indexOf("/instances/", pathOffset); |
| 2816 unittest.expect(index >= 0, unittest.isTrue); | 2870 unittest.expect(index >= 0, unittest.isTrue); |
| 2817 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2871 subPart = |
| 2872 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2818 pathOffset = index; | 2873 pathOffset = index; |
| 2819 unittest.expect(subPart, unittest.equals("$arg_project")); | 2874 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2820 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2875 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2876 unittest.equals("/instances/")); |
| 2821 pathOffset += 11; | 2877 pathOffset += 11; |
| 2822 index = path.indexOf("/clone", pathOffset); | 2878 index = path.indexOf("/clone", pathOffset); |
| 2823 unittest.expect(index >= 0, unittest.isTrue); | 2879 unittest.expect(index >= 0, unittest.isTrue); |
| 2824 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2880 subPart = |
| 2881 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2825 pathOffset = index; | 2882 pathOffset = index; |
| 2826 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2883 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2827 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/clone")); | 2884 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 2885 unittest.equals("/clone")); |
| 2828 pathOffset += 6; | 2886 pathOffset += 6; |
| 2829 | 2887 |
| 2830 var query = (req.url).query; | 2888 var query = (req.url).query; |
| 2831 var queryOffset = 0; | 2889 var queryOffset = 0; |
| 2832 var queryMap = {}; | 2890 var queryMap = {}; |
| 2833 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2891 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2834 parseBool(n) { | 2892 parseBool(n) { |
| 2835 if (n == "true") return true; | 2893 if (n == "true") return true; |
| 2836 if (n == "false") return false; | 2894 if (n == "false") return false; |
| 2837 if (n == null) return null; | 2895 if (n == null) return null; |
| 2838 throw new core.ArgumentError("Invalid boolean: $n"); | 2896 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2839 } | 2897 } |
| 2898 |
| 2840 if (query.length > 0) { | 2899 if (query.length > 0) { |
| 2841 for (var part in query.split("&")) { | 2900 for (var part in query.split("&")) { |
| 2842 var keyvalue = part.split("="); | 2901 var keyvalue = part.split("="); |
| 2843 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2902 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2903 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2844 } | 2904 } |
| 2845 } | 2905 } |
| 2846 | 2906 |
| 2847 | |
| 2848 var h = { | 2907 var h = { |
| 2849 "content-type" : "application/json; charset=utf-8", | 2908 "content-type": "application/json; charset=utf-8", |
| 2850 }; | 2909 }; |
| 2851 var resp = convert.JSON.encode(buildOperation()); | 2910 var resp = convert.JSON.encode(buildOperation()); |
| 2852 return new async.Future.value(stringResponse(200, h, resp)); | 2911 return new async.Future.value(stringResponse(200, h, resp)); |
| 2853 }), true); | 2912 }), true); |
| 2854 res.clone(arg_request, arg_project, arg_instance).then(unittest.expectAsyn
c1(((api.Operation response) { | 2913 res |
| 2914 .clone(arg_request, arg_project, arg_instance) |
| 2915 .then(unittest.expectAsync1(((api.Operation response) { |
| 2855 checkOperation(response); | 2916 checkOperation(response); |
| 2856 }))); | 2917 }))); |
| 2857 }); | 2918 }); |
| 2858 | 2919 |
| 2859 unittest.test("method--delete", () { | 2920 unittest.test("method--delete", () { |
| 2860 | |
| 2861 var mock = new HttpServerMock(); | 2921 var mock = new HttpServerMock(); |
| 2862 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2922 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 2863 var arg_project = "foo"; | 2923 var arg_project = "foo"; |
| 2864 var arg_instance = "foo"; | 2924 var arg_instance = "foo"; |
| 2865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2925 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2866 var path = (req.url).path; | 2926 var path = (req.url).path; |
| 2867 var pathOffset = 0; | 2927 var pathOffset = 0; |
| 2868 var index; | 2928 var index; |
| 2869 var subPart; | 2929 var subPart; |
| 2870 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2930 unittest.expect( |
| 2931 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2871 pathOffset += 1; | 2932 pathOffset += 1; |
| 2872 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 2933 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2934 unittest.equals("sql/v1beta4/")); |
| 2873 pathOffset += 12; | 2935 pathOffset += 12; |
| 2874 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2936 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2937 unittest.equals("projects/")); |
| 2875 pathOffset += 9; | 2938 pathOffset += 9; |
| 2876 index = path.indexOf("/instances/", pathOffset); | 2939 index = path.indexOf("/instances/", pathOffset); |
| 2877 unittest.expect(index >= 0, unittest.isTrue); | 2940 unittest.expect(index >= 0, unittest.isTrue); |
| 2878 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2941 subPart = |
| 2942 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2879 pathOffset = index; | 2943 pathOffset = index; |
| 2880 unittest.expect(subPart, unittest.equals("$arg_project")); | 2944 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2881 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2945 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2946 unittest.equals("/instances/")); |
| 2882 pathOffset += 11; | 2947 pathOffset += 11; |
| 2883 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2948 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2884 pathOffset = path.length; | 2949 pathOffset = path.length; |
| 2885 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2950 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2886 | 2951 |
| 2887 var query = (req.url).query; | 2952 var query = (req.url).query; |
| 2888 var queryOffset = 0; | 2953 var queryOffset = 0; |
| 2889 var queryMap = {}; | 2954 var queryMap = {}; |
| 2890 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2955 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2891 parseBool(n) { | 2956 parseBool(n) { |
| 2892 if (n == "true") return true; | 2957 if (n == "true") return true; |
| 2893 if (n == "false") return false; | 2958 if (n == "false") return false; |
| 2894 if (n == null) return null; | 2959 if (n == null) return null; |
| 2895 throw new core.ArgumentError("Invalid boolean: $n"); | 2960 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2896 } | 2961 } |
| 2962 |
| 2897 if (query.length > 0) { | 2963 if (query.length > 0) { |
| 2898 for (var part in query.split("&")) { | 2964 for (var part in query.split("&")) { |
| 2899 var keyvalue = part.split("="); | 2965 var keyvalue = part.split("="); |
| 2900 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2966 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2967 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2901 } | 2968 } |
| 2902 } | 2969 } |
| 2903 | 2970 |
| 2904 | |
| 2905 var h = { | 2971 var h = { |
| 2906 "content-type" : "application/json; charset=utf-8", | 2972 "content-type": "application/json; charset=utf-8", |
| 2907 }; | 2973 }; |
| 2908 var resp = convert.JSON.encode(buildOperation()); | 2974 var resp = convert.JSON.encode(buildOperation()); |
| 2909 return new async.Future.value(stringResponse(200, h, resp)); | 2975 return new async.Future.value(stringResponse(200, h, resp)); |
| 2910 }), true); | 2976 }), true); |
| 2911 res.delete(arg_project, arg_instance).then(unittest.expectAsync1(((api.Ope
ration response) { | 2977 res |
| 2978 .delete(arg_project, arg_instance) |
| 2979 .then(unittest.expectAsync1(((api.Operation response) { |
| 2912 checkOperation(response); | 2980 checkOperation(response); |
| 2913 }))); | 2981 }))); |
| 2914 }); | 2982 }); |
| 2915 | 2983 |
| 2916 unittest.test("method--export", () { | 2984 unittest.test("method--export", () { |
| 2917 | |
| 2918 var mock = new HttpServerMock(); | 2985 var mock = new HttpServerMock(); |
| 2919 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2986 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 2920 var arg_request = buildInstancesExportRequest(); | 2987 var arg_request = buildInstancesExportRequest(); |
| 2921 var arg_project = "foo"; | 2988 var arg_project = "foo"; |
| 2922 var arg_instance = "foo"; | 2989 var arg_instance = "foo"; |
| 2923 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2990 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2924 var obj = new api.InstancesExportRequest.fromJson(json); | 2991 var obj = new api.InstancesExportRequest.fromJson(json); |
| 2925 checkInstancesExportRequest(obj); | 2992 checkInstancesExportRequest(obj); |
| 2926 | 2993 |
| 2927 var path = (req.url).path; | 2994 var path = (req.url).path; |
| 2928 var pathOffset = 0; | 2995 var pathOffset = 0; |
| 2929 var index; | 2996 var index; |
| 2930 var subPart; | 2997 var subPart; |
| 2931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2998 unittest.expect( |
| 2999 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2932 pathOffset += 1; | 3000 pathOffset += 1; |
| 2933 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3001 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3002 unittest.equals("sql/v1beta4/")); |
| 2934 pathOffset += 12; | 3003 pathOffset += 12; |
| 2935 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3004 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3005 unittest.equals("projects/")); |
| 2936 pathOffset += 9; | 3006 pathOffset += 9; |
| 2937 index = path.indexOf("/instances/", pathOffset); | 3007 index = path.indexOf("/instances/", pathOffset); |
| 2938 unittest.expect(index >= 0, unittest.isTrue); | 3008 unittest.expect(index >= 0, unittest.isTrue); |
| 2939 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3009 subPart = |
| 3010 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2940 pathOffset = index; | 3011 pathOffset = index; |
| 2941 unittest.expect(subPart, unittest.equals("$arg_project")); | 3012 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 2942 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3013 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3014 unittest.equals("/instances/")); |
| 2943 pathOffset += 11; | 3015 pathOffset += 11; |
| 2944 index = path.indexOf("/export", pathOffset); | 3016 index = path.indexOf("/export", pathOffset); |
| 2945 unittest.expect(index >= 0, unittest.isTrue); | 3017 unittest.expect(index >= 0, unittest.isTrue); |
| 2946 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3018 subPart = |
| 3019 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2947 pathOffset = index; | 3020 pathOffset = index; |
| 2948 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3021 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 2949 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/export")); | 3022 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3023 unittest.equals("/export")); |
| 2950 pathOffset += 7; | 3024 pathOffset += 7; |
| 2951 | 3025 |
| 2952 var query = (req.url).query; | 3026 var query = (req.url).query; |
| 2953 var queryOffset = 0; | 3027 var queryOffset = 0; |
| 2954 var queryMap = {}; | 3028 var queryMap = {}; |
| 2955 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3029 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2956 parseBool(n) { | 3030 parseBool(n) { |
| 2957 if (n == "true") return true; | 3031 if (n == "true") return true; |
| 2958 if (n == "false") return false; | 3032 if (n == "false") return false; |
| 2959 if (n == null) return null; | 3033 if (n == null) return null; |
| 2960 throw new core.ArgumentError("Invalid boolean: $n"); | 3034 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2961 } | 3035 } |
| 3036 |
| 2962 if (query.length > 0) { | 3037 if (query.length > 0) { |
| 2963 for (var part in query.split("&")) { | 3038 for (var part in query.split("&")) { |
| 2964 var keyvalue = part.split("="); | 3039 var keyvalue = part.split("="); |
| 2965 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3040 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3041 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2966 } | 3042 } |
| 2967 } | 3043 } |
| 2968 | 3044 |
| 2969 | |
| 2970 var h = { | 3045 var h = { |
| 2971 "content-type" : "application/json; charset=utf-8", | 3046 "content-type": "application/json; charset=utf-8", |
| 2972 }; | 3047 }; |
| 2973 var resp = convert.JSON.encode(buildOperation()); | 3048 var resp = convert.JSON.encode(buildOperation()); |
| 2974 return new async.Future.value(stringResponse(200, h, resp)); | 3049 return new async.Future.value(stringResponse(200, h, resp)); |
| 2975 }), true); | 3050 }), true); |
| 2976 res.export(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 3051 res |
| 3052 .export(arg_request, arg_project, arg_instance) |
| 3053 .then(unittest.expectAsync1(((api.Operation response) { |
| 2977 checkOperation(response); | 3054 checkOperation(response); |
| 2978 }))); | 3055 }))); |
| 2979 }); | 3056 }); |
| 2980 | 3057 |
| 2981 unittest.test("method--failover", () { | 3058 unittest.test("method--failover", () { |
| 2982 | |
| 2983 var mock = new HttpServerMock(); | 3059 var mock = new HttpServerMock(); |
| 2984 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3060 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 2985 var arg_request = buildInstancesFailoverRequest(); | 3061 var arg_request = buildInstancesFailoverRequest(); |
| 2986 var arg_project = "foo"; | 3062 var arg_project = "foo"; |
| 2987 var arg_instance = "foo"; | 3063 var arg_instance = "foo"; |
| 2988 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3064 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2989 var obj = new api.InstancesFailoverRequest.fromJson(json); | 3065 var obj = new api.InstancesFailoverRequest.fromJson(json); |
| 2990 checkInstancesFailoverRequest(obj); | 3066 checkInstancesFailoverRequest(obj); |
| 2991 | 3067 |
| 2992 var path = (req.url).path; | 3068 var path = (req.url).path; |
| 2993 var pathOffset = 0; | 3069 var pathOffset = 0; |
| 2994 var index; | 3070 var index; |
| 2995 var subPart; | 3071 var subPart; |
| 2996 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3072 unittest.expect( |
| 3073 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2997 pathOffset += 1; | 3074 pathOffset += 1; |
| 2998 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3075 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3076 unittest.equals("sql/v1beta4/")); |
| 2999 pathOffset += 12; | 3077 pathOffset += 12; |
| 3000 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3078 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3079 unittest.equals("projects/")); |
| 3001 pathOffset += 9; | 3080 pathOffset += 9; |
| 3002 index = path.indexOf("/instances/", pathOffset); | 3081 index = path.indexOf("/instances/", pathOffset); |
| 3003 unittest.expect(index >= 0, unittest.isTrue); | 3082 unittest.expect(index >= 0, unittest.isTrue); |
| 3004 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3083 subPart = |
| 3084 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3005 pathOffset = index; | 3085 pathOffset = index; |
| 3006 unittest.expect(subPart, unittest.equals("$arg_project")); | 3086 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3007 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3087 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3088 unittest.equals("/instances/")); |
| 3008 pathOffset += 11; | 3089 pathOffset += 11; |
| 3009 index = path.indexOf("/failover", pathOffset); | 3090 index = path.indexOf("/failover", pathOffset); |
| 3010 unittest.expect(index >= 0, unittest.isTrue); | 3091 unittest.expect(index >= 0, unittest.isTrue); |
| 3011 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3092 subPart = |
| 3093 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3012 pathOffset = index; | 3094 pathOffset = index; |
| 3013 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3095 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3014 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/failover")); | 3096 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3097 unittest.equals("/failover")); |
| 3015 pathOffset += 9; | 3098 pathOffset += 9; |
| 3016 | 3099 |
| 3017 var query = (req.url).query; | 3100 var query = (req.url).query; |
| 3018 var queryOffset = 0; | 3101 var queryOffset = 0; |
| 3019 var queryMap = {}; | 3102 var queryMap = {}; |
| 3020 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3103 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3021 parseBool(n) { | 3104 parseBool(n) { |
| 3022 if (n == "true") return true; | 3105 if (n == "true") return true; |
| 3023 if (n == "false") return false; | 3106 if (n == "false") return false; |
| 3024 if (n == null) return null; | 3107 if (n == null) return null; |
| 3025 throw new core.ArgumentError("Invalid boolean: $n"); | 3108 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3026 } | 3109 } |
| 3110 |
| 3027 if (query.length > 0) { | 3111 if (query.length > 0) { |
| 3028 for (var part in query.split("&")) { | 3112 for (var part in query.split("&")) { |
| 3029 var keyvalue = part.split("="); | 3113 var keyvalue = part.split("="); |
| 3030 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3114 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3115 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3031 } | 3116 } |
| 3032 } | 3117 } |
| 3033 | 3118 |
| 3034 | |
| 3035 var h = { | 3119 var h = { |
| 3036 "content-type" : "application/json; charset=utf-8", | 3120 "content-type": "application/json; charset=utf-8", |
| 3037 }; | 3121 }; |
| 3038 var resp = convert.JSON.encode(buildOperation()); | 3122 var resp = convert.JSON.encode(buildOperation()); |
| 3039 return new async.Future.value(stringResponse(200, h, resp)); | 3123 return new async.Future.value(stringResponse(200, h, resp)); |
| 3040 }), true); | 3124 }), true); |
| 3041 res.failover(arg_request, arg_project, arg_instance).then(unittest.expectA
sync1(((api.Operation response) { | 3125 res |
| 3126 .failover(arg_request, arg_project, arg_instance) |
| 3127 .then(unittest.expectAsync1(((api.Operation response) { |
| 3042 checkOperation(response); | 3128 checkOperation(response); |
| 3043 }))); | 3129 }))); |
| 3044 }); | 3130 }); |
| 3045 | 3131 |
| 3046 unittest.test("method--get", () { | 3132 unittest.test("method--get", () { |
| 3047 | |
| 3048 var mock = new HttpServerMock(); | 3133 var mock = new HttpServerMock(); |
| 3049 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3134 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3050 var arg_project = "foo"; | 3135 var arg_project = "foo"; |
| 3051 var arg_instance = "foo"; | 3136 var arg_instance = "foo"; |
| 3052 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3137 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3053 var path = (req.url).path; | 3138 var path = (req.url).path; |
| 3054 var pathOffset = 0; | 3139 var pathOffset = 0; |
| 3055 var index; | 3140 var index; |
| 3056 var subPart; | 3141 var subPart; |
| 3057 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3142 unittest.expect( |
| 3143 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3058 pathOffset += 1; | 3144 pathOffset += 1; |
| 3059 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3145 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3146 unittest.equals("sql/v1beta4/")); |
| 3060 pathOffset += 12; | 3147 pathOffset += 12; |
| 3061 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3148 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3149 unittest.equals("projects/")); |
| 3062 pathOffset += 9; | 3150 pathOffset += 9; |
| 3063 index = path.indexOf("/instances/", pathOffset); | 3151 index = path.indexOf("/instances/", pathOffset); |
| 3064 unittest.expect(index >= 0, unittest.isTrue); | 3152 unittest.expect(index >= 0, unittest.isTrue); |
| 3065 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3153 subPart = |
| 3154 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3066 pathOffset = index; | 3155 pathOffset = index; |
| 3067 unittest.expect(subPart, unittest.equals("$arg_project")); | 3156 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3068 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3157 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3158 unittest.equals("/instances/")); |
| 3069 pathOffset += 11; | 3159 pathOffset += 11; |
| 3070 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3160 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3071 pathOffset = path.length; | 3161 pathOffset = path.length; |
| 3072 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3162 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3073 | 3163 |
| 3074 var query = (req.url).query; | 3164 var query = (req.url).query; |
| 3075 var queryOffset = 0; | 3165 var queryOffset = 0; |
| 3076 var queryMap = {}; | 3166 var queryMap = {}; |
| 3077 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3167 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3078 parseBool(n) { | 3168 parseBool(n) { |
| 3079 if (n == "true") return true; | 3169 if (n == "true") return true; |
| 3080 if (n == "false") return false; | 3170 if (n == "false") return false; |
| 3081 if (n == null) return null; | 3171 if (n == null) return null; |
| 3082 throw new core.ArgumentError("Invalid boolean: $n"); | 3172 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3083 } | 3173 } |
| 3174 |
| 3084 if (query.length > 0) { | 3175 if (query.length > 0) { |
| 3085 for (var part in query.split("&")) { | 3176 for (var part in query.split("&")) { |
| 3086 var keyvalue = part.split("="); | 3177 var keyvalue = part.split("="); |
| 3087 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3178 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3179 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3088 } | 3180 } |
| 3089 } | 3181 } |
| 3090 | 3182 |
| 3091 | |
| 3092 var h = { | 3183 var h = { |
| 3093 "content-type" : "application/json; charset=utf-8", | 3184 "content-type": "application/json; charset=utf-8", |
| 3094 }; | 3185 }; |
| 3095 var resp = convert.JSON.encode(buildDatabaseInstance()); | 3186 var resp = convert.JSON.encode(buildDatabaseInstance()); |
| 3096 return new async.Future.value(stringResponse(200, h, resp)); | 3187 return new async.Future.value(stringResponse(200, h, resp)); |
| 3097 }), true); | 3188 }), true); |
| 3098 res.get(arg_project, arg_instance).then(unittest.expectAsync1(((api.Databa
seInstance response) { | 3189 res |
| 3190 .get(arg_project, arg_instance) |
| 3191 .then(unittest.expectAsync1(((api.DatabaseInstance response) { |
| 3099 checkDatabaseInstance(response); | 3192 checkDatabaseInstance(response); |
| 3100 }))); | 3193 }))); |
| 3101 }); | 3194 }); |
| 3102 | 3195 |
| 3103 unittest.test("method--import", () { | 3196 unittest.test("method--import", () { |
| 3104 | |
| 3105 var mock = new HttpServerMock(); | 3197 var mock = new HttpServerMock(); |
| 3106 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3198 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3107 var arg_request = buildInstancesImportRequest(); | 3199 var arg_request = buildInstancesImportRequest(); |
| 3108 var arg_project = "foo"; | 3200 var arg_project = "foo"; |
| 3109 var arg_instance = "foo"; | 3201 var arg_instance = "foo"; |
| 3110 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3202 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3111 var obj = new api.InstancesImportRequest.fromJson(json); | 3203 var obj = new api.InstancesImportRequest.fromJson(json); |
| 3112 checkInstancesImportRequest(obj); | 3204 checkInstancesImportRequest(obj); |
| 3113 | 3205 |
| 3114 var path = (req.url).path; | 3206 var path = (req.url).path; |
| 3115 var pathOffset = 0; | 3207 var pathOffset = 0; |
| 3116 var index; | 3208 var index; |
| 3117 var subPart; | 3209 var subPart; |
| 3118 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3210 unittest.expect( |
| 3211 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3119 pathOffset += 1; | 3212 pathOffset += 1; |
| 3120 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3213 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3214 unittest.equals("sql/v1beta4/")); |
| 3121 pathOffset += 12; | 3215 pathOffset += 12; |
| 3122 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3216 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3217 unittest.equals("projects/")); |
| 3123 pathOffset += 9; | 3218 pathOffset += 9; |
| 3124 index = path.indexOf("/instances/", pathOffset); | 3219 index = path.indexOf("/instances/", pathOffset); |
| 3125 unittest.expect(index >= 0, unittest.isTrue); | 3220 unittest.expect(index >= 0, unittest.isTrue); |
| 3126 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3221 subPart = |
| 3222 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3127 pathOffset = index; | 3223 pathOffset = index; |
| 3128 unittest.expect(subPart, unittest.equals("$arg_project")); | 3224 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3129 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3225 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3226 unittest.equals("/instances/")); |
| 3130 pathOffset += 11; | 3227 pathOffset += 11; |
| 3131 index = path.indexOf("/import", pathOffset); | 3228 index = path.indexOf("/import", pathOffset); |
| 3132 unittest.expect(index >= 0, unittest.isTrue); | 3229 unittest.expect(index >= 0, unittest.isTrue); |
| 3133 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3230 subPart = |
| 3231 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3134 pathOffset = index; | 3232 pathOffset = index; |
| 3135 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3233 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3136 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/import")); | 3234 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 3235 unittest.equals("/import")); |
| 3137 pathOffset += 7; | 3236 pathOffset += 7; |
| 3138 | 3237 |
| 3139 var query = (req.url).query; | 3238 var query = (req.url).query; |
| 3140 var queryOffset = 0; | 3239 var queryOffset = 0; |
| 3141 var queryMap = {}; | 3240 var queryMap = {}; |
| 3142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3241 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3143 parseBool(n) { | 3242 parseBool(n) { |
| 3144 if (n == "true") return true; | 3243 if (n == "true") return true; |
| 3145 if (n == "false") return false; | 3244 if (n == "false") return false; |
| 3146 if (n == null) return null; | 3245 if (n == null) return null; |
| 3147 throw new core.ArgumentError("Invalid boolean: $n"); | 3246 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3148 } | 3247 } |
| 3248 |
| 3149 if (query.length > 0) { | 3249 if (query.length > 0) { |
| 3150 for (var part in query.split("&")) { | 3250 for (var part in query.split("&")) { |
| 3151 var keyvalue = part.split("="); | 3251 var keyvalue = part.split("="); |
| 3152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3252 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3253 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3153 } | 3254 } |
| 3154 } | 3255 } |
| 3155 | 3256 |
| 3156 | |
| 3157 var h = { | 3257 var h = { |
| 3158 "content-type" : "application/json; charset=utf-8", | 3258 "content-type": "application/json; charset=utf-8", |
| 3159 }; | 3259 }; |
| 3160 var resp = convert.JSON.encode(buildOperation()); | 3260 var resp = convert.JSON.encode(buildOperation()); |
| 3161 return new async.Future.value(stringResponse(200, h, resp)); | 3261 return new async.Future.value(stringResponse(200, h, resp)); |
| 3162 }), true); | 3262 }), true); |
| 3163 res.import(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 3263 res |
| 3264 .import(arg_request, arg_project, arg_instance) |
| 3265 .then(unittest.expectAsync1(((api.Operation response) { |
| 3164 checkOperation(response); | 3266 checkOperation(response); |
| 3165 }))); | 3267 }))); |
| 3166 }); | 3268 }); |
| 3167 | 3269 |
| 3168 unittest.test("method--insert", () { | 3270 unittest.test("method--insert", () { |
| 3169 | |
| 3170 var mock = new HttpServerMock(); | 3271 var mock = new HttpServerMock(); |
| 3171 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3272 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3172 var arg_request = buildDatabaseInstance(); | 3273 var arg_request = buildDatabaseInstance(); |
| 3173 var arg_project = "foo"; | 3274 var arg_project = "foo"; |
| 3174 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3275 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3175 var obj = new api.DatabaseInstance.fromJson(json); | 3276 var obj = new api.DatabaseInstance.fromJson(json); |
| 3176 checkDatabaseInstance(obj); | 3277 checkDatabaseInstance(obj); |
| 3177 | 3278 |
| 3178 var path = (req.url).path; | 3279 var path = (req.url).path; |
| 3179 var pathOffset = 0; | 3280 var pathOffset = 0; |
| 3180 var index; | 3281 var index; |
| 3181 var subPart; | 3282 var subPart; |
| 3182 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3283 unittest.expect( |
| 3284 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3183 pathOffset += 1; | 3285 pathOffset += 1; |
| 3184 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3286 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3287 unittest.equals("sql/v1beta4/")); |
| 3185 pathOffset += 12; | 3288 pathOffset += 12; |
| 3186 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3289 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3290 unittest.equals("projects/")); |
| 3187 pathOffset += 9; | 3291 pathOffset += 9; |
| 3188 index = path.indexOf("/instances", pathOffset); | 3292 index = path.indexOf("/instances", pathOffset); |
| 3189 unittest.expect(index >= 0, unittest.isTrue); | 3293 unittest.expect(index >= 0, unittest.isTrue); |
| 3190 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3294 subPart = |
| 3295 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3191 pathOffset = index; | 3296 pathOffset = index; |
| 3192 unittest.expect(subPart, unittest.equals("$arg_project")); | 3297 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3193 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/instances")); | 3298 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3299 unittest.equals("/instances")); |
| 3194 pathOffset += 10; | 3300 pathOffset += 10; |
| 3195 | 3301 |
| 3196 var query = (req.url).query; | 3302 var query = (req.url).query; |
| 3197 var queryOffset = 0; | 3303 var queryOffset = 0; |
| 3198 var queryMap = {}; | 3304 var queryMap = {}; |
| 3199 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3305 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3200 parseBool(n) { | 3306 parseBool(n) { |
| 3201 if (n == "true") return true; | 3307 if (n == "true") return true; |
| 3202 if (n == "false") return false; | 3308 if (n == "false") return false; |
| 3203 if (n == null) return null; | 3309 if (n == null) return null; |
| 3204 throw new core.ArgumentError("Invalid boolean: $n"); | 3310 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3205 } | 3311 } |
| 3312 |
| 3206 if (query.length > 0) { | 3313 if (query.length > 0) { |
| 3207 for (var part in query.split("&")) { | 3314 for (var part in query.split("&")) { |
| 3208 var keyvalue = part.split("="); | 3315 var keyvalue = part.split("="); |
| 3209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3316 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3317 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3210 } | 3318 } |
| 3211 } | 3319 } |
| 3212 | 3320 |
| 3213 | |
| 3214 var h = { | 3321 var h = { |
| 3215 "content-type" : "application/json; charset=utf-8", | 3322 "content-type": "application/json; charset=utf-8", |
| 3216 }; | 3323 }; |
| 3217 var resp = convert.JSON.encode(buildOperation()); | 3324 var resp = convert.JSON.encode(buildOperation()); |
| 3218 return new async.Future.value(stringResponse(200, h, resp)); | 3325 return new async.Future.value(stringResponse(200, h, resp)); |
| 3219 }), true); | 3326 }), true); |
| 3220 res.insert(arg_request, arg_project).then(unittest.expectAsync1(((api.Oper
ation response) { | 3327 res |
| 3328 .insert(arg_request, arg_project) |
| 3329 .then(unittest.expectAsync1(((api.Operation response) { |
| 3221 checkOperation(response); | 3330 checkOperation(response); |
| 3222 }))); | 3331 }))); |
| 3223 }); | 3332 }); |
| 3224 | 3333 |
| 3225 unittest.test("method--list", () { | 3334 unittest.test("method--list", () { |
| 3226 | |
| 3227 var mock = new HttpServerMock(); | 3335 var mock = new HttpServerMock(); |
| 3228 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3336 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3229 var arg_project = "foo"; | 3337 var arg_project = "foo"; |
| 3230 var arg_filter = "foo"; | 3338 var arg_filter = "foo"; |
| 3231 var arg_maxResults = 42; | 3339 var arg_maxResults = 42; |
| 3232 var arg_pageToken = "foo"; | 3340 var arg_pageToken = "foo"; |
| 3233 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3341 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3234 var path = (req.url).path; | 3342 var path = (req.url).path; |
| 3235 var pathOffset = 0; | 3343 var pathOffset = 0; |
| 3236 var index; | 3344 var index; |
| 3237 var subPart; | 3345 var subPart; |
| 3238 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3346 unittest.expect( |
| 3347 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3239 pathOffset += 1; | 3348 pathOffset += 1; |
| 3240 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3349 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3350 unittest.equals("sql/v1beta4/")); |
| 3241 pathOffset += 12; | 3351 pathOffset += 12; |
| 3242 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3352 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3353 unittest.equals("projects/")); |
| 3243 pathOffset += 9; | 3354 pathOffset += 9; |
| 3244 index = path.indexOf("/instances", pathOffset); | 3355 index = path.indexOf("/instances", pathOffset); |
| 3245 unittest.expect(index >= 0, unittest.isTrue); | 3356 unittest.expect(index >= 0, unittest.isTrue); |
| 3246 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3357 subPart = |
| 3358 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3247 pathOffset = index; | 3359 pathOffset = index; |
| 3248 unittest.expect(subPart, unittest.equals("$arg_project")); | 3360 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3249 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/instances")); | 3361 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3362 unittest.equals("/instances")); |
| 3250 pathOffset += 10; | 3363 pathOffset += 10; |
| 3251 | 3364 |
| 3252 var query = (req.url).query; | 3365 var query = (req.url).query; |
| 3253 var queryOffset = 0; | 3366 var queryOffset = 0; |
| 3254 var queryMap = {}; | 3367 var queryMap = {}; |
| 3255 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3368 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3256 parseBool(n) { | 3369 parseBool(n) { |
| 3257 if (n == "true") return true; | 3370 if (n == "true") return true; |
| 3258 if (n == "false") return false; | 3371 if (n == "false") return false; |
| 3259 if (n == null) return null; | 3372 if (n == null) return null; |
| 3260 throw new core.ArgumentError("Invalid boolean: $n"); | 3373 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3261 } | 3374 } |
| 3375 |
| 3262 if (query.length > 0) { | 3376 if (query.length > 0) { |
| 3263 for (var part in query.split("&")) { | 3377 for (var part in query.split("&")) { |
| 3264 var keyvalue = part.split("="); | 3378 var keyvalue = part.split("="); |
| 3265 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3379 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3380 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3266 } | 3381 } |
| 3267 } | 3382 } |
| 3268 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 3383 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 3269 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 3384 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 3270 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3385 unittest.equals(arg_maxResults)); |
| 3271 | 3386 unittest.expect( |
| 3387 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 3272 | 3388 |
| 3273 var h = { | 3389 var h = { |
| 3274 "content-type" : "application/json; charset=utf-8", | 3390 "content-type": "application/json; charset=utf-8", |
| 3275 }; | 3391 }; |
| 3276 var resp = convert.JSON.encode(buildInstancesListResponse()); | 3392 var resp = convert.JSON.encode(buildInstancesListResponse()); |
| 3277 return new async.Future.value(stringResponse(200, h, resp)); | 3393 return new async.Future.value(stringResponse(200, h, resp)); |
| 3278 }), true); | 3394 }), true); |
| 3279 res.list(arg_project, filter: arg_filter, maxResults: arg_maxResults, page
Token: arg_pageToken).then(unittest.expectAsync1(((api.InstancesListResponse res
ponse) { | 3395 res |
| 3396 .list(arg_project, |
| 3397 filter: arg_filter, |
| 3398 maxResults: arg_maxResults, |
| 3399 pageToken: arg_pageToken) |
| 3400 .then(unittest.expectAsync1(((api.InstancesListResponse response) { |
| 3280 checkInstancesListResponse(response); | 3401 checkInstancesListResponse(response); |
| 3281 }))); | 3402 }))); |
| 3282 }); | 3403 }); |
| 3283 | 3404 |
| 3284 unittest.test("method--patch", () { | 3405 unittest.test("method--patch", () { |
| 3285 | |
| 3286 var mock = new HttpServerMock(); | 3406 var mock = new HttpServerMock(); |
| 3287 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3407 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3288 var arg_request = buildDatabaseInstance(); | 3408 var arg_request = buildDatabaseInstance(); |
| 3289 var arg_project = "foo"; | 3409 var arg_project = "foo"; |
| 3290 var arg_instance = "foo"; | 3410 var arg_instance = "foo"; |
| 3291 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3411 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3292 var obj = new api.DatabaseInstance.fromJson(json); | 3412 var obj = new api.DatabaseInstance.fromJson(json); |
| 3293 checkDatabaseInstance(obj); | 3413 checkDatabaseInstance(obj); |
| 3294 | 3414 |
| 3295 var path = (req.url).path; | 3415 var path = (req.url).path; |
| 3296 var pathOffset = 0; | 3416 var pathOffset = 0; |
| 3297 var index; | 3417 var index; |
| 3298 var subPart; | 3418 var subPart; |
| 3299 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3419 unittest.expect( |
| 3420 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3300 pathOffset += 1; | 3421 pathOffset += 1; |
| 3301 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3422 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3423 unittest.equals("sql/v1beta4/")); |
| 3302 pathOffset += 12; | 3424 pathOffset += 12; |
| 3303 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3425 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3426 unittest.equals("projects/")); |
| 3304 pathOffset += 9; | 3427 pathOffset += 9; |
| 3305 index = path.indexOf("/instances/", pathOffset); | 3428 index = path.indexOf("/instances/", pathOffset); |
| 3306 unittest.expect(index >= 0, unittest.isTrue); | 3429 unittest.expect(index >= 0, unittest.isTrue); |
| 3307 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3430 subPart = |
| 3431 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3308 pathOffset = index; | 3432 pathOffset = index; |
| 3309 unittest.expect(subPart, unittest.equals("$arg_project")); | 3433 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3310 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3434 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3435 unittest.equals("/instances/")); |
| 3311 pathOffset += 11; | 3436 pathOffset += 11; |
| 3312 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3437 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3313 pathOffset = path.length; | 3438 pathOffset = path.length; |
| 3314 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3439 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3315 | 3440 |
| 3316 var query = (req.url).query; | 3441 var query = (req.url).query; |
| 3317 var queryOffset = 0; | 3442 var queryOffset = 0; |
| 3318 var queryMap = {}; | 3443 var queryMap = {}; |
| 3319 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3444 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3320 parseBool(n) { | 3445 parseBool(n) { |
| 3321 if (n == "true") return true; | 3446 if (n == "true") return true; |
| 3322 if (n == "false") return false; | 3447 if (n == "false") return false; |
| 3323 if (n == null) return null; | 3448 if (n == null) return null; |
| 3324 throw new core.ArgumentError("Invalid boolean: $n"); | 3449 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3325 } | 3450 } |
| 3451 |
| 3326 if (query.length > 0) { | 3452 if (query.length > 0) { |
| 3327 for (var part in query.split("&")) { | 3453 for (var part in query.split("&")) { |
| 3328 var keyvalue = part.split("="); | 3454 var keyvalue = part.split("="); |
| 3329 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3455 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3456 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3330 } | 3457 } |
| 3331 } | 3458 } |
| 3332 | 3459 |
| 3333 | |
| 3334 var h = { | 3460 var h = { |
| 3335 "content-type" : "application/json; charset=utf-8", | 3461 "content-type": "application/json; charset=utf-8", |
| 3336 }; | 3462 }; |
| 3337 var resp = convert.JSON.encode(buildOperation()); | 3463 var resp = convert.JSON.encode(buildOperation()); |
| 3338 return new async.Future.value(stringResponse(200, h, resp)); | 3464 return new async.Future.value(stringResponse(200, h, resp)); |
| 3339 }), true); | 3465 }), true); |
| 3340 res.patch(arg_request, arg_project, arg_instance).then(unittest.expectAsyn
c1(((api.Operation response) { | 3466 res |
| 3467 .patch(arg_request, arg_project, arg_instance) |
| 3468 .then(unittest.expectAsync1(((api.Operation response) { |
| 3341 checkOperation(response); | 3469 checkOperation(response); |
| 3342 }))); | 3470 }))); |
| 3343 }); | 3471 }); |
| 3344 | 3472 |
| 3345 unittest.test("method--promoteReplica", () { | 3473 unittest.test("method--promoteReplica", () { |
| 3346 | |
| 3347 var mock = new HttpServerMock(); | 3474 var mock = new HttpServerMock(); |
| 3348 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3475 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3349 var arg_project = "foo"; | 3476 var arg_project = "foo"; |
| 3350 var arg_instance = "foo"; | 3477 var arg_instance = "foo"; |
| 3351 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3478 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3352 var path = (req.url).path; | 3479 var path = (req.url).path; |
| 3353 var pathOffset = 0; | 3480 var pathOffset = 0; |
| 3354 var index; | 3481 var index; |
| 3355 var subPart; | 3482 var subPart; |
| 3356 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3483 unittest.expect( |
| 3484 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3357 pathOffset += 1; | 3485 pathOffset += 1; |
| 3358 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3486 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3487 unittest.equals("sql/v1beta4/")); |
| 3359 pathOffset += 12; | 3488 pathOffset += 12; |
| 3360 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3489 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3490 unittest.equals("projects/")); |
| 3361 pathOffset += 9; | 3491 pathOffset += 9; |
| 3362 index = path.indexOf("/instances/", pathOffset); | 3492 index = path.indexOf("/instances/", pathOffset); |
| 3363 unittest.expect(index >= 0, unittest.isTrue); | 3493 unittest.expect(index >= 0, unittest.isTrue); |
| 3364 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3494 subPart = |
| 3495 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3365 pathOffset = index; | 3496 pathOffset = index; |
| 3366 unittest.expect(subPart, unittest.equals("$arg_project")); | 3497 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3367 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3498 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3499 unittest.equals("/instances/")); |
| 3368 pathOffset += 11; | 3500 pathOffset += 11; |
| 3369 index = path.indexOf("/promoteReplica", pathOffset); | 3501 index = path.indexOf("/promoteReplica", pathOffset); |
| 3370 unittest.expect(index >= 0, unittest.isTrue); | 3502 unittest.expect(index >= 0, unittest.isTrue); |
| 3371 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3503 subPart = |
| 3504 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3372 pathOffset = index; | 3505 pathOffset = index; |
| 3373 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3506 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3374 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/promoteReplica")); | 3507 unittest.expect(path.substring(pathOffset, pathOffset + 15), |
| 3508 unittest.equals("/promoteReplica")); |
| 3375 pathOffset += 15; | 3509 pathOffset += 15; |
| 3376 | 3510 |
| 3377 var query = (req.url).query; | 3511 var query = (req.url).query; |
| 3378 var queryOffset = 0; | 3512 var queryOffset = 0; |
| 3379 var queryMap = {}; | 3513 var queryMap = {}; |
| 3380 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3514 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3381 parseBool(n) { | 3515 parseBool(n) { |
| 3382 if (n == "true") return true; | 3516 if (n == "true") return true; |
| 3383 if (n == "false") return false; | 3517 if (n == "false") return false; |
| 3384 if (n == null) return null; | 3518 if (n == null) return null; |
| 3385 throw new core.ArgumentError("Invalid boolean: $n"); | 3519 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3386 } | 3520 } |
| 3521 |
| 3387 if (query.length > 0) { | 3522 if (query.length > 0) { |
| 3388 for (var part in query.split("&")) { | 3523 for (var part in query.split("&")) { |
| 3389 var keyvalue = part.split("="); | 3524 var keyvalue = part.split("="); |
| 3390 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3525 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3526 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3391 } | 3527 } |
| 3392 } | 3528 } |
| 3393 | 3529 |
| 3394 | |
| 3395 var h = { | 3530 var h = { |
| 3396 "content-type" : "application/json; charset=utf-8", | 3531 "content-type": "application/json; charset=utf-8", |
| 3397 }; | 3532 }; |
| 3398 var resp = convert.JSON.encode(buildOperation()); | 3533 var resp = convert.JSON.encode(buildOperation()); |
| 3399 return new async.Future.value(stringResponse(200, h, resp)); | 3534 return new async.Future.value(stringResponse(200, h, resp)); |
| 3400 }), true); | 3535 }), true); |
| 3401 res.promoteReplica(arg_project, arg_instance).then(unittest.expectAsync1((
(api.Operation response) { | 3536 res |
| 3537 .promoteReplica(arg_project, arg_instance) |
| 3538 .then(unittest.expectAsync1(((api.Operation response) { |
| 3402 checkOperation(response); | 3539 checkOperation(response); |
| 3403 }))); | 3540 }))); |
| 3404 }); | 3541 }); |
| 3405 | 3542 |
| 3406 unittest.test("method--resetSslConfig", () { | 3543 unittest.test("method--resetSslConfig", () { |
| 3407 | |
| 3408 var mock = new HttpServerMock(); | 3544 var mock = new HttpServerMock(); |
| 3409 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3545 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3410 var arg_project = "foo"; | 3546 var arg_project = "foo"; |
| 3411 var arg_instance = "foo"; | 3547 var arg_instance = "foo"; |
| 3412 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3548 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3413 var path = (req.url).path; | 3549 var path = (req.url).path; |
| 3414 var pathOffset = 0; | 3550 var pathOffset = 0; |
| 3415 var index; | 3551 var index; |
| 3416 var subPart; | 3552 var subPart; |
| 3417 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3553 unittest.expect( |
| 3554 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3418 pathOffset += 1; | 3555 pathOffset += 1; |
| 3419 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3556 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3557 unittest.equals("sql/v1beta4/")); |
| 3420 pathOffset += 12; | 3558 pathOffset += 12; |
| 3421 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3559 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3560 unittest.equals("projects/")); |
| 3422 pathOffset += 9; | 3561 pathOffset += 9; |
| 3423 index = path.indexOf("/instances/", pathOffset); | 3562 index = path.indexOf("/instances/", pathOffset); |
| 3424 unittest.expect(index >= 0, unittest.isTrue); | 3563 unittest.expect(index >= 0, unittest.isTrue); |
| 3425 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3564 subPart = |
| 3565 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3426 pathOffset = index; | 3566 pathOffset = index; |
| 3427 unittest.expect(subPart, unittest.equals("$arg_project")); | 3567 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3428 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3568 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3569 unittest.equals("/instances/")); |
| 3429 pathOffset += 11; | 3570 pathOffset += 11; |
| 3430 index = path.indexOf("/resetSslConfig", pathOffset); | 3571 index = path.indexOf("/resetSslConfig", pathOffset); |
| 3431 unittest.expect(index >= 0, unittest.isTrue); | 3572 unittest.expect(index >= 0, unittest.isTrue); |
| 3432 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3573 subPart = |
| 3574 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3433 pathOffset = index; | 3575 pathOffset = index; |
| 3434 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3576 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3435 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/resetSslConfig")); | 3577 unittest.expect(path.substring(pathOffset, pathOffset + 15), |
| 3578 unittest.equals("/resetSslConfig")); |
| 3436 pathOffset += 15; | 3579 pathOffset += 15; |
| 3437 | 3580 |
| 3438 var query = (req.url).query; | 3581 var query = (req.url).query; |
| 3439 var queryOffset = 0; | 3582 var queryOffset = 0; |
| 3440 var queryMap = {}; | 3583 var queryMap = {}; |
| 3441 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3584 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3442 parseBool(n) { | 3585 parseBool(n) { |
| 3443 if (n == "true") return true; | 3586 if (n == "true") return true; |
| 3444 if (n == "false") return false; | 3587 if (n == "false") return false; |
| 3445 if (n == null) return null; | 3588 if (n == null) return null; |
| 3446 throw new core.ArgumentError("Invalid boolean: $n"); | 3589 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3447 } | 3590 } |
| 3591 |
| 3448 if (query.length > 0) { | 3592 if (query.length > 0) { |
| 3449 for (var part in query.split("&")) { | 3593 for (var part in query.split("&")) { |
| 3450 var keyvalue = part.split("="); | 3594 var keyvalue = part.split("="); |
| 3451 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3595 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3596 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3452 } | 3597 } |
| 3453 } | 3598 } |
| 3454 | 3599 |
| 3455 | |
| 3456 var h = { | 3600 var h = { |
| 3457 "content-type" : "application/json; charset=utf-8", | 3601 "content-type": "application/json; charset=utf-8", |
| 3458 }; | 3602 }; |
| 3459 var resp = convert.JSON.encode(buildOperation()); | 3603 var resp = convert.JSON.encode(buildOperation()); |
| 3460 return new async.Future.value(stringResponse(200, h, resp)); | 3604 return new async.Future.value(stringResponse(200, h, resp)); |
| 3461 }), true); | 3605 }), true); |
| 3462 res.resetSslConfig(arg_project, arg_instance).then(unittest.expectAsync1((
(api.Operation response) { | 3606 res |
| 3607 .resetSslConfig(arg_project, arg_instance) |
| 3608 .then(unittest.expectAsync1(((api.Operation response) { |
| 3463 checkOperation(response); | 3609 checkOperation(response); |
| 3464 }))); | 3610 }))); |
| 3465 }); | 3611 }); |
| 3466 | 3612 |
| 3467 unittest.test("method--restart", () { | 3613 unittest.test("method--restart", () { |
| 3468 | |
| 3469 var mock = new HttpServerMock(); | 3614 var mock = new HttpServerMock(); |
| 3470 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3615 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3471 var arg_project = "foo"; | 3616 var arg_project = "foo"; |
| 3472 var arg_instance = "foo"; | 3617 var arg_instance = "foo"; |
| 3473 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3618 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3474 var path = (req.url).path; | 3619 var path = (req.url).path; |
| 3475 var pathOffset = 0; | 3620 var pathOffset = 0; |
| 3476 var index; | 3621 var index; |
| 3477 var subPart; | 3622 var subPart; |
| 3478 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3623 unittest.expect( |
| 3624 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3479 pathOffset += 1; | 3625 pathOffset += 1; |
| 3480 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3626 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3627 unittest.equals("sql/v1beta4/")); |
| 3481 pathOffset += 12; | 3628 pathOffset += 12; |
| 3482 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3629 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3630 unittest.equals("projects/")); |
| 3483 pathOffset += 9; | 3631 pathOffset += 9; |
| 3484 index = path.indexOf("/instances/", pathOffset); | 3632 index = path.indexOf("/instances/", pathOffset); |
| 3485 unittest.expect(index >= 0, unittest.isTrue); | 3633 unittest.expect(index >= 0, unittest.isTrue); |
| 3486 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3634 subPart = |
| 3635 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3487 pathOffset = index; | 3636 pathOffset = index; |
| 3488 unittest.expect(subPart, unittest.equals("$arg_project")); | 3637 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3489 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3638 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3639 unittest.equals("/instances/")); |
| 3490 pathOffset += 11; | 3640 pathOffset += 11; |
| 3491 index = path.indexOf("/restart", pathOffset); | 3641 index = path.indexOf("/restart", pathOffset); |
| 3492 unittest.expect(index >= 0, unittest.isTrue); | 3642 unittest.expect(index >= 0, unittest.isTrue); |
| 3493 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3643 subPart = |
| 3644 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3494 pathOffset = index; | 3645 pathOffset = index; |
| 3495 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3646 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3496 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/restart")); | 3647 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 3648 unittest.equals("/restart")); |
| 3497 pathOffset += 8; | 3649 pathOffset += 8; |
| 3498 | 3650 |
| 3499 var query = (req.url).query; | 3651 var query = (req.url).query; |
| 3500 var queryOffset = 0; | 3652 var queryOffset = 0; |
| 3501 var queryMap = {}; | 3653 var queryMap = {}; |
| 3502 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3654 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3503 parseBool(n) { | 3655 parseBool(n) { |
| 3504 if (n == "true") return true; | 3656 if (n == "true") return true; |
| 3505 if (n == "false") return false; | 3657 if (n == "false") return false; |
| 3506 if (n == null) return null; | 3658 if (n == null) return null; |
| 3507 throw new core.ArgumentError("Invalid boolean: $n"); | 3659 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3508 } | 3660 } |
| 3661 |
| 3509 if (query.length > 0) { | 3662 if (query.length > 0) { |
| 3510 for (var part in query.split("&")) { | 3663 for (var part in query.split("&")) { |
| 3511 var keyvalue = part.split("="); | 3664 var keyvalue = part.split("="); |
| 3512 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3665 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3666 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3513 } | 3667 } |
| 3514 } | 3668 } |
| 3515 | 3669 |
| 3516 | |
| 3517 var h = { | 3670 var h = { |
| 3518 "content-type" : "application/json; charset=utf-8", | 3671 "content-type": "application/json; charset=utf-8", |
| 3519 }; | 3672 }; |
| 3520 var resp = convert.JSON.encode(buildOperation()); | 3673 var resp = convert.JSON.encode(buildOperation()); |
| 3521 return new async.Future.value(stringResponse(200, h, resp)); | 3674 return new async.Future.value(stringResponse(200, h, resp)); |
| 3522 }), true); | 3675 }), true); |
| 3523 res.restart(arg_project, arg_instance).then(unittest.expectAsync1(((api.Op
eration response) { | 3676 res |
| 3677 .restart(arg_project, arg_instance) |
| 3678 .then(unittest.expectAsync1(((api.Operation response) { |
| 3524 checkOperation(response); | 3679 checkOperation(response); |
| 3525 }))); | 3680 }))); |
| 3526 }); | 3681 }); |
| 3527 | 3682 |
| 3528 unittest.test("method--restoreBackup", () { | 3683 unittest.test("method--restoreBackup", () { |
| 3529 | |
| 3530 var mock = new HttpServerMock(); | 3684 var mock = new HttpServerMock(); |
| 3531 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3685 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3532 var arg_request = buildInstancesRestoreBackupRequest(); | 3686 var arg_request = buildInstancesRestoreBackupRequest(); |
| 3533 var arg_project = "foo"; | 3687 var arg_project = "foo"; |
| 3534 var arg_instance = "foo"; | 3688 var arg_instance = "foo"; |
| 3535 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3689 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3536 var obj = new api.InstancesRestoreBackupRequest.fromJson(json); | 3690 var obj = new api.InstancesRestoreBackupRequest.fromJson(json); |
| 3537 checkInstancesRestoreBackupRequest(obj); | 3691 checkInstancesRestoreBackupRequest(obj); |
| 3538 | 3692 |
| 3539 var path = (req.url).path; | 3693 var path = (req.url).path; |
| 3540 var pathOffset = 0; | 3694 var pathOffset = 0; |
| 3541 var index; | 3695 var index; |
| 3542 var subPart; | 3696 var subPart; |
| 3543 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3697 unittest.expect( |
| 3698 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3544 pathOffset += 1; | 3699 pathOffset += 1; |
| 3545 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3700 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3701 unittest.equals("sql/v1beta4/")); |
| 3546 pathOffset += 12; | 3702 pathOffset += 12; |
| 3547 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3703 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3704 unittest.equals("projects/")); |
| 3548 pathOffset += 9; | 3705 pathOffset += 9; |
| 3549 index = path.indexOf("/instances/", pathOffset); | 3706 index = path.indexOf("/instances/", pathOffset); |
| 3550 unittest.expect(index >= 0, unittest.isTrue); | 3707 unittest.expect(index >= 0, unittest.isTrue); |
| 3551 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3708 subPart = |
| 3709 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3552 pathOffset = index; | 3710 pathOffset = index; |
| 3553 unittest.expect(subPart, unittest.equals("$arg_project")); | 3711 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3554 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3712 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3713 unittest.equals("/instances/")); |
| 3555 pathOffset += 11; | 3714 pathOffset += 11; |
| 3556 index = path.indexOf("/restoreBackup", pathOffset); | 3715 index = path.indexOf("/restoreBackup", pathOffset); |
| 3557 unittest.expect(index >= 0, unittest.isTrue); | 3716 unittest.expect(index >= 0, unittest.isTrue); |
| 3558 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3717 subPart = |
| 3718 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3559 pathOffset = index; | 3719 pathOffset = index; |
| 3560 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3720 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3561 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/restoreBackup")); | 3721 unittest.expect(path.substring(pathOffset, pathOffset + 14), |
| 3722 unittest.equals("/restoreBackup")); |
| 3562 pathOffset += 14; | 3723 pathOffset += 14; |
| 3563 | 3724 |
| 3564 var query = (req.url).query; | 3725 var query = (req.url).query; |
| 3565 var queryOffset = 0; | 3726 var queryOffset = 0; |
| 3566 var queryMap = {}; | 3727 var queryMap = {}; |
| 3567 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3728 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3568 parseBool(n) { | 3729 parseBool(n) { |
| 3569 if (n == "true") return true; | 3730 if (n == "true") return true; |
| 3570 if (n == "false") return false; | 3731 if (n == "false") return false; |
| 3571 if (n == null) return null; | 3732 if (n == null) return null; |
| 3572 throw new core.ArgumentError("Invalid boolean: $n"); | 3733 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3573 } | 3734 } |
| 3735 |
| 3574 if (query.length > 0) { | 3736 if (query.length > 0) { |
| 3575 for (var part in query.split("&")) { | 3737 for (var part in query.split("&")) { |
| 3576 var keyvalue = part.split("="); | 3738 var keyvalue = part.split("="); |
| 3577 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3739 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3740 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3578 } | 3741 } |
| 3579 } | 3742 } |
| 3580 | 3743 |
| 3581 | |
| 3582 var h = { | 3744 var h = { |
| 3583 "content-type" : "application/json; charset=utf-8", | 3745 "content-type": "application/json; charset=utf-8", |
| 3584 }; | 3746 }; |
| 3585 var resp = convert.JSON.encode(buildOperation()); | 3747 var resp = convert.JSON.encode(buildOperation()); |
| 3586 return new async.Future.value(stringResponse(200, h, resp)); | 3748 return new async.Future.value(stringResponse(200, h, resp)); |
| 3587 }), true); | 3749 }), true); |
| 3588 res.restoreBackup(arg_request, arg_project, arg_instance).then(unittest.ex
pectAsync1(((api.Operation response) { | 3750 res |
| 3751 .restoreBackup(arg_request, arg_project, arg_instance) |
| 3752 .then(unittest.expectAsync1(((api.Operation response) { |
| 3589 checkOperation(response); | 3753 checkOperation(response); |
| 3590 }))); | 3754 }))); |
| 3591 }); | 3755 }); |
| 3592 | 3756 |
| 3593 unittest.test("method--startReplica", () { | 3757 unittest.test("method--startReplica", () { |
| 3594 | |
| 3595 var mock = new HttpServerMock(); | 3758 var mock = new HttpServerMock(); |
| 3596 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3759 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3597 var arg_project = "foo"; | 3760 var arg_project = "foo"; |
| 3598 var arg_instance = "foo"; | 3761 var arg_instance = "foo"; |
| 3599 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3762 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3600 var path = (req.url).path; | 3763 var path = (req.url).path; |
| 3601 var pathOffset = 0; | 3764 var pathOffset = 0; |
| 3602 var index; | 3765 var index; |
| 3603 var subPart; | 3766 var subPart; |
| 3604 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3767 unittest.expect( |
| 3768 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3605 pathOffset += 1; | 3769 pathOffset += 1; |
| 3606 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3770 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3771 unittest.equals("sql/v1beta4/")); |
| 3607 pathOffset += 12; | 3772 pathOffset += 12; |
| 3608 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3773 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3774 unittest.equals("projects/")); |
| 3609 pathOffset += 9; | 3775 pathOffset += 9; |
| 3610 index = path.indexOf("/instances/", pathOffset); | 3776 index = path.indexOf("/instances/", pathOffset); |
| 3611 unittest.expect(index >= 0, unittest.isTrue); | 3777 unittest.expect(index >= 0, unittest.isTrue); |
| 3612 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3778 subPart = |
| 3779 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3613 pathOffset = index; | 3780 pathOffset = index; |
| 3614 unittest.expect(subPart, unittest.equals("$arg_project")); | 3781 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3615 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3782 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3783 unittest.equals("/instances/")); |
| 3616 pathOffset += 11; | 3784 pathOffset += 11; |
| 3617 index = path.indexOf("/startReplica", pathOffset); | 3785 index = path.indexOf("/startReplica", pathOffset); |
| 3618 unittest.expect(index >= 0, unittest.isTrue); | 3786 unittest.expect(index >= 0, unittest.isTrue); |
| 3619 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3787 subPart = |
| 3788 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3620 pathOffset = index; | 3789 pathOffset = index; |
| 3621 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3790 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3622 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/startReplica")); | 3791 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 3792 unittest.equals("/startReplica")); |
| 3623 pathOffset += 13; | 3793 pathOffset += 13; |
| 3624 | 3794 |
| 3625 var query = (req.url).query; | 3795 var query = (req.url).query; |
| 3626 var queryOffset = 0; | 3796 var queryOffset = 0; |
| 3627 var queryMap = {}; | 3797 var queryMap = {}; |
| 3628 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3798 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3629 parseBool(n) { | 3799 parseBool(n) { |
| 3630 if (n == "true") return true; | 3800 if (n == "true") return true; |
| 3631 if (n == "false") return false; | 3801 if (n == "false") return false; |
| 3632 if (n == null) return null; | 3802 if (n == null) return null; |
| 3633 throw new core.ArgumentError("Invalid boolean: $n"); | 3803 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3634 } | 3804 } |
| 3805 |
| 3635 if (query.length > 0) { | 3806 if (query.length > 0) { |
| 3636 for (var part in query.split("&")) { | 3807 for (var part in query.split("&")) { |
| 3637 var keyvalue = part.split("="); | 3808 var keyvalue = part.split("="); |
| 3638 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3809 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3810 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3639 } | 3811 } |
| 3640 } | 3812 } |
| 3641 | 3813 |
| 3642 | |
| 3643 var h = { | 3814 var h = { |
| 3644 "content-type" : "application/json; charset=utf-8", | 3815 "content-type": "application/json; charset=utf-8", |
| 3645 }; | 3816 }; |
| 3646 var resp = convert.JSON.encode(buildOperation()); | 3817 var resp = convert.JSON.encode(buildOperation()); |
| 3647 return new async.Future.value(stringResponse(200, h, resp)); | 3818 return new async.Future.value(stringResponse(200, h, resp)); |
| 3648 }), true); | 3819 }), true); |
| 3649 res.startReplica(arg_project, arg_instance).then(unittest.expectAsync1(((a
pi.Operation response) { | 3820 res |
| 3821 .startReplica(arg_project, arg_instance) |
| 3822 .then(unittest.expectAsync1(((api.Operation response) { |
| 3650 checkOperation(response); | 3823 checkOperation(response); |
| 3651 }))); | 3824 }))); |
| 3652 }); | 3825 }); |
| 3653 | 3826 |
| 3654 unittest.test("method--stopReplica", () { | 3827 unittest.test("method--stopReplica", () { |
| 3655 | |
| 3656 var mock = new HttpServerMock(); | 3828 var mock = new HttpServerMock(); |
| 3657 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3829 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3658 var arg_project = "foo"; | 3830 var arg_project = "foo"; |
| 3659 var arg_instance = "foo"; | 3831 var arg_instance = "foo"; |
| 3660 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3832 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3661 var path = (req.url).path; | 3833 var path = (req.url).path; |
| 3662 var pathOffset = 0; | 3834 var pathOffset = 0; |
| 3663 var index; | 3835 var index; |
| 3664 var subPart; | 3836 var subPart; |
| 3665 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3837 unittest.expect( |
| 3838 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3666 pathOffset += 1; | 3839 pathOffset += 1; |
| 3667 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3840 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3841 unittest.equals("sql/v1beta4/")); |
| 3668 pathOffset += 12; | 3842 pathOffset += 12; |
| 3669 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3843 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3844 unittest.equals("projects/")); |
| 3670 pathOffset += 9; | 3845 pathOffset += 9; |
| 3671 index = path.indexOf("/instances/", pathOffset); | 3846 index = path.indexOf("/instances/", pathOffset); |
| 3672 unittest.expect(index >= 0, unittest.isTrue); | 3847 unittest.expect(index >= 0, unittest.isTrue); |
| 3673 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3848 subPart = |
| 3849 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3674 pathOffset = index; | 3850 pathOffset = index; |
| 3675 unittest.expect(subPart, unittest.equals("$arg_project")); | 3851 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3676 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3852 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3853 unittest.equals("/instances/")); |
| 3677 pathOffset += 11; | 3854 pathOffset += 11; |
| 3678 index = path.indexOf("/stopReplica", pathOffset); | 3855 index = path.indexOf("/stopReplica", pathOffset); |
| 3679 unittest.expect(index >= 0, unittest.isTrue); | 3856 unittest.expect(index >= 0, unittest.isTrue); |
| 3680 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3857 subPart = |
| 3858 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3681 pathOffset = index; | 3859 pathOffset = index; |
| 3682 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3860 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3683 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/stopReplica")); | 3861 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3862 unittest.equals("/stopReplica")); |
| 3684 pathOffset += 12; | 3863 pathOffset += 12; |
| 3685 | 3864 |
| 3686 var query = (req.url).query; | 3865 var query = (req.url).query; |
| 3687 var queryOffset = 0; | 3866 var queryOffset = 0; |
| 3688 var queryMap = {}; | 3867 var queryMap = {}; |
| 3689 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3868 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3690 parseBool(n) { | 3869 parseBool(n) { |
| 3691 if (n == "true") return true; | 3870 if (n == "true") return true; |
| 3692 if (n == "false") return false; | 3871 if (n == "false") return false; |
| 3693 if (n == null) return null; | 3872 if (n == null) return null; |
| 3694 throw new core.ArgumentError("Invalid boolean: $n"); | 3873 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3695 } | 3874 } |
| 3875 |
| 3696 if (query.length > 0) { | 3876 if (query.length > 0) { |
| 3697 for (var part in query.split("&")) { | 3877 for (var part in query.split("&")) { |
| 3698 var keyvalue = part.split("="); | 3878 var keyvalue = part.split("="); |
| 3699 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3879 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3880 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3700 } | 3881 } |
| 3701 } | 3882 } |
| 3702 | 3883 |
| 3703 | |
| 3704 var h = { | 3884 var h = { |
| 3705 "content-type" : "application/json; charset=utf-8", | 3885 "content-type": "application/json; charset=utf-8", |
| 3706 }; | 3886 }; |
| 3707 var resp = convert.JSON.encode(buildOperation()); | 3887 var resp = convert.JSON.encode(buildOperation()); |
| 3708 return new async.Future.value(stringResponse(200, h, resp)); | 3888 return new async.Future.value(stringResponse(200, h, resp)); |
| 3709 }), true); | 3889 }), true); |
| 3710 res.stopReplica(arg_project, arg_instance).then(unittest.expectAsync1(((ap
i.Operation response) { | 3890 res |
| 3891 .stopReplica(arg_project, arg_instance) |
| 3892 .then(unittest.expectAsync1(((api.Operation response) { |
| 3711 checkOperation(response); | 3893 checkOperation(response); |
| 3712 }))); | 3894 }))); |
| 3713 }); | 3895 }); |
| 3714 | 3896 |
| 3715 unittest.test("method--truncateLog", () { | 3897 unittest.test("method--truncateLog", () { |
| 3716 | |
| 3717 var mock = new HttpServerMock(); | 3898 var mock = new HttpServerMock(); |
| 3718 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3899 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3719 var arg_request = buildInstancesTruncateLogRequest(); | 3900 var arg_request = buildInstancesTruncateLogRequest(); |
| 3720 var arg_project = "foo"; | 3901 var arg_project = "foo"; |
| 3721 var arg_instance = "foo"; | 3902 var arg_instance = "foo"; |
| 3722 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3903 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3723 var obj = new api.InstancesTruncateLogRequest.fromJson(json); | 3904 var obj = new api.InstancesTruncateLogRequest.fromJson(json); |
| 3724 checkInstancesTruncateLogRequest(obj); | 3905 checkInstancesTruncateLogRequest(obj); |
| 3725 | 3906 |
| 3726 var path = (req.url).path; | 3907 var path = (req.url).path; |
| 3727 var pathOffset = 0; | 3908 var pathOffset = 0; |
| 3728 var index; | 3909 var index; |
| 3729 var subPart; | 3910 var subPart; |
| 3730 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3911 unittest.expect( |
| 3912 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3731 pathOffset += 1; | 3913 pathOffset += 1; |
| 3732 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3914 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3915 unittest.equals("sql/v1beta4/")); |
| 3733 pathOffset += 12; | 3916 pathOffset += 12; |
| 3734 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3917 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3918 unittest.equals("projects/")); |
| 3735 pathOffset += 9; | 3919 pathOffset += 9; |
| 3736 index = path.indexOf("/instances/", pathOffset); | 3920 index = path.indexOf("/instances/", pathOffset); |
| 3737 unittest.expect(index >= 0, unittest.isTrue); | 3921 unittest.expect(index >= 0, unittest.isTrue); |
| 3738 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3922 subPart = |
| 3923 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3739 pathOffset = index; | 3924 pathOffset = index; |
| 3740 unittest.expect(subPart, unittest.equals("$arg_project")); | 3925 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3741 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3926 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3927 unittest.equals("/instances/")); |
| 3742 pathOffset += 11; | 3928 pathOffset += 11; |
| 3743 index = path.indexOf("/truncateLog", pathOffset); | 3929 index = path.indexOf("/truncateLog", pathOffset); |
| 3744 unittest.expect(index >= 0, unittest.isTrue); | 3930 unittest.expect(index >= 0, unittest.isTrue); |
| 3745 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3931 subPart = |
| 3932 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3746 pathOffset = index; | 3933 pathOffset = index; |
| 3747 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3934 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3748 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/truncateLog")); | 3935 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3936 unittest.equals("/truncateLog")); |
| 3749 pathOffset += 12; | 3937 pathOffset += 12; |
| 3750 | 3938 |
| 3751 var query = (req.url).query; | 3939 var query = (req.url).query; |
| 3752 var queryOffset = 0; | 3940 var queryOffset = 0; |
| 3753 var queryMap = {}; | 3941 var queryMap = {}; |
| 3754 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3942 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3755 parseBool(n) { | 3943 parseBool(n) { |
| 3756 if (n == "true") return true; | 3944 if (n == "true") return true; |
| 3757 if (n == "false") return false; | 3945 if (n == "false") return false; |
| 3758 if (n == null) return null; | 3946 if (n == null) return null; |
| 3759 throw new core.ArgumentError("Invalid boolean: $n"); | 3947 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3760 } | 3948 } |
| 3949 |
| 3761 if (query.length > 0) { | 3950 if (query.length > 0) { |
| 3762 for (var part in query.split("&")) { | 3951 for (var part in query.split("&")) { |
| 3763 var keyvalue = part.split("="); | 3952 var keyvalue = part.split("="); |
| 3764 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3953 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3954 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3765 } | 3955 } |
| 3766 } | 3956 } |
| 3767 | 3957 |
| 3768 | |
| 3769 var h = { | 3958 var h = { |
| 3770 "content-type" : "application/json; charset=utf-8", | 3959 "content-type": "application/json; charset=utf-8", |
| 3771 }; | 3960 }; |
| 3772 var resp = convert.JSON.encode(buildOperation()); | 3961 var resp = convert.JSON.encode(buildOperation()); |
| 3773 return new async.Future.value(stringResponse(200, h, resp)); | 3962 return new async.Future.value(stringResponse(200, h, resp)); |
| 3774 }), true); | 3963 }), true); |
| 3775 res.truncateLog(arg_request, arg_project, arg_instance).then(unittest.expe
ctAsync1(((api.Operation response) { | 3964 res |
| 3965 .truncateLog(arg_request, arg_project, arg_instance) |
| 3966 .then(unittest.expectAsync1(((api.Operation response) { |
| 3776 checkOperation(response); | 3967 checkOperation(response); |
| 3777 }))); | 3968 }))); |
| 3778 }); | 3969 }); |
| 3779 | 3970 |
| 3780 unittest.test("method--update", () { | 3971 unittest.test("method--update", () { |
| 3781 | |
| 3782 var mock = new HttpServerMock(); | 3972 var mock = new HttpServerMock(); |
| 3783 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 3973 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
| 3784 var arg_request = buildDatabaseInstance(); | 3974 var arg_request = buildDatabaseInstance(); |
| 3785 var arg_project = "foo"; | 3975 var arg_project = "foo"; |
| 3786 var arg_instance = "foo"; | 3976 var arg_instance = "foo"; |
| 3787 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3977 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3788 var obj = new api.DatabaseInstance.fromJson(json); | 3978 var obj = new api.DatabaseInstance.fromJson(json); |
| 3789 checkDatabaseInstance(obj); | 3979 checkDatabaseInstance(obj); |
| 3790 | 3980 |
| 3791 var path = (req.url).path; | 3981 var path = (req.url).path; |
| 3792 var pathOffset = 0; | 3982 var pathOffset = 0; |
| 3793 var index; | 3983 var index; |
| 3794 var subPart; | 3984 var subPart; |
| 3795 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3985 unittest.expect( |
| 3986 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3796 pathOffset += 1; | 3987 pathOffset += 1; |
| 3797 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 3988 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3989 unittest.equals("sql/v1beta4/")); |
| 3798 pathOffset += 12; | 3990 pathOffset += 12; |
| 3799 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3991 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3992 unittest.equals("projects/")); |
| 3800 pathOffset += 9; | 3993 pathOffset += 9; |
| 3801 index = path.indexOf("/instances/", pathOffset); | 3994 index = path.indexOf("/instances/", pathOffset); |
| 3802 unittest.expect(index >= 0, unittest.isTrue); | 3995 unittest.expect(index >= 0, unittest.isTrue); |
| 3803 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3996 subPart = |
| 3997 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3804 pathOffset = index; | 3998 pathOffset = index; |
| 3805 unittest.expect(subPart, unittest.equals("$arg_project")); | 3999 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3806 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4000 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4001 unittest.equals("/instances/")); |
| 3807 pathOffset += 11; | 4002 pathOffset += 11; |
| 3808 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 4003 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3809 pathOffset = path.length; | 4004 pathOffset = path.length; |
| 3810 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4005 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3811 | 4006 |
| 3812 var query = (req.url).query; | 4007 var query = (req.url).query; |
| 3813 var queryOffset = 0; | 4008 var queryOffset = 0; |
| 3814 var queryMap = {}; | 4009 var queryMap = {}; |
| 3815 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4010 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3816 parseBool(n) { | 4011 parseBool(n) { |
| 3817 if (n == "true") return true; | 4012 if (n == "true") return true; |
| 3818 if (n == "false") return false; | 4013 if (n == "false") return false; |
| 3819 if (n == null) return null; | 4014 if (n == null) return null; |
| 3820 throw new core.ArgumentError("Invalid boolean: $n"); | 4015 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3821 } | 4016 } |
| 4017 |
| 3822 if (query.length > 0) { | 4018 if (query.length > 0) { |
| 3823 for (var part in query.split("&")) { | 4019 for (var part in query.split("&")) { |
| 3824 var keyvalue = part.split("="); | 4020 var keyvalue = part.split("="); |
| 3825 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4021 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4022 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3826 } | 4023 } |
| 3827 } | 4024 } |
| 3828 | 4025 |
| 3829 | |
| 3830 var h = { | 4026 var h = { |
| 3831 "content-type" : "application/json; charset=utf-8", | 4027 "content-type": "application/json; charset=utf-8", |
| 3832 }; | 4028 }; |
| 3833 var resp = convert.JSON.encode(buildOperation()); | 4029 var resp = convert.JSON.encode(buildOperation()); |
| 3834 return new async.Future.value(stringResponse(200, h, resp)); | 4030 return new async.Future.value(stringResponse(200, h, resp)); |
| 3835 }), true); | 4031 }), true); |
| 3836 res.update(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 4032 res |
| 4033 .update(arg_request, arg_project, arg_instance) |
| 4034 .then(unittest.expectAsync1(((api.Operation response) { |
| 3837 checkOperation(response); | 4035 checkOperation(response); |
| 3838 }))); | 4036 }))); |
| 3839 }); | 4037 }); |
| 3840 | |
| 3841 }); | 4038 }); |
| 3842 | 4039 |
| 3843 | |
| 3844 unittest.group("resource-OperationsResourceApi", () { | 4040 unittest.group("resource-OperationsResourceApi", () { |
| 3845 unittest.test("method--get", () { | 4041 unittest.test("method--get", () { |
| 3846 | |
| 3847 var mock = new HttpServerMock(); | 4042 var mock = new HttpServerMock(); |
| 3848 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; | 4043 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; |
| 3849 var arg_project = "foo"; | 4044 var arg_project = "foo"; |
| 3850 var arg_operation = "foo"; | 4045 var arg_operation = "foo"; |
| 3851 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4046 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3852 var path = (req.url).path; | 4047 var path = (req.url).path; |
| 3853 var pathOffset = 0; | 4048 var pathOffset = 0; |
| 3854 var index; | 4049 var index; |
| 3855 var subPart; | 4050 var subPart; |
| 3856 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4051 unittest.expect( |
| 4052 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3857 pathOffset += 1; | 4053 pathOffset += 1; |
| 3858 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4054 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4055 unittest.equals("sql/v1beta4/")); |
| 3859 pathOffset += 12; | 4056 pathOffset += 12; |
| 3860 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4057 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4058 unittest.equals("projects/")); |
| 3861 pathOffset += 9; | 4059 pathOffset += 9; |
| 3862 index = path.indexOf("/operations/", pathOffset); | 4060 index = path.indexOf("/operations/", pathOffset); |
| 3863 unittest.expect(index >= 0, unittest.isTrue); | 4061 unittest.expect(index >= 0, unittest.isTrue); |
| 3864 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4062 subPart = |
| 4063 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3865 pathOffset = index; | 4064 pathOffset = index; |
| 3866 unittest.expect(subPart, unittest.equals("$arg_project")); | 4065 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3867 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/operations/")); | 4066 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4067 unittest.equals("/operations/")); |
| 3868 pathOffset += 12; | 4068 pathOffset += 12; |
| 3869 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 4069 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3870 pathOffset = path.length; | 4070 pathOffset = path.length; |
| 3871 unittest.expect(subPart, unittest.equals("$arg_operation")); | 4071 unittest.expect(subPart, unittest.equals("$arg_operation")); |
| 3872 | 4072 |
| 3873 var query = (req.url).query; | 4073 var query = (req.url).query; |
| 3874 var queryOffset = 0; | 4074 var queryOffset = 0; |
| 3875 var queryMap = {}; | 4075 var queryMap = {}; |
| 3876 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4076 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3877 parseBool(n) { | 4077 parseBool(n) { |
| 3878 if (n == "true") return true; | 4078 if (n == "true") return true; |
| 3879 if (n == "false") return false; | 4079 if (n == "false") return false; |
| 3880 if (n == null) return null; | 4080 if (n == null) return null; |
| 3881 throw new core.ArgumentError("Invalid boolean: $n"); | 4081 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3882 } | 4082 } |
| 4083 |
| 3883 if (query.length > 0) { | 4084 if (query.length > 0) { |
| 3884 for (var part in query.split("&")) { | 4085 for (var part in query.split("&")) { |
| 3885 var keyvalue = part.split("="); | 4086 var keyvalue = part.split("="); |
| 3886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4087 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4088 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3887 } | 4089 } |
| 3888 } | 4090 } |
| 3889 | 4091 |
| 3890 | |
| 3891 var h = { | 4092 var h = { |
| 3892 "content-type" : "application/json; charset=utf-8", | 4093 "content-type": "application/json; charset=utf-8", |
| 3893 }; | 4094 }; |
| 3894 var resp = convert.JSON.encode(buildOperation()); | 4095 var resp = convert.JSON.encode(buildOperation()); |
| 3895 return new async.Future.value(stringResponse(200, h, resp)); | 4096 return new async.Future.value(stringResponse(200, h, resp)); |
| 3896 }), true); | 4097 }), true); |
| 3897 res.get(arg_project, arg_operation).then(unittest.expectAsync1(((api.Opera
tion response) { | 4098 res |
| 4099 .get(arg_project, arg_operation) |
| 4100 .then(unittest.expectAsync1(((api.Operation response) { |
| 3898 checkOperation(response); | 4101 checkOperation(response); |
| 3899 }))); | 4102 }))); |
| 3900 }); | 4103 }); |
| 3901 | 4104 |
| 3902 unittest.test("method--list", () { | 4105 unittest.test("method--list", () { |
| 3903 | |
| 3904 var mock = new HttpServerMock(); | 4106 var mock = new HttpServerMock(); |
| 3905 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; | 4107 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; |
| 3906 var arg_project = "foo"; | 4108 var arg_project = "foo"; |
| 3907 var arg_instance = "foo"; | 4109 var arg_instance = "foo"; |
| 3908 var arg_maxResults = 42; | 4110 var arg_maxResults = 42; |
| 3909 var arg_pageToken = "foo"; | 4111 var arg_pageToken = "foo"; |
| 3910 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4112 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3911 var path = (req.url).path; | 4113 var path = (req.url).path; |
| 3912 var pathOffset = 0; | 4114 var pathOffset = 0; |
| 3913 var index; | 4115 var index; |
| 3914 var subPart; | 4116 var subPart; |
| 3915 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4117 unittest.expect( |
| 4118 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3916 pathOffset += 1; | 4119 pathOffset += 1; |
| 3917 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4120 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4121 unittest.equals("sql/v1beta4/")); |
| 3918 pathOffset += 12; | 4122 pathOffset += 12; |
| 3919 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4123 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4124 unittest.equals("projects/")); |
| 3920 pathOffset += 9; | 4125 pathOffset += 9; |
| 3921 index = path.indexOf("/operations", pathOffset); | 4126 index = path.indexOf("/operations", pathOffset); |
| 3922 unittest.expect(index >= 0, unittest.isTrue); | 4127 unittest.expect(index >= 0, unittest.isTrue); |
| 3923 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4128 subPart = |
| 4129 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3924 pathOffset = index; | 4130 pathOffset = index; |
| 3925 unittest.expect(subPart, unittest.equals("$arg_project")); | 4131 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3926 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/operations")); | 4132 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4133 unittest.equals("/operations")); |
| 3927 pathOffset += 11; | 4134 pathOffset += 11; |
| 3928 | 4135 |
| 3929 var query = (req.url).query; | 4136 var query = (req.url).query; |
| 3930 var queryOffset = 0; | 4137 var queryOffset = 0; |
| 3931 var queryMap = {}; | 4138 var queryMap = {}; |
| 3932 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4139 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3933 parseBool(n) { | 4140 parseBool(n) { |
| 3934 if (n == "true") return true; | 4141 if (n == "true") return true; |
| 3935 if (n == "false") return false; | 4142 if (n == "false") return false; |
| 3936 if (n == null) return null; | 4143 if (n == null) return null; |
| 3937 throw new core.ArgumentError("Invalid boolean: $n"); | 4144 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3938 } | 4145 } |
| 4146 |
| 3939 if (query.length > 0) { | 4147 if (query.length > 0) { |
| 3940 for (var part in query.split("&")) { | 4148 for (var part in query.split("&")) { |
| 3941 var keyvalue = part.split("="); | 4149 var keyvalue = part.split("="); |
| 3942 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4150 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4151 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3943 } | 4152 } |
| 3944 } | 4153 } |
| 3945 unittest.expect(queryMap["instance"].first, unittest.equals(arg_instance
)); | 4154 unittest.expect( |
| 3946 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 4155 queryMap["instance"].first, unittest.equals(arg_instance)); |
| 3947 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 4156 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 3948 | 4157 unittest.equals(arg_maxResults)); |
| 4158 unittest.expect( |
| 4159 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 3949 | 4160 |
| 3950 var h = { | 4161 var h = { |
| 3951 "content-type" : "application/json; charset=utf-8", | 4162 "content-type": "application/json; charset=utf-8", |
| 3952 }; | 4163 }; |
| 3953 var resp = convert.JSON.encode(buildOperationsListResponse()); | 4164 var resp = convert.JSON.encode(buildOperationsListResponse()); |
| 3954 return new async.Future.value(stringResponse(200, h, resp)); | 4165 return new async.Future.value(stringResponse(200, h, resp)); |
| 3955 }), true); | 4166 }), true); |
| 3956 res.list(arg_project, arg_instance, maxResults: arg_maxResults, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.OperationsListResponse response
) { | 4167 res |
| 4168 .list(arg_project, arg_instance, |
| 4169 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 4170 .then(unittest.expectAsync1(((api.OperationsListResponse response) { |
| 3957 checkOperationsListResponse(response); | 4171 checkOperationsListResponse(response); |
| 3958 }))); | 4172 }))); |
| 3959 }); | 4173 }); |
| 3960 | |
| 3961 }); | 4174 }); |
| 3962 | 4175 |
| 3963 | |
| 3964 unittest.group("resource-SslCertsResourceApi", () { | 4176 unittest.group("resource-SslCertsResourceApi", () { |
| 3965 unittest.test("method--createEphemeral", () { | 4177 unittest.test("method--createEphemeral", () { |
| 3966 | |
| 3967 var mock = new HttpServerMock(); | 4178 var mock = new HttpServerMock(); |
| 3968 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 4179 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
| 3969 var arg_request = buildSslCertsCreateEphemeralRequest(); | 4180 var arg_request = buildSslCertsCreateEphemeralRequest(); |
| 3970 var arg_project = "foo"; | 4181 var arg_project = "foo"; |
| 3971 var arg_instance = "foo"; | 4182 var arg_instance = "foo"; |
| 3972 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4183 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3973 var obj = new api.SslCertsCreateEphemeralRequest.fromJson(json); | 4184 var obj = new api.SslCertsCreateEphemeralRequest.fromJson(json); |
| 3974 checkSslCertsCreateEphemeralRequest(obj); | 4185 checkSslCertsCreateEphemeralRequest(obj); |
| 3975 | 4186 |
| 3976 var path = (req.url).path; | 4187 var path = (req.url).path; |
| 3977 var pathOffset = 0; | 4188 var pathOffset = 0; |
| 3978 var index; | 4189 var index; |
| 3979 var subPart; | 4190 var subPart; |
| 3980 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4191 unittest.expect( |
| 4192 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3981 pathOffset += 1; | 4193 pathOffset += 1; |
| 3982 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4194 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4195 unittest.equals("sql/v1beta4/")); |
| 3983 pathOffset += 12; | 4196 pathOffset += 12; |
| 3984 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4197 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4198 unittest.equals("projects/")); |
| 3985 pathOffset += 9; | 4199 pathOffset += 9; |
| 3986 index = path.indexOf("/instances/", pathOffset); | 4200 index = path.indexOf("/instances/", pathOffset); |
| 3987 unittest.expect(index >= 0, unittest.isTrue); | 4201 unittest.expect(index >= 0, unittest.isTrue); |
| 3988 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4202 subPart = |
| 4203 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3989 pathOffset = index; | 4204 pathOffset = index; |
| 3990 unittest.expect(subPart, unittest.equals("$arg_project")); | 4205 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 3991 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4206 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4207 unittest.equals("/instances/")); |
| 3992 pathOffset += 11; | 4208 pathOffset += 11; |
| 3993 index = path.indexOf("/createEphemeral", pathOffset); | 4209 index = path.indexOf("/createEphemeral", pathOffset); |
| 3994 unittest.expect(index >= 0, unittest.isTrue); | 4210 unittest.expect(index >= 0, unittest.isTrue); |
| 3995 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4211 subPart = |
| 4212 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3996 pathOffset = index; | 4213 pathOffset = index; |
| 3997 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4214 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 3998 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/createEphemeral")); | 4215 unittest.expect(path.substring(pathOffset, pathOffset + 16), |
| 4216 unittest.equals("/createEphemeral")); |
| 3999 pathOffset += 16; | 4217 pathOffset += 16; |
| 4000 | 4218 |
| 4001 var query = (req.url).query; | 4219 var query = (req.url).query; |
| 4002 var queryOffset = 0; | 4220 var queryOffset = 0; |
| 4003 var queryMap = {}; | 4221 var queryMap = {}; |
| 4004 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4222 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4005 parseBool(n) { | 4223 parseBool(n) { |
| 4006 if (n == "true") return true; | 4224 if (n == "true") return true; |
| 4007 if (n == "false") return false; | 4225 if (n == "false") return false; |
| 4008 if (n == null) return null; | 4226 if (n == null) return null; |
| 4009 throw new core.ArgumentError("Invalid boolean: $n"); | 4227 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4010 } | 4228 } |
| 4229 |
| 4011 if (query.length > 0) { | 4230 if (query.length > 0) { |
| 4012 for (var part in query.split("&")) { | 4231 for (var part in query.split("&")) { |
| 4013 var keyvalue = part.split("="); | 4232 var keyvalue = part.split("="); |
| 4014 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4233 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4234 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4015 } | 4235 } |
| 4016 } | 4236 } |
| 4017 | 4237 |
| 4018 | |
| 4019 var h = { | 4238 var h = { |
| 4020 "content-type" : "application/json; charset=utf-8", | 4239 "content-type": "application/json; charset=utf-8", |
| 4021 }; | 4240 }; |
| 4022 var resp = convert.JSON.encode(buildSslCert()); | 4241 var resp = convert.JSON.encode(buildSslCert()); |
| 4023 return new async.Future.value(stringResponse(200, h, resp)); | 4242 return new async.Future.value(stringResponse(200, h, resp)); |
| 4024 }), true); | 4243 }), true); |
| 4025 res.createEphemeral(arg_request, arg_project, arg_instance).then(unittest.
expectAsync1(((api.SslCert response) { | 4244 res |
| 4245 .createEphemeral(arg_request, arg_project, arg_instance) |
| 4246 .then(unittest.expectAsync1(((api.SslCert response) { |
| 4026 checkSslCert(response); | 4247 checkSslCert(response); |
| 4027 }))); | 4248 }))); |
| 4028 }); | 4249 }); |
| 4029 | 4250 |
| 4030 unittest.test("method--delete", () { | 4251 unittest.test("method--delete", () { |
| 4031 | |
| 4032 var mock = new HttpServerMock(); | 4252 var mock = new HttpServerMock(); |
| 4033 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 4253 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
| 4034 var arg_project = "foo"; | 4254 var arg_project = "foo"; |
| 4035 var arg_instance = "foo"; | 4255 var arg_instance = "foo"; |
| 4036 var arg_sha1Fingerprint = "foo"; | 4256 var arg_sha1Fingerprint = "foo"; |
| 4037 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4257 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4038 var path = (req.url).path; | 4258 var path = (req.url).path; |
| 4039 var pathOffset = 0; | 4259 var pathOffset = 0; |
| 4040 var index; | 4260 var index; |
| 4041 var subPart; | 4261 var subPart; |
| 4042 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4262 unittest.expect( |
| 4263 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4043 pathOffset += 1; | 4264 pathOffset += 1; |
| 4044 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4265 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4266 unittest.equals("sql/v1beta4/")); |
| 4045 pathOffset += 12; | 4267 pathOffset += 12; |
| 4046 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4268 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4269 unittest.equals("projects/")); |
| 4047 pathOffset += 9; | 4270 pathOffset += 9; |
| 4048 index = path.indexOf("/instances/", pathOffset); | 4271 index = path.indexOf("/instances/", pathOffset); |
| 4049 unittest.expect(index >= 0, unittest.isTrue); | 4272 unittest.expect(index >= 0, unittest.isTrue); |
| 4050 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4273 subPart = |
| 4274 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4051 pathOffset = index; | 4275 pathOffset = index; |
| 4052 unittest.expect(subPart, unittest.equals("$arg_project")); | 4276 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4053 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4277 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4278 unittest.equals("/instances/")); |
| 4054 pathOffset += 11; | 4279 pathOffset += 11; |
| 4055 index = path.indexOf("/sslCerts/", pathOffset); | 4280 index = path.indexOf("/sslCerts/", pathOffset); |
| 4056 unittest.expect(index >= 0, unittest.isTrue); | 4281 unittest.expect(index >= 0, unittest.isTrue); |
| 4057 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4282 subPart = |
| 4283 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4058 pathOffset = index; | 4284 pathOffset = index; |
| 4059 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4285 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4060 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/sslCerts/")); | 4286 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 4287 unittest.equals("/sslCerts/")); |
| 4061 pathOffset += 10; | 4288 pathOffset += 10; |
| 4062 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 4289 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 4063 pathOffset = path.length; | 4290 pathOffset = path.length; |
| 4064 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); | 4291 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); |
| 4065 | 4292 |
| 4066 var query = (req.url).query; | 4293 var query = (req.url).query; |
| 4067 var queryOffset = 0; | 4294 var queryOffset = 0; |
| 4068 var queryMap = {}; | 4295 var queryMap = {}; |
| 4069 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4296 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4070 parseBool(n) { | 4297 parseBool(n) { |
| 4071 if (n == "true") return true; | 4298 if (n == "true") return true; |
| 4072 if (n == "false") return false; | 4299 if (n == "false") return false; |
| 4073 if (n == null) return null; | 4300 if (n == null) return null; |
| 4074 throw new core.ArgumentError("Invalid boolean: $n"); | 4301 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4075 } | 4302 } |
| 4303 |
| 4076 if (query.length > 0) { | 4304 if (query.length > 0) { |
| 4077 for (var part in query.split("&")) { | 4305 for (var part in query.split("&")) { |
| 4078 var keyvalue = part.split("="); | 4306 var keyvalue = part.split("="); |
| 4079 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4307 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4308 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4080 } | 4309 } |
| 4081 } | 4310 } |
| 4082 | 4311 |
| 4083 | |
| 4084 var h = { | 4312 var h = { |
| 4085 "content-type" : "application/json; charset=utf-8", | 4313 "content-type": "application/json; charset=utf-8", |
| 4086 }; | 4314 }; |
| 4087 var resp = convert.JSON.encode(buildOperation()); | 4315 var resp = convert.JSON.encode(buildOperation()); |
| 4088 return new async.Future.value(stringResponse(200, h, resp)); | 4316 return new async.Future.value(stringResponse(200, h, resp)); |
| 4089 }), true); | 4317 }), true); |
| 4090 res.delete(arg_project, arg_instance, arg_sha1Fingerprint).then(unittest.e
xpectAsync1(((api.Operation response) { | 4318 res |
| 4319 .delete(arg_project, arg_instance, arg_sha1Fingerprint) |
| 4320 .then(unittest.expectAsync1(((api.Operation response) { |
| 4091 checkOperation(response); | 4321 checkOperation(response); |
| 4092 }))); | 4322 }))); |
| 4093 }); | 4323 }); |
| 4094 | 4324 |
| 4095 unittest.test("method--get", () { | 4325 unittest.test("method--get", () { |
| 4096 | |
| 4097 var mock = new HttpServerMock(); | 4326 var mock = new HttpServerMock(); |
| 4098 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 4327 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
| 4099 var arg_project = "foo"; | 4328 var arg_project = "foo"; |
| 4100 var arg_instance = "foo"; | 4329 var arg_instance = "foo"; |
| 4101 var arg_sha1Fingerprint = "foo"; | 4330 var arg_sha1Fingerprint = "foo"; |
| 4102 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4331 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4103 var path = (req.url).path; | 4332 var path = (req.url).path; |
| 4104 var pathOffset = 0; | 4333 var pathOffset = 0; |
| 4105 var index; | 4334 var index; |
| 4106 var subPart; | 4335 var subPart; |
| 4107 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4336 unittest.expect( |
| 4337 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4108 pathOffset += 1; | 4338 pathOffset += 1; |
| 4109 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4339 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4340 unittest.equals("sql/v1beta4/")); |
| 4110 pathOffset += 12; | 4341 pathOffset += 12; |
| 4111 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4342 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4343 unittest.equals("projects/")); |
| 4112 pathOffset += 9; | 4344 pathOffset += 9; |
| 4113 index = path.indexOf("/instances/", pathOffset); | 4345 index = path.indexOf("/instances/", pathOffset); |
| 4114 unittest.expect(index >= 0, unittest.isTrue); | 4346 unittest.expect(index >= 0, unittest.isTrue); |
| 4115 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4347 subPart = |
| 4348 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4116 pathOffset = index; | 4349 pathOffset = index; |
| 4117 unittest.expect(subPart, unittest.equals("$arg_project")); | 4350 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4118 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4351 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4352 unittest.equals("/instances/")); |
| 4119 pathOffset += 11; | 4353 pathOffset += 11; |
| 4120 index = path.indexOf("/sslCerts/", pathOffset); | 4354 index = path.indexOf("/sslCerts/", pathOffset); |
| 4121 unittest.expect(index >= 0, unittest.isTrue); | 4355 unittest.expect(index >= 0, unittest.isTrue); |
| 4122 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4356 subPart = |
| 4357 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4123 pathOffset = index; | 4358 pathOffset = index; |
| 4124 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4359 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4125 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/sslCerts/")); | 4360 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 4361 unittest.equals("/sslCerts/")); |
| 4126 pathOffset += 10; | 4362 pathOffset += 10; |
| 4127 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 4363 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 4128 pathOffset = path.length; | 4364 pathOffset = path.length; |
| 4129 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); | 4365 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); |
| 4130 | 4366 |
| 4131 var query = (req.url).query; | 4367 var query = (req.url).query; |
| 4132 var queryOffset = 0; | 4368 var queryOffset = 0; |
| 4133 var queryMap = {}; | 4369 var queryMap = {}; |
| 4134 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4370 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4135 parseBool(n) { | 4371 parseBool(n) { |
| 4136 if (n == "true") return true; | 4372 if (n == "true") return true; |
| 4137 if (n == "false") return false; | 4373 if (n == "false") return false; |
| 4138 if (n == null) return null; | 4374 if (n == null) return null; |
| 4139 throw new core.ArgumentError("Invalid boolean: $n"); | 4375 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4140 } | 4376 } |
| 4377 |
| 4141 if (query.length > 0) { | 4378 if (query.length > 0) { |
| 4142 for (var part in query.split("&")) { | 4379 for (var part in query.split("&")) { |
| 4143 var keyvalue = part.split("="); | 4380 var keyvalue = part.split("="); |
| 4144 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4381 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4382 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4145 } | 4383 } |
| 4146 } | 4384 } |
| 4147 | 4385 |
| 4148 | |
| 4149 var h = { | 4386 var h = { |
| 4150 "content-type" : "application/json; charset=utf-8", | 4387 "content-type": "application/json; charset=utf-8", |
| 4151 }; | 4388 }; |
| 4152 var resp = convert.JSON.encode(buildSslCert()); | 4389 var resp = convert.JSON.encode(buildSslCert()); |
| 4153 return new async.Future.value(stringResponse(200, h, resp)); | 4390 return new async.Future.value(stringResponse(200, h, resp)); |
| 4154 }), true); | 4391 }), true); |
| 4155 res.get(arg_project, arg_instance, arg_sha1Fingerprint).then(unittest.expe
ctAsync1(((api.SslCert response) { | 4392 res |
| 4393 .get(arg_project, arg_instance, arg_sha1Fingerprint) |
| 4394 .then(unittest.expectAsync1(((api.SslCert response) { |
| 4156 checkSslCert(response); | 4395 checkSslCert(response); |
| 4157 }))); | 4396 }))); |
| 4158 }); | 4397 }); |
| 4159 | 4398 |
| 4160 unittest.test("method--insert", () { | 4399 unittest.test("method--insert", () { |
| 4161 | |
| 4162 var mock = new HttpServerMock(); | 4400 var mock = new HttpServerMock(); |
| 4163 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 4401 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
| 4164 var arg_request = buildSslCertsInsertRequest(); | 4402 var arg_request = buildSslCertsInsertRequest(); |
| 4165 var arg_project = "foo"; | 4403 var arg_project = "foo"; |
| 4166 var arg_instance = "foo"; | 4404 var arg_instance = "foo"; |
| 4167 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4405 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4168 var obj = new api.SslCertsInsertRequest.fromJson(json); | 4406 var obj = new api.SslCertsInsertRequest.fromJson(json); |
| 4169 checkSslCertsInsertRequest(obj); | 4407 checkSslCertsInsertRequest(obj); |
| 4170 | 4408 |
| 4171 var path = (req.url).path; | 4409 var path = (req.url).path; |
| 4172 var pathOffset = 0; | 4410 var pathOffset = 0; |
| 4173 var index; | 4411 var index; |
| 4174 var subPart; | 4412 var subPart; |
| 4175 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4413 unittest.expect( |
| 4414 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4176 pathOffset += 1; | 4415 pathOffset += 1; |
| 4177 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4416 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4417 unittest.equals("sql/v1beta4/")); |
| 4178 pathOffset += 12; | 4418 pathOffset += 12; |
| 4179 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4419 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4420 unittest.equals("projects/")); |
| 4180 pathOffset += 9; | 4421 pathOffset += 9; |
| 4181 index = path.indexOf("/instances/", pathOffset); | 4422 index = path.indexOf("/instances/", pathOffset); |
| 4182 unittest.expect(index >= 0, unittest.isTrue); | 4423 unittest.expect(index >= 0, unittest.isTrue); |
| 4183 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4424 subPart = |
| 4425 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4184 pathOffset = index; | 4426 pathOffset = index; |
| 4185 unittest.expect(subPart, unittest.equals("$arg_project")); | 4427 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4186 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4428 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4429 unittest.equals("/instances/")); |
| 4187 pathOffset += 11; | 4430 pathOffset += 11; |
| 4188 index = path.indexOf("/sslCerts", pathOffset); | 4431 index = path.indexOf("/sslCerts", pathOffset); |
| 4189 unittest.expect(index >= 0, unittest.isTrue); | 4432 unittest.expect(index >= 0, unittest.isTrue); |
| 4190 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4433 subPart = |
| 4434 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4191 pathOffset = index; | 4435 pathOffset = index; |
| 4192 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4436 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4193 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/sslCerts")); | 4437 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4438 unittest.equals("/sslCerts")); |
| 4194 pathOffset += 9; | 4439 pathOffset += 9; |
| 4195 | 4440 |
| 4196 var query = (req.url).query; | 4441 var query = (req.url).query; |
| 4197 var queryOffset = 0; | 4442 var queryOffset = 0; |
| 4198 var queryMap = {}; | 4443 var queryMap = {}; |
| 4199 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4444 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4200 parseBool(n) { | 4445 parseBool(n) { |
| 4201 if (n == "true") return true; | 4446 if (n == "true") return true; |
| 4202 if (n == "false") return false; | 4447 if (n == "false") return false; |
| 4203 if (n == null) return null; | 4448 if (n == null) return null; |
| 4204 throw new core.ArgumentError("Invalid boolean: $n"); | 4449 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4205 } | 4450 } |
| 4451 |
| 4206 if (query.length > 0) { | 4452 if (query.length > 0) { |
| 4207 for (var part in query.split("&")) { | 4453 for (var part in query.split("&")) { |
| 4208 var keyvalue = part.split("="); | 4454 var keyvalue = part.split("="); |
| 4209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4455 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4456 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4210 } | 4457 } |
| 4211 } | 4458 } |
| 4212 | 4459 |
| 4213 | |
| 4214 var h = { | 4460 var h = { |
| 4215 "content-type" : "application/json; charset=utf-8", | 4461 "content-type": "application/json; charset=utf-8", |
| 4216 }; | 4462 }; |
| 4217 var resp = convert.JSON.encode(buildSslCertsInsertResponse()); | 4463 var resp = convert.JSON.encode(buildSslCertsInsertResponse()); |
| 4218 return new async.Future.value(stringResponse(200, h, resp)); | 4464 return new async.Future.value(stringResponse(200, h, resp)); |
| 4219 }), true); | 4465 }), true); |
| 4220 res.insert(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.SslCertsInsertResponse response) { | 4466 res |
| 4467 .insert(arg_request, arg_project, arg_instance) |
| 4468 .then(unittest.expectAsync1(((api.SslCertsInsertResponse response) { |
| 4221 checkSslCertsInsertResponse(response); | 4469 checkSslCertsInsertResponse(response); |
| 4222 }))); | 4470 }))); |
| 4223 }); | 4471 }); |
| 4224 | 4472 |
| 4225 unittest.test("method--list", () { | 4473 unittest.test("method--list", () { |
| 4226 | |
| 4227 var mock = new HttpServerMock(); | 4474 var mock = new HttpServerMock(); |
| 4228 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 4475 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
| 4229 var arg_project = "foo"; | 4476 var arg_project = "foo"; |
| 4230 var arg_instance = "foo"; | 4477 var arg_instance = "foo"; |
| 4231 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4478 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4232 var path = (req.url).path; | 4479 var path = (req.url).path; |
| 4233 var pathOffset = 0; | 4480 var pathOffset = 0; |
| 4234 var index; | 4481 var index; |
| 4235 var subPart; | 4482 var subPart; |
| 4236 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4483 unittest.expect( |
| 4484 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4237 pathOffset += 1; | 4485 pathOffset += 1; |
| 4238 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4486 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4487 unittest.equals("sql/v1beta4/")); |
| 4239 pathOffset += 12; | 4488 pathOffset += 12; |
| 4240 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4489 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4490 unittest.equals("projects/")); |
| 4241 pathOffset += 9; | 4491 pathOffset += 9; |
| 4242 index = path.indexOf("/instances/", pathOffset); | 4492 index = path.indexOf("/instances/", pathOffset); |
| 4243 unittest.expect(index >= 0, unittest.isTrue); | 4493 unittest.expect(index >= 0, unittest.isTrue); |
| 4244 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4494 subPart = |
| 4495 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4245 pathOffset = index; | 4496 pathOffset = index; |
| 4246 unittest.expect(subPart, unittest.equals("$arg_project")); | 4497 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4247 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4498 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4499 unittest.equals("/instances/")); |
| 4248 pathOffset += 11; | 4500 pathOffset += 11; |
| 4249 index = path.indexOf("/sslCerts", pathOffset); | 4501 index = path.indexOf("/sslCerts", pathOffset); |
| 4250 unittest.expect(index >= 0, unittest.isTrue); | 4502 unittest.expect(index >= 0, unittest.isTrue); |
| 4251 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4503 subPart = |
| 4504 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4252 pathOffset = index; | 4505 pathOffset = index; |
| 4253 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4506 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4254 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/sslCerts")); | 4507 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4508 unittest.equals("/sslCerts")); |
| 4255 pathOffset += 9; | 4509 pathOffset += 9; |
| 4256 | 4510 |
| 4257 var query = (req.url).query; | 4511 var query = (req.url).query; |
| 4258 var queryOffset = 0; | 4512 var queryOffset = 0; |
| 4259 var queryMap = {}; | 4513 var queryMap = {}; |
| 4260 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4514 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4261 parseBool(n) { | 4515 parseBool(n) { |
| 4262 if (n == "true") return true; | 4516 if (n == "true") return true; |
| 4263 if (n == "false") return false; | 4517 if (n == "false") return false; |
| 4264 if (n == null) return null; | 4518 if (n == null) return null; |
| 4265 throw new core.ArgumentError("Invalid boolean: $n"); | 4519 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4266 } | 4520 } |
| 4521 |
| 4267 if (query.length > 0) { | 4522 if (query.length > 0) { |
| 4268 for (var part in query.split("&")) { | 4523 for (var part in query.split("&")) { |
| 4269 var keyvalue = part.split("="); | 4524 var keyvalue = part.split("="); |
| 4270 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4525 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4526 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4271 } | 4527 } |
| 4272 } | 4528 } |
| 4273 | 4529 |
| 4274 | |
| 4275 var h = { | 4530 var h = { |
| 4276 "content-type" : "application/json; charset=utf-8", | 4531 "content-type": "application/json; charset=utf-8", |
| 4277 }; | 4532 }; |
| 4278 var resp = convert.JSON.encode(buildSslCertsListResponse()); | 4533 var resp = convert.JSON.encode(buildSslCertsListResponse()); |
| 4279 return new async.Future.value(stringResponse(200, h, resp)); | 4534 return new async.Future.value(stringResponse(200, h, resp)); |
| 4280 }), true); | 4535 }), true); |
| 4281 res.list(arg_project, arg_instance).then(unittest.expectAsync1(((api.SslCe
rtsListResponse response) { | 4536 res |
| 4537 .list(arg_project, arg_instance) |
| 4538 .then(unittest.expectAsync1(((api.SslCertsListResponse response) { |
| 4282 checkSslCertsListResponse(response); | 4539 checkSslCertsListResponse(response); |
| 4283 }))); | 4540 }))); |
| 4284 }); | 4541 }); |
| 4285 | |
| 4286 }); | 4542 }); |
| 4287 | 4543 |
| 4288 | |
| 4289 unittest.group("resource-TiersResourceApi", () { | 4544 unittest.group("resource-TiersResourceApi", () { |
| 4290 unittest.test("method--list", () { | 4545 unittest.test("method--list", () { |
| 4291 | |
| 4292 var mock = new HttpServerMock(); | 4546 var mock = new HttpServerMock(); |
| 4293 api.TiersResourceApi res = new api.SqladminApi(mock).tiers; | 4547 api.TiersResourceApi res = new api.SqladminApi(mock).tiers; |
| 4294 var arg_project = "foo"; | 4548 var arg_project = "foo"; |
| 4295 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4549 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4296 var path = (req.url).path; | 4550 var path = (req.url).path; |
| 4297 var pathOffset = 0; | 4551 var pathOffset = 0; |
| 4298 var index; | 4552 var index; |
| 4299 var subPart; | 4553 var subPart; |
| 4300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4554 unittest.expect( |
| 4555 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4301 pathOffset += 1; | 4556 pathOffset += 1; |
| 4302 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4557 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4558 unittest.equals("sql/v1beta4/")); |
| 4303 pathOffset += 12; | 4559 pathOffset += 12; |
| 4304 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4560 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4561 unittest.equals("projects/")); |
| 4305 pathOffset += 9; | 4562 pathOffset += 9; |
| 4306 index = path.indexOf("/tiers", pathOffset); | 4563 index = path.indexOf("/tiers", pathOffset); |
| 4307 unittest.expect(index >= 0, unittest.isTrue); | 4564 unittest.expect(index >= 0, unittest.isTrue); |
| 4308 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4565 subPart = |
| 4566 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4309 pathOffset = index; | 4567 pathOffset = index; |
| 4310 unittest.expect(subPart, unittest.equals("$arg_project")); | 4568 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4311 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/tiers")); | 4569 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 4570 unittest.equals("/tiers")); |
| 4312 pathOffset += 6; | 4571 pathOffset += 6; |
| 4313 | 4572 |
| 4314 var query = (req.url).query; | 4573 var query = (req.url).query; |
| 4315 var queryOffset = 0; | 4574 var queryOffset = 0; |
| 4316 var queryMap = {}; | 4575 var queryMap = {}; |
| 4317 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4576 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4318 parseBool(n) { | 4577 parseBool(n) { |
| 4319 if (n == "true") return true; | 4578 if (n == "true") return true; |
| 4320 if (n == "false") return false; | 4579 if (n == "false") return false; |
| 4321 if (n == null) return null; | 4580 if (n == null) return null; |
| 4322 throw new core.ArgumentError("Invalid boolean: $n"); | 4581 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4323 } | 4582 } |
| 4583 |
| 4324 if (query.length > 0) { | 4584 if (query.length > 0) { |
| 4325 for (var part in query.split("&")) { | 4585 for (var part in query.split("&")) { |
| 4326 var keyvalue = part.split("="); | 4586 var keyvalue = part.split("="); |
| 4327 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4587 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4588 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4328 } | 4589 } |
| 4329 } | 4590 } |
| 4330 | 4591 |
| 4331 | |
| 4332 var h = { | 4592 var h = { |
| 4333 "content-type" : "application/json; charset=utf-8", | 4593 "content-type": "application/json; charset=utf-8", |
| 4334 }; | 4594 }; |
| 4335 var resp = convert.JSON.encode(buildTiersListResponse()); | 4595 var resp = convert.JSON.encode(buildTiersListResponse()); |
| 4336 return new async.Future.value(stringResponse(200, h, resp)); | 4596 return new async.Future.value(stringResponse(200, h, resp)); |
| 4337 }), true); | 4597 }), true); |
| 4338 res.list(arg_project).then(unittest.expectAsync1(((api.TiersListResponse r
esponse) { | 4598 res |
| 4599 .list(arg_project) |
| 4600 .then(unittest.expectAsync1(((api.TiersListResponse response) { |
| 4339 checkTiersListResponse(response); | 4601 checkTiersListResponse(response); |
| 4340 }))); | 4602 }))); |
| 4341 }); | 4603 }); |
| 4342 | |
| 4343 }); | 4604 }); |
| 4344 | 4605 |
| 4345 | |
| 4346 unittest.group("resource-UsersResourceApi", () { | 4606 unittest.group("resource-UsersResourceApi", () { |
| 4347 unittest.test("method--delete", () { | 4607 unittest.test("method--delete", () { |
| 4348 | |
| 4349 var mock = new HttpServerMock(); | 4608 var mock = new HttpServerMock(); |
| 4350 api.UsersResourceApi res = new api.SqladminApi(mock).users; | 4609 api.UsersResourceApi res = new api.SqladminApi(mock).users; |
| 4351 var arg_project = "foo"; | 4610 var arg_project = "foo"; |
| 4352 var arg_instance = "foo"; | 4611 var arg_instance = "foo"; |
| 4353 var arg_host = "foo"; | 4612 var arg_host = "foo"; |
| 4354 var arg_name = "foo"; | 4613 var arg_name = "foo"; |
| 4355 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4614 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4356 var path = (req.url).path; | 4615 var path = (req.url).path; |
| 4357 var pathOffset = 0; | 4616 var pathOffset = 0; |
| 4358 var index; | 4617 var index; |
| 4359 var subPart; | 4618 var subPart; |
| 4360 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4619 unittest.expect( |
| 4620 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4361 pathOffset += 1; | 4621 pathOffset += 1; |
| 4362 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4622 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4623 unittest.equals("sql/v1beta4/")); |
| 4363 pathOffset += 12; | 4624 pathOffset += 12; |
| 4364 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4625 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4626 unittest.equals("projects/")); |
| 4365 pathOffset += 9; | 4627 pathOffset += 9; |
| 4366 index = path.indexOf("/instances/", pathOffset); | 4628 index = path.indexOf("/instances/", pathOffset); |
| 4367 unittest.expect(index >= 0, unittest.isTrue); | 4629 unittest.expect(index >= 0, unittest.isTrue); |
| 4368 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4630 subPart = |
| 4631 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4369 pathOffset = index; | 4632 pathOffset = index; |
| 4370 unittest.expect(subPart, unittest.equals("$arg_project")); | 4633 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4371 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4634 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4635 unittest.equals("/instances/")); |
| 4372 pathOffset += 11; | 4636 pathOffset += 11; |
| 4373 index = path.indexOf("/users", pathOffset); | 4637 index = path.indexOf("/users", pathOffset); |
| 4374 unittest.expect(index >= 0, unittest.isTrue); | 4638 unittest.expect(index >= 0, unittest.isTrue); |
| 4375 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4639 subPart = |
| 4640 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4376 pathOffset = index; | 4641 pathOffset = index; |
| 4377 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4642 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4378 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); | 4643 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 4644 unittest.equals("/users")); |
| 4379 pathOffset += 6; | 4645 pathOffset += 6; |
| 4380 | 4646 |
| 4381 var query = (req.url).query; | 4647 var query = (req.url).query; |
| 4382 var queryOffset = 0; | 4648 var queryOffset = 0; |
| 4383 var queryMap = {}; | 4649 var queryMap = {}; |
| 4384 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4650 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4385 parseBool(n) { | 4651 parseBool(n) { |
| 4386 if (n == "true") return true; | 4652 if (n == "true") return true; |
| 4387 if (n == "false") return false; | 4653 if (n == "false") return false; |
| 4388 if (n == null) return null; | 4654 if (n == null) return null; |
| 4389 throw new core.ArgumentError("Invalid boolean: $n"); | 4655 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4390 } | 4656 } |
| 4657 |
| 4391 if (query.length > 0) { | 4658 if (query.length > 0) { |
| 4392 for (var part in query.split("&")) { | 4659 for (var part in query.split("&")) { |
| 4393 var keyvalue = part.split("="); | 4660 var keyvalue = part.split("="); |
| 4394 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4661 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4662 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4395 } | 4663 } |
| 4396 } | 4664 } |
| 4397 unittest.expect(queryMap["host"].first, unittest.equals(arg_host)); | 4665 unittest.expect(queryMap["host"].first, unittest.equals(arg_host)); |
| 4398 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | 4666 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 4399 | 4667 |
| 4400 | |
| 4401 var h = { | 4668 var h = { |
| 4402 "content-type" : "application/json; charset=utf-8", | 4669 "content-type": "application/json; charset=utf-8", |
| 4403 }; | 4670 }; |
| 4404 var resp = convert.JSON.encode(buildOperation()); | 4671 var resp = convert.JSON.encode(buildOperation()); |
| 4405 return new async.Future.value(stringResponse(200, h, resp)); | 4672 return new async.Future.value(stringResponse(200, h, resp)); |
| 4406 }), true); | 4673 }), true); |
| 4407 res.delete(arg_project, arg_instance, arg_host, arg_name).then(unittest.ex
pectAsync1(((api.Operation response) { | 4674 res |
| 4675 .delete(arg_project, arg_instance, arg_host, arg_name) |
| 4676 .then(unittest.expectAsync1(((api.Operation response) { |
| 4408 checkOperation(response); | 4677 checkOperation(response); |
| 4409 }))); | 4678 }))); |
| 4410 }); | 4679 }); |
| 4411 | 4680 |
| 4412 unittest.test("method--insert", () { | 4681 unittest.test("method--insert", () { |
| 4413 | |
| 4414 var mock = new HttpServerMock(); | 4682 var mock = new HttpServerMock(); |
| 4415 api.UsersResourceApi res = new api.SqladminApi(mock).users; | 4683 api.UsersResourceApi res = new api.SqladminApi(mock).users; |
| 4416 var arg_request = buildUser(); | 4684 var arg_request = buildUser(); |
| 4417 var arg_project = "foo"; | 4685 var arg_project = "foo"; |
| 4418 var arg_instance = "foo"; | 4686 var arg_instance = "foo"; |
| 4419 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4687 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4420 var obj = new api.User.fromJson(json); | 4688 var obj = new api.User.fromJson(json); |
| 4421 checkUser(obj); | 4689 checkUser(obj); |
| 4422 | 4690 |
| 4423 var path = (req.url).path; | 4691 var path = (req.url).path; |
| 4424 var pathOffset = 0; | 4692 var pathOffset = 0; |
| 4425 var index; | 4693 var index; |
| 4426 var subPart; | 4694 var subPart; |
| 4427 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4695 unittest.expect( |
| 4696 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4428 pathOffset += 1; | 4697 pathOffset += 1; |
| 4429 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4698 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4699 unittest.equals("sql/v1beta4/")); |
| 4430 pathOffset += 12; | 4700 pathOffset += 12; |
| 4431 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4701 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4702 unittest.equals("projects/")); |
| 4432 pathOffset += 9; | 4703 pathOffset += 9; |
| 4433 index = path.indexOf("/instances/", pathOffset); | 4704 index = path.indexOf("/instances/", pathOffset); |
| 4434 unittest.expect(index >= 0, unittest.isTrue); | 4705 unittest.expect(index >= 0, unittest.isTrue); |
| 4435 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4706 subPart = |
| 4707 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4436 pathOffset = index; | 4708 pathOffset = index; |
| 4437 unittest.expect(subPart, unittest.equals("$arg_project")); | 4709 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4438 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4710 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4711 unittest.equals("/instances/")); |
| 4439 pathOffset += 11; | 4712 pathOffset += 11; |
| 4440 index = path.indexOf("/users", pathOffset); | 4713 index = path.indexOf("/users", pathOffset); |
| 4441 unittest.expect(index >= 0, unittest.isTrue); | 4714 unittest.expect(index >= 0, unittest.isTrue); |
| 4442 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4715 subPart = |
| 4716 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4443 pathOffset = index; | 4717 pathOffset = index; |
| 4444 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4718 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4445 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); | 4719 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 4720 unittest.equals("/users")); |
| 4446 pathOffset += 6; | 4721 pathOffset += 6; |
| 4447 | 4722 |
| 4448 var query = (req.url).query; | 4723 var query = (req.url).query; |
| 4449 var queryOffset = 0; | 4724 var queryOffset = 0; |
| 4450 var queryMap = {}; | 4725 var queryMap = {}; |
| 4451 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4726 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4452 parseBool(n) { | 4727 parseBool(n) { |
| 4453 if (n == "true") return true; | 4728 if (n == "true") return true; |
| 4454 if (n == "false") return false; | 4729 if (n == "false") return false; |
| 4455 if (n == null) return null; | 4730 if (n == null) return null; |
| 4456 throw new core.ArgumentError("Invalid boolean: $n"); | 4731 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4457 } | 4732 } |
| 4733 |
| 4458 if (query.length > 0) { | 4734 if (query.length > 0) { |
| 4459 for (var part in query.split("&")) { | 4735 for (var part in query.split("&")) { |
| 4460 var keyvalue = part.split("="); | 4736 var keyvalue = part.split("="); |
| 4461 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4737 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4738 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4462 } | 4739 } |
| 4463 } | 4740 } |
| 4464 | 4741 |
| 4465 | |
| 4466 var h = { | 4742 var h = { |
| 4467 "content-type" : "application/json; charset=utf-8", | 4743 "content-type": "application/json; charset=utf-8", |
| 4468 }; | 4744 }; |
| 4469 var resp = convert.JSON.encode(buildOperation()); | 4745 var resp = convert.JSON.encode(buildOperation()); |
| 4470 return new async.Future.value(stringResponse(200, h, resp)); | 4746 return new async.Future.value(stringResponse(200, h, resp)); |
| 4471 }), true); | 4747 }), true); |
| 4472 res.insert(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.Operation response) { | 4748 res |
| 4749 .insert(arg_request, arg_project, arg_instance) |
| 4750 .then(unittest.expectAsync1(((api.Operation response) { |
| 4473 checkOperation(response); | 4751 checkOperation(response); |
| 4474 }))); | 4752 }))); |
| 4475 }); | 4753 }); |
| 4476 | 4754 |
| 4477 unittest.test("method--list", () { | 4755 unittest.test("method--list", () { |
| 4478 | |
| 4479 var mock = new HttpServerMock(); | 4756 var mock = new HttpServerMock(); |
| 4480 api.UsersResourceApi res = new api.SqladminApi(mock).users; | 4757 api.UsersResourceApi res = new api.SqladminApi(mock).users; |
| 4481 var arg_project = "foo"; | 4758 var arg_project = "foo"; |
| 4482 var arg_instance = "foo"; | 4759 var arg_instance = "foo"; |
| 4483 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4760 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4484 var path = (req.url).path; | 4761 var path = (req.url).path; |
| 4485 var pathOffset = 0; | 4762 var pathOffset = 0; |
| 4486 var index; | 4763 var index; |
| 4487 var subPart; | 4764 var subPart; |
| 4488 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4765 unittest.expect( |
| 4766 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4489 pathOffset += 1; | 4767 pathOffset += 1; |
| 4490 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4768 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4769 unittest.equals("sql/v1beta4/")); |
| 4491 pathOffset += 12; | 4770 pathOffset += 12; |
| 4492 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4771 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4772 unittest.equals("projects/")); |
| 4493 pathOffset += 9; | 4773 pathOffset += 9; |
| 4494 index = path.indexOf("/instances/", pathOffset); | 4774 index = path.indexOf("/instances/", pathOffset); |
| 4495 unittest.expect(index >= 0, unittest.isTrue); | 4775 unittest.expect(index >= 0, unittest.isTrue); |
| 4496 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4776 subPart = |
| 4777 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4497 pathOffset = index; | 4778 pathOffset = index; |
| 4498 unittest.expect(subPart, unittest.equals("$arg_project")); | 4779 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4499 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4780 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4781 unittest.equals("/instances/")); |
| 4500 pathOffset += 11; | 4782 pathOffset += 11; |
| 4501 index = path.indexOf("/users", pathOffset); | 4783 index = path.indexOf("/users", pathOffset); |
| 4502 unittest.expect(index >= 0, unittest.isTrue); | 4784 unittest.expect(index >= 0, unittest.isTrue); |
| 4503 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4785 subPart = |
| 4786 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4504 pathOffset = index; | 4787 pathOffset = index; |
| 4505 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4788 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4506 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); | 4789 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 4790 unittest.equals("/users")); |
| 4507 pathOffset += 6; | 4791 pathOffset += 6; |
| 4508 | 4792 |
| 4509 var query = (req.url).query; | 4793 var query = (req.url).query; |
| 4510 var queryOffset = 0; | 4794 var queryOffset = 0; |
| 4511 var queryMap = {}; | 4795 var queryMap = {}; |
| 4512 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4796 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4513 parseBool(n) { | 4797 parseBool(n) { |
| 4514 if (n == "true") return true; | 4798 if (n == "true") return true; |
| 4515 if (n == "false") return false; | 4799 if (n == "false") return false; |
| 4516 if (n == null) return null; | 4800 if (n == null) return null; |
| 4517 throw new core.ArgumentError("Invalid boolean: $n"); | 4801 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4518 } | 4802 } |
| 4803 |
| 4519 if (query.length > 0) { | 4804 if (query.length > 0) { |
| 4520 for (var part in query.split("&")) { | 4805 for (var part in query.split("&")) { |
| 4521 var keyvalue = part.split("="); | 4806 var keyvalue = part.split("="); |
| 4522 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4807 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4808 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4523 } | 4809 } |
| 4524 } | 4810 } |
| 4525 | 4811 |
| 4526 | |
| 4527 var h = { | 4812 var h = { |
| 4528 "content-type" : "application/json; charset=utf-8", | 4813 "content-type": "application/json; charset=utf-8", |
| 4529 }; | 4814 }; |
| 4530 var resp = convert.JSON.encode(buildUsersListResponse()); | 4815 var resp = convert.JSON.encode(buildUsersListResponse()); |
| 4531 return new async.Future.value(stringResponse(200, h, resp)); | 4816 return new async.Future.value(stringResponse(200, h, resp)); |
| 4532 }), true); | 4817 }), true); |
| 4533 res.list(arg_project, arg_instance).then(unittest.expectAsync1(((api.Users
ListResponse response) { | 4818 res |
| 4819 .list(arg_project, arg_instance) |
| 4820 .then(unittest.expectAsync1(((api.UsersListResponse response) { |
| 4534 checkUsersListResponse(response); | 4821 checkUsersListResponse(response); |
| 4535 }))); | 4822 }))); |
| 4536 }); | 4823 }); |
| 4537 | 4824 |
| 4538 unittest.test("method--update", () { | 4825 unittest.test("method--update", () { |
| 4539 | |
| 4540 var mock = new HttpServerMock(); | 4826 var mock = new HttpServerMock(); |
| 4541 api.UsersResourceApi res = new api.SqladminApi(mock).users; | 4827 api.UsersResourceApi res = new api.SqladminApi(mock).users; |
| 4542 var arg_request = buildUser(); | 4828 var arg_request = buildUser(); |
| 4543 var arg_project = "foo"; | 4829 var arg_project = "foo"; |
| 4544 var arg_instance = "foo"; | 4830 var arg_instance = "foo"; |
| 4545 var arg_host = "foo"; | 4831 var arg_host = "foo"; |
| 4546 var arg_name = "foo"; | 4832 var arg_name = "foo"; |
| 4547 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 4833 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 4548 var obj = new api.User.fromJson(json); | 4834 var obj = new api.User.fromJson(json); |
| 4549 checkUser(obj); | 4835 checkUser(obj); |
| 4550 | 4836 |
| 4551 var path = (req.url).path; | 4837 var path = (req.url).path; |
| 4552 var pathOffset = 0; | 4838 var pathOffset = 0; |
| 4553 var index; | 4839 var index; |
| 4554 var subPart; | 4840 var subPart; |
| 4555 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 4841 unittest.expect( |
| 4842 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 4556 pathOffset += 1; | 4843 pathOffset += 1; |
| 4557 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta4/")); | 4844 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 4845 unittest.equals("sql/v1beta4/")); |
| 4558 pathOffset += 12; | 4846 pathOffset += 12; |
| 4559 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 4847 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 4848 unittest.equals("projects/")); |
| 4560 pathOffset += 9; | 4849 pathOffset += 9; |
| 4561 index = path.indexOf("/instances/", pathOffset); | 4850 index = path.indexOf("/instances/", pathOffset); |
| 4562 unittest.expect(index >= 0, unittest.isTrue); | 4851 unittest.expect(index >= 0, unittest.isTrue); |
| 4563 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4852 subPart = |
| 4853 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4564 pathOffset = index; | 4854 pathOffset = index; |
| 4565 unittest.expect(subPart, unittest.equals("$arg_project")); | 4855 unittest.expect(subPart, unittest.equals("$arg_project")); |
| 4566 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 4856 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 4857 unittest.equals("/instances/")); |
| 4567 pathOffset += 11; | 4858 pathOffset += 11; |
| 4568 index = path.indexOf("/users", pathOffset); | 4859 index = path.indexOf("/users", pathOffset); |
| 4569 unittest.expect(index >= 0, unittest.isTrue); | 4860 unittest.expect(index >= 0, unittest.isTrue); |
| 4570 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 4861 subPart = |
| 4862 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 4571 pathOffset = index; | 4863 pathOffset = index; |
| 4572 unittest.expect(subPart, unittest.equals("$arg_instance")); | 4864 unittest.expect(subPart, unittest.equals("$arg_instance")); |
| 4573 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); | 4865 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 4866 unittest.equals("/users")); |
| 4574 pathOffset += 6; | 4867 pathOffset += 6; |
| 4575 | 4868 |
| 4576 var query = (req.url).query; | 4869 var query = (req.url).query; |
| 4577 var queryOffset = 0; | 4870 var queryOffset = 0; |
| 4578 var queryMap = {}; | 4871 var queryMap = {}; |
| 4579 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 4872 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4580 parseBool(n) { | 4873 parseBool(n) { |
| 4581 if (n == "true") return true; | 4874 if (n == "true") return true; |
| 4582 if (n == "false") return false; | 4875 if (n == "false") return false; |
| 4583 if (n == null) return null; | 4876 if (n == null) return null; |
| 4584 throw new core.ArgumentError("Invalid boolean: $n"); | 4877 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4585 } | 4878 } |
| 4879 |
| 4586 if (query.length > 0) { | 4880 if (query.length > 0) { |
| 4587 for (var part in query.split("&")) { | 4881 for (var part in query.split("&")) { |
| 4588 var keyvalue = part.split("="); | 4882 var keyvalue = part.split("="); |
| 4589 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 4883 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 4884 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 4590 } | 4885 } |
| 4591 } | 4886 } |
| 4592 unittest.expect(queryMap["host"].first, unittest.equals(arg_host)); | 4887 unittest.expect(queryMap["host"].first, unittest.equals(arg_host)); |
| 4593 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | 4888 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
| 4594 | 4889 |
| 4595 | |
| 4596 var h = { | 4890 var h = { |
| 4597 "content-type" : "application/json; charset=utf-8", | 4891 "content-type": "application/json; charset=utf-8", |
| 4598 }; | 4892 }; |
| 4599 var resp = convert.JSON.encode(buildOperation()); | 4893 var resp = convert.JSON.encode(buildOperation()); |
| 4600 return new async.Future.value(stringResponse(200, h, resp)); | 4894 return new async.Future.value(stringResponse(200, h, resp)); |
| 4601 }), true); | 4895 }), true); |
| 4602 res.update(arg_request, arg_project, arg_instance, arg_host, arg_name).the
n(unittest.expectAsync1(((api.Operation response) { | 4896 res |
| 4897 .update(arg_request, arg_project, arg_instance, arg_host, arg_name) |
| 4898 .then(unittest.expectAsync1(((api.Operation response) { |
| 4603 checkOperation(response); | 4899 checkOperation(response); |
| 4604 }))); | 4900 }))); |
| 4605 }); | 4901 }); |
| 4606 | |
| 4607 }); | 4902 }); |
| 4608 | |
| 4609 | |
| 4610 } | 4903 } |
| 4611 | |
| OLD | NEW |