OLD | NEW |
1 library googleapis_beta.sqladmin.v1beta3.test; | 1 library googleapis_beta.sqladmin.v1beta3.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/v1beta3.dart' as api; | 10 import 'package:googleapis_beta/sqladmin/v1beta3.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 buildCounterBackupConfiguration = 0; | 53 core.int buildCounterBackupConfiguration = 0; |
55 buildBackupConfiguration() { | 54 buildBackupConfiguration() { |
56 var o = new api.BackupConfiguration(); | 55 var o = new api.BackupConfiguration(); |
57 buildCounterBackupConfiguration++; | 56 buildCounterBackupConfiguration++; |
58 if (buildCounterBackupConfiguration < 3) { | 57 if (buildCounterBackupConfiguration < 3) { |
59 o.binaryLogEnabled = true; | 58 o.binaryLogEnabled = true; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 o.status = "foo"; | 93 o.status = "foo"; |
95 } | 94 } |
96 buildCounterBackupRun--; | 95 buildCounterBackupRun--; |
97 return o; | 96 return o; |
98 } | 97 } |
99 | 98 |
100 checkBackupRun(api.BackupRun o) { | 99 checkBackupRun(api.BackupRun o) { |
101 buildCounterBackupRun++; | 100 buildCounterBackupRun++; |
102 if (buildCounterBackupRun < 3) { | 101 if (buildCounterBackupRun < 3) { |
103 unittest.expect(o.backupConfiguration, unittest.equals('foo')); | 102 unittest.expect(o.backupConfiguration, unittest.equals('foo')); |
104 unittest.expect(o.dueTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 103 unittest.expect( |
105 unittest.expect(o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 104 o.dueTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
106 unittest.expect(o.enqueuedTime, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); | 105 unittest.expect( |
| 106 o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 107 unittest.expect(o.enqueuedTime, |
| 108 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
107 checkOperationError(o.error); | 109 checkOperationError(o.error); |
108 unittest.expect(o.instance, unittest.equals('foo')); | 110 unittest.expect(o.instance, unittest.equals('foo')); |
109 unittest.expect(o.kind, unittest.equals('foo')); | 111 unittest.expect(o.kind, unittest.equals('foo')); |
110 unittest.expect(o.startTime, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 112 unittest.expect(o.startTime, |
| 113 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
111 unittest.expect(o.status, unittest.equals('foo')); | 114 unittest.expect(o.status, unittest.equals('foo')); |
112 } | 115 } |
113 buildCounterBackupRun--; | 116 buildCounterBackupRun--; |
114 } | 117 } |
115 | 118 |
116 buildUnnamed3191() { | 119 buildUnnamed3184() { |
117 var o = new core.List<api.BackupRun>(); | 120 var o = new core.List<api.BackupRun>(); |
118 o.add(buildBackupRun()); | 121 o.add(buildBackupRun()); |
119 o.add(buildBackupRun()); | 122 o.add(buildBackupRun()); |
120 return o; | 123 return o; |
121 } | 124 } |
122 | 125 |
123 checkUnnamed3191(core.List<api.BackupRun> o) { | 126 checkUnnamed3184(core.List<api.BackupRun> o) { |
124 unittest.expect(o, unittest.hasLength(2)); | 127 unittest.expect(o, unittest.hasLength(2)); |
125 checkBackupRun(o[0]); | 128 checkBackupRun(o[0]); |
126 checkBackupRun(o[1]); | 129 checkBackupRun(o[1]); |
127 } | 130 } |
128 | 131 |
129 core.int buildCounterBackupRunsListResponse = 0; | 132 core.int buildCounterBackupRunsListResponse = 0; |
130 buildBackupRunsListResponse() { | 133 buildBackupRunsListResponse() { |
131 var o = new api.BackupRunsListResponse(); | 134 var o = new api.BackupRunsListResponse(); |
132 buildCounterBackupRunsListResponse++; | 135 buildCounterBackupRunsListResponse++; |
133 if (buildCounterBackupRunsListResponse < 3) { | 136 if (buildCounterBackupRunsListResponse < 3) { |
134 o.items = buildUnnamed3191(); | 137 o.items = buildUnnamed3184(); |
135 o.kind = "foo"; | 138 o.kind = "foo"; |
136 o.nextPageToken = "foo"; | 139 o.nextPageToken = "foo"; |
137 } | 140 } |
138 buildCounterBackupRunsListResponse--; | 141 buildCounterBackupRunsListResponse--; |
139 return o; | 142 return o; |
140 } | 143 } |
141 | 144 |
142 checkBackupRunsListResponse(api.BackupRunsListResponse o) { | 145 checkBackupRunsListResponse(api.BackupRunsListResponse o) { |
143 buildCounterBackupRunsListResponse++; | 146 buildCounterBackupRunsListResponse++; |
144 if (buildCounterBackupRunsListResponse < 3) { | 147 if (buildCounterBackupRunsListResponse < 3) { |
145 checkUnnamed3191(o.items); | 148 checkUnnamed3184(o.items); |
146 unittest.expect(o.kind, unittest.equals('foo')); | 149 unittest.expect(o.kind, unittest.equals('foo')); |
147 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 150 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
148 } | 151 } |
149 buildCounterBackupRunsListResponse--; | 152 buildCounterBackupRunsListResponse--; |
150 } | 153 } |
151 | 154 |
152 core.int buildCounterBinLogCoordinates = 0; | 155 core.int buildCounterBinLogCoordinates = 0; |
153 buildBinLogCoordinates() { | 156 buildBinLogCoordinates() { |
154 var o = new api.BinLogCoordinates(); | 157 var o = new api.BinLogCoordinates(); |
155 buildCounterBinLogCoordinates++; | 158 buildCounterBinLogCoordinates++; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 214 |
212 checkDatabaseFlags(api.DatabaseFlags o) { | 215 checkDatabaseFlags(api.DatabaseFlags o) { |
213 buildCounterDatabaseFlags++; | 216 buildCounterDatabaseFlags++; |
214 if (buildCounterDatabaseFlags < 3) { | 217 if (buildCounterDatabaseFlags < 3) { |
215 unittest.expect(o.name, unittest.equals('foo')); | 218 unittest.expect(o.name, unittest.equals('foo')); |
216 unittest.expect(o.value, unittest.equals('foo')); | 219 unittest.expect(o.value, unittest.equals('foo')); |
217 } | 220 } |
218 buildCounterDatabaseFlags--; | 221 buildCounterDatabaseFlags--; |
219 } | 222 } |
220 | 223 |
221 buildUnnamed3192() { | 224 buildUnnamed3185() { |
222 var o = new core.List<api.IpMapping>(); | 225 var o = new core.List<api.IpMapping>(); |
223 o.add(buildIpMapping()); | 226 o.add(buildIpMapping()); |
224 o.add(buildIpMapping()); | 227 o.add(buildIpMapping()); |
225 return o; | 228 return o; |
226 } | 229 } |
227 | 230 |
228 checkUnnamed3192(core.List<api.IpMapping> o) { | 231 checkUnnamed3185(core.List<api.IpMapping> o) { |
229 unittest.expect(o, unittest.hasLength(2)); | 232 unittest.expect(o, unittest.hasLength(2)); |
230 checkIpMapping(o[0]); | 233 checkIpMapping(o[0]); |
231 checkIpMapping(o[1]); | 234 checkIpMapping(o[1]); |
232 } | 235 } |
233 | 236 |
234 buildUnnamed3193() { | 237 buildUnnamed3186() { |
235 var o = new core.List<core.String>(); | 238 var o = new core.List<core.String>(); |
236 o.add("foo"); | 239 o.add("foo"); |
237 o.add("foo"); | 240 o.add("foo"); |
238 return o; | 241 return o; |
239 } | 242 } |
240 | 243 |
241 checkUnnamed3193(core.List<core.String> o) { | 244 checkUnnamed3186(core.List<core.String> o) { |
242 unittest.expect(o, unittest.hasLength(2)); | 245 unittest.expect(o, unittest.hasLength(2)); |
243 unittest.expect(o[0], unittest.equals('foo')); | 246 unittest.expect(o[0], unittest.equals('foo')); |
244 unittest.expect(o[1], unittest.equals('foo')); | 247 unittest.expect(o[1], unittest.equals('foo')); |
245 } | 248 } |
246 | 249 |
247 core.int buildCounterDatabaseInstance = 0; | 250 core.int buildCounterDatabaseInstance = 0; |
248 buildDatabaseInstance() { | 251 buildDatabaseInstance() { |
249 var o = new api.DatabaseInstance(); | 252 var o = new api.DatabaseInstance(); |
250 buildCounterDatabaseInstance++; | 253 buildCounterDatabaseInstance++; |
251 if (buildCounterDatabaseInstance < 3) { | 254 if (buildCounterDatabaseInstance < 3) { |
252 o.connectionName = "foo"; | 255 o.connectionName = "foo"; |
253 o.currentDiskSize = "foo"; | 256 o.currentDiskSize = "foo"; |
254 o.databaseVersion = "foo"; | 257 o.databaseVersion = "foo"; |
255 o.etag = "foo"; | 258 o.etag = "foo"; |
256 o.instance = "foo"; | 259 o.instance = "foo"; |
257 o.instanceType = "foo"; | 260 o.instanceType = "foo"; |
258 o.ipAddresses = buildUnnamed3192(); | 261 o.ipAddresses = buildUnnamed3185(); |
259 o.ipv6Address = "foo"; | 262 o.ipv6Address = "foo"; |
260 o.kind = "foo"; | 263 o.kind = "foo"; |
261 o.masterInstanceName = "foo"; | 264 o.masterInstanceName = "foo"; |
262 o.maxDiskSize = "foo"; | 265 o.maxDiskSize = "foo"; |
263 o.project = "foo"; | 266 o.project = "foo"; |
264 o.region = "foo"; | 267 o.region = "foo"; |
265 o.replicaNames = buildUnnamed3193(); | 268 o.replicaNames = buildUnnamed3186(); |
266 o.serverCaCert = buildSslCert(); | 269 o.serverCaCert = buildSslCert(); |
267 o.serviceAccountEmailAddress = "foo"; | 270 o.serviceAccountEmailAddress = "foo"; |
268 o.settings = buildSettings(); | 271 o.settings = buildSettings(); |
269 o.state = "foo"; | 272 o.state = "foo"; |
270 } | 273 } |
271 buildCounterDatabaseInstance--; | 274 buildCounterDatabaseInstance--; |
272 return o; | 275 return o; |
273 } | 276 } |
274 | 277 |
275 checkDatabaseInstance(api.DatabaseInstance o) { | 278 checkDatabaseInstance(api.DatabaseInstance o) { |
276 buildCounterDatabaseInstance++; | 279 buildCounterDatabaseInstance++; |
277 if (buildCounterDatabaseInstance < 3) { | 280 if (buildCounterDatabaseInstance < 3) { |
278 unittest.expect(o.connectionName, unittest.equals('foo')); | 281 unittest.expect(o.connectionName, unittest.equals('foo')); |
279 unittest.expect(o.currentDiskSize, unittest.equals('foo')); | 282 unittest.expect(o.currentDiskSize, unittest.equals('foo')); |
280 unittest.expect(o.databaseVersion, unittest.equals('foo')); | 283 unittest.expect(o.databaseVersion, unittest.equals('foo')); |
281 unittest.expect(o.etag, unittest.equals('foo')); | 284 unittest.expect(o.etag, unittest.equals('foo')); |
282 unittest.expect(o.instance, unittest.equals('foo')); | 285 unittest.expect(o.instance, unittest.equals('foo')); |
283 unittest.expect(o.instanceType, unittest.equals('foo')); | 286 unittest.expect(o.instanceType, unittest.equals('foo')); |
284 checkUnnamed3192(o.ipAddresses); | 287 checkUnnamed3185(o.ipAddresses); |
285 unittest.expect(o.ipv6Address, unittest.equals('foo')); | 288 unittest.expect(o.ipv6Address, unittest.equals('foo')); |
286 unittest.expect(o.kind, unittest.equals('foo')); | 289 unittest.expect(o.kind, unittest.equals('foo')); |
287 unittest.expect(o.masterInstanceName, unittest.equals('foo')); | 290 unittest.expect(o.masterInstanceName, unittest.equals('foo')); |
288 unittest.expect(o.maxDiskSize, unittest.equals('foo')); | 291 unittest.expect(o.maxDiskSize, unittest.equals('foo')); |
289 unittest.expect(o.project, unittest.equals('foo')); | 292 unittest.expect(o.project, unittest.equals('foo')); |
290 unittest.expect(o.region, unittest.equals('foo')); | 293 unittest.expect(o.region, unittest.equals('foo')); |
291 checkUnnamed3193(o.replicaNames); | 294 checkUnnamed3186(o.replicaNames); |
292 checkSslCert(o.serverCaCert); | 295 checkSslCert(o.serverCaCert); |
293 unittest.expect(o.serviceAccountEmailAddress, unittest.equals('foo')); | 296 unittest.expect(o.serviceAccountEmailAddress, unittest.equals('foo')); |
294 checkSettings(o.settings); | 297 checkSettings(o.settings); |
295 unittest.expect(o.state, unittest.equals('foo')); | 298 unittest.expect(o.state, unittest.equals('foo')); |
296 } | 299 } |
297 buildCounterDatabaseInstance--; | 300 buildCounterDatabaseInstance--; |
298 } | 301 } |
299 | 302 |
300 buildUnnamed3194() { | 303 buildUnnamed3187() { |
301 var o = new core.List<core.String>(); | 304 var o = new core.List<core.String>(); |
302 o.add("foo"); | 305 o.add("foo"); |
303 o.add("foo"); | 306 o.add("foo"); |
304 return o; | 307 return o; |
305 } | 308 } |
306 | 309 |
307 checkUnnamed3194(core.List<core.String> o) { | 310 checkUnnamed3187(core.List<core.String> o) { |
308 unittest.expect(o, unittest.hasLength(2)); | 311 unittest.expect(o, unittest.hasLength(2)); |
309 unittest.expect(o[0], unittest.equals('foo')); | 312 unittest.expect(o[0], unittest.equals('foo')); |
310 unittest.expect(o[1], unittest.equals('foo')); | 313 unittest.expect(o[1], unittest.equals('foo')); |
311 } | 314 } |
312 | 315 |
313 buildUnnamed3195() { | 316 buildUnnamed3188() { |
314 var o = new core.List<core.String>(); | 317 var o = new core.List<core.String>(); |
315 o.add("foo"); | 318 o.add("foo"); |
316 o.add("foo"); | 319 o.add("foo"); |
317 return o; | 320 return o; |
318 } | 321 } |
319 | 322 |
320 checkUnnamed3195(core.List<core.String> o) { | 323 checkUnnamed3188(core.List<core.String> o) { |
321 unittest.expect(o, unittest.hasLength(2)); | 324 unittest.expect(o, unittest.hasLength(2)); |
322 unittest.expect(o[0], unittest.equals('foo')); | 325 unittest.expect(o[0], unittest.equals('foo')); |
323 unittest.expect(o[1], unittest.equals('foo')); | 326 unittest.expect(o[1], unittest.equals('foo')); |
324 } | 327 } |
325 | 328 |
326 core.int buildCounterExportContext = 0; | 329 core.int buildCounterExportContext = 0; |
327 buildExportContext() { | 330 buildExportContext() { |
328 var o = new api.ExportContext(); | 331 var o = new api.ExportContext(); |
329 buildCounterExportContext++; | 332 buildCounterExportContext++; |
330 if (buildCounterExportContext < 3) { | 333 if (buildCounterExportContext < 3) { |
331 o.database = buildUnnamed3194(); | 334 o.database = buildUnnamed3187(); |
332 o.kind = "foo"; | 335 o.kind = "foo"; |
333 o.table = buildUnnamed3195(); | 336 o.table = buildUnnamed3188(); |
334 o.uri = "foo"; | 337 o.uri = "foo"; |
335 } | 338 } |
336 buildCounterExportContext--; | 339 buildCounterExportContext--; |
337 return o; | 340 return o; |
338 } | 341 } |
339 | 342 |
340 checkExportContext(api.ExportContext o) { | 343 checkExportContext(api.ExportContext o) { |
341 buildCounterExportContext++; | 344 buildCounterExportContext++; |
342 if (buildCounterExportContext < 3) { | 345 if (buildCounterExportContext < 3) { |
343 checkUnnamed3194(o.database); | 346 checkUnnamed3187(o.database); |
344 unittest.expect(o.kind, unittest.equals('foo')); | 347 unittest.expect(o.kind, unittest.equals('foo')); |
345 checkUnnamed3195(o.table); | 348 checkUnnamed3188(o.table); |
346 unittest.expect(o.uri, unittest.equals('foo')); | 349 unittest.expect(o.uri, unittest.equals('foo')); |
347 } | 350 } |
348 buildCounterExportContext--; | 351 buildCounterExportContext--; |
349 } | 352 } |
350 | 353 |
351 buildUnnamed3196() { | 354 buildUnnamed3189() { |
352 var o = new core.List<core.String>(); | 355 var o = new core.List<core.String>(); |
353 o.add("foo"); | 356 o.add("foo"); |
354 o.add("foo"); | 357 o.add("foo"); |
355 return o; | 358 return o; |
356 } | 359 } |
357 | 360 |
358 checkUnnamed3196(core.List<core.String> o) { | 361 checkUnnamed3189(core.List<core.String> o) { |
359 unittest.expect(o, unittest.hasLength(2)); | 362 unittest.expect(o, unittest.hasLength(2)); |
360 unittest.expect(o[0], unittest.equals('foo')); | 363 unittest.expect(o[0], unittest.equals('foo')); |
361 unittest.expect(o[1], unittest.equals('foo')); | 364 unittest.expect(o[1], unittest.equals('foo')); |
362 } | 365 } |
363 | 366 |
364 buildUnnamed3197() { | 367 buildUnnamed3190() { |
365 var o = new core.List<core.String>(); | 368 var o = new core.List<core.String>(); |
366 o.add("foo"); | 369 o.add("foo"); |
367 o.add("foo"); | 370 o.add("foo"); |
368 return o; | 371 return o; |
369 } | 372 } |
370 | 373 |
371 checkUnnamed3197(core.List<core.String> o) { | 374 checkUnnamed3190(core.List<core.String> o) { |
372 unittest.expect(o, unittest.hasLength(2)); | 375 unittest.expect(o, unittest.hasLength(2)); |
373 unittest.expect(o[0], unittest.equals('foo')); | 376 unittest.expect(o[0], unittest.equals('foo')); |
374 unittest.expect(o[1], unittest.equals('foo')); | 377 unittest.expect(o[1], unittest.equals('foo')); |
375 } | 378 } |
376 | 379 |
377 core.int buildCounterFlag = 0; | 380 core.int buildCounterFlag = 0; |
378 buildFlag() { | 381 buildFlag() { |
379 var o = new api.Flag(); | 382 var o = new api.Flag(); |
380 buildCounterFlag++; | 383 buildCounterFlag++; |
381 if (buildCounterFlag < 3) { | 384 if (buildCounterFlag < 3) { |
382 o.allowedStringValues = buildUnnamed3196(); | 385 o.allowedStringValues = buildUnnamed3189(); |
383 o.appliesTo = buildUnnamed3197(); | 386 o.appliesTo = buildUnnamed3190(); |
384 o.kind = "foo"; | 387 o.kind = "foo"; |
385 o.maxValue = "foo"; | 388 o.maxValue = "foo"; |
386 o.minValue = "foo"; | 389 o.minValue = "foo"; |
387 o.name = "foo"; | 390 o.name = "foo"; |
388 o.type = "foo"; | 391 o.type = "foo"; |
389 } | 392 } |
390 buildCounterFlag--; | 393 buildCounterFlag--; |
391 return o; | 394 return o; |
392 } | 395 } |
393 | 396 |
394 checkFlag(api.Flag o) { | 397 checkFlag(api.Flag o) { |
395 buildCounterFlag++; | 398 buildCounterFlag++; |
396 if (buildCounterFlag < 3) { | 399 if (buildCounterFlag < 3) { |
397 checkUnnamed3196(o.allowedStringValues); | 400 checkUnnamed3189(o.allowedStringValues); |
398 checkUnnamed3197(o.appliesTo); | 401 checkUnnamed3190(o.appliesTo); |
399 unittest.expect(o.kind, unittest.equals('foo')); | 402 unittest.expect(o.kind, unittest.equals('foo')); |
400 unittest.expect(o.maxValue, unittest.equals('foo')); | 403 unittest.expect(o.maxValue, unittest.equals('foo')); |
401 unittest.expect(o.minValue, unittest.equals('foo')); | 404 unittest.expect(o.minValue, unittest.equals('foo')); |
402 unittest.expect(o.name, unittest.equals('foo')); | 405 unittest.expect(o.name, unittest.equals('foo')); |
403 unittest.expect(o.type, unittest.equals('foo')); | 406 unittest.expect(o.type, unittest.equals('foo')); |
404 } | 407 } |
405 buildCounterFlag--; | 408 buildCounterFlag--; |
406 } | 409 } |
407 | 410 |
408 buildUnnamed3198() { | 411 buildUnnamed3191() { |
409 var o = new core.List<api.Flag>(); | 412 var o = new core.List<api.Flag>(); |
410 o.add(buildFlag()); | 413 o.add(buildFlag()); |
411 o.add(buildFlag()); | 414 o.add(buildFlag()); |
412 return o; | 415 return o; |
413 } | 416 } |
414 | 417 |
415 checkUnnamed3198(core.List<api.Flag> o) { | 418 checkUnnamed3191(core.List<api.Flag> o) { |
416 unittest.expect(o, unittest.hasLength(2)); | 419 unittest.expect(o, unittest.hasLength(2)); |
417 checkFlag(o[0]); | 420 checkFlag(o[0]); |
418 checkFlag(o[1]); | 421 checkFlag(o[1]); |
419 } | 422 } |
420 | 423 |
421 core.int buildCounterFlagsListResponse = 0; | 424 core.int buildCounterFlagsListResponse = 0; |
422 buildFlagsListResponse() { | 425 buildFlagsListResponse() { |
423 var o = new api.FlagsListResponse(); | 426 var o = new api.FlagsListResponse(); |
424 buildCounterFlagsListResponse++; | 427 buildCounterFlagsListResponse++; |
425 if (buildCounterFlagsListResponse < 3) { | 428 if (buildCounterFlagsListResponse < 3) { |
426 o.items = buildUnnamed3198(); | 429 o.items = buildUnnamed3191(); |
427 o.kind = "foo"; | 430 o.kind = "foo"; |
428 } | 431 } |
429 buildCounterFlagsListResponse--; | 432 buildCounterFlagsListResponse--; |
430 return o; | 433 return o; |
431 } | 434 } |
432 | 435 |
433 checkFlagsListResponse(api.FlagsListResponse o) { | 436 checkFlagsListResponse(api.FlagsListResponse o) { |
434 buildCounterFlagsListResponse++; | 437 buildCounterFlagsListResponse++; |
435 if (buildCounterFlagsListResponse < 3) { | 438 if (buildCounterFlagsListResponse < 3) { |
436 checkUnnamed3198(o.items); | 439 checkUnnamed3191(o.items); |
437 unittest.expect(o.kind, unittest.equals('foo')); | 440 unittest.expect(o.kind, unittest.equals('foo')); |
438 } | 441 } |
439 buildCounterFlagsListResponse--; | 442 buildCounterFlagsListResponse--; |
440 } | 443 } |
441 | 444 |
442 buildUnnamed3199() { | 445 buildUnnamed3192() { |
443 var o = new core.List<core.String>(); | 446 var o = new core.List<core.String>(); |
444 o.add("foo"); | 447 o.add("foo"); |
445 o.add("foo"); | 448 o.add("foo"); |
446 return o; | 449 return o; |
447 } | 450 } |
448 | 451 |
449 checkUnnamed3199(core.List<core.String> o) { | 452 checkUnnamed3192(core.List<core.String> o) { |
450 unittest.expect(o, unittest.hasLength(2)); | 453 unittest.expect(o, unittest.hasLength(2)); |
451 unittest.expect(o[0], unittest.equals('foo')); | 454 unittest.expect(o[0], unittest.equals('foo')); |
452 unittest.expect(o[1], unittest.equals('foo')); | 455 unittest.expect(o[1], unittest.equals('foo')); |
453 } | 456 } |
454 | 457 |
455 core.int buildCounterImportContext = 0; | 458 core.int buildCounterImportContext = 0; |
456 buildImportContext() { | 459 buildImportContext() { |
457 var o = new api.ImportContext(); | 460 var o = new api.ImportContext(); |
458 buildCounterImportContext++; | 461 buildCounterImportContext++; |
459 if (buildCounterImportContext < 3) { | 462 if (buildCounterImportContext < 3) { |
460 o.database = "foo"; | 463 o.database = "foo"; |
461 o.kind = "foo"; | 464 o.kind = "foo"; |
462 o.uri = buildUnnamed3199(); | 465 o.uri = buildUnnamed3192(); |
463 } | 466 } |
464 buildCounterImportContext--; | 467 buildCounterImportContext--; |
465 return o; | 468 return o; |
466 } | 469 } |
467 | 470 |
468 checkImportContext(api.ImportContext o) { | 471 checkImportContext(api.ImportContext o) { |
469 buildCounterImportContext++; | 472 buildCounterImportContext++; |
470 if (buildCounterImportContext < 3) { | 473 if (buildCounterImportContext < 3) { |
471 unittest.expect(o.database, unittest.equals('foo')); | 474 unittest.expect(o.database, unittest.equals('foo')); |
472 unittest.expect(o.kind, unittest.equals('foo')); | 475 unittest.expect(o.kind, unittest.equals('foo')); |
473 checkUnnamed3199(o.uri); | 476 checkUnnamed3192(o.uri); |
474 } | 477 } |
475 buildCounterImportContext--; | 478 buildCounterImportContext--; |
476 } | 479 } |
477 | 480 |
478 buildUnnamed3200() { | 481 buildUnnamed3193() { |
479 var o = new core.List<api.OperationError>(); | 482 var o = new core.List<api.OperationError>(); |
480 o.add(buildOperationError()); | 483 o.add(buildOperationError()); |
481 o.add(buildOperationError()); | 484 o.add(buildOperationError()); |
482 return o; | 485 return o; |
483 } | 486 } |
484 | 487 |
485 checkUnnamed3200(core.List<api.OperationError> o) { | 488 checkUnnamed3193(core.List<api.OperationError> o) { |
486 unittest.expect(o, unittest.hasLength(2)); | 489 unittest.expect(o, unittest.hasLength(2)); |
487 checkOperationError(o[0]); | 490 checkOperationError(o[0]); |
488 checkOperationError(o[1]); | 491 checkOperationError(o[1]); |
489 } | 492 } |
490 | 493 |
491 core.int buildCounterInstanceOperation = 0; | 494 core.int buildCounterInstanceOperation = 0; |
492 buildInstanceOperation() { | 495 buildInstanceOperation() { |
493 var o = new api.InstanceOperation(); | 496 var o = new api.InstanceOperation(); |
494 buildCounterInstanceOperation++; | 497 buildCounterInstanceOperation++; |
495 if (buildCounterInstanceOperation < 3) { | 498 if (buildCounterInstanceOperation < 3) { |
496 o.endTime = core.DateTime.parse("2002-02-27T14:01:02"); | 499 o.endTime = core.DateTime.parse("2002-02-27T14:01:02"); |
497 o.enqueuedTime = core.DateTime.parse("2002-02-27T14:01:02"); | 500 o.enqueuedTime = core.DateTime.parse("2002-02-27T14:01:02"); |
498 o.error = buildUnnamed3200(); | 501 o.error = buildUnnamed3193(); |
499 o.exportContext = buildExportContext(); | 502 o.exportContext = buildExportContext(); |
500 o.importContext = buildImportContext(); | 503 o.importContext = buildImportContext(); |
501 o.instance = "foo"; | 504 o.instance = "foo"; |
502 o.kind = "foo"; | 505 o.kind = "foo"; |
503 o.operation = "foo"; | 506 o.operation = "foo"; |
504 o.operationType = "foo"; | 507 o.operationType = "foo"; |
505 o.startTime = core.DateTime.parse("2002-02-27T14:01:02"); | 508 o.startTime = core.DateTime.parse("2002-02-27T14:01:02"); |
506 o.state = "foo"; | 509 o.state = "foo"; |
507 o.userEmailAddress = "foo"; | 510 o.userEmailAddress = "foo"; |
508 } | 511 } |
509 buildCounterInstanceOperation--; | 512 buildCounterInstanceOperation--; |
510 return o; | 513 return o; |
511 } | 514 } |
512 | 515 |
513 checkInstanceOperation(api.InstanceOperation o) { | 516 checkInstanceOperation(api.InstanceOperation o) { |
514 buildCounterInstanceOperation++; | 517 buildCounterInstanceOperation++; |
515 if (buildCounterInstanceOperation < 3) { | 518 if (buildCounterInstanceOperation < 3) { |
516 unittest.expect(o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 519 unittest.expect( |
517 unittest.expect(o.enqueuedTime, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); | 520 o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
518 checkUnnamed3200(o.error); | 521 unittest.expect(o.enqueuedTime, |
| 522 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 523 checkUnnamed3193(o.error); |
519 checkExportContext(o.exportContext); | 524 checkExportContext(o.exportContext); |
520 checkImportContext(o.importContext); | 525 checkImportContext(o.importContext); |
521 unittest.expect(o.instance, unittest.equals('foo')); | 526 unittest.expect(o.instance, unittest.equals('foo')); |
522 unittest.expect(o.kind, unittest.equals('foo')); | 527 unittest.expect(o.kind, unittest.equals('foo')); |
523 unittest.expect(o.operation, unittest.equals('foo')); | 528 unittest.expect(o.operation, unittest.equals('foo')); |
524 unittest.expect(o.operationType, unittest.equals('foo')); | 529 unittest.expect(o.operationType, unittest.equals('foo')); |
525 unittest.expect(o.startTime, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); | 530 unittest.expect(o.startTime, |
| 531 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
526 unittest.expect(o.state, unittest.equals('foo')); | 532 unittest.expect(o.state, unittest.equals('foo')); |
527 unittest.expect(o.userEmailAddress, unittest.equals('foo')); | 533 unittest.expect(o.userEmailAddress, unittest.equals('foo')); |
528 } | 534 } |
529 buildCounterInstanceOperation--; | 535 buildCounterInstanceOperation--; |
530 } | 536 } |
531 | 537 |
532 core.int buildCounterInstanceSetRootPasswordRequest = 0; | 538 core.int buildCounterInstanceSetRootPasswordRequest = 0; |
533 buildInstanceSetRootPasswordRequest() { | 539 buildInstanceSetRootPasswordRequest() { |
534 var o = new api.InstanceSetRootPasswordRequest(); | 540 var o = new api.InstanceSetRootPasswordRequest(); |
535 buildCounterInstanceSetRootPasswordRequest++; | 541 buildCounterInstanceSetRootPasswordRequest++; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 709 |
704 checkInstancesInsertResponse(api.InstancesInsertResponse o) { | 710 checkInstancesInsertResponse(api.InstancesInsertResponse o) { |
705 buildCounterInstancesInsertResponse++; | 711 buildCounterInstancesInsertResponse++; |
706 if (buildCounterInstancesInsertResponse < 3) { | 712 if (buildCounterInstancesInsertResponse < 3) { |
707 unittest.expect(o.kind, unittest.equals('foo')); | 713 unittest.expect(o.kind, unittest.equals('foo')); |
708 unittest.expect(o.operation, unittest.equals('foo')); | 714 unittest.expect(o.operation, unittest.equals('foo')); |
709 } | 715 } |
710 buildCounterInstancesInsertResponse--; | 716 buildCounterInstancesInsertResponse--; |
711 } | 717 } |
712 | 718 |
713 buildUnnamed3201() { | 719 buildUnnamed3194() { |
714 var o = new core.List<api.DatabaseInstance>(); | 720 var o = new core.List<api.DatabaseInstance>(); |
715 o.add(buildDatabaseInstance()); | 721 o.add(buildDatabaseInstance()); |
716 o.add(buildDatabaseInstance()); | 722 o.add(buildDatabaseInstance()); |
717 return o; | 723 return o; |
718 } | 724 } |
719 | 725 |
720 checkUnnamed3201(core.List<api.DatabaseInstance> o) { | 726 checkUnnamed3194(core.List<api.DatabaseInstance> o) { |
721 unittest.expect(o, unittest.hasLength(2)); | 727 unittest.expect(o, unittest.hasLength(2)); |
722 checkDatabaseInstance(o[0]); | 728 checkDatabaseInstance(o[0]); |
723 checkDatabaseInstance(o[1]); | 729 checkDatabaseInstance(o[1]); |
724 } | 730 } |
725 | 731 |
726 core.int buildCounterInstancesListResponse = 0; | 732 core.int buildCounterInstancesListResponse = 0; |
727 buildInstancesListResponse() { | 733 buildInstancesListResponse() { |
728 var o = new api.InstancesListResponse(); | 734 var o = new api.InstancesListResponse(); |
729 buildCounterInstancesListResponse++; | 735 buildCounterInstancesListResponse++; |
730 if (buildCounterInstancesListResponse < 3) { | 736 if (buildCounterInstancesListResponse < 3) { |
731 o.items = buildUnnamed3201(); | 737 o.items = buildUnnamed3194(); |
732 o.kind = "foo"; | 738 o.kind = "foo"; |
733 o.nextPageToken = "foo"; | 739 o.nextPageToken = "foo"; |
734 } | 740 } |
735 buildCounterInstancesListResponse--; | 741 buildCounterInstancesListResponse--; |
736 return o; | 742 return o; |
737 } | 743 } |
738 | 744 |
739 checkInstancesListResponse(api.InstancesListResponse o) { | 745 checkInstancesListResponse(api.InstancesListResponse o) { |
740 buildCounterInstancesListResponse++; | 746 buildCounterInstancesListResponse++; |
741 if (buildCounterInstancesListResponse < 3) { | 747 if (buildCounterInstancesListResponse < 3) { |
742 checkUnnamed3201(o.items); | 748 checkUnnamed3194(o.items); |
743 unittest.expect(o.kind, unittest.equals('foo')); | 749 unittest.expect(o.kind, unittest.equals('foo')); |
744 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 750 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
745 } | 751 } |
746 buildCounterInstancesListResponse--; | 752 buildCounterInstancesListResponse--; |
747 } | 753 } |
748 | 754 |
749 core.int buildCounterInstancesPromoteReplicaResponse = 0; | 755 core.int buildCounterInstancesPromoteReplicaResponse = 0; |
750 buildInstancesPromoteReplicaResponse() { | 756 buildInstancesPromoteReplicaResponse() { |
751 var o = new api.InstancesPromoteReplicaResponse(); | 757 var o = new api.InstancesPromoteReplicaResponse(); |
752 buildCounterInstancesPromoteReplicaResponse++; | 758 buildCounterInstancesPromoteReplicaResponse++; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 | 871 |
866 checkInstancesUpdateResponse(api.InstancesUpdateResponse o) { | 872 checkInstancesUpdateResponse(api.InstancesUpdateResponse o) { |
867 buildCounterInstancesUpdateResponse++; | 873 buildCounterInstancesUpdateResponse++; |
868 if (buildCounterInstancesUpdateResponse < 3) { | 874 if (buildCounterInstancesUpdateResponse < 3) { |
869 unittest.expect(o.kind, unittest.equals('foo')); | 875 unittest.expect(o.kind, unittest.equals('foo')); |
870 unittest.expect(o.operation, unittest.equals('foo')); | 876 unittest.expect(o.operation, unittest.equals('foo')); |
871 } | 877 } |
872 buildCounterInstancesUpdateResponse--; | 878 buildCounterInstancesUpdateResponse--; |
873 } | 879 } |
874 | 880 |
875 buildUnnamed3202() { | 881 buildUnnamed3195() { |
876 var o = new core.List<core.String>(); | 882 var o = new core.List<core.String>(); |
877 o.add("foo"); | 883 o.add("foo"); |
878 o.add("foo"); | 884 o.add("foo"); |
879 return o; | 885 return o; |
880 } | 886 } |
881 | 887 |
882 checkUnnamed3202(core.List<core.String> o) { | 888 checkUnnamed3195(core.List<core.String> o) { |
883 unittest.expect(o, unittest.hasLength(2)); | 889 unittest.expect(o, unittest.hasLength(2)); |
884 unittest.expect(o[0], unittest.equals('foo')); | 890 unittest.expect(o[0], unittest.equals('foo')); |
885 unittest.expect(o[1], unittest.equals('foo')); | 891 unittest.expect(o[1], unittest.equals('foo')); |
886 } | 892 } |
887 | 893 |
888 core.int buildCounterIpConfiguration = 0; | 894 core.int buildCounterIpConfiguration = 0; |
889 buildIpConfiguration() { | 895 buildIpConfiguration() { |
890 var o = new api.IpConfiguration(); | 896 var o = new api.IpConfiguration(); |
891 buildCounterIpConfiguration++; | 897 buildCounterIpConfiguration++; |
892 if (buildCounterIpConfiguration < 3) { | 898 if (buildCounterIpConfiguration < 3) { |
893 o.authorizedNetworks = buildUnnamed3202(); | 899 o.authorizedNetworks = buildUnnamed3195(); |
894 o.enabled = true; | 900 o.enabled = true; |
895 o.kind = "foo"; | 901 o.kind = "foo"; |
896 o.requireSsl = true; | 902 o.requireSsl = true; |
897 } | 903 } |
898 buildCounterIpConfiguration--; | 904 buildCounterIpConfiguration--; |
899 return o; | 905 return o; |
900 } | 906 } |
901 | 907 |
902 checkIpConfiguration(api.IpConfiguration o) { | 908 checkIpConfiguration(api.IpConfiguration o) { |
903 buildCounterIpConfiguration++; | 909 buildCounterIpConfiguration++; |
904 if (buildCounterIpConfiguration < 3) { | 910 if (buildCounterIpConfiguration < 3) { |
905 checkUnnamed3202(o.authorizedNetworks); | 911 checkUnnamed3195(o.authorizedNetworks); |
906 unittest.expect(o.enabled, unittest.isTrue); | 912 unittest.expect(o.enabled, unittest.isTrue); |
907 unittest.expect(o.kind, unittest.equals('foo')); | 913 unittest.expect(o.kind, unittest.equals('foo')); |
908 unittest.expect(o.requireSsl, unittest.isTrue); | 914 unittest.expect(o.requireSsl, unittest.isTrue); |
909 } | 915 } |
910 buildCounterIpConfiguration--; | 916 buildCounterIpConfiguration--; |
911 } | 917 } |
912 | 918 |
913 core.int buildCounterIpMapping = 0; | 919 core.int buildCounterIpMapping = 0; |
914 buildIpMapping() { | 920 buildIpMapping() { |
915 var o = new api.IpMapping(); | 921 var o = new api.IpMapping(); |
916 buildCounterIpMapping++; | 922 buildCounterIpMapping++; |
917 if (buildCounterIpMapping < 3) { | 923 if (buildCounterIpMapping < 3) { |
918 o.ipAddress = "foo"; | 924 o.ipAddress = "foo"; |
919 o.timeToRetire = core.DateTime.parse("2002-02-27T14:01:02"); | 925 o.timeToRetire = core.DateTime.parse("2002-02-27T14:01:02"); |
920 } | 926 } |
921 buildCounterIpMapping--; | 927 buildCounterIpMapping--; |
922 return o; | 928 return o; |
923 } | 929 } |
924 | 930 |
925 checkIpMapping(api.IpMapping o) { | 931 checkIpMapping(api.IpMapping o) { |
926 buildCounterIpMapping++; | 932 buildCounterIpMapping++; |
927 if (buildCounterIpMapping < 3) { | 933 if (buildCounterIpMapping < 3) { |
928 unittest.expect(o.ipAddress, unittest.equals('foo')); | 934 unittest.expect(o.ipAddress, unittest.equals('foo')); |
929 unittest.expect(o.timeToRetire, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); | 935 unittest.expect(o.timeToRetire, |
| 936 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
930 } | 937 } |
931 buildCounterIpMapping--; | 938 buildCounterIpMapping--; |
932 } | 939 } |
933 | 940 |
934 core.int buildCounterLocationPreference = 0; | 941 core.int buildCounterLocationPreference = 0; |
935 buildLocationPreference() { | 942 buildLocationPreference() { |
936 var o = new api.LocationPreference(); | 943 var o = new api.LocationPreference(); |
937 buildCounterLocationPreference++; | 944 buildCounterLocationPreference++; |
938 if (buildCounterLocationPreference < 3) { | 945 if (buildCounterLocationPreference < 3) { |
939 o.followGaeApplication = "foo"; | 946 o.followGaeApplication = "foo"; |
(...skipping 28 matching lines...) Expand all Loading... |
968 | 975 |
969 checkOperationError(api.OperationError o) { | 976 checkOperationError(api.OperationError o) { |
970 buildCounterOperationError++; | 977 buildCounterOperationError++; |
971 if (buildCounterOperationError < 3) { | 978 if (buildCounterOperationError < 3) { |
972 unittest.expect(o.code, unittest.equals('foo')); | 979 unittest.expect(o.code, unittest.equals('foo')); |
973 unittest.expect(o.kind, unittest.equals('foo')); | 980 unittest.expect(o.kind, unittest.equals('foo')); |
974 } | 981 } |
975 buildCounterOperationError--; | 982 buildCounterOperationError--; |
976 } | 983 } |
977 | 984 |
978 buildUnnamed3203() { | 985 buildUnnamed3196() { |
979 var o = new core.List<api.InstanceOperation>(); | 986 var o = new core.List<api.InstanceOperation>(); |
980 o.add(buildInstanceOperation()); | 987 o.add(buildInstanceOperation()); |
981 o.add(buildInstanceOperation()); | 988 o.add(buildInstanceOperation()); |
982 return o; | 989 return o; |
983 } | 990 } |
984 | 991 |
985 checkUnnamed3203(core.List<api.InstanceOperation> o) { | 992 checkUnnamed3196(core.List<api.InstanceOperation> o) { |
986 unittest.expect(o, unittest.hasLength(2)); | 993 unittest.expect(o, unittest.hasLength(2)); |
987 checkInstanceOperation(o[0]); | 994 checkInstanceOperation(o[0]); |
988 checkInstanceOperation(o[1]); | 995 checkInstanceOperation(o[1]); |
989 } | 996 } |
990 | 997 |
991 core.int buildCounterOperationsListResponse = 0; | 998 core.int buildCounterOperationsListResponse = 0; |
992 buildOperationsListResponse() { | 999 buildOperationsListResponse() { |
993 var o = new api.OperationsListResponse(); | 1000 var o = new api.OperationsListResponse(); |
994 buildCounterOperationsListResponse++; | 1001 buildCounterOperationsListResponse++; |
995 if (buildCounterOperationsListResponse < 3) { | 1002 if (buildCounterOperationsListResponse < 3) { |
996 o.items = buildUnnamed3203(); | 1003 o.items = buildUnnamed3196(); |
997 o.kind = "foo"; | 1004 o.kind = "foo"; |
998 o.nextPageToken = "foo"; | 1005 o.nextPageToken = "foo"; |
999 } | 1006 } |
1000 buildCounterOperationsListResponse--; | 1007 buildCounterOperationsListResponse--; |
1001 return o; | 1008 return o; |
1002 } | 1009 } |
1003 | 1010 |
1004 checkOperationsListResponse(api.OperationsListResponse o) { | 1011 checkOperationsListResponse(api.OperationsListResponse o) { |
1005 buildCounterOperationsListResponse++; | 1012 buildCounterOperationsListResponse++; |
1006 if (buildCounterOperationsListResponse < 3) { | 1013 if (buildCounterOperationsListResponse < 3) { |
1007 checkUnnamed3203(o.items); | 1014 checkUnnamed3196(o.items); |
1008 unittest.expect(o.kind, unittest.equals('foo')); | 1015 unittest.expect(o.kind, unittest.equals('foo')); |
1009 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 1016 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
1010 } | 1017 } |
1011 buildCounterOperationsListResponse--; | 1018 buildCounterOperationsListResponse--; |
1012 } | 1019 } |
1013 | 1020 |
1014 core.int buildCounterSetRootPasswordContext = 0; | 1021 core.int buildCounterSetRootPasswordContext = 0; |
1015 buildSetRootPasswordContext() { | 1022 buildSetRootPasswordContext() { |
1016 var o = new api.SetRootPasswordContext(); | 1023 var o = new api.SetRootPasswordContext(); |
1017 buildCounterSetRootPasswordContext++; | 1024 buildCounterSetRootPasswordContext++; |
1018 if (buildCounterSetRootPasswordContext < 3) { | 1025 if (buildCounterSetRootPasswordContext < 3) { |
1019 o.kind = "foo"; | 1026 o.kind = "foo"; |
1020 o.password = "foo"; | 1027 o.password = "foo"; |
1021 } | 1028 } |
1022 buildCounterSetRootPasswordContext--; | 1029 buildCounterSetRootPasswordContext--; |
1023 return o; | 1030 return o; |
1024 } | 1031 } |
1025 | 1032 |
1026 checkSetRootPasswordContext(api.SetRootPasswordContext o) { | 1033 checkSetRootPasswordContext(api.SetRootPasswordContext o) { |
1027 buildCounterSetRootPasswordContext++; | 1034 buildCounterSetRootPasswordContext++; |
1028 if (buildCounterSetRootPasswordContext < 3) { | 1035 if (buildCounterSetRootPasswordContext < 3) { |
1029 unittest.expect(o.kind, unittest.equals('foo')); | 1036 unittest.expect(o.kind, unittest.equals('foo')); |
1030 unittest.expect(o.password, unittest.equals('foo')); | 1037 unittest.expect(o.password, unittest.equals('foo')); |
1031 } | 1038 } |
1032 buildCounterSetRootPasswordContext--; | 1039 buildCounterSetRootPasswordContext--; |
1033 } | 1040 } |
1034 | 1041 |
1035 buildUnnamed3204() { | 1042 buildUnnamed3197() { |
1036 var o = new core.List<core.String>(); | 1043 var o = new core.List<core.String>(); |
1037 o.add("foo"); | 1044 o.add("foo"); |
1038 o.add("foo"); | 1045 o.add("foo"); |
1039 return o; | 1046 return o; |
1040 } | 1047 } |
1041 | 1048 |
1042 checkUnnamed3204(core.List<core.String> o) { | 1049 checkUnnamed3197(core.List<core.String> o) { |
1043 unittest.expect(o, unittest.hasLength(2)); | 1050 unittest.expect(o, unittest.hasLength(2)); |
1044 unittest.expect(o[0], unittest.equals('foo')); | 1051 unittest.expect(o[0], unittest.equals('foo')); |
1045 unittest.expect(o[1], unittest.equals('foo')); | 1052 unittest.expect(o[1], unittest.equals('foo')); |
1046 } | 1053 } |
1047 | 1054 |
1048 buildUnnamed3205() { | 1055 buildUnnamed3198() { |
1049 var o = new core.List<api.BackupConfiguration>(); | 1056 var o = new core.List<api.BackupConfiguration>(); |
1050 o.add(buildBackupConfiguration()); | 1057 o.add(buildBackupConfiguration()); |
1051 o.add(buildBackupConfiguration()); | 1058 o.add(buildBackupConfiguration()); |
1052 return o; | 1059 return o; |
1053 } | 1060 } |
1054 | 1061 |
1055 checkUnnamed3205(core.List<api.BackupConfiguration> o) { | 1062 checkUnnamed3198(core.List<api.BackupConfiguration> o) { |
1056 unittest.expect(o, unittest.hasLength(2)); | 1063 unittest.expect(o, unittest.hasLength(2)); |
1057 checkBackupConfiguration(o[0]); | 1064 checkBackupConfiguration(o[0]); |
1058 checkBackupConfiguration(o[1]); | 1065 checkBackupConfiguration(o[1]); |
1059 } | 1066 } |
1060 | 1067 |
1061 buildUnnamed3206() { | 1068 buildUnnamed3199() { |
1062 var o = new core.List<api.DatabaseFlags>(); | 1069 var o = new core.List<api.DatabaseFlags>(); |
1063 o.add(buildDatabaseFlags()); | 1070 o.add(buildDatabaseFlags()); |
1064 o.add(buildDatabaseFlags()); | 1071 o.add(buildDatabaseFlags()); |
1065 return o; | 1072 return o; |
1066 } | 1073 } |
1067 | 1074 |
1068 checkUnnamed3206(core.List<api.DatabaseFlags> o) { | 1075 checkUnnamed3199(core.List<api.DatabaseFlags> o) { |
1069 unittest.expect(o, unittest.hasLength(2)); | 1076 unittest.expect(o, unittest.hasLength(2)); |
1070 checkDatabaseFlags(o[0]); | 1077 checkDatabaseFlags(o[0]); |
1071 checkDatabaseFlags(o[1]); | 1078 checkDatabaseFlags(o[1]); |
1072 } | 1079 } |
1073 | 1080 |
1074 core.int buildCounterSettings = 0; | 1081 core.int buildCounterSettings = 0; |
1075 buildSettings() { | 1082 buildSettings() { |
1076 var o = new api.Settings(); | 1083 var o = new api.Settings(); |
1077 buildCounterSettings++; | 1084 buildCounterSettings++; |
1078 if (buildCounterSettings < 3) { | 1085 if (buildCounterSettings < 3) { |
1079 o.activationPolicy = "foo"; | 1086 o.activationPolicy = "foo"; |
1080 o.authorizedGaeApplications = buildUnnamed3204(); | 1087 o.authorizedGaeApplications = buildUnnamed3197(); |
1081 o.backupConfiguration = buildUnnamed3205(); | 1088 o.backupConfiguration = buildUnnamed3198(); |
1082 o.databaseFlags = buildUnnamed3206(); | 1089 o.databaseFlags = buildUnnamed3199(); |
1083 o.databaseReplicationEnabled = true; | 1090 o.databaseReplicationEnabled = true; |
1084 o.ipConfiguration = buildIpConfiguration(); | 1091 o.ipConfiguration = buildIpConfiguration(); |
1085 o.kind = "foo"; | 1092 o.kind = "foo"; |
1086 o.locationPreference = buildLocationPreference(); | 1093 o.locationPreference = buildLocationPreference(); |
1087 o.pricingPlan = "foo"; | 1094 o.pricingPlan = "foo"; |
1088 o.replicationType = "foo"; | 1095 o.replicationType = "foo"; |
1089 o.settingsVersion = "foo"; | 1096 o.settingsVersion = "foo"; |
1090 o.tier = "foo"; | 1097 o.tier = "foo"; |
1091 } | 1098 } |
1092 buildCounterSettings--; | 1099 buildCounterSettings--; |
1093 return o; | 1100 return o; |
1094 } | 1101 } |
1095 | 1102 |
1096 checkSettings(api.Settings o) { | 1103 checkSettings(api.Settings o) { |
1097 buildCounterSettings++; | 1104 buildCounterSettings++; |
1098 if (buildCounterSettings < 3) { | 1105 if (buildCounterSettings < 3) { |
1099 unittest.expect(o.activationPolicy, unittest.equals('foo')); | 1106 unittest.expect(o.activationPolicy, unittest.equals('foo')); |
1100 checkUnnamed3204(o.authorizedGaeApplications); | 1107 checkUnnamed3197(o.authorizedGaeApplications); |
1101 checkUnnamed3205(o.backupConfiguration); | 1108 checkUnnamed3198(o.backupConfiguration); |
1102 checkUnnamed3206(o.databaseFlags); | 1109 checkUnnamed3199(o.databaseFlags); |
1103 unittest.expect(o.databaseReplicationEnabled, unittest.isTrue); | 1110 unittest.expect(o.databaseReplicationEnabled, unittest.isTrue); |
1104 checkIpConfiguration(o.ipConfiguration); | 1111 checkIpConfiguration(o.ipConfiguration); |
1105 unittest.expect(o.kind, unittest.equals('foo')); | 1112 unittest.expect(o.kind, unittest.equals('foo')); |
1106 checkLocationPreference(o.locationPreference); | 1113 checkLocationPreference(o.locationPreference); |
1107 unittest.expect(o.pricingPlan, unittest.equals('foo')); | 1114 unittest.expect(o.pricingPlan, unittest.equals('foo')); |
1108 unittest.expect(o.replicationType, unittest.equals('foo')); | 1115 unittest.expect(o.replicationType, unittest.equals('foo')); |
1109 unittest.expect(o.settingsVersion, unittest.equals('foo')); | 1116 unittest.expect(o.settingsVersion, unittest.equals('foo')); |
1110 unittest.expect(o.tier, unittest.equals('foo')); | 1117 unittest.expect(o.tier, unittest.equals('foo')); |
1111 } | 1118 } |
1112 buildCounterSettings--; | 1119 buildCounterSettings--; |
(...skipping 16 matching lines...) Expand all Loading... |
1129 buildCounterSslCert--; | 1136 buildCounterSslCert--; |
1130 return o; | 1137 return o; |
1131 } | 1138 } |
1132 | 1139 |
1133 checkSslCert(api.SslCert o) { | 1140 checkSslCert(api.SslCert o) { |
1134 buildCounterSslCert++; | 1141 buildCounterSslCert++; |
1135 if (buildCounterSslCert < 3) { | 1142 if (buildCounterSslCert < 3) { |
1136 unittest.expect(o.cert, unittest.equals('foo')); | 1143 unittest.expect(o.cert, unittest.equals('foo')); |
1137 unittest.expect(o.certSerialNumber, unittest.equals('foo')); | 1144 unittest.expect(o.certSerialNumber, unittest.equals('foo')); |
1138 unittest.expect(o.commonName, unittest.equals('foo')); | 1145 unittest.expect(o.commonName, unittest.equals('foo')); |
1139 unittest.expect(o.createTime, unittest.equals(core.DateTime.parse("2002-02-2
7T14:01:02"))); | 1146 unittest.expect(o.createTime, |
1140 unittest.expect(o.expirationTime, unittest.equals(core.DateTime.parse("2002-
02-27T14:01:02"))); | 1147 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 1148 unittest.expect(o.expirationTime, |
| 1149 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
1141 unittest.expect(o.instance, unittest.equals('foo')); | 1150 unittest.expect(o.instance, unittest.equals('foo')); |
1142 unittest.expect(o.kind, unittest.equals('foo')); | 1151 unittest.expect(o.kind, unittest.equals('foo')); |
1143 unittest.expect(o.sha1Fingerprint, unittest.equals('foo')); | 1152 unittest.expect(o.sha1Fingerprint, unittest.equals('foo')); |
1144 } | 1153 } |
1145 buildCounterSslCert--; | 1154 buildCounterSslCert--; |
1146 } | 1155 } |
1147 | 1156 |
1148 core.int buildCounterSslCertDetail = 0; | 1157 core.int buildCounterSslCertDetail = 0; |
1149 buildSslCertDetail() { | 1158 buildSslCertDetail() { |
1150 var o = new api.SslCertDetail(); | 1159 var o = new api.SslCertDetail(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 checkSslCertsInsertResponse(api.SslCertsInsertResponse o) { | 1231 checkSslCertsInsertResponse(api.SslCertsInsertResponse o) { |
1223 buildCounterSslCertsInsertResponse++; | 1232 buildCounterSslCertsInsertResponse++; |
1224 if (buildCounterSslCertsInsertResponse < 3) { | 1233 if (buildCounterSslCertsInsertResponse < 3) { |
1225 checkSslCertDetail(o.clientCert); | 1234 checkSslCertDetail(o.clientCert); |
1226 unittest.expect(o.kind, unittest.equals('foo')); | 1235 unittest.expect(o.kind, unittest.equals('foo')); |
1227 checkSslCert(o.serverCaCert); | 1236 checkSslCert(o.serverCaCert); |
1228 } | 1237 } |
1229 buildCounterSslCertsInsertResponse--; | 1238 buildCounterSslCertsInsertResponse--; |
1230 } | 1239 } |
1231 | 1240 |
1232 buildUnnamed3207() { | 1241 buildUnnamed3200() { |
1233 var o = new core.List<api.SslCert>(); | 1242 var o = new core.List<api.SslCert>(); |
1234 o.add(buildSslCert()); | 1243 o.add(buildSslCert()); |
1235 o.add(buildSslCert()); | 1244 o.add(buildSslCert()); |
1236 return o; | 1245 return o; |
1237 } | 1246 } |
1238 | 1247 |
1239 checkUnnamed3207(core.List<api.SslCert> o) { | 1248 checkUnnamed3200(core.List<api.SslCert> o) { |
1240 unittest.expect(o, unittest.hasLength(2)); | 1249 unittest.expect(o, unittest.hasLength(2)); |
1241 checkSslCert(o[0]); | 1250 checkSslCert(o[0]); |
1242 checkSslCert(o[1]); | 1251 checkSslCert(o[1]); |
1243 } | 1252 } |
1244 | 1253 |
1245 core.int buildCounterSslCertsListResponse = 0; | 1254 core.int buildCounterSslCertsListResponse = 0; |
1246 buildSslCertsListResponse() { | 1255 buildSslCertsListResponse() { |
1247 var o = new api.SslCertsListResponse(); | 1256 var o = new api.SslCertsListResponse(); |
1248 buildCounterSslCertsListResponse++; | 1257 buildCounterSslCertsListResponse++; |
1249 if (buildCounterSslCertsListResponse < 3) { | 1258 if (buildCounterSslCertsListResponse < 3) { |
1250 o.items = buildUnnamed3207(); | 1259 o.items = buildUnnamed3200(); |
1251 o.kind = "foo"; | 1260 o.kind = "foo"; |
1252 } | 1261 } |
1253 buildCounterSslCertsListResponse--; | 1262 buildCounterSslCertsListResponse--; |
1254 return o; | 1263 return o; |
1255 } | 1264 } |
1256 | 1265 |
1257 checkSslCertsListResponse(api.SslCertsListResponse o) { | 1266 checkSslCertsListResponse(api.SslCertsListResponse o) { |
1258 buildCounterSslCertsListResponse++; | 1267 buildCounterSslCertsListResponse++; |
1259 if (buildCounterSslCertsListResponse < 3) { | 1268 if (buildCounterSslCertsListResponse < 3) { |
1260 checkUnnamed3207(o.items); | 1269 checkUnnamed3200(o.items); |
1261 unittest.expect(o.kind, unittest.equals('foo')); | 1270 unittest.expect(o.kind, unittest.equals('foo')); |
1262 } | 1271 } |
1263 buildCounterSslCertsListResponse--; | 1272 buildCounterSslCertsListResponse--; |
1264 } | 1273 } |
1265 | 1274 |
1266 buildUnnamed3208() { | 1275 buildUnnamed3201() { |
1267 var o = new core.List<core.String>(); | 1276 var o = new core.List<core.String>(); |
1268 o.add("foo"); | 1277 o.add("foo"); |
1269 o.add("foo"); | 1278 o.add("foo"); |
1270 return o; | 1279 return o; |
1271 } | 1280 } |
1272 | 1281 |
1273 checkUnnamed3208(core.List<core.String> o) { | 1282 checkUnnamed3201(core.List<core.String> o) { |
1274 unittest.expect(o, unittest.hasLength(2)); | 1283 unittest.expect(o, unittest.hasLength(2)); |
1275 unittest.expect(o[0], unittest.equals('foo')); | 1284 unittest.expect(o[0], unittest.equals('foo')); |
1276 unittest.expect(o[1], unittest.equals('foo')); | 1285 unittest.expect(o[1], unittest.equals('foo')); |
1277 } | 1286 } |
1278 | 1287 |
1279 core.int buildCounterTier = 0; | 1288 core.int buildCounterTier = 0; |
1280 buildTier() { | 1289 buildTier() { |
1281 var o = new api.Tier(); | 1290 var o = new api.Tier(); |
1282 buildCounterTier++; | 1291 buildCounterTier++; |
1283 if (buildCounterTier < 3) { | 1292 if (buildCounterTier < 3) { |
1284 o.DiskQuota = "foo"; | 1293 o.DiskQuota = "foo"; |
1285 o.RAM = "foo"; | 1294 o.RAM = "foo"; |
1286 o.kind = "foo"; | 1295 o.kind = "foo"; |
1287 o.region = buildUnnamed3208(); | 1296 o.region = buildUnnamed3201(); |
1288 o.tier = "foo"; | 1297 o.tier = "foo"; |
1289 } | 1298 } |
1290 buildCounterTier--; | 1299 buildCounterTier--; |
1291 return o; | 1300 return o; |
1292 } | 1301 } |
1293 | 1302 |
1294 checkTier(api.Tier o) { | 1303 checkTier(api.Tier o) { |
1295 buildCounterTier++; | 1304 buildCounterTier++; |
1296 if (buildCounterTier < 3) { | 1305 if (buildCounterTier < 3) { |
1297 unittest.expect(o.DiskQuota, unittest.equals('foo')); | 1306 unittest.expect(o.DiskQuota, unittest.equals('foo')); |
1298 unittest.expect(o.RAM, unittest.equals('foo')); | 1307 unittest.expect(o.RAM, unittest.equals('foo')); |
1299 unittest.expect(o.kind, unittest.equals('foo')); | 1308 unittest.expect(o.kind, unittest.equals('foo')); |
1300 checkUnnamed3208(o.region); | 1309 checkUnnamed3201(o.region); |
1301 unittest.expect(o.tier, unittest.equals('foo')); | 1310 unittest.expect(o.tier, unittest.equals('foo')); |
1302 } | 1311 } |
1303 buildCounterTier--; | 1312 buildCounterTier--; |
1304 } | 1313 } |
1305 | 1314 |
1306 buildUnnamed3209() { | 1315 buildUnnamed3202() { |
1307 var o = new core.List<api.Tier>(); | 1316 var o = new core.List<api.Tier>(); |
1308 o.add(buildTier()); | 1317 o.add(buildTier()); |
1309 o.add(buildTier()); | 1318 o.add(buildTier()); |
1310 return o; | 1319 return o; |
1311 } | 1320 } |
1312 | 1321 |
1313 checkUnnamed3209(core.List<api.Tier> o) { | 1322 checkUnnamed3202(core.List<api.Tier> o) { |
1314 unittest.expect(o, unittest.hasLength(2)); | 1323 unittest.expect(o, unittest.hasLength(2)); |
1315 checkTier(o[0]); | 1324 checkTier(o[0]); |
1316 checkTier(o[1]); | 1325 checkTier(o[1]); |
1317 } | 1326 } |
1318 | 1327 |
1319 core.int buildCounterTiersListResponse = 0; | 1328 core.int buildCounterTiersListResponse = 0; |
1320 buildTiersListResponse() { | 1329 buildTiersListResponse() { |
1321 var o = new api.TiersListResponse(); | 1330 var o = new api.TiersListResponse(); |
1322 buildCounterTiersListResponse++; | 1331 buildCounterTiersListResponse++; |
1323 if (buildCounterTiersListResponse < 3) { | 1332 if (buildCounterTiersListResponse < 3) { |
1324 o.items = buildUnnamed3209(); | 1333 o.items = buildUnnamed3202(); |
1325 o.kind = "foo"; | 1334 o.kind = "foo"; |
1326 } | 1335 } |
1327 buildCounterTiersListResponse--; | 1336 buildCounterTiersListResponse--; |
1328 return o; | 1337 return o; |
1329 } | 1338 } |
1330 | 1339 |
1331 checkTiersListResponse(api.TiersListResponse o) { | 1340 checkTiersListResponse(api.TiersListResponse o) { |
1332 buildCounterTiersListResponse++; | 1341 buildCounterTiersListResponse++; |
1333 if (buildCounterTiersListResponse < 3) { | 1342 if (buildCounterTiersListResponse < 3) { |
1334 checkUnnamed3209(o.items); | 1343 checkUnnamed3202(o.items); |
1335 unittest.expect(o.kind, unittest.equals('foo')); | 1344 unittest.expect(o.kind, unittest.equals('foo')); |
1336 } | 1345 } |
1337 buildCounterTiersListResponse--; | 1346 buildCounterTiersListResponse--; |
1338 } | 1347 } |
1339 | 1348 |
1340 | |
1341 main() { | 1349 main() { |
1342 unittest.group("obj-schema-BackupConfiguration", () { | 1350 unittest.group("obj-schema-BackupConfiguration", () { |
1343 unittest.test("to-json--from-json", () { | 1351 unittest.test("to-json--from-json", () { |
1344 var o = buildBackupConfiguration(); | 1352 var o = buildBackupConfiguration(); |
1345 var od = new api.BackupConfiguration.fromJson(o.toJson()); | 1353 var od = new api.BackupConfiguration.fromJson(o.toJson()); |
1346 checkBackupConfiguration(od); | 1354 checkBackupConfiguration(od); |
1347 }); | 1355 }); |
1348 }); | 1356 }); |
1349 | 1357 |
1350 | |
1351 unittest.group("obj-schema-BackupRun", () { | 1358 unittest.group("obj-schema-BackupRun", () { |
1352 unittest.test("to-json--from-json", () { | 1359 unittest.test("to-json--from-json", () { |
1353 var o = buildBackupRun(); | 1360 var o = buildBackupRun(); |
1354 var od = new api.BackupRun.fromJson(o.toJson()); | 1361 var od = new api.BackupRun.fromJson(o.toJson()); |
1355 checkBackupRun(od); | 1362 checkBackupRun(od); |
1356 }); | 1363 }); |
1357 }); | 1364 }); |
1358 | 1365 |
1359 | |
1360 unittest.group("obj-schema-BackupRunsListResponse", () { | 1366 unittest.group("obj-schema-BackupRunsListResponse", () { |
1361 unittest.test("to-json--from-json", () { | 1367 unittest.test("to-json--from-json", () { |
1362 var o = buildBackupRunsListResponse(); | 1368 var o = buildBackupRunsListResponse(); |
1363 var od = new api.BackupRunsListResponse.fromJson(o.toJson()); | 1369 var od = new api.BackupRunsListResponse.fromJson(o.toJson()); |
1364 checkBackupRunsListResponse(od); | 1370 checkBackupRunsListResponse(od); |
1365 }); | 1371 }); |
1366 }); | 1372 }); |
1367 | 1373 |
1368 | |
1369 unittest.group("obj-schema-BinLogCoordinates", () { | 1374 unittest.group("obj-schema-BinLogCoordinates", () { |
1370 unittest.test("to-json--from-json", () { | 1375 unittest.test("to-json--from-json", () { |
1371 var o = buildBinLogCoordinates(); | 1376 var o = buildBinLogCoordinates(); |
1372 var od = new api.BinLogCoordinates.fromJson(o.toJson()); | 1377 var od = new api.BinLogCoordinates.fromJson(o.toJson()); |
1373 checkBinLogCoordinates(od); | 1378 checkBinLogCoordinates(od); |
1374 }); | 1379 }); |
1375 }); | 1380 }); |
1376 | 1381 |
1377 | |
1378 unittest.group("obj-schema-CloneContext", () { | 1382 unittest.group("obj-schema-CloneContext", () { |
1379 unittest.test("to-json--from-json", () { | 1383 unittest.test("to-json--from-json", () { |
1380 var o = buildCloneContext(); | 1384 var o = buildCloneContext(); |
1381 var od = new api.CloneContext.fromJson(o.toJson()); | 1385 var od = new api.CloneContext.fromJson(o.toJson()); |
1382 checkCloneContext(od); | 1386 checkCloneContext(od); |
1383 }); | 1387 }); |
1384 }); | 1388 }); |
1385 | 1389 |
1386 | |
1387 unittest.group("obj-schema-DatabaseFlags", () { | 1390 unittest.group("obj-schema-DatabaseFlags", () { |
1388 unittest.test("to-json--from-json", () { | 1391 unittest.test("to-json--from-json", () { |
1389 var o = buildDatabaseFlags(); | 1392 var o = buildDatabaseFlags(); |
1390 var od = new api.DatabaseFlags.fromJson(o.toJson()); | 1393 var od = new api.DatabaseFlags.fromJson(o.toJson()); |
1391 checkDatabaseFlags(od); | 1394 checkDatabaseFlags(od); |
1392 }); | 1395 }); |
1393 }); | 1396 }); |
1394 | 1397 |
1395 | |
1396 unittest.group("obj-schema-DatabaseInstance", () { | 1398 unittest.group("obj-schema-DatabaseInstance", () { |
1397 unittest.test("to-json--from-json", () { | 1399 unittest.test("to-json--from-json", () { |
1398 var o = buildDatabaseInstance(); | 1400 var o = buildDatabaseInstance(); |
1399 var od = new api.DatabaseInstance.fromJson(o.toJson()); | 1401 var od = new api.DatabaseInstance.fromJson(o.toJson()); |
1400 checkDatabaseInstance(od); | 1402 checkDatabaseInstance(od); |
1401 }); | 1403 }); |
1402 }); | 1404 }); |
1403 | 1405 |
1404 | |
1405 unittest.group("obj-schema-ExportContext", () { | 1406 unittest.group("obj-schema-ExportContext", () { |
1406 unittest.test("to-json--from-json", () { | 1407 unittest.test("to-json--from-json", () { |
1407 var o = buildExportContext(); | 1408 var o = buildExportContext(); |
1408 var od = new api.ExportContext.fromJson(o.toJson()); | 1409 var od = new api.ExportContext.fromJson(o.toJson()); |
1409 checkExportContext(od); | 1410 checkExportContext(od); |
1410 }); | 1411 }); |
1411 }); | 1412 }); |
1412 | 1413 |
1413 | |
1414 unittest.group("obj-schema-Flag", () { | 1414 unittest.group("obj-schema-Flag", () { |
1415 unittest.test("to-json--from-json", () { | 1415 unittest.test("to-json--from-json", () { |
1416 var o = buildFlag(); | 1416 var o = buildFlag(); |
1417 var od = new api.Flag.fromJson(o.toJson()); | 1417 var od = new api.Flag.fromJson(o.toJson()); |
1418 checkFlag(od); | 1418 checkFlag(od); |
1419 }); | 1419 }); |
1420 }); | 1420 }); |
1421 | 1421 |
1422 | |
1423 unittest.group("obj-schema-FlagsListResponse", () { | 1422 unittest.group("obj-schema-FlagsListResponse", () { |
1424 unittest.test("to-json--from-json", () { | 1423 unittest.test("to-json--from-json", () { |
1425 var o = buildFlagsListResponse(); | 1424 var o = buildFlagsListResponse(); |
1426 var od = new api.FlagsListResponse.fromJson(o.toJson()); | 1425 var od = new api.FlagsListResponse.fromJson(o.toJson()); |
1427 checkFlagsListResponse(od); | 1426 checkFlagsListResponse(od); |
1428 }); | 1427 }); |
1429 }); | 1428 }); |
1430 | 1429 |
1431 | |
1432 unittest.group("obj-schema-ImportContext", () { | 1430 unittest.group("obj-schema-ImportContext", () { |
1433 unittest.test("to-json--from-json", () { | 1431 unittest.test("to-json--from-json", () { |
1434 var o = buildImportContext(); | 1432 var o = buildImportContext(); |
1435 var od = new api.ImportContext.fromJson(o.toJson()); | 1433 var od = new api.ImportContext.fromJson(o.toJson()); |
1436 checkImportContext(od); | 1434 checkImportContext(od); |
1437 }); | 1435 }); |
1438 }); | 1436 }); |
1439 | 1437 |
1440 | |
1441 unittest.group("obj-schema-InstanceOperation", () { | 1438 unittest.group("obj-schema-InstanceOperation", () { |
1442 unittest.test("to-json--from-json", () { | 1439 unittest.test("to-json--from-json", () { |
1443 var o = buildInstanceOperation(); | 1440 var o = buildInstanceOperation(); |
1444 var od = new api.InstanceOperation.fromJson(o.toJson()); | 1441 var od = new api.InstanceOperation.fromJson(o.toJson()); |
1445 checkInstanceOperation(od); | 1442 checkInstanceOperation(od); |
1446 }); | 1443 }); |
1447 }); | 1444 }); |
1448 | 1445 |
1449 | |
1450 unittest.group("obj-schema-InstanceSetRootPasswordRequest", () { | 1446 unittest.group("obj-schema-InstanceSetRootPasswordRequest", () { |
1451 unittest.test("to-json--from-json", () { | 1447 unittest.test("to-json--from-json", () { |
1452 var o = buildInstanceSetRootPasswordRequest(); | 1448 var o = buildInstanceSetRootPasswordRequest(); |
1453 var od = new api.InstanceSetRootPasswordRequest.fromJson(o.toJson()); | 1449 var od = new api.InstanceSetRootPasswordRequest.fromJson(o.toJson()); |
1454 checkInstanceSetRootPasswordRequest(od); | 1450 checkInstanceSetRootPasswordRequest(od); |
1455 }); | 1451 }); |
1456 }); | 1452 }); |
1457 | 1453 |
1458 | |
1459 unittest.group("obj-schema-InstancesCloneRequest", () { | 1454 unittest.group("obj-schema-InstancesCloneRequest", () { |
1460 unittest.test("to-json--from-json", () { | 1455 unittest.test("to-json--from-json", () { |
1461 var o = buildInstancesCloneRequest(); | 1456 var o = buildInstancesCloneRequest(); |
1462 var od = new api.InstancesCloneRequest.fromJson(o.toJson()); | 1457 var od = new api.InstancesCloneRequest.fromJson(o.toJson()); |
1463 checkInstancesCloneRequest(od); | 1458 checkInstancesCloneRequest(od); |
1464 }); | 1459 }); |
1465 }); | 1460 }); |
1466 | 1461 |
1467 | |
1468 unittest.group("obj-schema-InstancesCloneResponse", () { | 1462 unittest.group("obj-schema-InstancesCloneResponse", () { |
1469 unittest.test("to-json--from-json", () { | 1463 unittest.test("to-json--from-json", () { |
1470 var o = buildInstancesCloneResponse(); | 1464 var o = buildInstancesCloneResponse(); |
1471 var od = new api.InstancesCloneResponse.fromJson(o.toJson()); | 1465 var od = new api.InstancesCloneResponse.fromJson(o.toJson()); |
1472 checkInstancesCloneResponse(od); | 1466 checkInstancesCloneResponse(od); |
1473 }); | 1467 }); |
1474 }); | 1468 }); |
1475 | 1469 |
1476 | |
1477 unittest.group("obj-schema-InstancesDeleteResponse", () { | 1470 unittest.group("obj-schema-InstancesDeleteResponse", () { |
1478 unittest.test("to-json--from-json", () { | 1471 unittest.test("to-json--from-json", () { |
1479 var o = buildInstancesDeleteResponse(); | 1472 var o = buildInstancesDeleteResponse(); |
1480 var od = new api.InstancesDeleteResponse.fromJson(o.toJson()); | 1473 var od = new api.InstancesDeleteResponse.fromJson(o.toJson()); |
1481 checkInstancesDeleteResponse(od); | 1474 checkInstancesDeleteResponse(od); |
1482 }); | 1475 }); |
1483 }); | 1476 }); |
1484 | 1477 |
1485 | |
1486 unittest.group("obj-schema-InstancesExportRequest", () { | 1478 unittest.group("obj-schema-InstancesExportRequest", () { |
1487 unittest.test("to-json--from-json", () { | 1479 unittest.test("to-json--from-json", () { |
1488 var o = buildInstancesExportRequest(); | 1480 var o = buildInstancesExportRequest(); |
1489 var od = new api.InstancesExportRequest.fromJson(o.toJson()); | 1481 var od = new api.InstancesExportRequest.fromJson(o.toJson()); |
1490 checkInstancesExportRequest(od); | 1482 checkInstancesExportRequest(od); |
1491 }); | 1483 }); |
1492 }); | 1484 }); |
1493 | 1485 |
1494 | |
1495 unittest.group("obj-schema-InstancesExportResponse", () { | 1486 unittest.group("obj-schema-InstancesExportResponse", () { |
1496 unittest.test("to-json--from-json", () { | 1487 unittest.test("to-json--from-json", () { |
1497 var o = buildInstancesExportResponse(); | 1488 var o = buildInstancesExportResponse(); |
1498 var od = new api.InstancesExportResponse.fromJson(o.toJson()); | 1489 var od = new api.InstancesExportResponse.fromJson(o.toJson()); |
1499 checkInstancesExportResponse(od); | 1490 checkInstancesExportResponse(od); |
1500 }); | 1491 }); |
1501 }); | 1492 }); |
1502 | 1493 |
1503 | |
1504 unittest.group("obj-schema-InstancesImportRequest", () { | 1494 unittest.group("obj-schema-InstancesImportRequest", () { |
1505 unittest.test("to-json--from-json", () { | 1495 unittest.test("to-json--from-json", () { |
1506 var o = buildInstancesImportRequest(); | 1496 var o = buildInstancesImportRequest(); |
1507 var od = new api.InstancesImportRequest.fromJson(o.toJson()); | 1497 var od = new api.InstancesImportRequest.fromJson(o.toJson()); |
1508 checkInstancesImportRequest(od); | 1498 checkInstancesImportRequest(od); |
1509 }); | 1499 }); |
1510 }); | 1500 }); |
1511 | 1501 |
1512 | |
1513 unittest.group("obj-schema-InstancesImportResponse", () { | 1502 unittest.group("obj-schema-InstancesImportResponse", () { |
1514 unittest.test("to-json--from-json", () { | 1503 unittest.test("to-json--from-json", () { |
1515 var o = buildInstancesImportResponse(); | 1504 var o = buildInstancesImportResponse(); |
1516 var od = new api.InstancesImportResponse.fromJson(o.toJson()); | 1505 var od = new api.InstancesImportResponse.fromJson(o.toJson()); |
1517 checkInstancesImportResponse(od); | 1506 checkInstancesImportResponse(od); |
1518 }); | 1507 }); |
1519 }); | 1508 }); |
1520 | 1509 |
1521 | |
1522 unittest.group("obj-schema-InstancesInsertResponse", () { | 1510 unittest.group("obj-schema-InstancesInsertResponse", () { |
1523 unittest.test("to-json--from-json", () { | 1511 unittest.test("to-json--from-json", () { |
1524 var o = buildInstancesInsertResponse(); | 1512 var o = buildInstancesInsertResponse(); |
1525 var od = new api.InstancesInsertResponse.fromJson(o.toJson()); | 1513 var od = new api.InstancesInsertResponse.fromJson(o.toJson()); |
1526 checkInstancesInsertResponse(od); | 1514 checkInstancesInsertResponse(od); |
1527 }); | 1515 }); |
1528 }); | 1516 }); |
1529 | 1517 |
1530 | |
1531 unittest.group("obj-schema-InstancesListResponse", () { | 1518 unittest.group("obj-schema-InstancesListResponse", () { |
1532 unittest.test("to-json--from-json", () { | 1519 unittest.test("to-json--from-json", () { |
1533 var o = buildInstancesListResponse(); | 1520 var o = buildInstancesListResponse(); |
1534 var od = new api.InstancesListResponse.fromJson(o.toJson()); | 1521 var od = new api.InstancesListResponse.fromJson(o.toJson()); |
1535 checkInstancesListResponse(od); | 1522 checkInstancesListResponse(od); |
1536 }); | 1523 }); |
1537 }); | 1524 }); |
1538 | 1525 |
1539 | |
1540 unittest.group("obj-schema-InstancesPromoteReplicaResponse", () { | 1526 unittest.group("obj-schema-InstancesPromoteReplicaResponse", () { |
1541 unittest.test("to-json--from-json", () { | 1527 unittest.test("to-json--from-json", () { |
1542 var o = buildInstancesPromoteReplicaResponse(); | 1528 var o = buildInstancesPromoteReplicaResponse(); |
1543 var od = new api.InstancesPromoteReplicaResponse.fromJson(o.toJson()); | 1529 var od = new api.InstancesPromoteReplicaResponse.fromJson(o.toJson()); |
1544 checkInstancesPromoteReplicaResponse(od); | 1530 checkInstancesPromoteReplicaResponse(od); |
1545 }); | 1531 }); |
1546 }); | 1532 }); |
1547 | 1533 |
1548 | |
1549 unittest.group("obj-schema-InstancesResetSslConfigResponse", () { | 1534 unittest.group("obj-schema-InstancesResetSslConfigResponse", () { |
1550 unittest.test("to-json--from-json", () { | 1535 unittest.test("to-json--from-json", () { |
1551 var o = buildInstancesResetSslConfigResponse(); | 1536 var o = buildInstancesResetSslConfigResponse(); |
1552 var od = new api.InstancesResetSslConfigResponse.fromJson(o.toJson()); | 1537 var od = new api.InstancesResetSslConfigResponse.fromJson(o.toJson()); |
1553 checkInstancesResetSslConfigResponse(od); | 1538 checkInstancesResetSslConfigResponse(od); |
1554 }); | 1539 }); |
1555 }); | 1540 }); |
1556 | 1541 |
1557 | |
1558 unittest.group("obj-schema-InstancesRestartResponse", () { | 1542 unittest.group("obj-schema-InstancesRestartResponse", () { |
1559 unittest.test("to-json--from-json", () { | 1543 unittest.test("to-json--from-json", () { |
1560 var o = buildInstancesRestartResponse(); | 1544 var o = buildInstancesRestartResponse(); |
1561 var od = new api.InstancesRestartResponse.fromJson(o.toJson()); | 1545 var od = new api.InstancesRestartResponse.fromJson(o.toJson()); |
1562 checkInstancesRestartResponse(od); | 1546 checkInstancesRestartResponse(od); |
1563 }); | 1547 }); |
1564 }); | 1548 }); |
1565 | 1549 |
1566 | |
1567 unittest.group("obj-schema-InstancesRestoreBackupResponse", () { | 1550 unittest.group("obj-schema-InstancesRestoreBackupResponse", () { |
1568 unittest.test("to-json--from-json", () { | 1551 unittest.test("to-json--from-json", () { |
1569 var o = buildInstancesRestoreBackupResponse(); | 1552 var o = buildInstancesRestoreBackupResponse(); |
1570 var od = new api.InstancesRestoreBackupResponse.fromJson(o.toJson()); | 1553 var od = new api.InstancesRestoreBackupResponse.fromJson(o.toJson()); |
1571 checkInstancesRestoreBackupResponse(od); | 1554 checkInstancesRestoreBackupResponse(od); |
1572 }); | 1555 }); |
1573 }); | 1556 }); |
1574 | 1557 |
1575 | |
1576 unittest.group("obj-schema-InstancesSetRootPasswordResponse", () { | 1558 unittest.group("obj-schema-InstancesSetRootPasswordResponse", () { |
1577 unittest.test("to-json--from-json", () { | 1559 unittest.test("to-json--from-json", () { |
1578 var o = buildInstancesSetRootPasswordResponse(); | 1560 var o = buildInstancesSetRootPasswordResponse(); |
1579 var od = new api.InstancesSetRootPasswordResponse.fromJson(o.toJson()); | 1561 var od = new api.InstancesSetRootPasswordResponse.fromJson(o.toJson()); |
1580 checkInstancesSetRootPasswordResponse(od); | 1562 checkInstancesSetRootPasswordResponse(od); |
1581 }); | 1563 }); |
1582 }); | 1564 }); |
1583 | 1565 |
1584 | |
1585 unittest.group("obj-schema-InstancesUpdateResponse", () { | 1566 unittest.group("obj-schema-InstancesUpdateResponse", () { |
1586 unittest.test("to-json--from-json", () { | 1567 unittest.test("to-json--from-json", () { |
1587 var o = buildInstancesUpdateResponse(); | 1568 var o = buildInstancesUpdateResponse(); |
1588 var od = new api.InstancesUpdateResponse.fromJson(o.toJson()); | 1569 var od = new api.InstancesUpdateResponse.fromJson(o.toJson()); |
1589 checkInstancesUpdateResponse(od); | 1570 checkInstancesUpdateResponse(od); |
1590 }); | 1571 }); |
1591 }); | 1572 }); |
1592 | 1573 |
1593 | |
1594 unittest.group("obj-schema-IpConfiguration", () { | 1574 unittest.group("obj-schema-IpConfiguration", () { |
1595 unittest.test("to-json--from-json", () { | 1575 unittest.test("to-json--from-json", () { |
1596 var o = buildIpConfiguration(); | 1576 var o = buildIpConfiguration(); |
1597 var od = new api.IpConfiguration.fromJson(o.toJson()); | 1577 var od = new api.IpConfiguration.fromJson(o.toJson()); |
1598 checkIpConfiguration(od); | 1578 checkIpConfiguration(od); |
1599 }); | 1579 }); |
1600 }); | 1580 }); |
1601 | 1581 |
1602 | |
1603 unittest.group("obj-schema-IpMapping", () { | 1582 unittest.group("obj-schema-IpMapping", () { |
1604 unittest.test("to-json--from-json", () { | 1583 unittest.test("to-json--from-json", () { |
1605 var o = buildIpMapping(); | 1584 var o = buildIpMapping(); |
1606 var od = new api.IpMapping.fromJson(o.toJson()); | 1585 var od = new api.IpMapping.fromJson(o.toJson()); |
1607 checkIpMapping(od); | 1586 checkIpMapping(od); |
1608 }); | 1587 }); |
1609 }); | 1588 }); |
1610 | 1589 |
1611 | |
1612 unittest.group("obj-schema-LocationPreference", () { | 1590 unittest.group("obj-schema-LocationPreference", () { |
1613 unittest.test("to-json--from-json", () { | 1591 unittest.test("to-json--from-json", () { |
1614 var o = buildLocationPreference(); | 1592 var o = buildLocationPreference(); |
1615 var od = new api.LocationPreference.fromJson(o.toJson()); | 1593 var od = new api.LocationPreference.fromJson(o.toJson()); |
1616 checkLocationPreference(od); | 1594 checkLocationPreference(od); |
1617 }); | 1595 }); |
1618 }); | 1596 }); |
1619 | 1597 |
1620 | |
1621 unittest.group("obj-schema-OperationError", () { | 1598 unittest.group("obj-schema-OperationError", () { |
1622 unittest.test("to-json--from-json", () { | 1599 unittest.test("to-json--from-json", () { |
1623 var o = buildOperationError(); | 1600 var o = buildOperationError(); |
1624 var od = new api.OperationError.fromJson(o.toJson()); | 1601 var od = new api.OperationError.fromJson(o.toJson()); |
1625 checkOperationError(od); | 1602 checkOperationError(od); |
1626 }); | 1603 }); |
1627 }); | 1604 }); |
1628 | 1605 |
1629 | |
1630 unittest.group("obj-schema-OperationsListResponse", () { | 1606 unittest.group("obj-schema-OperationsListResponse", () { |
1631 unittest.test("to-json--from-json", () { | 1607 unittest.test("to-json--from-json", () { |
1632 var o = buildOperationsListResponse(); | 1608 var o = buildOperationsListResponse(); |
1633 var od = new api.OperationsListResponse.fromJson(o.toJson()); | 1609 var od = new api.OperationsListResponse.fromJson(o.toJson()); |
1634 checkOperationsListResponse(od); | 1610 checkOperationsListResponse(od); |
1635 }); | 1611 }); |
1636 }); | 1612 }); |
1637 | 1613 |
1638 | |
1639 unittest.group("obj-schema-SetRootPasswordContext", () { | 1614 unittest.group("obj-schema-SetRootPasswordContext", () { |
1640 unittest.test("to-json--from-json", () { | 1615 unittest.test("to-json--from-json", () { |
1641 var o = buildSetRootPasswordContext(); | 1616 var o = buildSetRootPasswordContext(); |
1642 var od = new api.SetRootPasswordContext.fromJson(o.toJson()); | 1617 var od = new api.SetRootPasswordContext.fromJson(o.toJson()); |
1643 checkSetRootPasswordContext(od); | 1618 checkSetRootPasswordContext(od); |
1644 }); | 1619 }); |
1645 }); | 1620 }); |
1646 | 1621 |
1647 | |
1648 unittest.group("obj-schema-Settings", () { | 1622 unittest.group("obj-schema-Settings", () { |
1649 unittest.test("to-json--from-json", () { | 1623 unittest.test("to-json--from-json", () { |
1650 var o = buildSettings(); | 1624 var o = buildSettings(); |
1651 var od = new api.Settings.fromJson(o.toJson()); | 1625 var od = new api.Settings.fromJson(o.toJson()); |
1652 checkSettings(od); | 1626 checkSettings(od); |
1653 }); | 1627 }); |
1654 }); | 1628 }); |
1655 | 1629 |
1656 | |
1657 unittest.group("obj-schema-SslCert", () { | 1630 unittest.group("obj-schema-SslCert", () { |
1658 unittest.test("to-json--from-json", () { | 1631 unittest.test("to-json--from-json", () { |
1659 var o = buildSslCert(); | 1632 var o = buildSslCert(); |
1660 var od = new api.SslCert.fromJson(o.toJson()); | 1633 var od = new api.SslCert.fromJson(o.toJson()); |
1661 checkSslCert(od); | 1634 checkSslCert(od); |
1662 }); | 1635 }); |
1663 }); | 1636 }); |
1664 | 1637 |
1665 | |
1666 unittest.group("obj-schema-SslCertDetail", () { | 1638 unittest.group("obj-schema-SslCertDetail", () { |
1667 unittest.test("to-json--from-json", () { | 1639 unittest.test("to-json--from-json", () { |
1668 var o = buildSslCertDetail(); | 1640 var o = buildSslCertDetail(); |
1669 var od = new api.SslCertDetail.fromJson(o.toJson()); | 1641 var od = new api.SslCertDetail.fromJson(o.toJson()); |
1670 checkSslCertDetail(od); | 1642 checkSslCertDetail(od); |
1671 }); | 1643 }); |
1672 }); | 1644 }); |
1673 | 1645 |
1674 | |
1675 unittest.group("obj-schema-SslCertsDeleteResponse", () { | 1646 unittest.group("obj-schema-SslCertsDeleteResponse", () { |
1676 unittest.test("to-json--from-json", () { | 1647 unittest.test("to-json--from-json", () { |
1677 var o = buildSslCertsDeleteResponse(); | 1648 var o = buildSslCertsDeleteResponse(); |
1678 var od = new api.SslCertsDeleteResponse.fromJson(o.toJson()); | 1649 var od = new api.SslCertsDeleteResponse.fromJson(o.toJson()); |
1679 checkSslCertsDeleteResponse(od); | 1650 checkSslCertsDeleteResponse(od); |
1680 }); | 1651 }); |
1681 }); | 1652 }); |
1682 | 1653 |
1683 | |
1684 unittest.group("obj-schema-SslCertsInsertRequest", () { | 1654 unittest.group("obj-schema-SslCertsInsertRequest", () { |
1685 unittest.test("to-json--from-json", () { | 1655 unittest.test("to-json--from-json", () { |
1686 var o = buildSslCertsInsertRequest(); | 1656 var o = buildSslCertsInsertRequest(); |
1687 var od = new api.SslCertsInsertRequest.fromJson(o.toJson()); | 1657 var od = new api.SslCertsInsertRequest.fromJson(o.toJson()); |
1688 checkSslCertsInsertRequest(od); | 1658 checkSslCertsInsertRequest(od); |
1689 }); | 1659 }); |
1690 }); | 1660 }); |
1691 | 1661 |
1692 | |
1693 unittest.group("obj-schema-SslCertsInsertResponse", () { | 1662 unittest.group("obj-schema-SslCertsInsertResponse", () { |
1694 unittest.test("to-json--from-json", () { | 1663 unittest.test("to-json--from-json", () { |
1695 var o = buildSslCertsInsertResponse(); | 1664 var o = buildSslCertsInsertResponse(); |
1696 var od = new api.SslCertsInsertResponse.fromJson(o.toJson()); | 1665 var od = new api.SslCertsInsertResponse.fromJson(o.toJson()); |
1697 checkSslCertsInsertResponse(od); | 1666 checkSslCertsInsertResponse(od); |
1698 }); | 1667 }); |
1699 }); | 1668 }); |
1700 | 1669 |
1701 | |
1702 unittest.group("obj-schema-SslCertsListResponse", () { | 1670 unittest.group("obj-schema-SslCertsListResponse", () { |
1703 unittest.test("to-json--from-json", () { | 1671 unittest.test("to-json--from-json", () { |
1704 var o = buildSslCertsListResponse(); | 1672 var o = buildSslCertsListResponse(); |
1705 var od = new api.SslCertsListResponse.fromJson(o.toJson()); | 1673 var od = new api.SslCertsListResponse.fromJson(o.toJson()); |
1706 checkSslCertsListResponse(od); | 1674 checkSslCertsListResponse(od); |
1707 }); | 1675 }); |
1708 }); | 1676 }); |
1709 | 1677 |
1710 | |
1711 unittest.group("obj-schema-Tier", () { | 1678 unittest.group("obj-schema-Tier", () { |
1712 unittest.test("to-json--from-json", () { | 1679 unittest.test("to-json--from-json", () { |
1713 var o = buildTier(); | 1680 var o = buildTier(); |
1714 var od = new api.Tier.fromJson(o.toJson()); | 1681 var od = new api.Tier.fromJson(o.toJson()); |
1715 checkTier(od); | 1682 checkTier(od); |
1716 }); | 1683 }); |
1717 }); | 1684 }); |
1718 | 1685 |
1719 | |
1720 unittest.group("obj-schema-TiersListResponse", () { | 1686 unittest.group("obj-schema-TiersListResponse", () { |
1721 unittest.test("to-json--from-json", () { | 1687 unittest.test("to-json--from-json", () { |
1722 var o = buildTiersListResponse(); | 1688 var o = buildTiersListResponse(); |
1723 var od = new api.TiersListResponse.fromJson(o.toJson()); | 1689 var od = new api.TiersListResponse.fromJson(o.toJson()); |
1724 checkTiersListResponse(od); | 1690 checkTiersListResponse(od); |
1725 }); | 1691 }); |
1726 }); | 1692 }); |
1727 | 1693 |
1728 | |
1729 unittest.group("resource-BackupRunsResourceApi", () { | 1694 unittest.group("resource-BackupRunsResourceApi", () { |
1730 unittest.test("method--get", () { | 1695 unittest.test("method--get", () { |
1731 | |
1732 var mock = new HttpServerMock(); | 1696 var mock = new HttpServerMock(); |
1733 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 1697 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
1734 var arg_project = "foo"; | 1698 var arg_project = "foo"; |
1735 var arg_instance = "foo"; | 1699 var arg_instance = "foo"; |
1736 var arg_backupConfiguration = "foo"; | 1700 var arg_backupConfiguration = "foo"; |
1737 var arg_dueTime = "foo"; | 1701 var arg_dueTime = "foo"; |
1738 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1702 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1739 var path = (req.url).path; | 1703 var path = (req.url).path; |
1740 var pathOffset = 0; | 1704 var pathOffset = 0; |
1741 var index; | 1705 var index; |
1742 var subPart; | 1706 var subPart; |
1743 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1707 unittest.expect( |
| 1708 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1744 pathOffset += 1; | 1709 pathOffset += 1; |
1745 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 1710 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1711 unittest.equals("sql/v1beta3/")); |
1746 pathOffset += 12; | 1712 pathOffset += 12; |
1747 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 1713 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 1714 unittest.equals("projects/")); |
1748 pathOffset += 9; | 1715 pathOffset += 9; |
1749 index = path.indexOf("/instances/", pathOffset); | 1716 index = path.indexOf("/instances/", pathOffset); |
1750 unittest.expect(index >= 0, unittest.isTrue); | 1717 unittest.expect(index >= 0, unittest.isTrue); |
1751 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1718 subPart = |
| 1719 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1752 pathOffset = index; | 1720 pathOffset = index; |
1753 unittest.expect(subPart, unittest.equals("$arg_project")); | 1721 unittest.expect(subPart, unittest.equals("$arg_project")); |
1754 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 1722 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 1723 unittest.equals("/instances/")); |
1755 pathOffset += 11; | 1724 pathOffset += 11; |
1756 index = path.indexOf("/backupRuns/", pathOffset); | 1725 index = path.indexOf("/backupRuns/", pathOffset); |
1757 unittest.expect(index >= 0, unittest.isTrue); | 1726 unittest.expect(index >= 0, unittest.isTrue); |
1758 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1727 subPart = |
| 1728 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1759 pathOffset = index; | 1729 pathOffset = index; |
1760 unittest.expect(subPart, unittest.equals("$arg_instance")); | 1730 unittest.expect(subPart, unittest.equals("$arg_instance")); |
1761 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/backupRuns/")); | 1731 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1732 unittest.equals("/backupRuns/")); |
1762 pathOffset += 12; | 1733 pathOffset += 12; |
1763 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1734 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1764 pathOffset = path.length; | 1735 pathOffset = path.length; |
1765 unittest.expect(subPart, unittest.equals("$arg_backupConfiguration")); | 1736 unittest.expect(subPart, unittest.equals("$arg_backupConfiguration")); |
1766 | 1737 |
1767 var query = (req.url).query; | 1738 var query = (req.url).query; |
1768 var queryOffset = 0; | 1739 var queryOffset = 0; |
1769 var queryMap = {}; | 1740 var queryMap = {}; |
1770 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1741 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1771 parseBool(n) { | 1742 parseBool(n) { |
1772 if (n == "true") return true; | 1743 if (n == "true") return true; |
1773 if (n == "false") return false; | 1744 if (n == "false") return false; |
1774 if (n == null) return null; | 1745 if (n == null) return null; |
1775 throw new core.ArgumentError("Invalid boolean: $n"); | 1746 throw new core.ArgumentError("Invalid boolean: $n"); |
1776 } | 1747 } |
| 1748 |
1777 if (query.length > 0) { | 1749 if (query.length > 0) { |
1778 for (var part in query.split("&")) { | 1750 for (var part in query.split("&")) { |
1779 var keyvalue = part.split("="); | 1751 var keyvalue = part.split("="); |
1780 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1752 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1753 core.Uri.decodeQueryComponent(keyvalue[1])); |
1781 } | 1754 } |
1782 } | 1755 } |
1783 unittest.expect(queryMap["dueTime"].first, unittest.equals(arg_dueTime))
; | 1756 unittest.expect( |
1784 | 1757 queryMap["dueTime"].first, unittest.equals(arg_dueTime)); |
1785 | 1758 |
1786 var h = { | 1759 var h = { |
1787 "content-type" : "application/json; charset=utf-8", | 1760 "content-type": "application/json; charset=utf-8", |
1788 }; | 1761 }; |
1789 var resp = convert.JSON.encode(buildBackupRun()); | 1762 var resp = convert.JSON.encode(buildBackupRun()); |
1790 return new async.Future.value(stringResponse(200, h, resp)); | 1763 return new async.Future.value(stringResponse(200, h, resp)); |
1791 }), true); | 1764 }), true); |
1792 res.get(arg_project, arg_instance, arg_backupConfiguration, arg_dueTime).t
hen(unittest.expectAsync1(((api.BackupRun response) { | 1765 res |
| 1766 .get(arg_project, arg_instance, arg_backupConfiguration, arg_dueTime) |
| 1767 .then(unittest.expectAsync1(((api.BackupRun response) { |
1793 checkBackupRun(response); | 1768 checkBackupRun(response); |
1794 }))); | 1769 }))); |
1795 }); | 1770 }); |
1796 | 1771 |
1797 unittest.test("method--list", () { | 1772 unittest.test("method--list", () { |
1798 | |
1799 var mock = new HttpServerMock(); | 1773 var mock = new HttpServerMock(); |
1800 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; | 1774 api.BackupRunsResourceApi res = new api.SqladminApi(mock).backupRuns; |
1801 var arg_project = "foo"; | 1775 var arg_project = "foo"; |
1802 var arg_instance = "foo"; | 1776 var arg_instance = "foo"; |
1803 var arg_backupConfiguration = "foo"; | 1777 var arg_backupConfiguration = "foo"; |
1804 var arg_maxResults = 42; | 1778 var arg_maxResults = 42; |
1805 var arg_pageToken = "foo"; | 1779 var arg_pageToken = "foo"; |
1806 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1780 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1807 var path = (req.url).path; | 1781 var path = (req.url).path; |
1808 var pathOffset = 0; | 1782 var pathOffset = 0; |
1809 var index; | 1783 var index; |
1810 var subPart; | 1784 var subPart; |
1811 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1785 unittest.expect( |
| 1786 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1812 pathOffset += 1; | 1787 pathOffset += 1; |
1813 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 1788 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1789 unittest.equals("sql/v1beta3/")); |
1814 pathOffset += 12; | 1790 pathOffset += 12; |
1815 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 1791 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 1792 unittest.equals("projects/")); |
1816 pathOffset += 9; | 1793 pathOffset += 9; |
1817 index = path.indexOf("/instances/", pathOffset); | 1794 index = path.indexOf("/instances/", pathOffset); |
1818 unittest.expect(index >= 0, unittest.isTrue); | 1795 unittest.expect(index >= 0, unittest.isTrue); |
1819 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1796 subPart = |
| 1797 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1820 pathOffset = index; | 1798 pathOffset = index; |
1821 unittest.expect(subPart, unittest.equals("$arg_project")); | 1799 unittest.expect(subPart, unittest.equals("$arg_project")); |
1822 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 1800 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 1801 unittest.equals("/instances/")); |
1823 pathOffset += 11; | 1802 pathOffset += 11; |
1824 index = path.indexOf("/backupRuns", pathOffset); | 1803 index = path.indexOf("/backupRuns", pathOffset); |
1825 unittest.expect(index >= 0, unittest.isTrue); | 1804 unittest.expect(index >= 0, unittest.isTrue); |
1826 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1805 subPart = |
| 1806 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1827 pathOffset = index; | 1807 pathOffset = index; |
1828 unittest.expect(subPart, unittest.equals("$arg_instance")); | 1808 unittest.expect(subPart, unittest.equals("$arg_instance")); |
1829 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/backupRuns")); | 1809 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 1810 unittest.equals("/backupRuns")); |
1830 pathOffset += 11; | 1811 pathOffset += 11; |
1831 | 1812 |
1832 var query = (req.url).query; | 1813 var query = (req.url).query; |
1833 var queryOffset = 0; | 1814 var queryOffset = 0; |
1834 var queryMap = {}; | 1815 var queryMap = {}; |
1835 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1816 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1836 parseBool(n) { | 1817 parseBool(n) { |
1837 if (n == "true") return true; | 1818 if (n == "true") return true; |
1838 if (n == "false") return false; | 1819 if (n == "false") return false; |
1839 if (n == null) return null; | 1820 if (n == null) return null; |
1840 throw new core.ArgumentError("Invalid boolean: $n"); | 1821 throw new core.ArgumentError("Invalid boolean: $n"); |
1841 } | 1822 } |
| 1823 |
1842 if (query.length > 0) { | 1824 if (query.length > 0) { |
1843 for (var part in query.split("&")) { | 1825 for (var part in query.split("&")) { |
1844 var keyvalue = part.split("="); | 1826 var keyvalue = part.split("="); |
1845 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1827 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1828 core.Uri.decodeQueryComponent(keyvalue[1])); |
1846 } | 1829 } |
1847 } | 1830 } |
1848 unittest.expect(queryMap["backupConfiguration"].first, unittest.equals(a
rg_backupConfiguration)); | 1831 unittest.expect(queryMap["backupConfiguration"].first, |
1849 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1832 unittest.equals(arg_backupConfiguration)); |
1850 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1833 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
1851 | 1834 unittest.equals(arg_maxResults)); |
| 1835 unittest.expect( |
| 1836 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
1852 | 1837 |
1853 var h = { | 1838 var h = { |
1854 "content-type" : "application/json; charset=utf-8", | 1839 "content-type": "application/json; charset=utf-8", |
1855 }; | 1840 }; |
1856 var resp = convert.JSON.encode(buildBackupRunsListResponse()); | 1841 var resp = convert.JSON.encode(buildBackupRunsListResponse()); |
1857 return new async.Future.value(stringResponse(200, h, resp)); | 1842 return new async.Future.value(stringResponse(200, h, resp)); |
1858 }), true); | 1843 }), true); |
1859 res.list(arg_project, arg_instance, arg_backupConfiguration, maxResults: a
rg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync1(((api.Backup
RunsListResponse response) { | 1844 res |
| 1845 .list(arg_project, arg_instance, arg_backupConfiguration, |
| 1846 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 1847 .then(unittest.expectAsync1(((api.BackupRunsListResponse response) { |
1860 checkBackupRunsListResponse(response); | 1848 checkBackupRunsListResponse(response); |
1861 }))); | 1849 }))); |
1862 }); | 1850 }); |
1863 | |
1864 }); | 1851 }); |
1865 | 1852 |
1866 | |
1867 unittest.group("resource-FlagsResourceApi", () { | 1853 unittest.group("resource-FlagsResourceApi", () { |
1868 unittest.test("method--list", () { | 1854 unittest.test("method--list", () { |
1869 | |
1870 var mock = new HttpServerMock(); | 1855 var mock = new HttpServerMock(); |
1871 api.FlagsResourceApi res = new api.SqladminApi(mock).flags; | 1856 api.FlagsResourceApi res = new api.SqladminApi(mock).flags; |
1872 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1857 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1873 var path = (req.url).path; | 1858 var path = (req.url).path; |
1874 var pathOffset = 0; | 1859 var pathOffset = 0; |
1875 var index; | 1860 var index; |
1876 var subPart; | 1861 var subPart; |
1877 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1862 unittest.expect( |
| 1863 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1878 pathOffset += 1; | 1864 pathOffset += 1; |
1879 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 1865 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1866 unittest.equals("sql/v1beta3/")); |
1880 pathOffset += 12; | 1867 pathOffset += 12; |
1881 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("flags")); | 1868 unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| 1869 unittest.equals("flags")); |
1882 pathOffset += 5; | 1870 pathOffset += 5; |
1883 | 1871 |
1884 var query = (req.url).query; | 1872 var query = (req.url).query; |
1885 var queryOffset = 0; | 1873 var queryOffset = 0; |
1886 var queryMap = {}; | 1874 var queryMap = {}; |
1887 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1875 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1888 parseBool(n) { | 1876 parseBool(n) { |
1889 if (n == "true") return true; | 1877 if (n == "true") return true; |
1890 if (n == "false") return false; | 1878 if (n == "false") return false; |
1891 if (n == null) return null; | 1879 if (n == null) return null; |
1892 throw new core.ArgumentError("Invalid boolean: $n"); | 1880 throw new core.ArgumentError("Invalid boolean: $n"); |
1893 } | 1881 } |
| 1882 |
1894 if (query.length > 0) { | 1883 if (query.length > 0) { |
1895 for (var part in query.split("&")) { | 1884 for (var part in query.split("&")) { |
1896 var keyvalue = part.split("="); | 1885 var keyvalue = part.split("="); |
1897 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1887 core.Uri.decodeQueryComponent(keyvalue[1])); |
1898 } | 1888 } |
1899 } | 1889 } |
1900 | 1890 |
1901 | |
1902 var h = { | 1891 var h = { |
1903 "content-type" : "application/json; charset=utf-8", | 1892 "content-type": "application/json; charset=utf-8", |
1904 }; | 1893 }; |
1905 var resp = convert.JSON.encode(buildFlagsListResponse()); | 1894 var resp = convert.JSON.encode(buildFlagsListResponse()); |
1906 return new async.Future.value(stringResponse(200, h, resp)); | 1895 return new async.Future.value(stringResponse(200, h, resp)); |
1907 }), true); | 1896 }), true); |
1908 res.list().then(unittest.expectAsync1(((api.FlagsListResponse response) { | 1897 res.list().then(unittest.expectAsync1(((api.FlagsListResponse response) { |
1909 checkFlagsListResponse(response); | 1898 checkFlagsListResponse(response); |
1910 }))); | 1899 }))); |
1911 }); | 1900 }); |
1912 | |
1913 }); | 1901 }); |
1914 | 1902 |
1915 | |
1916 unittest.group("resource-InstancesResourceApi", () { | 1903 unittest.group("resource-InstancesResourceApi", () { |
1917 unittest.test("method--clone", () { | 1904 unittest.test("method--clone", () { |
1918 | |
1919 var mock = new HttpServerMock(); | 1905 var mock = new HttpServerMock(); |
1920 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 1906 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
1921 var arg_request = buildInstancesCloneRequest(); | 1907 var arg_request = buildInstancesCloneRequest(); |
1922 var arg_project = "foo"; | 1908 var arg_project = "foo"; |
1923 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1909 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1924 var obj = new api.InstancesCloneRequest.fromJson(json); | 1910 var obj = new api.InstancesCloneRequest.fromJson(json); |
1925 checkInstancesCloneRequest(obj); | 1911 checkInstancesCloneRequest(obj); |
1926 | 1912 |
1927 var path = (req.url).path; | 1913 var path = (req.url).path; |
1928 var pathOffset = 0; | 1914 var pathOffset = 0; |
1929 var index; | 1915 var index; |
1930 var subPart; | 1916 var subPart; |
1931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1917 unittest.expect( |
| 1918 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1932 pathOffset += 1; | 1919 pathOffset += 1; |
1933 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 1920 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1921 unittest.equals("sql/v1beta3/")); |
1934 pathOffset += 12; | 1922 pathOffset += 12; |
1935 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 1923 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 1924 unittest.equals("projects/")); |
1936 pathOffset += 9; | 1925 pathOffset += 9; |
1937 index = path.indexOf("/instances/clone", pathOffset); | 1926 index = path.indexOf("/instances/clone", pathOffset); |
1938 unittest.expect(index >= 0, unittest.isTrue); | 1927 unittest.expect(index >= 0, unittest.isTrue); |
1939 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1928 subPart = |
| 1929 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1940 pathOffset = index; | 1930 pathOffset = index; |
1941 unittest.expect(subPart, unittest.equals("$arg_project")); | 1931 unittest.expect(subPart, unittest.equals("$arg_project")); |
1942 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/instances/clone")); | 1932 unittest.expect(path.substring(pathOffset, pathOffset + 16), |
| 1933 unittest.equals("/instances/clone")); |
1943 pathOffset += 16; | 1934 pathOffset += 16; |
1944 | 1935 |
1945 var query = (req.url).query; | 1936 var query = (req.url).query; |
1946 var queryOffset = 0; | 1937 var queryOffset = 0; |
1947 var queryMap = {}; | 1938 var queryMap = {}; |
1948 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1939 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1949 parseBool(n) { | 1940 parseBool(n) { |
1950 if (n == "true") return true; | 1941 if (n == "true") return true; |
1951 if (n == "false") return false; | 1942 if (n == "false") return false; |
1952 if (n == null) return null; | 1943 if (n == null) return null; |
1953 throw new core.ArgumentError("Invalid boolean: $n"); | 1944 throw new core.ArgumentError("Invalid boolean: $n"); |
1954 } | 1945 } |
| 1946 |
1955 if (query.length > 0) { | 1947 if (query.length > 0) { |
1956 for (var part in query.split("&")) { | 1948 for (var part in query.split("&")) { |
1957 var keyvalue = part.split("="); | 1949 var keyvalue = part.split("="); |
1958 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1950 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1951 core.Uri.decodeQueryComponent(keyvalue[1])); |
1959 } | 1952 } |
1960 } | 1953 } |
1961 | 1954 |
1962 | |
1963 var h = { | 1955 var h = { |
1964 "content-type" : "application/json; charset=utf-8", | 1956 "content-type": "application/json; charset=utf-8", |
1965 }; | 1957 }; |
1966 var resp = convert.JSON.encode(buildInstancesCloneResponse()); | 1958 var resp = convert.JSON.encode(buildInstancesCloneResponse()); |
1967 return new async.Future.value(stringResponse(200, h, resp)); | 1959 return new async.Future.value(stringResponse(200, h, resp)); |
1968 }), true); | 1960 }), true); |
1969 res.clone(arg_request, arg_project).then(unittest.expectAsync1(((api.Insta
ncesCloneResponse response) { | 1961 res |
| 1962 .clone(arg_request, arg_project) |
| 1963 .then(unittest.expectAsync1(((api.InstancesCloneResponse response) { |
1970 checkInstancesCloneResponse(response); | 1964 checkInstancesCloneResponse(response); |
1971 }))); | 1965 }))); |
1972 }); | 1966 }); |
1973 | 1967 |
1974 unittest.test("method--delete", () { | 1968 unittest.test("method--delete", () { |
1975 | |
1976 var mock = new HttpServerMock(); | 1969 var mock = new HttpServerMock(); |
1977 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 1970 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
1978 var arg_project = "foo"; | 1971 var arg_project = "foo"; |
1979 var arg_instance = "foo"; | 1972 var arg_instance = "foo"; |
1980 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1973 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1981 var path = (req.url).path; | 1974 var path = (req.url).path; |
1982 var pathOffset = 0; | 1975 var pathOffset = 0; |
1983 var index; | 1976 var index; |
1984 var subPart; | 1977 var subPart; |
1985 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1978 unittest.expect( |
| 1979 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1986 pathOffset += 1; | 1980 pathOffset += 1; |
1987 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 1981 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1982 unittest.equals("sql/v1beta3/")); |
1988 pathOffset += 12; | 1983 pathOffset += 12; |
1989 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 1984 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 1985 unittest.equals("projects/")); |
1990 pathOffset += 9; | 1986 pathOffset += 9; |
1991 index = path.indexOf("/instances/", pathOffset); | 1987 index = path.indexOf("/instances/", pathOffset); |
1992 unittest.expect(index >= 0, unittest.isTrue); | 1988 unittest.expect(index >= 0, unittest.isTrue); |
1993 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1989 subPart = |
| 1990 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1994 pathOffset = index; | 1991 pathOffset = index; |
1995 unittest.expect(subPart, unittest.equals("$arg_project")); | 1992 unittest.expect(subPart, unittest.equals("$arg_project")); |
1996 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 1993 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 1994 unittest.equals("/instances/")); |
1997 pathOffset += 11; | 1995 pathOffset += 11; |
1998 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1996 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1999 pathOffset = path.length; | 1997 pathOffset = path.length; |
2000 unittest.expect(subPart, unittest.equals("$arg_instance")); | 1998 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2001 | 1999 |
2002 var query = (req.url).query; | 2000 var query = (req.url).query; |
2003 var queryOffset = 0; | 2001 var queryOffset = 0; |
2004 var queryMap = {}; | 2002 var queryMap = {}; |
2005 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2003 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2006 parseBool(n) { | 2004 parseBool(n) { |
2007 if (n == "true") return true; | 2005 if (n == "true") return true; |
2008 if (n == "false") return false; | 2006 if (n == "false") return false; |
2009 if (n == null) return null; | 2007 if (n == null) return null; |
2010 throw new core.ArgumentError("Invalid boolean: $n"); | 2008 throw new core.ArgumentError("Invalid boolean: $n"); |
2011 } | 2009 } |
| 2010 |
2012 if (query.length > 0) { | 2011 if (query.length > 0) { |
2013 for (var part in query.split("&")) { | 2012 for (var part in query.split("&")) { |
2014 var keyvalue = part.split("="); | 2013 var keyvalue = part.split("="); |
2015 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2014 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2015 core.Uri.decodeQueryComponent(keyvalue[1])); |
2016 } | 2016 } |
2017 } | 2017 } |
2018 | 2018 |
2019 | |
2020 var h = { | 2019 var h = { |
2021 "content-type" : "application/json; charset=utf-8", | 2020 "content-type": "application/json; charset=utf-8", |
2022 }; | 2021 }; |
2023 var resp = convert.JSON.encode(buildInstancesDeleteResponse()); | 2022 var resp = convert.JSON.encode(buildInstancesDeleteResponse()); |
2024 return new async.Future.value(stringResponse(200, h, resp)); | 2023 return new async.Future.value(stringResponse(200, h, resp)); |
2025 }), true); | 2024 }), true); |
2026 res.delete(arg_project, arg_instance).then(unittest.expectAsync1(((api.Ins
tancesDeleteResponse response) { | 2025 res |
| 2026 .delete(arg_project, arg_instance) |
| 2027 .then(unittest.expectAsync1(((api.InstancesDeleteResponse response) { |
2027 checkInstancesDeleteResponse(response); | 2028 checkInstancesDeleteResponse(response); |
2028 }))); | 2029 }))); |
2029 }); | 2030 }); |
2030 | 2031 |
2031 unittest.test("method--export", () { | 2032 unittest.test("method--export", () { |
2032 | |
2033 var mock = new HttpServerMock(); | 2033 var mock = new HttpServerMock(); |
2034 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2034 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2035 var arg_request = buildInstancesExportRequest(); | 2035 var arg_request = buildInstancesExportRequest(); |
2036 var arg_project = "foo"; | 2036 var arg_project = "foo"; |
2037 var arg_instance = "foo"; | 2037 var arg_instance = "foo"; |
2038 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2038 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2039 var obj = new api.InstancesExportRequest.fromJson(json); | 2039 var obj = new api.InstancesExportRequest.fromJson(json); |
2040 checkInstancesExportRequest(obj); | 2040 checkInstancesExportRequest(obj); |
2041 | 2041 |
2042 var path = (req.url).path; | 2042 var path = (req.url).path; |
2043 var pathOffset = 0; | 2043 var pathOffset = 0; |
2044 var index; | 2044 var index; |
2045 var subPart; | 2045 var subPart; |
2046 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2046 unittest.expect( |
| 2047 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2047 pathOffset += 1; | 2048 pathOffset += 1; |
2048 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2049 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2050 unittest.equals("sql/v1beta3/")); |
2049 pathOffset += 12; | 2051 pathOffset += 12; |
2050 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2052 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2053 unittest.equals("projects/")); |
2051 pathOffset += 9; | 2054 pathOffset += 9; |
2052 index = path.indexOf("/instances/", pathOffset); | 2055 index = path.indexOf("/instances/", pathOffset); |
2053 unittest.expect(index >= 0, unittest.isTrue); | 2056 unittest.expect(index >= 0, unittest.isTrue); |
2054 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2057 subPart = |
| 2058 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2055 pathOffset = index; | 2059 pathOffset = index; |
2056 unittest.expect(subPart, unittest.equals("$arg_project")); | 2060 unittest.expect(subPart, unittest.equals("$arg_project")); |
2057 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2061 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2062 unittest.equals("/instances/")); |
2058 pathOffset += 11; | 2063 pathOffset += 11; |
2059 index = path.indexOf("/export", pathOffset); | 2064 index = path.indexOf("/export", pathOffset); |
2060 unittest.expect(index >= 0, unittest.isTrue); | 2065 unittest.expect(index >= 0, unittest.isTrue); |
2061 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2066 subPart = |
| 2067 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2062 pathOffset = index; | 2068 pathOffset = index; |
2063 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2069 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2064 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/export")); | 2070 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2071 unittest.equals("/export")); |
2065 pathOffset += 7; | 2072 pathOffset += 7; |
2066 | 2073 |
2067 var query = (req.url).query; | 2074 var query = (req.url).query; |
2068 var queryOffset = 0; | 2075 var queryOffset = 0; |
2069 var queryMap = {}; | 2076 var queryMap = {}; |
2070 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2077 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2071 parseBool(n) { | 2078 parseBool(n) { |
2072 if (n == "true") return true; | 2079 if (n == "true") return true; |
2073 if (n == "false") return false; | 2080 if (n == "false") return false; |
2074 if (n == null) return null; | 2081 if (n == null) return null; |
2075 throw new core.ArgumentError("Invalid boolean: $n"); | 2082 throw new core.ArgumentError("Invalid boolean: $n"); |
2076 } | 2083 } |
| 2084 |
2077 if (query.length > 0) { | 2085 if (query.length > 0) { |
2078 for (var part in query.split("&")) { | 2086 for (var part in query.split("&")) { |
2079 var keyvalue = part.split("="); | 2087 var keyvalue = part.split("="); |
2080 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2088 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2089 core.Uri.decodeQueryComponent(keyvalue[1])); |
2081 } | 2090 } |
2082 } | 2091 } |
2083 | 2092 |
2084 | |
2085 var h = { | 2093 var h = { |
2086 "content-type" : "application/json; charset=utf-8", | 2094 "content-type": "application/json; charset=utf-8", |
2087 }; | 2095 }; |
2088 var resp = convert.JSON.encode(buildInstancesExportResponse()); | 2096 var resp = convert.JSON.encode(buildInstancesExportResponse()); |
2089 return new async.Future.value(stringResponse(200, h, resp)); | 2097 return new async.Future.value(stringResponse(200, h, resp)); |
2090 }), true); | 2098 }), true); |
2091 res.export(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.InstancesExportResponse response) { | 2099 res |
| 2100 .export(arg_request, arg_project, arg_instance) |
| 2101 .then(unittest.expectAsync1(((api.InstancesExportResponse response) { |
2092 checkInstancesExportResponse(response); | 2102 checkInstancesExportResponse(response); |
2093 }))); | 2103 }))); |
2094 }); | 2104 }); |
2095 | 2105 |
2096 unittest.test("method--get", () { | 2106 unittest.test("method--get", () { |
2097 | |
2098 var mock = new HttpServerMock(); | 2107 var mock = new HttpServerMock(); |
2099 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2108 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2100 var arg_project = "foo"; | 2109 var arg_project = "foo"; |
2101 var arg_instance = "foo"; | 2110 var arg_instance = "foo"; |
2102 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2111 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2103 var path = (req.url).path; | 2112 var path = (req.url).path; |
2104 var pathOffset = 0; | 2113 var pathOffset = 0; |
2105 var index; | 2114 var index; |
2106 var subPart; | 2115 var subPart; |
2107 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2116 unittest.expect( |
| 2117 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2108 pathOffset += 1; | 2118 pathOffset += 1; |
2109 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2119 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2120 unittest.equals("sql/v1beta3/")); |
2110 pathOffset += 12; | 2121 pathOffset += 12; |
2111 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2122 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2123 unittest.equals("projects/")); |
2112 pathOffset += 9; | 2124 pathOffset += 9; |
2113 index = path.indexOf("/instances/", pathOffset); | 2125 index = path.indexOf("/instances/", pathOffset); |
2114 unittest.expect(index >= 0, unittest.isTrue); | 2126 unittest.expect(index >= 0, unittest.isTrue); |
2115 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2127 subPart = |
| 2128 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2116 pathOffset = index; | 2129 pathOffset = index; |
2117 unittest.expect(subPart, unittest.equals("$arg_project")); | 2130 unittest.expect(subPart, unittest.equals("$arg_project")); |
2118 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2131 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2132 unittest.equals("/instances/")); |
2119 pathOffset += 11; | 2133 pathOffset += 11; |
2120 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2134 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
2121 pathOffset = path.length; | 2135 pathOffset = path.length; |
2122 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2136 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2123 | 2137 |
2124 var query = (req.url).query; | 2138 var query = (req.url).query; |
2125 var queryOffset = 0; | 2139 var queryOffset = 0; |
2126 var queryMap = {}; | 2140 var queryMap = {}; |
2127 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2141 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2128 parseBool(n) { | 2142 parseBool(n) { |
2129 if (n == "true") return true; | 2143 if (n == "true") return true; |
2130 if (n == "false") return false; | 2144 if (n == "false") return false; |
2131 if (n == null) return null; | 2145 if (n == null) return null; |
2132 throw new core.ArgumentError("Invalid boolean: $n"); | 2146 throw new core.ArgumentError("Invalid boolean: $n"); |
2133 } | 2147 } |
| 2148 |
2134 if (query.length > 0) { | 2149 if (query.length > 0) { |
2135 for (var part in query.split("&")) { | 2150 for (var part in query.split("&")) { |
2136 var keyvalue = part.split("="); | 2151 var keyvalue = part.split("="); |
2137 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2153 core.Uri.decodeQueryComponent(keyvalue[1])); |
2138 } | 2154 } |
2139 } | 2155 } |
2140 | 2156 |
2141 | |
2142 var h = { | 2157 var h = { |
2143 "content-type" : "application/json; charset=utf-8", | 2158 "content-type": "application/json; charset=utf-8", |
2144 }; | 2159 }; |
2145 var resp = convert.JSON.encode(buildDatabaseInstance()); | 2160 var resp = convert.JSON.encode(buildDatabaseInstance()); |
2146 return new async.Future.value(stringResponse(200, h, resp)); | 2161 return new async.Future.value(stringResponse(200, h, resp)); |
2147 }), true); | 2162 }), true); |
2148 res.get(arg_project, arg_instance).then(unittest.expectAsync1(((api.Databa
seInstance response) { | 2163 res |
| 2164 .get(arg_project, arg_instance) |
| 2165 .then(unittest.expectAsync1(((api.DatabaseInstance response) { |
2149 checkDatabaseInstance(response); | 2166 checkDatabaseInstance(response); |
2150 }))); | 2167 }))); |
2151 }); | 2168 }); |
2152 | 2169 |
2153 unittest.test("method--import", () { | 2170 unittest.test("method--import", () { |
2154 | |
2155 var mock = new HttpServerMock(); | 2171 var mock = new HttpServerMock(); |
2156 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2172 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2157 var arg_request = buildInstancesImportRequest(); | 2173 var arg_request = buildInstancesImportRequest(); |
2158 var arg_project = "foo"; | 2174 var arg_project = "foo"; |
2159 var arg_instance = "foo"; | 2175 var arg_instance = "foo"; |
2160 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2176 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2161 var obj = new api.InstancesImportRequest.fromJson(json); | 2177 var obj = new api.InstancesImportRequest.fromJson(json); |
2162 checkInstancesImportRequest(obj); | 2178 checkInstancesImportRequest(obj); |
2163 | 2179 |
2164 var path = (req.url).path; | 2180 var path = (req.url).path; |
2165 var pathOffset = 0; | 2181 var pathOffset = 0; |
2166 var index; | 2182 var index; |
2167 var subPart; | 2183 var subPart; |
2168 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2184 unittest.expect( |
| 2185 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2169 pathOffset += 1; | 2186 pathOffset += 1; |
2170 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2187 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2188 unittest.equals("sql/v1beta3/")); |
2171 pathOffset += 12; | 2189 pathOffset += 12; |
2172 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2190 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2191 unittest.equals("projects/")); |
2173 pathOffset += 9; | 2192 pathOffset += 9; |
2174 index = path.indexOf("/instances/", pathOffset); | 2193 index = path.indexOf("/instances/", pathOffset); |
2175 unittest.expect(index >= 0, unittest.isTrue); | 2194 unittest.expect(index >= 0, unittest.isTrue); |
2176 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2195 subPart = |
| 2196 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2177 pathOffset = index; | 2197 pathOffset = index; |
2178 unittest.expect(subPart, unittest.equals("$arg_project")); | 2198 unittest.expect(subPart, unittest.equals("$arg_project")); |
2179 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2199 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2200 unittest.equals("/instances/")); |
2180 pathOffset += 11; | 2201 pathOffset += 11; |
2181 index = path.indexOf("/import", pathOffset); | 2202 index = path.indexOf("/import", pathOffset); |
2182 unittest.expect(index >= 0, unittest.isTrue); | 2203 unittest.expect(index >= 0, unittest.isTrue); |
2183 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2204 subPart = |
| 2205 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2184 pathOffset = index; | 2206 pathOffset = index; |
2185 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2207 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2186 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/import")); | 2208 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2209 unittest.equals("/import")); |
2187 pathOffset += 7; | 2210 pathOffset += 7; |
2188 | 2211 |
2189 var query = (req.url).query; | 2212 var query = (req.url).query; |
2190 var queryOffset = 0; | 2213 var queryOffset = 0; |
2191 var queryMap = {}; | 2214 var queryMap = {}; |
2192 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2215 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2193 parseBool(n) { | 2216 parseBool(n) { |
2194 if (n == "true") return true; | 2217 if (n == "true") return true; |
2195 if (n == "false") return false; | 2218 if (n == "false") return false; |
2196 if (n == null) return null; | 2219 if (n == null) return null; |
2197 throw new core.ArgumentError("Invalid boolean: $n"); | 2220 throw new core.ArgumentError("Invalid boolean: $n"); |
2198 } | 2221 } |
| 2222 |
2199 if (query.length > 0) { | 2223 if (query.length > 0) { |
2200 for (var part in query.split("&")) { | 2224 for (var part in query.split("&")) { |
2201 var keyvalue = part.split("="); | 2225 var keyvalue = part.split("="); |
2202 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2226 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2227 core.Uri.decodeQueryComponent(keyvalue[1])); |
2203 } | 2228 } |
2204 } | 2229 } |
2205 | 2230 |
2206 | |
2207 var h = { | 2231 var h = { |
2208 "content-type" : "application/json; charset=utf-8", | 2232 "content-type": "application/json; charset=utf-8", |
2209 }; | 2233 }; |
2210 var resp = convert.JSON.encode(buildInstancesImportResponse()); | 2234 var resp = convert.JSON.encode(buildInstancesImportResponse()); |
2211 return new async.Future.value(stringResponse(200, h, resp)); | 2235 return new async.Future.value(stringResponse(200, h, resp)); |
2212 }), true); | 2236 }), true); |
2213 res.import(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.InstancesImportResponse response) { | 2237 res |
| 2238 .import(arg_request, arg_project, arg_instance) |
| 2239 .then(unittest.expectAsync1(((api.InstancesImportResponse response) { |
2214 checkInstancesImportResponse(response); | 2240 checkInstancesImportResponse(response); |
2215 }))); | 2241 }))); |
2216 }); | 2242 }); |
2217 | 2243 |
2218 unittest.test("method--insert", () { | 2244 unittest.test("method--insert", () { |
2219 | |
2220 var mock = new HttpServerMock(); | 2245 var mock = new HttpServerMock(); |
2221 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2246 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2222 var arg_request = buildDatabaseInstance(); | 2247 var arg_request = buildDatabaseInstance(); |
2223 var arg_project = "foo"; | 2248 var arg_project = "foo"; |
2224 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2249 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2225 var obj = new api.DatabaseInstance.fromJson(json); | 2250 var obj = new api.DatabaseInstance.fromJson(json); |
2226 checkDatabaseInstance(obj); | 2251 checkDatabaseInstance(obj); |
2227 | 2252 |
2228 var path = (req.url).path; | 2253 var path = (req.url).path; |
2229 var pathOffset = 0; | 2254 var pathOffset = 0; |
2230 var index; | 2255 var index; |
2231 var subPart; | 2256 var subPart; |
2232 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2257 unittest.expect( |
| 2258 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2233 pathOffset += 1; | 2259 pathOffset += 1; |
2234 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2260 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2261 unittest.equals("sql/v1beta3/")); |
2235 pathOffset += 12; | 2262 pathOffset += 12; |
2236 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2263 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2264 unittest.equals("projects/")); |
2237 pathOffset += 9; | 2265 pathOffset += 9; |
2238 index = path.indexOf("/instances", pathOffset); | 2266 index = path.indexOf("/instances", pathOffset); |
2239 unittest.expect(index >= 0, unittest.isTrue); | 2267 unittest.expect(index >= 0, unittest.isTrue); |
2240 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2268 subPart = |
| 2269 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2241 pathOffset = index; | 2270 pathOffset = index; |
2242 unittest.expect(subPart, unittest.equals("$arg_project")); | 2271 unittest.expect(subPart, unittest.equals("$arg_project")); |
2243 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/instances")); | 2272 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2273 unittest.equals("/instances")); |
2244 pathOffset += 10; | 2274 pathOffset += 10; |
2245 | 2275 |
2246 var query = (req.url).query; | 2276 var query = (req.url).query; |
2247 var queryOffset = 0; | 2277 var queryOffset = 0; |
2248 var queryMap = {}; | 2278 var queryMap = {}; |
2249 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2279 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2250 parseBool(n) { | 2280 parseBool(n) { |
2251 if (n == "true") return true; | 2281 if (n == "true") return true; |
2252 if (n == "false") return false; | 2282 if (n == "false") return false; |
2253 if (n == null) return null; | 2283 if (n == null) return null; |
2254 throw new core.ArgumentError("Invalid boolean: $n"); | 2284 throw new core.ArgumentError("Invalid boolean: $n"); |
2255 } | 2285 } |
| 2286 |
2256 if (query.length > 0) { | 2287 if (query.length > 0) { |
2257 for (var part in query.split("&")) { | 2288 for (var part in query.split("&")) { |
2258 var keyvalue = part.split("="); | 2289 var keyvalue = part.split("="); |
2259 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2290 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2291 core.Uri.decodeQueryComponent(keyvalue[1])); |
2260 } | 2292 } |
2261 } | 2293 } |
2262 | 2294 |
2263 | |
2264 var h = { | 2295 var h = { |
2265 "content-type" : "application/json; charset=utf-8", | 2296 "content-type": "application/json; charset=utf-8", |
2266 }; | 2297 }; |
2267 var resp = convert.JSON.encode(buildInstancesInsertResponse()); | 2298 var resp = convert.JSON.encode(buildInstancesInsertResponse()); |
2268 return new async.Future.value(stringResponse(200, h, resp)); | 2299 return new async.Future.value(stringResponse(200, h, resp)); |
2269 }), true); | 2300 }), true); |
2270 res.insert(arg_request, arg_project).then(unittest.expectAsync1(((api.Inst
ancesInsertResponse response) { | 2301 res |
| 2302 .insert(arg_request, arg_project) |
| 2303 .then(unittest.expectAsync1(((api.InstancesInsertResponse response) { |
2271 checkInstancesInsertResponse(response); | 2304 checkInstancesInsertResponse(response); |
2272 }))); | 2305 }))); |
2273 }); | 2306 }); |
2274 | 2307 |
2275 unittest.test("method--list", () { | 2308 unittest.test("method--list", () { |
2276 | |
2277 var mock = new HttpServerMock(); | 2309 var mock = new HttpServerMock(); |
2278 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2310 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2279 var arg_project = "foo"; | 2311 var arg_project = "foo"; |
2280 var arg_maxResults = 42; | 2312 var arg_maxResults = 42; |
2281 var arg_pageToken = "foo"; | 2313 var arg_pageToken = "foo"; |
2282 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2314 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2283 var path = (req.url).path; | 2315 var path = (req.url).path; |
2284 var pathOffset = 0; | 2316 var pathOffset = 0; |
2285 var index; | 2317 var index; |
2286 var subPart; | 2318 var subPart; |
2287 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2319 unittest.expect( |
| 2320 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2288 pathOffset += 1; | 2321 pathOffset += 1; |
2289 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2322 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2323 unittest.equals("sql/v1beta3/")); |
2290 pathOffset += 12; | 2324 pathOffset += 12; |
2291 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2325 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2326 unittest.equals("projects/")); |
2292 pathOffset += 9; | 2327 pathOffset += 9; |
2293 index = path.indexOf("/instances", pathOffset); | 2328 index = path.indexOf("/instances", pathOffset); |
2294 unittest.expect(index >= 0, unittest.isTrue); | 2329 unittest.expect(index >= 0, unittest.isTrue); |
2295 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2330 subPart = |
| 2331 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2296 pathOffset = index; | 2332 pathOffset = index; |
2297 unittest.expect(subPart, unittest.equals("$arg_project")); | 2333 unittest.expect(subPart, unittest.equals("$arg_project")); |
2298 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/instances")); | 2334 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 2335 unittest.equals("/instances")); |
2299 pathOffset += 10; | 2336 pathOffset += 10; |
2300 | 2337 |
2301 var query = (req.url).query; | 2338 var query = (req.url).query; |
2302 var queryOffset = 0; | 2339 var queryOffset = 0; |
2303 var queryMap = {}; | 2340 var queryMap = {}; |
2304 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2341 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2305 parseBool(n) { | 2342 parseBool(n) { |
2306 if (n == "true") return true; | 2343 if (n == "true") return true; |
2307 if (n == "false") return false; | 2344 if (n == "false") return false; |
2308 if (n == null) return null; | 2345 if (n == null) return null; |
2309 throw new core.ArgumentError("Invalid boolean: $n"); | 2346 throw new core.ArgumentError("Invalid boolean: $n"); |
2310 } | 2347 } |
| 2348 |
2311 if (query.length > 0) { | 2349 if (query.length > 0) { |
2312 for (var part in query.split("&")) { | 2350 for (var part in query.split("&")) { |
2313 var keyvalue = part.split("="); | 2351 var keyvalue = part.split("="); |
2314 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2352 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2353 core.Uri.decodeQueryComponent(keyvalue[1])); |
2315 } | 2354 } |
2316 } | 2355 } |
2317 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 2356 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
2318 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2357 unittest.equals(arg_maxResults)); |
2319 | 2358 unittest.expect( |
| 2359 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
2320 | 2360 |
2321 var h = { | 2361 var h = { |
2322 "content-type" : "application/json; charset=utf-8", | 2362 "content-type": "application/json; charset=utf-8", |
2323 }; | 2363 }; |
2324 var resp = convert.JSON.encode(buildInstancesListResponse()); | 2364 var resp = convert.JSON.encode(buildInstancesListResponse()); |
2325 return new async.Future.value(stringResponse(200, h, resp)); | 2365 return new async.Future.value(stringResponse(200, h, resp)); |
2326 }), true); | 2366 }), true); |
2327 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync1(((api.InstancesListResponse response) { | 2367 res |
| 2368 .list(arg_project, |
| 2369 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 2370 .then(unittest.expectAsync1(((api.InstancesListResponse response) { |
2328 checkInstancesListResponse(response); | 2371 checkInstancesListResponse(response); |
2329 }))); | 2372 }))); |
2330 }); | 2373 }); |
2331 | 2374 |
2332 unittest.test("method--patch", () { | 2375 unittest.test("method--patch", () { |
2333 | |
2334 var mock = new HttpServerMock(); | 2376 var mock = new HttpServerMock(); |
2335 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2377 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2336 var arg_request = buildDatabaseInstance(); | 2378 var arg_request = buildDatabaseInstance(); |
2337 var arg_project = "foo"; | 2379 var arg_project = "foo"; |
2338 var arg_instance = "foo"; | 2380 var arg_instance = "foo"; |
2339 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2381 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2340 var obj = new api.DatabaseInstance.fromJson(json); | 2382 var obj = new api.DatabaseInstance.fromJson(json); |
2341 checkDatabaseInstance(obj); | 2383 checkDatabaseInstance(obj); |
2342 | 2384 |
2343 var path = (req.url).path; | 2385 var path = (req.url).path; |
2344 var pathOffset = 0; | 2386 var pathOffset = 0; |
2345 var index; | 2387 var index; |
2346 var subPart; | 2388 var subPart; |
2347 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2389 unittest.expect( |
| 2390 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2348 pathOffset += 1; | 2391 pathOffset += 1; |
2349 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2392 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2393 unittest.equals("sql/v1beta3/")); |
2350 pathOffset += 12; | 2394 pathOffset += 12; |
2351 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2395 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2396 unittest.equals("projects/")); |
2352 pathOffset += 9; | 2397 pathOffset += 9; |
2353 index = path.indexOf("/instances/", pathOffset); | 2398 index = path.indexOf("/instances/", pathOffset); |
2354 unittest.expect(index >= 0, unittest.isTrue); | 2399 unittest.expect(index >= 0, unittest.isTrue); |
2355 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2400 subPart = |
| 2401 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2356 pathOffset = index; | 2402 pathOffset = index; |
2357 unittest.expect(subPart, unittest.equals("$arg_project")); | 2403 unittest.expect(subPart, unittest.equals("$arg_project")); |
2358 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2404 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2405 unittest.equals("/instances/")); |
2359 pathOffset += 11; | 2406 pathOffset += 11; |
2360 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2407 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
2361 pathOffset = path.length; | 2408 pathOffset = path.length; |
2362 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2409 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2363 | 2410 |
2364 var query = (req.url).query; | 2411 var query = (req.url).query; |
2365 var queryOffset = 0; | 2412 var queryOffset = 0; |
2366 var queryMap = {}; | 2413 var queryMap = {}; |
2367 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2414 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2368 parseBool(n) { | 2415 parseBool(n) { |
2369 if (n == "true") return true; | 2416 if (n == "true") return true; |
2370 if (n == "false") return false; | 2417 if (n == "false") return false; |
2371 if (n == null) return null; | 2418 if (n == null) return null; |
2372 throw new core.ArgumentError("Invalid boolean: $n"); | 2419 throw new core.ArgumentError("Invalid boolean: $n"); |
2373 } | 2420 } |
| 2421 |
2374 if (query.length > 0) { | 2422 if (query.length > 0) { |
2375 for (var part in query.split("&")) { | 2423 for (var part in query.split("&")) { |
2376 var keyvalue = part.split("="); | 2424 var keyvalue = part.split("="); |
2377 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2425 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2426 core.Uri.decodeQueryComponent(keyvalue[1])); |
2378 } | 2427 } |
2379 } | 2428 } |
2380 | 2429 |
2381 | |
2382 var h = { | 2430 var h = { |
2383 "content-type" : "application/json; charset=utf-8", | 2431 "content-type": "application/json; charset=utf-8", |
2384 }; | 2432 }; |
2385 var resp = convert.JSON.encode(buildInstancesUpdateResponse()); | 2433 var resp = convert.JSON.encode(buildInstancesUpdateResponse()); |
2386 return new async.Future.value(stringResponse(200, h, resp)); | 2434 return new async.Future.value(stringResponse(200, h, resp)); |
2387 }), true); | 2435 }), true); |
2388 res.patch(arg_request, arg_project, arg_instance).then(unittest.expectAsyn
c1(((api.InstancesUpdateResponse response) { | 2436 res |
| 2437 .patch(arg_request, arg_project, arg_instance) |
| 2438 .then(unittest.expectAsync1(((api.InstancesUpdateResponse response) { |
2389 checkInstancesUpdateResponse(response); | 2439 checkInstancesUpdateResponse(response); |
2390 }))); | 2440 }))); |
2391 }); | 2441 }); |
2392 | 2442 |
2393 unittest.test("method--promoteReplica", () { | 2443 unittest.test("method--promoteReplica", () { |
2394 | |
2395 var mock = new HttpServerMock(); | 2444 var mock = new HttpServerMock(); |
2396 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2445 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2397 var arg_project = "foo"; | 2446 var arg_project = "foo"; |
2398 var arg_instance = "foo"; | 2447 var arg_instance = "foo"; |
2399 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2448 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2400 var path = (req.url).path; | 2449 var path = (req.url).path; |
2401 var pathOffset = 0; | 2450 var pathOffset = 0; |
2402 var index; | 2451 var index; |
2403 var subPart; | 2452 var subPart; |
2404 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2453 unittest.expect( |
| 2454 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2405 pathOffset += 1; | 2455 pathOffset += 1; |
2406 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2456 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2457 unittest.equals("sql/v1beta3/")); |
2407 pathOffset += 12; | 2458 pathOffset += 12; |
2408 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2459 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2460 unittest.equals("projects/")); |
2409 pathOffset += 9; | 2461 pathOffset += 9; |
2410 index = path.indexOf("/instances/", pathOffset); | 2462 index = path.indexOf("/instances/", pathOffset); |
2411 unittest.expect(index >= 0, unittest.isTrue); | 2463 unittest.expect(index >= 0, unittest.isTrue); |
2412 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2464 subPart = |
| 2465 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2413 pathOffset = index; | 2466 pathOffset = index; |
2414 unittest.expect(subPart, unittest.equals("$arg_project")); | 2467 unittest.expect(subPart, unittest.equals("$arg_project")); |
2415 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2468 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2469 unittest.equals("/instances/")); |
2416 pathOffset += 11; | 2470 pathOffset += 11; |
2417 index = path.indexOf("/promoteReplica", pathOffset); | 2471 index = path.indexOf("/promoteReplica", pathOffset); |
2418 unittest.expect(index >= 0, unittest.isTrue); | 2472 unittest.expect(index >= 0, unittest.isTrue); |
2419 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2473 subPart = |
| 2474 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2420 pathOffset = index; | 2475 pathOffset = index; |
2421 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2476 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2422 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/promoteReplica")); | 2477 unittest.expect(path.substring(pathOffset, pathOffset + 15), |
| 2478 unittest.equals("/promoteReplica")); |
2423 pathOffset += 15; | 2479 pathOffset += 15; |
2424 | 2480 |
2425 var query = (req.url).query; | 2481 var query = (req.url).query; |
2426 var queryOffset = 0; | 2482 var queryOffset = 0; |
2427 var queryMap = {}; | 2483 var queryMap = {}; |
2428 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2484 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2429 parseBool(n) { | 2485 parseBool(n) { |
2430 if (n == "true") return true; | 2486 if (n == "true") return true; |
2431 if (n == "false") return false; | 2487 if (n == "false") return false; |
2432 if (n == null) return null; | 2488 if (n == null) return null; |
2433 throw new core.ArgumentError("Invalid boolean: $n"); | 2489 throw new core.ArgumentError("Invalid boolean: $n"); |
2434 } | 2490 } |
| 2491 |
2435 if (query.length > 0) { | 2492 if (query.length > 0) { |
2436 for (var part in query.split("&")) { | 2493 for (var part in query.split("&")) { |
2437 var keyvalue = part.split("="); | 2494 var keyvalue = part.split("="); |
2438 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2495 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2496 core.Uri.decodeQueryComponent(keyvalue[1])); |
2439 } | 2497 } |
2440 } | 2498 } |
2441 | 2499 |
2442 | |
2443 var h = { | 2500 var h = { |
2444 "content-type" : "application/json; charset=utf-8", | 2501 "content-type": "application/json; charset=utf-8", |
2445 }; | 2502 }; |
2446 var resp = convert.JSON.encode(buildInstancesPromoteReplicaResponse()); | 2503 var resp = convert.JSON.encode(buildInstancesPromoteReplicaResponse()); |
2447 return new async.Future.value(stringResponse(200, h, resp)); | 2504 return new async.Future.value(stringResponse(200, h, resp)); |
2448 }), true); | 2505 }), true); |
2449 res.promoteReplica(arg_project, arg_instance).then(unittest.expectAsync1((
(api.InstancesPromoteReplicaResponse response) { | 2506 res.promoteReplica(arg_project, arg_instance).then(unittest |
| 2507 .expectAsync1(((api.InstancesPromoteReplicaResponse response) { |
2450 checkInstancesPromoteReplicaResponse(response); | 2508 checkInstancesPromoteReplicaResponse(response); |
2451 }))); | 2509 }))); |
2452 }); | 2510 }); |
2453 | 2511 |
2454 unittest.test("method--resetSslConfig", () { | 2512 unittest.test("method--resetSslConfig", () { |
2455 | |
2456 var mock = new HttpServerMock(); | 2513 var mock = new HttpServerMock(); |
2457 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2514 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2458 var arg_project = "foo"; | 2515 var arg_project = "foo"; |
2459 var arg_instance = "foo"; | 2516 var arg_instance = "foo"; |
2460 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2517 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2461 var path = (req.url).path; | 2518 var path = (req.url).path; |
2462 var pathOffset = 0; | 2519 var pathOffset = 0; |
2463 var index; | 2520 var index; |
2464 var subPart; | 2521 var subPart; |
2465 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2522 unittest.expect( |
| 2523 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2466 pathOffset += 1; | 2524 pathOffset += 1; |
2467 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2525 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2526 unittest.equals("sql/v1beta3/")); |
2468 pathOffset += 12; | 2527 pathOffset += 12; |
2469 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2528 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2529 unittest.equals("projects/")); |
2470 pathOffset += 9; | 2530 pathOffset += 9; |
2471 index = path.indexOf("/instances/", pathOffset); | 2531 index = path.indexOf("/instances/", pathOffset); |
2472 unittest.expect(index >= 0, unittest.isTrue); | 2532 unittest.expect(index >= 0, unittest.isTrue); |
2473 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2533 subPart = |
| 2534 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2474 pathOffset = index; | 2535 pathOffset = index; |
2475 unittest.expect(subPart, unittest.equals("$arg_project")); | 2536 unittest.expect(subPart, unittest.equals("$arg_project")); |
2476 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2537 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2538 unittest.equals("/instances/")); |
2477 pathOffset += 11; | 2539 pathOffset += 11; |
2478 index = path.indexOf("/resetSslConfig", pathOffset); | 2540 index = path.indexOf("/resetSslConfig", pathOffset); |
2479 unittest.expect(index >= 0, unittest.isTrue); | 2541 unittest.expect(index >= 0, unittest.isTrue); |
2480 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2542 subPart = |
| 2543 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2481 pathOffset = index; | 2544 pathOffset = index; |
2482 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2545 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2483 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/resetSslConfig")); | 2546 unittest.expect(path.substring(pathOffset, pathOffset + 15), |
| 2547 unittest.equals("/resetSslConfig")); |
2484 pathOffset += 15; | 2548 pathOffset += 15; |
2485 | 2549 |
2486 var query = (req.url).query; | 2550 var query = (req.url).query; |
2487 var queryOffset = 0; | 2551 var queryOffset = 0; |
2488 var queryMap = {}; | 2552 var queryMap = {}; |
2489 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2553 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2490 parseBool(n) { | 2554 parseBool(n) { |
2491 if (n == "true") return true; | 2555 if (n == "true") return true; |
2492 if (n == "false") return false; | 2556 if (n == "false") return false; |
2493 if (n == null) return null; | 2557 if (n == null) return null; |
2494 throw new core.ArgumentError("Invalid boolean: $n"); | 2558 throw new core.ArgumentError("Invalid boolean: $n"); |
2495 } | 2559 } |
| 2560 |
2496 if (query.length > 0) { | 2561 if (query.length > 0) { |
2497 for (var part in query.split("&")) { | 2562 for (var part in query.split("&")) { |
2498 var keyvalue = part.split("="); | 2563 var keyvalue = part.split("="); |
2499 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2564 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2565 core.Uri.decodeQueryComponent(keyvalue[1])); |
2500 } | 2566 } |
2501 } | 2567 } |
2502 | 2568 |
2503 | |
2504 var h = { | 2569 var h = { |
2505 "content-type" : "application/json; charset=utf-8", | 2570 "content-type": "application/json; charset=utf-8", |
2506 }; | 2571 }; |
2507 var resp = convert.JSON.encode(buildInstancesResetSslConfigResponse()); | 2572 var resp = convert.JSON.encode(buildInstancesResetSslConfigResponse()); |
2508 return new async.Future.value(stringResponse(200, h, resp)); | 2573 return new async.Future.value(stringResponse(200, h, resp)); |
2509 }), true); | 2574 }), true); |
2510 res.resetSslConfig(arg_project, arg_instance).then(unittest.expectAsync1((
(api.InstancesResetSslConfigResponse response) { | 2575 res.resetSslConfig(arg_project, arg_instance).then(unittest |
| 2576 .expectAsync1(((api.InstancesResetSslConfigResponse response) { |
2511 checkInstancesResetSslConfigResponse(response); | 2577 checkInstancesResetSslConfigResponse(response); |
2512 }))); | 2578 }))); |
2513 }); | 2579 }); |
2514 | 2580 |
2515 unittest.test("method--restart", () { | 2581 unittest.test("method--restart", () { |
2516 | |
2517 var mock = new HttpServerMock(); | 2582 var mock = new HttpServerMock(); |
2518 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2583 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2519 var arg_project = "foo"; | 2584 var arg_project = "foo"; |
2520 var arg_instance = "foo"; | 2585 var arg_instance = "foo"; |
2521 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2586 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2522 var path = (req.url).path; | 2587 var path = (req.url).path; |
2523 var pathOffset = 0; | 2588 var pathOffset = 0; |
2524 var index; | 2589 var index; |
2525 var subPart; | 2590 var subPart; |
2526 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2591 unittest.expect( |
| 2592 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2527 pathOffset += 1; | 2593 pathOffset += 1; |
2528 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2594 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2595 unittest.equals("sql/v1beta3/")); |
2529 pathOffset += 12; | 2596 pathOffset += 12; |
2530 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2597 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2598 unittest.equals("projects/")); |
2531 pathOffset += 9; | 2599 pathOffset += 9; |
2532 index = path.indexOf("/instances/", pathOffset); | 2600 index = path.indexOf("/instances/", pathOffset); |
2533 unittest.expect(index >= 0, unittest.isTrue); | 2601 unittest.expect(index >= 0, unittest.isTrue); |
2534 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2602 subPart = |
| 2603 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2535 pathOffset = index; | 2604 pathOffset = index; |
2536 unittest.expect(subPart, unittest.equals("$arg_project")); | 2605 unittest.expect(subPart, unittest.equals("$arg_project")); |
2537 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2606 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2607 unittest.equals("/instances/")); |
2538 pathOffset += 11; | 2608 pathOffset += 11; |
2539 index = path.indexOf("/restart", pathOffset); | 2609 index = path.indexOf("/restart", pathOffset); |
2540 unittest.expect(index >= 0, unittest.isTrue); | 2610 unittest.expect(index >= 0, unittest.isTrue); |
2541 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2611 subPart = |
| 2612 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2542 pathOffset = index; | 2613 pathOffset = index; |
2543 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2614 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2544 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/restart")); | 2615 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 2616 unittest.equals("/restart")); |
2545 pathOffset += 8; | 2617 pathOffset += 8; |
2546 | 2618 |
2547 var query = (req.url).query; | 2619 var query = (req.url).query; |
2548 var queryOffset = 0; | 2620 var queryOffset = 0; |
2549 var queryMap = {}; | 2621 var queryMap = {}; |
2550 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2622 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2551 parseBool(n) { | 2623 parseBool(n) { |
2552 if (n == "true") return true; | 2624 if (n == "true") return true; |
2553 if (n == "false") return false; | 2625 if (n == "false") return false; |
2554 if (n == null) return null; | 2626 if (n == null) return null; |
2555 throw new core.ArgumentError("Invalid boolean: $n"); | 2627 throw new core.ArgumentError("Invalid boolean: $n"); |
2556 } | 2628 } |
| 2629 |
2557 if (query.length > 0) { | 2630 if (query.length > 0) { |
2558 for (var part in query.split("&")) { | 2631 for (var part in query.split("&")) { |
2559 var keyvalue = part.split("="); | 2632 var keyvalue = part.split("="); |
2560 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2633 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2634 core.Uri.decodeQueryComponent(keyvalue[1])); |
2561 } | 2635 } |
2562 } | 2636 } |
2563 | 2637 |
2564 | |
2565 var h = { | 2638 var h = { |
2566 "content-type" : "application/json; charset=utf-8", | 2639 "content-type": "application/json; charset=utf-8", |
2567 }; | 2640 }; |
2568 var resp = convert.JSON.encode(buildInstancesRestartResponse()); | 2641 var resp = convert.JSON.encode(buildInstancesRestartResponse()); |
2569 return new async.Future.value(stringResponse(200, h, resp)); | 2642 return new async.Future.value(stringResponse(200, h, resp)); |
2570 }), true); | 2643 }), true); |
2571 res.restart(arg_project, arg_instance).then(unittest.expectAsync1(((api.In
stancesRestartResponse response) { | 2644 res |
| 2645 .restart(arg_project, arg_instance) |
| 2646 .then(unittest.expectAsync1(((api.InstancesRestartResponse response) { |
2572 checkInstancesRestartResponse(response); | 2647 checkInstancesRestartResponse(response); |
2573 }))); | 2648 }))); |
2574 }); | 2649 }); |
2575 | 2650 |
2576 unittest.test("method--restoreBackup", () { | 2651 unittest.test("method--restoreBackup", () { |
2577 | |
2578 var mock = new HttpServerMock(); | 2652 var mock = new HttpServerMock(); |
2579 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2653 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2580 var arg_project = "foo"; | 2654 var arg_project = "foo"; |
2581 var arg_instance = "foo"; | 2655 var arg_instance = "foo"; |
2582 var arg_backupConfiguration = "foo"; | 2656 var arg_backupConfiguration = "foo"; |
2583 var arg_dueTime = "foo"; | 2657 var arg_dueTime = "foo"; |
2584 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2658 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2585 var path = (req.url).path; | 2659 var path = (req.url).path; |
2586 var pathOffset = 0; | 2660 var pathOffset = 0; |
2587 var index; | 2661 var index; |
2588 var subPart; | 2662 var subPart; |
2589 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2663 unittest.expect( |
| 2664 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2590 pathOffset += 1; | 2665 pathOffset += 1; |
2591 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2666 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2667 unittest.equals("sql/v1beta3/")); |
2592 pathOffset += 12; | 2668 pathOffset += 12; |
2593 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2669 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2670 unittest.equals("projects/")); |
2594 pathOffset += 9; | 2671 pathOffset += 9; |
2595 index = path.indexOf("/instances/", pathOffset); | 2672 index = path.indexOf("/instances/", pathOffset); |
2596 unittest.expect(index >= 0, unittest.isTrue); | 2673 unittest.expect(index >= 0, unittest.isTrue); |
2597 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2674 subPart = |
| 2675 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2598 pathOffset = index; | 2676 pathOffset = index; |
2599 unittest.expect(subPart, unittest.equals("$arg_project")); | 2677 unittest.expect(subPart, unittest.equals("$arg_project")); |
2600 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2678 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2679 unittest.equals("/instances/")); |
2601 pathOffset += 11; | 2680 pathOffset += 11; |
2602 index = path.indexOf("/restoreBackup", pathOffset); | 2681 index = path.indexOf("/restoreBackup", pathOffset); |
2603 unittest.expect(index >= 0, unittest.isTrue); | 2682 unittest.expect(index >= 0, unittest.isTrue); |
2604 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2683 subPart = |
| 2684 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2605 pathOffset = index; | 2685 pathOffset = index; |
2606 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2686 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2607 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/restoreBackup")); | 2687 unittest.expect(path.substring(pathOffset, pathOffset + 14), |
| 2688 unittest.equals("/restoreBackup")); |
2608 pathOffset += 14; | 2689 pathOffset += 14; |
2609 | 2690 |
2610 var query = (req.url).query; | 2691 var query = (req.url).query; |
2611 var queryOffset = 0; | 2692 var queryOffset = 0; |
2612 var queryMap = {}; | 2693 var queryMap = {}; |
2613 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2694 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2614 parseBool(n) { | 2695 parseBool(n) { |
2615 if (n == "true") return true; | 2696 if (n == "true") return true; |
2616 if (n == "false") return false; | 2697 if (n == "false") return false; |
2617 if (n == null) return null; | 2698 if (n == null) return null; |
2618 throw new core.ArgumentError("Invalid boolean: $n"); | 2699 throw new core.ArgumentError("Invalid boolean: $n"); |
2619 } | 2700 } |
| 2701 |
2620 if (query.length > 0) { | 2702 if (query.length > 0) { |
2621 for (var part in query.split("&")) { | 2703 for (var part in query.split("&")) { |
2622 var keyvalue = part.split("="); | 2704 var keyvalue = part.split("="); |
2623 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2705 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2706 core.Uri.decodeQueryComponent(keyvalue[1])); |
2624 } | 2707 } |
2625 } | 2708 } |
2626 unittest.expect(queryMap["backupConfiguration"].first, unittest.equals(a
rg_backupConfiguration)); | 2709 unittest.expect(queryMap["backupConfiguration"].first, |
2627 unittest.expect(queryMap["dueTime"].first, unittest.equals(arg_dueTime))
; | 2710 unittest.equals(arg_backupConfiguration)); |
2628 | 2711 unittest.expect( |
| 2712 queryMap["dueTime"].first, unittest.equals(arg_dueTime)); |
2629 | 2713 |
2630 var h = { | 2714 var h = { |
2631 "content-type" : "application/json; charset=utf-8", | 2715 "content-type": "application/json; charset=utf-8", |
2632 }; | 2716 }; |
2633 var resp = convert.JSON.encode(buildInstancesRestoreBackupResponse()); | 2717 var resp = convert.JSON.encode(buildInstancesRestoreBackupResponse()); |
2634 return new async.Future.value(stringResponse(200, h, resp)); | 2718 return new async.Future.value(stringResponse(200, h, resp)); |
2635 }), true); | 2719 }), true); |
2636 res.restoreBackup(arg_project, arg_instance, arg_backupConfiguration, arg_
dueTime).then(unittest.expectAsync1(((api.InstancesRestoreBackupResponse respons
e) { | 2720 res |
| 2721 .restoreBackup( |
| 2722 arg_project, arg_instance, arg_backupConfiguration, arg_dueTime) |
| 2723 .then(unittest |
| 2724 .expectAsync1(((api.InstancesRestoreBackupResponse response) { |
2637 checkInstancesRestoreBackupResponse(response); | 2725 checkInstancesRestoreBackupResponse(response); |
2638 }))); | 2726 }))); |
2639 }); | 2727 }); |
2640 | 2728 |
2641 unittest.test("method--setRootPassword", () { | 2729 unittest.test("method--setRootPassword", () { |
2642 | |
2643 var mock = new HttpServerMock(); | 2730 var mock = new HttpServerMock(); |
2644 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2731 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2645 var arg_request = buildInstanceSetRootPasswordRequest(); | 2732 var arg_request = buildInstanceSetRootPasswordRequest(); |
2646 var arg_project = "foo"; | 2733 var arg_project = "foo"; |
2647 var arg_instance = "foo"; | 2734 var arg_instance = "foo"; |
2648 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2735 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2649 var obj = new api.InstanceSetRootPasswordRequest.fromJson(json); | 2736 var obj = new api.InstanceSetRootPasswordRequest.fromJson(json); |
2650 checkInstanceSetRootPasswordRequest(obj); | 2737 checkInstanceSetRootPasswordRequest(obj); |
2651 | 2738 |
2652 var path = (req.url).path; | 2739 var path = (req.url).path; |
2653 var pathOffset = 0; | 2740 var pathOffset = 0; |
2654 var index; | 2741 var index; |
2655 var subPart; | 2742 var subPart; |
2656 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2743 unittest.expect( |
| 2744 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2657 pathOffset += 1; | 2745 pathOffset += 1; |
2658 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2746 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2747 unittest.equals("sql/v1beta3/")); |
2659 pathOffset += 12; | 2748 pathOffset += 12; |
2660 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2749 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2750 unittest.equals("projects/")); |
2661 pathOffset += 9; | 2751 pathOffset += 9; |
2662 index = path.indexOf("/instances/", pathOffset); | 2752 index = path.indexOf("/instances/", pathOffset); |
2663 unittest.expect(index >= 0, unittest.isTrue); | 2753 unittest.expect(index >= 0, unittest.isTrue); |
2664 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2754 subPart = |
| 2755 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2665 pathOffset = index; | 2756 pathOffset = index; |
2666 unittest.expect(subPart, unittest.equals("$arg_project")); | 2757 unittest.expect(subPart, unittest.equals("$arg_project")); |
2667 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2758 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2759 unittest.equals("/instances/")); |
2668 pathOffset += 11; | 2760 pathOffset += 11; |
2669 index = path.indexOf("/setRootPassword", pathOffset); | 2761 index = path.indexOf("/setRootPassword", pathOffset); |
2670 unittest.expect(index >= 0, unittest.isTrue); | 2762 unittest.expect(index >= 0, unittest.isTrue); |
2671 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2763 subPart = |
| 2764 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2672 pathOffset = index; | 2765 pathOffset = index; |
2673 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2766 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2674 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/setRootPassword")); | 2767 unittest.expect(path.substring(pathOffset, pathOffset + 16), |
| 2768 unittest.equals("/setRootPassword")); |
2675 pathOffset += 16; | 2769 pathOffset += 16; |
2676 | 2770 |
2677 var query = (req.url).query; | 2771 var query = (req.url).query; |
2678 var queryOffset = 0; | 2772 var queryOffset = 0; |
2679 var queryMap = {}; | 2773 var queryMap = {}; |
2680 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2774 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2681 parseBool(n) { | 2775 parseBool(n) { |
2682 if (n == "true") return true; | 2776 if (n == "true") return true; |
2683 if (n == "false") return false; | 2777 if (n == "false") return false; |
2684 if (n == null) return null; | 2778 if (n == null) return null; |
2685 throw new core.ArgumentError("Invalid boolean: $n"); | 2779 throw new core.ArgumentError("Invalid boolean: $n"); |
2686 } | 2780 } |
| 2781 |
2687 if (query.length > 0) { | 2782 if (query.length > 0) { |
2688 for (var part in query.split("&")) { | 2783 for (var part in query.split("&")) { |
2689 var keyvalue = part.split("="); | 2784 var keyvalue = part.split("="); |
2690 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2785 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2786 core.Uri.decodeQueryComponent(keyvalue[1])); |
2691 } | 2787 } |
2692 } | 2788 } |
2693 | 2789 |
2694 | |
2695 var h = { | 2790 var h = { |
2696 "content-type" : "application/json; charset=utf-8", | 2791 "content-type": "application/json; charset=utf-8", |
2697 }; | 2792 }; |
2698 var resp = convert.JSON.encode(buildInstancesSetRootPasswordResponse()); | 2793 var resp = convert.JSON.encode(buildInstancesSetRootPasswordResponse()); |
2699 return new async.Future.value(stringResponse(200, h, resp)); | 2794 return new async.Future.value(stringResponse(200, h, resp)); |
2700 }), true); | 2795 }), true); |
2701 res.setRootPassword(arg_request, arg_project, arg_instance).then(unittest.
expectAsync1(((api.InstancesSetRootPasswordResponse response) { | 2796 res.setRootPassword(arg_request, arg_project, arg_instance).then(unittest |
| 2797 .expectAsync1(((api.InstancesSetRootPasswordResponse response) { |
2702 checkInstancesSetRootPasswordResponse(response); | 2798 checkInstancesSetRootPasswordResponse(response); |
2703 }))); | 2799 }))); |
2704 }); | 2800 }); |
2705 | 2801 |
2706 unittest.test("method--update", () { | 2802 unittest.test("method--update", () { |
2707 | |
2708 var mock = new HttpServerMock(); | 2803 var mock = new HttpServerMock(); |
2709 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; | 2804 api.InstancesResourceApi res = new api.SqladminApi(mock).instances; |
2710 var arg_request = buildDatabaseInstance(); | 2805 var arg_request = buildDatabaseInstance(); |
2711 var arg_project = "foo"; | 2806 var arg_project = "foo"; |
2712 var arg_instance = "foo"; | 2807 var arg_instance = "foo"; |
2713 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2808 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2714 var obj = new api.DatabaseInstance.fromJson(json); | 2809 var obj = new api.DatabaseInstance.fromJson(json); |
2715 checkDatabaseInstance(obj); | 2810 checkDatabaseInstance(obj); |
2716 | 2811 |
2717 var path = (req.url).path; | 2812 var path = (req.url).path; |
2718 var pathOffset = 0; | 2813 var pathOffset = 0; |
2719 var index; | 2814 var index; |
2720 var subPart; | 2815 var subPart; |
2721 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2816 unittest.expect( |
| 2817 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2722 pathOffset += 1; | 2818 pathOffset += 1; |
2723 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2819 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2820 unittest.equals("sql/v1beta3/")); |
2724 pathOffset += 12; | 2821 pathOffset += 12; |
2725 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2822 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2823 unittest.equals("projects/")); |
2726 pathOffset += 9; | 2824 pathOffset += 9; |
2727 index = path.indexOf("/instances/", pathOffset); | 2825 index = path.indexOf("/instances/", pathOffset); |
2728 unittest.expect(index >= 0, unittest.isTrue); | 2826 unittest.expect(index >= 0, unittest.isTrue); |
2729 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2827 subPart = |
| 2828 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2730 pathOffset = index; | 2829 pathOffset = index; |
2731 unittest.expect(subPart, unittest.equals("$arg_project")); | 2830 unittest.expect(subPart, unittest.equals("$arg_project")); |
2732 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2831 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2832 unittest.equals("/instances/")); |
2733 pathOffset += 11; | 2833 pathOffset += 11; |
2734 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2834 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
2735 pathOffset = path.length; | 2835 pathOffset = path.length; |
2736 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2836 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2737 | 2837 |
2738 var query = (req.url).query; | 2838 var query = (req.url).query; |
2739 var queryOffset = 0; | 2839 var queryOffset = 0; |
2740 var queryMap = {}; | 2840 var queryMap = {}; |
2741 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2841 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2742 parseBool(n) { | 2842 parseBool(n) { |
2743 if (n == "true") return true; | 2843 if (n == "true") return true; |
2744 if (n == "false") return false; | 2844 if (n == "false") return false; |
2745 if (n == null) return null; | 2845 if (n == null) return null; |
2746 throw new core.ArgumentError("Invalid boolean: $n"); | 2846 throw new core.ArgumentError("Invalid boolean: $n"); |
2747 } | 2847 } |
| 2848 |
2748 if (query.length > 0) { | 2849 if (query.length > 0) { |
2749 for (var part in query.split("&")) { | 2850 for (var part in query.split("&")) { |
2750 var keyvalue = part.split("="); | 2851 var keyvalue = part.split("="); |
2751 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2852 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2853 core.Uri.decodeQueryComponent(keyvalue[1])); |
2752 } | 2854 } |
2753 } | 2855 } |
2754 | 2856 |
2755 | |
2756 var h = { | 2857 var h = { |
2757 "content-type" : "application/json; charset=utf-8", | 2858 "content-type": "application/json; charset=utf-8", |
2758 }; | 2859 }; |
2759 var resp = convert.JSON.encode(buildInstancesUpdateResponse()); | 2860 var resp = convert.JSON.encode(buildInstancesUpdateResponse()); |
2760 return new async.Future.value(stringResponse(200, h, resp)); | 2861 return new async.Future.value(stringResponse(200, h, resp)); |
2761 }), true); | 2862 }), true); |
2762 res.update(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.InstancesUpdateResponse response) { | 2863 res |
| 2864 .update(arg_request, arg_project, arg_instance) |
| 2865 .then(unittest.expectAsync1(((api.InstancesUpdateResponse response) { |
2763 checkInstancesUpdateResponse(response); | 2866 checkInstancesUpdateResponse(response); |
2764 }))); | 2867 }))); |
2765 }); | 2868 }); |
2766 | |
2767 }); | 2869 }); |
2768 | 2870 |
2769 | |
2770 unittest.group("resource-OperationsResourceApi", () { | 2871 unittest.group("resource-OperationsResourceApi", () { |
2771 unittest.test("method--get", () { | 2872 unittest.test("method--get", () { |
2772 | |
2773 var mock = new HttpServerMock(); | 2873 var mock = new HttpServerMock(); |
2774 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; | 2874 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; |
2775 var arg_project = "foo"; | 2875 var arg_project = "foo"; |
2776 var arg_instance = "foo"; | 2876 var arg_instance = "foo"; |
2777 var arg_operation = "foo"; | 2877 var arg_operation = "foo"; |
2778 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2878 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2779 var path = (req.url).path; | 2879 var path = (req.url).path; |
2780 var pathOffset = 0; | 2880 var pathOffset = 0; |
2781 var index; | 2881 var index; |
2782 var subPart; | 2882 var subPart; |
2783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2883 unittest.expect( |
| 2884 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2784 pathOffset += 1; | 2885 pathOffset += 1; |
2785 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2886 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2887 unittest.equals("sql/v1beta3/")); |
2786 pathOffset += 12; | 2888 pathOffset += 12; |
2787 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2889 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2890 unittest.equals("projects/")); |
2788 pathOffset += 9; | 2891 pathOffset += 9; |
2789 index = path.indexOf("/instances/", pathOffset); | 2892 index = path.indexOf("/instances/", pathOffset); |
2790 unittest.expect(index >= 0, unittest.isTrue); | 2893 unittest.expect(index >= 0, unittest.isTrue); |
2791 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2894 subPart = |
| 2895 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2792 pathOffset = index; | 2896 pathOffset = index; |
2793 unittest.expect(subPart, unittest.equals("$arg_project")); | 2897 unittest.expect(subPart, unittest.equals("$arg_project")); |
2794 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2898 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2899 unittest.equals("/instances/")); |
2795 pathOffset += 11; | 2900 pathOffset += 11; |
2796 index = path.indexOf("/operations/", pathOffset); | 2901 index = path.indexOf("/operations/", pathOffset); |
2797 unittest.expect(index >= 0, unittest.isTrue); | 2902 unittest.expect(index >= 0, unittest.isTrue); |
2798 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2903 subPart = |
| 2904 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2799 pathOffset = index; | 2905 pathOffset = index; |
2800 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2906 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2801 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/operations/")); | 2907 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2908 unittest.equals("/operations/")); |
2802 pathOffset += 12; | 2909 pathOffset += 12; |
2803 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2910 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
2804 pathOffset = path.length; | 2911 pathOffset = path.length; |
2805 unittest.expect(subPart, unittest.equals("$arg_operation")); | 2912 unittest.expect(subPart, unittest.equals("$arg_operation")); |
2806 | 2913 |
2807 var query = (req.url).query; | 2914 var query = (req.url).query; |
2808 var queryOffset = 0; | 2915 var queryOffset = 0; |
2809 var queryMap = {}; | 2916 var queryMap = {}; |
2810 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2917 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2811 parseBool(n) { | 2918 parseBool(n) { |
2812 if (n == "true") return true; | 2919 if (n == "true") return true; |
2813 if (n == "false") return false; | 2920 if (n == "false") return false; |
2814 if (n == null) return null; | 2921 if (n == null) return null; |
2815 throw new core.ArgumentError("Invalid boolean: $n"); | 2922 throw new core.ArgumentError("Invalid boolean: $n"); |
2816 } | 2923 } |
| 2924 |
2817 if (query.length > 0) { | 2925 if (query.length > 0) { |
2818 for (var part in query.split("&")) { | 2926 for (var part in query.split("&")) { |
2819 var keyvalue = part.split("="); | 2927 var keyvalue = part.split("="); |
2820 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2928 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2929 core.Uri.decodeQueryComponent(keyvalue[1])); |
2821 } | 2930 } |
2822 } | 2931 } |
2823 | 2932 |
2824 | |
2825 var h = { | 2933 var h = { |
2826 "content-type" : "application/json; charset=utf-8", | 2934 "content-type": "application/json; charset=utf-8", |
2827 }; | 2935 }; |
2828 var resp = convert.JSON.encode(buildInstanceOperation()); | 2936 var resp = convert.JSON.encode(buildInstanceOperation()); |
2829 return new async.Future.value(stringResponse(200, h, resp)); | 2937 return new async.Future.value(stringResponse(200, h, resp)); |
2830 }), true); | 2938 }), true); |
2831 res.get(arg_project, arg_instance, arg_operation).then(unittest.expectAsyn
c1(((api.InstanceOperation response) { | 2939 res |
| 2940 .get(arg_project, arg_instance, arg_operation) |
| 2941 .then(unittest.expectAsync1(((api.InstanceOperation response) { |
2832 checkInstanceOperation(response); | 2942 checkInstanceOperation(response); |
2833 }))); | 2943 }))); |
2834 }); | 2944 }); |
2835 | 2945 |
2836 unittest.test("method--list", () { | 2946 unittest.test("method--list", () { |
2837 | |
2838 var mock = new HttpServerMock(); | 2947 var mock = new HttpServerMock(); |
2839 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; | 2948 api.OperationsResourceApi res = new api.SqladminApi(mock).operations; |
2840 var arg_project = "foo"; | 2949 var arg_project = "foo"; |
2841 var arg_instance = "foo"; | 2950 var arg_instance = "foo"; |
2842 var arg_maxResults = 42; | 2951 var arg_maxResults = 42; |
2843 var arg_pageToken = "foo"; | 2952 var arg_pageToken = "foo"; |
2844 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2953 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2845 var path = (req.url).path; | 2954 var path = (req.url).path; |
2846 var pathOffset = 0; | 2955 var pathOffset = 0; |
2847 var index; | 2956 var index; |
2848 var subPart; | 2957 var subPart; |
2849 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2958 unittest.expect( |
| 2959 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2850 pathOffset += 1; | 2960 pathOffset += 1; |
2851 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 2961 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2962 unittest.equals("sql/v1beta3/")); |
2852 pathOffset += 12; | 2963 pathOffset += 12; |
2853 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 2964 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 2965 unittest.equals("projects/")); |
2854 pathOffset += 9; | 2966 pathOffset += 9; |
2855 index = path.indexOf("/instances/", pathOffset); | 2967 index = path.indexOf("/instances/", pathOffset); |
2856 unittest.expect(index >= 0, unittest.isTrue); | 2968 unittest.expect(index >= 0, unittest.isTrue); |
2857 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2969 subPart = |
| 2970 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2858 pathOffset = index; | 2971 pathOffset = index; |
2859 unittest.expect(subPart, unittest.equals("$arg_project")); | 2972 unittest.expect(subPart, unittest.equals("$arg_project")); |
2860 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 2973 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2974 unittest.equals("/instances/")); |
2861 pathOffset += 11; | 2975 pathOffset += 11; |
2862 index = path.indexOf("/operations", pathOffset); | 2976 index = path.indexOf("/operations", pathOffset); |
2863 unittest.expect(index >= 0, unittest.isTrue); | 2977 unittest.expect(index >= 0, unittest.isTrue); |
2864 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2978 subPart = |
| 2979 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2865 pathOffset = index; | 2980 pathOffset = index; |
2866 unittest.expect(subPart, unittest.equals("$arg_instance")); | 2981 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2867 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/operations")); | 2982 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2983 unittest.equals("/operations")); |
2868 pathOffset += 11; | 2984 pathOffset += 11; |
2869 | 2985 |
2870 var query = (req.url).query; | 2986 var query = (req.url).query; |
2871 var queryOffset = 0; | 2987 var queryOffset = 0; |
2872 var queryMap = {}; | 2988 var queryMap = {}; |
2873 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2989 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2874 parseBool(n) { | 2990 parseBool(n) { |
2875 if (n == "true") return true; | 2991 if (n == "true") return true; |
2876 if (n == "false") return false; | 2992 if (n == "false") return false; |
2877 if (n == null) return null; | 2993 if (n == null) return null; |
2878 throw new core.ArgumentError("Invalid boolean: $n"); | 2994 throw new core.ArgumentError("Invalid boolean: $n"); |
2879 } | 2995 } |
| 2996 |
2880 if (query.length > 0) { | 2997 if (query.length > 0) { |
2881 for (var part in query.split("&")) { | 2998 for (var part in query.split("&")) { |
2882 var keyvalue = part.split("="); | 2999 var keyvalue = part.split("="); |
2883 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3000 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3001 core.Uri.decodeQueryComponent(keyvalue[1])); |
2884 } | 3002 } |
2885 } | 3003 } |
2886 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 3004 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
2887 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3005 unittest.equals(arg_maxResults)); |
2888 | 3006 unittest.expect( |
| 3007 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
2889 | 3008 |
2890 var h = { | 3009 var h = { |
2891 "content-type" : "application/json; charset=utf-8", | 3010 "content-type": "application/json; charset=utf-8", |
2892 }; | 3011 }; |
2893 var resp = convert.JSON.encode(buildOperationsListResponse()); | 3012 var resp = convert.JSON.encode(buildOperationsListResponse()); |
2894 return new async.Future.value(stringResponse(200, h, resp)); | 3013 return new async.Future.value(stringResponse(200, h, resp)); |
2895 }), true); | 3014 }), true); |
2896 res.list(arg_project, arg_instance, maxResults: arg_maxResults, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.OperationsListResponse response
) { | 3015 res |
| 3016 .list(arg_project, arg_instance, |
| 3017 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 3018 .then(unittest.expectAsync1(((api.OperationsListResponse response) { |
2897 checkOperationsListResponse(response); | 3019 checkOperationsListResponse(response); |
2898 }))); | 3020 }))); |
2899 }); | 3021 }); |
2900 | |
2901 }); | 3022 }); |
2902 | 3023 |
2903 | |
2904 unittest.group("resource-SslCertsResourceApi", () { | 3024 unittest.group("resource-SslCertsResourceApi", () { |
2905 unittest.test("method--delete", () { | 3025 unittest.test("method--delete", () { |
2906 | |
2907 var mock = new HttpServerMock(); | 3026 var mock = new HttpServerMock(); |
2908 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 3027 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
2909 var arg_project = "foo"; | 3028 var arg_project = "foo"; |
2910 var arg_instance = "foo"; | 3029 var arg_instance = "foo"; |
2911 var arg_sha1Fingerprint = "foo"; | 3030 var arg_sha1Fingerprint = "foo"; |
2912 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3031 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2913 var path = (req.url).path; | 3032 var path = (req.url).path; |
2914 var pathOffset = 0; | 3033 var pathOffset = 0; |
2915 var index; | 3034 var index; |
2916 var subPart; | 3035 var subPart; |
2917 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3036 unittest.expect( |
| 3037 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2918 pathOffset += 1; | 3038 pathOffset += 1; |
2919 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 3039 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3040 unittest.equals("sql/v1beta3/")); |
2920 pathOffset += 12; | 3041 pathOffset += 12; |
2921 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3042 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3043 unittest.equals("projects/")); |
2922 pathOffset += 9; | 3044 pathOffset += 9; |
2923 index = path.indexOf("/instances/", pathOffset); | 3045 index = path.indexOf("/instances/", pathOffset); |
2924 unittest.expect(index >= 0, unittest.isTrue); | 3046 unittest.expect(index >= 0, unittest.isTrue); |
2925 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3047 subPart = |
| 3048 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2926 pathOffset = index; | 3049 pathOffset = index; |
2927 unittest.expect(subPart, unittest.equals("$arg_project")); | 3050 unittest.expect(subPart, unittest.equals("$arg_project")); |
2928 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3051 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3052 unittest.equals("/instances/")); |
2929 pathOffset += 11; | 3053 pathOffset += 11; |
2930 index = path.indexOf("/sslCerts/", pathOffset); | 3054 index = path.indexOf("/sslCerts/", pathOffset); |
2931 unittest.expect(index >= 0, unittest.isTrue); | 3055 unittest.expect(index >= 0, unittest.isTrue); |
2932 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3056 subPart = |
| 3057 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2933 pathOffset = index; | 3058 pathOffset = index; |
2934 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3059 unittest.expect(subPart, unittest.equals("$arg_instance")); |
2935 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/sslCerts/")); | 3060 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3061 unittest.equals("/sslCerts/")); |
2936 pathOffset += 10; | 3062 pathOffset += 10; |
2937 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3063 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
2938 pathOffset = path.length; | 3064 pathOffset = path.length; |
2939 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); | 3065 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); |
2940 | 3066 |
2941 var query = (req.url).query; | 3067 var query = (req.url).query; |
2942 var queryOffset = 0; | 3068 var queryOffset = 0; |
2943 var queryMap = {}; | 3069 var queryMap = {}; |
2944 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3070 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2945 parseBool(n) { | 3071 parseBool(n) { |
2946 if (n == "true") return true; | 3072 if (n == "true") return true; |
2947 if (n == "false") return false; | 3073 if (n == "false") return false; |
2948 if (n == null) return null; | 3074 if (n == null) return null; |
2949 throw new core.ArgumentError("Invalid boolean: $n"); | 3075 throw new core.ArgumentError("Invalid boolean: $n"); |
2950 } | 3076 } |
| 3077 |
2951 if (query.length > 0) { | 3078 if (query.length > 0) { |
2952 for (var part in query.split("&")) { | 3079 for (var part in query.split("&")) { |
2953 var keyvalue = part.split("="); | 3080 var keyvalue = part.split("="); |
2954 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3081 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3082 core.Uri.decodeQueryComponent(keyvalue[1])); |
2955 } | 3083 } |
2956 } | 3084 } |
2957 | 3085 |
2958 | |
2959 var h = { | 3086 var h = { |
2960 "content-type" : "application/json; charset=utf-8", | 3087 "content-type": "application/json; charset=utf-8", |
2961 }; | 3088 }; |
2962 var resp = convert.JSON.encode(buildSslCertsDeleteResponse()); | 3089 var resp = convert.JSON.encode(buildSslCertsDeleteResponse()); |
2963 return new async.Future.value(stringResponse(200, h, resp)); | 3090 return new async.Future.value(stringResponse(200, h, resp)); |
2964 }), true); | 3091 }), true); |
2965 res.delete(arg_project, arg_instance, arg_sha1Fingerprint).then(unittest.e
xpectAsync1(((api.SslCertsDeleteResponse response) { | 3092 res |
| 3093 .delete(arg_project, arg_instance, arg_sha1Fingerprint) |
| 3094 .then(unittest.expectAsync1(((api.SslCertsDeleteResponse response) { |
2966 checkSslCertsDeleteResponse(response); | 3095 checkSslCertsDeleteResponse(response); |
2967 }))); | 3096 }))); |
2968 }); | 3097 }); |
2969 | 3098 |
2970 unittest.test("method--get", () { | 3099 unittest.test("method--get", () { |
2971 | |
2972 var mock = new HttpServerMock(); | 3100 var mock = new HttpServerMock(); |
2973 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 3101 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
2974 var arg_project = "foo"; | 3102 var arg_project = "foo"; |
2975 var arg_instance = "foo"; | 3103 var arg_instance = "foo"; |
2976 var arg_sha1Fingerprint = "foo"; | 3104 var arg_sha1Fingerprint = "foo"; |
2977 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3105 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
2978 var path = (req.url).path; | 3106 var path = (req.url).path; |
2979 var pathOffset = 0; | 3107 var pathOffset = 0; |
2980 var index; | 3108 var index; |
2981 var subPart; | 3109 var subPart; |
2982 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3110 unittest.expect( |
| 3111 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
2983 pathOffset += 1; | 3112 pathOffset += 1; |
2984 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 3113 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3114 unittest.equals("sql/v1beta3/")); |
2985 pathOffset += 12; | 3115 pathOffset += 12; |
2986 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3116 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3117 unittest.equals("projects/")); |
2987 pathOffset += 9; | 3118 pathOffset += 9; |
2988 index = path.indexOf("/instances/", pathOffset); | 3119 index = path.indexOf("/instances/", pathOffset); |
2989 unittest.expect(index >= 0, unittest.isTrue); | 3120 unittest.expect(index >= 0, unittest.isTrue); |
2990 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3121 subPart = |
| 3122 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2991 pathOffset = index; | 3123 pathOffset = index; |
2992 unittest.expect(subPart, unittest.equals("$arg_project")); | 3124 unittest.expect(subPart, unittest.equals("$arg_project")); |
2993 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3125 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3126 unittest.equals("/instances/")); |
2994 pathOffset += 11; | 3127 pathOffset += 11; |
2995 index = path.indexOf("/sslCerts/", pathOffset); | 3128 index = path.indexOf("/sslCerts/", pathOffset); |
2996 unittest.expect(index >= 0, unittest.isTrue); | 3129 unittest.expect(index >= 0, unittest.isTrue); |
2997 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3130 subPart = |
| 3131 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
2998 pathOffset = index; | 3132 pathOffset = index; |
2999 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3133 unittest.expect(subPart, unittest.equals("$arg_instance")); |
3000 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/sslCerts/")); | 3134 unittest.expect(path.substring(pathOffset, pathOffset + 10), |
| 3135 unittest.equals("/sslCerts/")); |
3001 pathOffset += 10; | 3136 pathOffset += 10; |
3002 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3137 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
3003 pathOffset = path.length; | 3138 pathOffset = path.length; |
3004 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); | 3139 unittest.expect(subPart, unittest.equals("$arg_sha1Fingerprint")); |
3005 | 3140 |
3006 var query = (req.url).query; | 3141 var query = (req.url).query; |
3007 var queryOffset = 0; | 3142 var queryOffset = 0; |
3008 var queryMap = {}; | 3143 var queryMap = {}; |
3009 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3144 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3010 parseBool(n) { | 3145 parseBool(n) { |
3011 if (n == "true") return true; | 3146 if (n == "true") return true; |
3012 if (n == "false") return false; | 3147 if (n == "false") return false; |
3013 if (n == null) return null; | 3148 if (n == null) return null; |
3014 throw new core.ArgumentError("Invalid boolean: $n"); | 3149 throw new core.ArgumentError("Invalid boolean: $n"); |
3015 } | 3150 } |
| 3151 |
3016 if (query.length > 0) { | 3152 if (query.length > 0) { |
3017 for (var part in query.split("&")) { | 3153 for (var part in query.split("&")) { |
3018 var keyvalue = part.split("="); | 3154 var keyvalue = part.split("="); |
3019 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3155 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3156 core.Uri.decodeQueryComponent(keyvalue[1])); |
3020 } | 3157 } |
3021 } | 3158 } |
3022 | 3159 |
3023 | |
3024 var h = { | 3160 var h = { |
3025 "content-type" : "application/json; charset=utf-8", | 3161 "content-type": "application/json; charset=utf-8", |
3026 }; | 3162 }; |
3027 var resp = convert.JSON.encode(buildSslCert()); | 3163 var resp = convert.JSON.encode(buildSslCert()); |
3028 return new async.Future.value(stringResponse(200, h, resp)); | 3164 return new async.Future.value(stringResponse(200, h, resp)); |
3029 }), true); | 3165 }), true); |
3030 res.get(arg_project, arg_instance, arg_sha1Fingerprint).then(unittest.expe
ctAsync1(((api.SslCert response) { | 3166 res |
| 3167 .get(arg_project, arg_instance, arg_sha1Fingerprint) |
| 3168 .then(unittest.expectAsync1(((api.SslCert response) { |
3031 checkSslCert(response); | 3169 checkSslCert(response); |
3032 }))); | 3170 }))); |
3033 }); | 3171 }); |
3034 | 3172 |
3035 unittest.test("method--insert", () { | 3173 unittest.test("method--insert", () { |
3036 | |
3037 var mock = new HttpServerMock(); | 3174 var mock = new HttpServerMock(); |
3038 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 3175 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
3039 var arg_request = buildSslCertsInsertRequest(); | 3176 var arg_request = buildSslCertsInsertRequest(); |
3040 var arg_project = "foo"; | 3177 var arg_project = "foo"; |
3041 var arg_instance = "foo"; | 3178 var arg_instance = "foo"; |
3042 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3179 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3043 var obj = new api.SslCertsInsertRequest.fromJson(json); | 3180 var obj = new api.SslCertsInsertRequest.fromJson(json); |
3044 checkSslCertsInsertRequest(obj); | 3181 checkSslCertsInsertRequest(obj); |
3045 | 3182 |
3046 var path = (req.url).path; | 3183 var path = (req.url).path; |
3047 var pathOffset = 0; | 3184 var pathOffset = 0; |
3048 var index; | 3185 var index; |
3049 var subPart; | 3186 var subPart; |
3050 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3187 unittest.expect( |
| 3188 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3051 pathOffset += 1; | 3189 pathOffset += 1; |
3052 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 3190 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3191 unittest.equals("sql/v1beta3/")); |
3053 pathOffset += 12; | 3192 pathOffset += 12; |
3054 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3193 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3194 unittest.equals("projects/")); |
3055 pathOffset += 9; | 3195 pathOffset += 9; |
3056 index = path.indexOf("/instances/", pathOffset); | 3196 index = path.indexOf("/instances/", pathOffset); |
3057 unittest.expect(index >= 0, unittest.isTrue); | 3197 unittest.expect(index >= 0, unittest.isTrue); |
3058 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3198 subPart = |
| 3199 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
3059 pathOffset = index; | 3200 pathOffset = index; |
3060 unittest.expect(subPart, unittest.equals("$arg_project")); | 3201 unittest.expect(subPart, unittest.equals("$arg_project")); |
3061 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3202 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3203 unittest.equals("/instances/")); |
3062 pathOffset += 11; | 3204 pathOffset += 11; |
3063 index = path.indexOf("/sslCerts", pathOffset); | 3205 index = path.indexOf("/sslCerts", pathOffset); |
3064 unittest.expect(index >= 0, unittest.isTrue); | 3206 unittest.expect(index >= 0, unittest.isTrue); |
3065 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3207 subPart = |
| 3208 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
3066 pathOffset = index; | 3209 pathOffset = index; |
3067 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3210 unittest.expect(subPart, unittest.equals("$arg_instance")); |
3068 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/sslCerts")); | 3211 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3212 unittest.equals("/sslCerts")); |
3069 pathOffset += 9; | 3213 pathOffset += 9; |
3070 | 3214 |
3071 var query = (req.url).query; | 3215 var query = (req.url).query; |
3072 var queryOffset = 0; | 3216 var queryOffset = 0; |
3073 var queryMap = {}; | 3217 var queryMap = {}; |
3074 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3218 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3075 parseBool(n) { | 3219 parseBool(n) { |
3076 if (n == "true") return true; | 3220 if (n == "true") return true; |
3077 if (n == "false") return false; | 3221 if (n == "false") return false; |
3078 if (n == null) return null; | 3222 if (n == null) return null; |
3079 throw new core.ArgumentError("Invalid boolean: $n"); | 3223 throw new core.ArgumentError("Invalid boolean: $n"); |
3080 } | 3224 } |
| 3225 |
3081 if (query.length > 0) { | 3226 if (query.length > 0) { |
3082 for (var part in query.split("&")) { | 3227 for (var part in query.split("&")) { |
3083 var keyvalue = part.split("="); | 3228 var keyvalue = part.split("="); |
3084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3229 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3230 core.Uri.decodeQueryComponent(keyvalue[1])); |
3085 } | 3231 } |
3086 } | 3232 } |
3087 | 3233 |
3088 | |
3089 var h = { | 3234 var h = { |
3090 "content-type" : "application/json; charset=utf-8", | 3235 "content-type": "application/json; charset=utf-8", |
3091 }; | 3236 }; |
3092 var resp = convert.JSON.encode(buildSslCertsInsertResponse()); | 3237 var resp = convert.JSON.encode(buildSslCertsInsertResponse()); |
3093 return new async.Future.value(stringResponse(200, h, resp)); | 3238 return new async.Future.value(stringResponse(200, h, resp)); |
3094 }), true); | 3239 }), true); |
3095 res.insert(arg_request, arg_project, arg_instance).then(unittest.expectAsy
nc1(((api.SslCertsInsertResponse response) { | 3240 res |
| 3241 .insert(arg_request, arg_project, arg_instance) |
| 3242 .then(unittest.expectAsync1(((api.SslCertsInsertResponse response) { |
3096 checkSslCertsInsertResponse(response); | 3243 checkSslCertsInsertResponse(response); |
3097 }))); | 3244 }))); |
3098 }); | 3245 }); |
3099 | 3246 |
3100 unittest.test("method--list", () { | 3247 unittest.test("method--list", () { |
3101 | |
3102 var mock = new HttpServerMock(); | 3248 var mock = new HttpServerMock(); |
3103 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; | 3249 api.SslCertsResourceApi res = new api.SqladminApi(mock).sslCerts; |
3104 var arg_project = "foo"; | 3250 var arg_project = "foo"; |
3105 var arg_instance = "foo"; | 3251 var arg_instance = "foo"; |
3106 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3252 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3107 var path = (req.url).path; | 3253 var path = (req.url).path; |
3108 var pathOffset = 0; | 3254 var pathOffset = 0; |
3109 var index; | 3255 var index; |
3110 var subPart; | 3256 var subPart; |
3111 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3257 unittest.expect( |
| 3258 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3112 pathOffset += 1; | 3259 pathOffset += 1; |
3113 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 3260 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3261 unittest.equals("sql/v1beta3/")); |
3114 pathOffset += 12; | 3262 pathOffset += 12; |
3115 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3263 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3264 unittest.equals("projects/")); |
3116 pathOffset += 9; | 3265 pathOffset += 9; |
3117 index = path.indexOf("/instances/", pathOffset); | 3266 index = path.indexOf("/instances/", pathOffset); |
3118 unittest.expect(index >= 0, unittest.isTrue); | 3267 unittest.expect(index >= 0, unittest.isTrue); |
3119 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3268 subPart = |
| 3269 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
3120 pathOffset = index; | 3270 pathOffset = index; |
3121 unittest.expect(subPart, unittest.equals("$arg_project")); | 3271 unittest.expect(subPart, unittest.equals("$arg_project")); |
3122 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); | 3272 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3273 unittest.equals("/instances/")); |
3123 pathOffset += 11; | 3274 pathOffset += 11; |
3124 index = path.indexOf("/sslCerts", pathOffset); | 3275 index = path.indexOf("/sslCerts", pathOffset); |
3125 unittest.expect(index >= 0, unittest.isTrue); | 3276 unittest.expect(index >= 0, unittest.isTrue); |
3126 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3277 subPart = |
| 3278 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
3127 pathOffset = index; | 3279 pathOffset = index; |
3128 unittest.expect(subPart, unittest.equals("$arg_instance")); | 3280 unittest.expect(subPart, unittest.equals("$arg_instance")); |
3129 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/sslCerts")); | 3281 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3282 unittest.equals("/sslCerts")); |
3130 pathOffset += 9; | 3283 pathOffset += 9; |
3131 | 3284 |
3132 var query = (req.url).query; | 3285 var query = (req.url).query; |
3133 var queryOffset = 0; | 3286 var queryOffset = 0; |
3134 var queryMap = {}; | 3287 var queryMap = {}; |
3135 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3288 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3136 parseBool(n) { | 3289 parseBool(n) { |
3137 if (n == "true") return true; | 3290 if (n == "true") return true; |
3138 if (n == "false") return false; | 3291 if (n == "false") return false; |
3139 if (n == null) return null; | 3292 if (n == null) return null; |
3140 throw new core.ArgumentError("Invalid boolean: $n"); | 3293 throw new core.ArgumentError("Invalid boolean: $n"); |
3141 } | 3294 } |
| 3295 |
3142 if (query.length > 0) { | 3296 if (query.length > 0) { |
3143 for (var part in query.split("&")) { | 3297 for (var part in query.split("&")) { |
3144 var keyvalue = part.split("="); | 3298 var keyvalue = part.split("="); |
3145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3299 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3300 core.Uri.decodeQueryComponent(keyvalue[1])); |
3146 } | 3301 } |
3147 } | 3302 } |
3148 | 3303 |
3149 | |
3150 var h = { | 3304 var h = { |
3151 "content-type" : "application/json; charset=utf-8", | 3305 "content-type": "application/json; charset=utf-8", |
3152 }; | 3306 }; |
3153 var resp = convert.JSON.encode(buildSslCertsListResponse()); | 3307 var resp = convert.JSON.encode(buildSslCertsListResponse()); |
3154 return new async.Future.value(stringResponse(200, h, resp)); | 3308 return new async.Future.value(stringResponse(200, h, resp)); |
3155 }), true); | 3309 }), true); |
3156 res.list(arg_project, arg_instance).then(unittest.expectAsync1(((api.SslCe
rtsListResponse response) { | 3310 res |
| 3311 .list(arg_project, arg_instance) |
| 3312 .then(unittest.expectAsync1(((api.SslCertsListResponse response) { |
3157 checkSslCertsListResponse(response); | 3313 checkSslCertsListResponse(response); |
3158 }))); | 3314 }))); |
3159 }); | 3315 }); |
3160 | |
3161 }); | 3316 }); |
3162 | 3317 |
3163 | |
3164 unittest.group("resource-TiersResourceApi", () { | 3318 unittest.group("resource-TiersResourceApi", () { |
3165 unittest.test("method--list", () { | 3319 unittest.test("method--list", () { |
3166 | |
3167 var mock = new HttpServerMock(); | 3320 var mock = new HttpServerMock(); |
3168 api.TiersResourceApi res = new api.SqladminApi(mock).tiers; | 3321 api.TiersResourceApi res = new api.SqladminApi(mock).tiers; |
3169 var arg_project = "foo"; | 3322 var arg_project = "foo"; |
3170 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3323 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
3171 var path = (req.url).path; | 3324 var path = (req.url).path; |
3172 var pathOffset = 0; | 3325 var pathOffset = 0; |
3173 var index; | 3326 var index; |
3174 var subPart; | 3327 var subPart; |
3175 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3328 unittest.expect( |
| 3329 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
3176 pathOffset += 1; | 3330 pathOffset += 1; |
3177 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("sql/v1beta3/")); | 3331 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3332 unittest.equals("sql/v1beta3/")); |
3178 pathOffset += 12; | 3333 pathOffset += 12; |
3179 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); | 3334 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3335 unittest.equals("projects/")); |
3180 pathOffset += 9; | 3336 pathOffset += 9; |
3181 index = path.indexOf("/tiers", pathOffset); | 3337 index = path.indexOf("/tiers", pathOffset); |
3182 unittest.expect(index >= 0, unittest.isTrue); | 3338 unittest.expect(index >= 0, unittest.isTrue); |
3183 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3339 subPart = |
| 3340 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
3184 pathOffset = index; | 3341 pathOffset = index; |
3185 unittest.expect(subPart, unittest.equals("$arg_project")); | 3342 unittest.expect(subPart, unittest.equals("$arg_project")); |
3186 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/tiers")); | 3343 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 3344 unittest.equals("/tiers")); |
3187 pathOffset += 6; | 3345 pathOffset += 6; |
3188 | 3346 |
3189 var query = (req.url).query; | 3347 var query = (req.url).query; |
3190 var queryOffset = 0; | 3348 var queryOffset = 0; |
3191 var queryMap = {}; | 3349 var queryMap = {}; |
3192 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3350 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
3193 parseBool(n) { | 3351 parseBool(n) { |
3194 if (n == "true") return true; | 3352 if (n == "true") return true; |
3195 if (n == "false") return false; | 3353 if (n == "false") return false; |
3196 if (n == null) return null; | 3354 if (n == null) return null; |
3197 throw new core.ArgumentError("Invalid boolean: $n"); | 3355 throw new core.ArgumentError("Invalid boolean: $n"); |
3198 } | 3356 } |
| 3357 |
3199 if (query.length > 0) { | 3358 if (query.length > 0) { |
3200 for (var part in query.split("&")) { | 3359 for (var part in query.split("&")) { |
3201 var keyvalue = part.split("="); | 3360 var keyvalue = part.split("="); |
3202 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3361 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3362 core.Uri.decodeQueryComponent(keyvalue[1])); |
3203 } | 3363 } |
3204 } | 3364 } |
3205 | 3365 |
3206 | |
3207 var h = { | 3366 var h = { |
3208 "content-type" : "application/json; charset=utf-8", | 3367 "content-type": "application/json; charset=utf-8", |
3209 }; | 3368 }; |
3210 var resp = convert.JSON.encode(buildTiersListResponse()); | 3369 var resp = convert.JSON.encode(buildTiersListResponse()); |
3211 return new async.Future.value(stringResponse(200, h, resp)); | 3370 return new async.Future.value(stringResponse(200, h, resp)); |
3212 }), true); | 3371 }), true); |
3213 res.list(arg_project).then(unittest.expectAsync1(((api.TiersListResponse r
esponse) { | 3372 res |
| 3373 .list(arg_project) |
| 3374 .then(unittest.expectAsync1(((api.TiersListResponse response) { |
3214 checkTiersListResponse(response); | 3375 checkTiersListResponse(response); |
3215 }))); | 3376 }))); |
3216 }); | 3377 }); |
3217 | |
3218 }); | 3378 }); |
3219 | |
3220 | |
3221 } | 3379 } |
3222 | |
OLD | NEW |