OLD | NEW |
1 library googleapis.storagetransfer.v1.test; | 1 library googleapis.storagetransfer.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:test/test.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return o; | 126 return o; |
127 } | 127 } |
128 | 128 |
129 checkEmpty(api.Empty o) { | 129 checkEmpty(api.Empty o) { |
130 buildCounterEmpty++; | 130 buildCounterEmpty++; |
131 if (buildCounterEmpty < 3) { | 131 if (buildCounterEmpty < 3) { |
132 } | 132 } |
133 buildCounterEmpty--; | 133 buildCounterEmpty--; |
134 } | 134 } |
135 | 135 |
136 buildUnnamed1391() { | 136 buildUnnamed1408() { |
137 var o = new core.List<core.String>(); | 137 var o = new core.List<core.String>(); |
138 o.add("foo"); | 138 o.add("foo"); |
139 o.add("foo"); | 139 o.add("foo"); |
140 return o; | 140 return o; |
141 } | 141 } |
142 | 142 |
143 checkUnnamed1391(core.List<core.String> o) { | 143 checkUnnamed1408(core.List<core.String> o) { |
144 unittest.expect(o, unittest.hasLength(2)); | 144 unittest.expect(o, unittest.hasLength(2)); |
145 unittest.expect(o[0], unittest.equals('foo')); | 145 unittest.expect(o[0], unittest.equals('foo')); |
146 unittest.expect(o[1], unittest.equals('foo')); | 146 unittest.expect(o[1], unittest.equals('foo')); |
147 } | 147 } |
148 | 148 |
149 core.int buildCounterErrorLogEntry = 0; | 149 core.int buildCounterErrorLogEntry = 0; |
150 buildErrorLogEntry() { | 150 buildErrorLogEntry() { |
151 var o = new api.ErrorLogEntry(); | 151 var o = new api.ErrorLogEntry(); |
152 buildCounterErrorLogEntry++; | 152 buildCounterErrorLogEntry++; |
153 if (buildCounterErrorLogEntry < 3) { | 153 if (buildCounterErrorLogEntry < 3) { |
154 o.errorDetails = buildUnnamed1391(); | 154 o.errorDetails = buildUnnamed1408(); |
155 o.url = "foo"; | 155 o.url = "foo"; |
156 } | 156 } |
157 buildCounterErrorLogEntry--; | 157 buildCounterErrorLogEntry--; |
158 return o; | 158 return o; |
159 } | 159 } |
160 | 160 |
161 checkErrorLogEntry(api.ErrorLogEntry o) { | 161 checkErrorLogEntry(api.ErrorLogEntry o) { |
162 buildCounterErrorLogEntry++; | 162 buildCounterErrorLogEntry++; |
163 if (buildCounterErrorLogEntry < 3) { | 163 if (buildCounterErrorLogEntry < 3) { |
164 checkUnnamed1391(o.errorDetails); | 164 checkUnnamed1408(o.errorDetails); |
165 unittest.expect(o.url, unittest.equals('foo')); | 165 unittest.expect(o.url, unittest.equals('foo')); |
166 } | 166 } |
167 buildCounterErrorLogEntry--; | 167 buildCounterErrorLogEntry--; |
168 } | 168 } |
169 | 169 |
170 buildUnnamed1392() { | 170 buildUnnamed1409() { |
171 var o = new core.List<api.ErrorLogEntry>(); | 171 var o = new core.List<api.ErrorLogEntry>(); |
172 o.add(buildErrorLogEntry()); | 172 o.add(buildErrorLogEntry()); |
173 o.add(buildErrorLogEntry()); | 173 o.add(buildErrorLogEntry()); |
174 return o; | 174 return o; |
175 } | 175 } |
176 | 176 |
177 checkUnnamed1392(core.List<api.ErrorLogEntry> o) { | 177 checkUnnamed1409(core.List<api.ErrorLogEntry> o) { |
178 unittest.expect(o, unittest.hasLength(2)); | 178 unittest.expect(o, unittest.hasLength(2)); |
179 checkErrorLogEntry(o[0]); | 179 checkErrorLogEntry(o[0]); |
180 checkErrorLogEntry(o[1]); | 180 checkErrorLogEntry(o[1]); |
181 } | 181 } |
182 | 182 |
183 core.int buildCounterErrorSummary = 0; | 183 core.int buildCounterErrorSummary = 0; |
184 buildErrorSummary() { | 184 buildErrorSummary() { |
185 var o = new api.ErrorSummary(); | 185 var o = new api.ErrorSummary(); |
186 buildCounterErrorSummary++; | 186 buildCounterErrorSummary++; |
187 if (buildCounterErrorSummary < 3) { | 187 if (buildCounterErrorSummary < 3) { |
188 o.errorCode = "foo"; | 188 o.errorCode = "foo"; |
189 o.errorCount = "foo"; | 189 o.errorCount = "foo"; |
190 o.errorLogEntries = buildUnnamed1392(); | 190 o.errorLogEntries = buildUnnamed1409(); |
191 } | 191 } |
192 buildCounterErrorSummary--; | 192 buildCounterErrorSummary--; |
193 return o; | 193 return o; |
194 } | 194 } |
195 | 195 |
196 checkErrorSummary(api.ErrorSummary o) { | 196 checkErrorSummary(api.ErrorSummary o) { |
197 buildCounterErrorSummary++; | 197 buildCounterErrorSummary++; |
198 if (buildCounterErrorSummary < 3) { | 198 if (buildCounterErrorSummary < 3) { |
199 unittest.expect(o.errorCode, unittest.equals('foo')); | 199 unittest.expect(o.errorCode, unittest.equals('foo')); |
200 unittest.expect(o.errorCount, unittest.equals('foo')); | 200 unittest.expect(o.errorCount, unittest.equals('foo')); |
201 checkUnnamed1392(o.errorLogEntries); | 201 checkUnnamed1409(o.errorLogEntries); |
202 } | 202 } |
203 buildCounterErrorSummary--; | 203 buildCounterErrorSummary--; |
204 } | 204 } |
205 | 205 |
206 core.int buildCounterGcsData = 0; | 206 core.int buildCounterGcsData = 0; |
207 buildGcsData() { | 207 buildGcsData() { |
208 var o = new api.GcsData(); | 208 var o = new api.GcsData(); |
209 buildCounterGcsData++; | 209 buildCounterGcsData++; |
210 if (buildCounterGcsData < 3) { | 210 if (buildCounterGcsData < 3) { |
211 o.bucketName = "foo"; | 211 o.bucketName = "foo"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 checkHttpData(api.HttpData o) { | 255 checkHttpData(api.HttpData o) { |
256 buildCounterHttpData++; | 256 buildCounterHttpData++; |
257 if (buildCounterHttpData < 3) { | 257 if (buildCounterHttpData < 3) { |
258 unittest.expect(o.listUrl, unittest.equals('foo')); | 258 unittest.expect(o.listUrl, unittest.equals('foo')); |
259 } | 259 } |
260 buildCounterHttpData--; | 260 buildCounterHttpData--; |
261 } | 261 } |
262 | 262 |
263 buildUnnamed1393() { | 263 buildUnnamed1410() { |
264 var o = new core.List<api.Operation>(); | 264 var o = new core.List<api.Operation>(); |
265 o.add(buildOperation()); | 265 o.add(buildOperation()); |
266 o.add(buildOperation()); | 266 o.add(buildOperation()); |
267 return o; | 267 return o; |
268 } | 268 } |
269 | 269 |
270 checkUnnamed1393(core.List<api.Operation> o) { | 270 checkUnnamed1410(core.List<api.Operation> o) { |
271 unittest.expect(o, unittest.hasLength(2)); | 271 unittest.expect(o, unittest.hasLength(2)); |
272 checkOperation(o[0]); | 272 checkOperation(o[0]); |
273 checkOperation(o[1]); | 273 checkOperation(o[1]); |
274 } | 274 } |
275 | 275 |
276 core.int buildCounterListOperationsResponse = 0; | 276 core.int buildCounterListOperationsResponse = 0; |
277 buildListOperationsResponse() { | 277 buildListOperationsResponse() { |
278 var o = new api.ListOperationsResponse(); | 278 var o = new api.ListOperationsResponse(); |
279 buildCounterListOperationsResponse++; | 279 buildCounterListOperationsResponse++; |
280 if (buildCounterListOperationsResponse < 3) { | 280 if (buildCounterListOperationsResponse < 3) { |
281 o.nextPageToken = "foo"; | 281 o.nextPageToken = "foo"; |
282 o.operations = buildUnnamed1393(); | 282 o.operations = buildUnnamed1410(); |
283 } | 283 } |
284 buildCounterListOperationsResponse--; | 284 buildCounterListOperationsResponse--; |
285 return o; | 285 return o; |
286 } | 286 } |
287 | 287 |
288 checkListOperationsResponse(api.ListOperationsResponse o) { | 288 checkListOperationsResponse(api.ListOperationsResponse o) { |
289 buildCounterListOperationsResponse++; | 289 buildCounterListOperationsResponse++; |
290 if (buildCounterListOperationsResponse < 3) { | 290 if (buildCounterListOperationsResponse < 3) { |
291 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 291 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
292 checkUnnamed1393(o.operations); | 292 checkUnnamed1410(o.operations); |
293 } | 293 } |
294 buildCounterListOperationsResponse--; | 294 buildCounterListOperationsResponse--; |
295 } | 295 } |
296 | 296 |
297 buildUnnamed1394() { | 297 buildUnnamed1411() { |
298 var o = new core.List<api.TransferJob>(); | 298 var o = new core.List<api.TransferJob>(); |
299 o.add(buildTransferJob()); | 299 o.add(buildTransferJob()); |
300 o.add(buildTransferJob()); | 300 o.add(buildTransferJob()); |
301 return o; | 301 return o; |
302 } | 302 } |
303 | 303 |
304 checkUnnamed1394(core.List<api.TransferJob> o) { | 304 checkUnnamed1411(core.List<api.TransferJob> o) { |
305 unittest.expect(o, unittest.hasLength(2)); | 305 unittest.expect(o, unittest.hasLength(2)); |
306 checkTransferJob(o[0]); | 306 checkTransferJob(o[0]); |
307 checkTransferJob(o[1]); | 307 checkTransferJob(o[1]); |
308 } | 308 } |
309 | 309 |
310 core.int buildCounterListTransferJobsResponse = 0; | 310 core.int buildCounterListTransferJobsResponse = 0; |
311 buildListTransferJobsResponse() { | 311 buildListTransferJobsResponse() { |
312 var o = new api.ListTransferJobsResponse(); | 312 var o = new api.ListTransferJobsResponse(); |
313 buildCounterListTransferJobsResponse++; | 313 buildCounterListTransferJobsResponse++; |
314 if (buildCounterListTransferJobsResponse < 3) { | 314 if (buildCounterListTransferJobsResponse < 3) { |
315 o.nextPageToken = "foo"; | 315 o.nextPageToken = "foo"; |
316 o.transferJobs = buildUnnamed1394(); | 316 o.transferJobs = buildUnnamed1411(); |
317 } | 317 } |
318 buildCounterListTransferJobsResponse--; | 318 buildCounterListTransferJobsResponse--; |
319 return o; | 319 return o; |
320 } | 320 } |
321 | 321 |
322 checkListTransferJobsResponse(api.ListTransferJobsResponse o) { | 322 checkListTransferJobsResponse(api.ListTransferJobsResponse o) { |
323 buildCounterListTransferJobsResponse++; | 323 buildCounterListTransferJobsResponse++; |
324 if (buildCounterListTransferJobsResponse < 3) { | 324 if (buildCounterListTransferJobsResponse < 3) { |
325 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 325 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
326 checkUnnamed1394(o.transferJobs); | 326 checkUnnamed1411(o.transferJobs); |
327 } | 327 } |
328 buildCounterListTransferJobsResponse--; | 328 buildCounterListTransferJobsResponse--; |
329 } | 329 } |
330 | 330 |
331 buildUnnamed1395() { | 331 buildUnnamed1412() { |
332 var o = new core.List<core.String>(); | 332 var o = new core.List<core.String>(); |
333 o.add("foo"); | 333 o.add("foo"); |
334 o.add("foo"); | 334 o.add("foo"); |
335 return o; | 335 return o; |
336 } | 336 } |
337 | 337 |
338 checkUnnamed1395(core.List<core.String> o) { | 338 checkUnnamed1412(core.List<core.String> o) { |
339 unittest.expect(o, unittest.hasLength(2)); | 339 unittest.expect(o, unittest.hasLength(2)); |
340 unittest.expect(o[0], unittest.equals('foo')); | 340 unittest.expect(o[0], unittest.equals('foo')); |
341 unittest.expect(o[1], unittest.equals('foo')); | 341 unittest.expect(o[1], unittest.equals('foo')); |
342 } | 342 } |
343 | 343 |
344 buildUnnamed1396() { | 344 buildUnnamed1413() { |
345 var o = new core.List<core.String>(); | 345 var o = new core.List<core.String>(); |
346 o.add("foo"); | 346 o.add("foo"); |
347 o.add("foo"); | 347 o.add("foo"); |
348 return o; | 348 return o; |
349 } | 349 } |
350 | 350 |
351 checkUnnamed1396(core.List<core.String> o) { | 351 checkUnnamed1413(core.List<core.String> o) { |
352 unittest.expect(o, unittest.hasLength(2)); | 352 unittest.expect(o, unittest.hasLength(2)); |
353 unittest.expect(o[0], unittest.equals('foo')); | 353 unittest.expect(o[0], unittest.equals('foo')); |
354 unittest.expect(o[1], unittest.equals('foo')); | 354 unittest.expect(o[1], unittest.equals('foo')); |
355 } | 355 } |
356 | 356 |
357 core.int buildCounterObjectConditions = 0; | 357 core.int buildCounterObjectConditions = 0; |
358 buildObjectConditions() { | 358 buildObjectConditions() { |
359 var o = new api.ObjectConditions(); | 359 var o = new api.ObjectConditions(); |
360 buildCounterObjectConditions++; | 360 buildCounterObjectConditions++; |
361 if (buildCounterObjectConditions < 3) { | 361 if (buildCounterObjectConditions < 3) { |
362 o.excludePrefixes = buildUnnamed1395(); | 362 o.excludePrefixes = buildUnnamed1412(); |
363 o.includePrefixes = buildUnnamed1396(); | 363 o.includePrefixes = buildUnnamed1413(); |
364 o.maxTimeElapsedSinceLastModification = "foo"; | 364 o.maxTimeElapsedSinceLastModification = "foo"; |
365 o.minTimeElapsedSinceLastModification = "foo"; | 365 o.minTimeElapsedSinceLastModification = "foo"; |
366 } | 366 } |
367 buildCounterObjectConditions--; | 367 buildCounterObjectConditions--; |
368 return o; | 368 return o; |
369 } | 369 } |
370 | 370 |
371 checkObjectConditions(api.ObjectConditions o) { | 371 checkObjectConditions(api.ObjectConditions o) { |
372 buildCounterObjectConditions++; | 372 buildCounterObjectConditions++; |
373 if (buildCounterObjectConditions < 3) { | 373 if (buildCounterObjectConditions < 3) { |
374 checkUnnamed1395(o.excludePrefixes); | 374 checkUnnamed1412(o.excludePrefixes); |
375 checkUnnamed1396(o.includePrefixes); | 375 checkUnnamed1413(o.includePrefixes); |
376 unittest.expect(o.maxTimeElapsedSinceLastModification, unittest.equals('foo'
)); | 376 unittest.expect(o.maxTimeElapsedSinceLastModification, unittest.equals('foo'
)); |
377 unittest.expect(o.minTimeElapsedSinceLastModification, unittest.equals('foo'
)); | 377 unittest.expect(o.minTimeElapsedSinceLastModification, unittest.equals('foo'
)); |
378 } | 378 } |
379 buildCounterObjectConditions--; | 379 buildCounterObjectConditions--; |
380 } | 380 } |
381 | 381 |
382 buildUnnamed1397() { | 382 buildUnnamed1414() { |
383 var o = new core.Map<core.String, core.Object>(); | 383 var o = new core.Map<core.String, core.Object>(); |
384 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 384 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
385 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 385 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
386 return o; | 386 return o; |
387 } | 387 } |
388 | 388 |
389 checkUnnamed1397(core.Map<core.String, core.Object> o) { | 389 checkUnnamed1414(core.Map<core.String, core.Object> o) { |
390 unittest.expect(o, unittest.hasLength(2)); | 390 unittest.expect(o, unittest.hasLength(2)); |
391 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 391 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
392 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 392 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
393 } | 393 } |
394 | 394 |
395 buildUnnamed1398() { | 395 buildUnnamed1415() { |
396 var o = new core.Map<core.String, core.Object>(); | 396 var o = new core.Map<core.String, core.Object>(); |
397 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 397 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
398 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 398 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
399 return o; | 399 return o; |
400 } | 400 } |
401 | 401 |
402 checkUnnamed1398(core.Map<core.String, core.Object> o) { | 402 checkUnnamed1415(core.Map<core.String, core.Object> o) { |
403 unittest.expect(o, unittest.hasLength(2)); | 403 unittest.expect(o, unittest.hasLength(2)); |
404 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 404 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
405 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 405 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
406 } | 406 } |
407 | 407 |
408 core.int buildCounterOperation = 0; | 408 core.int buildCounterOperation = 0; |
409 buildOperation() { | 409 buildOperation() { |
410 var o = new api.Operation(); | 410 var o = new api.Operation(); |
411 buildCounterOperation++; | 411 buildCounterOperation++; |
412 if (buildCounterOperation < 3) { | 412 if (buildCounterOperation < 3) { |
413 o.done = true; | 413 o.done = true; |
414 o.error = buildStatus(); | 414 o.error = buildStatus(); |
415 o.metadata = buildUnnamed1397(); | 415 o.metadata = buildUnnamed1414(); |
416 o.name = "foo"; | 416 o.name = "foo"; |
417 o.response = buildUnnamed1398(); | 417 o.response = buildUnnamed1415(); |
418 } | 418 } |
419 buildCounterOperation--; | 419 buildCounterOperation--; |
420 return o; | 420 return o; |
421 } | 421 } |
422 | 422 |
423 checkOperation(api.Operation o) { | 423 checkOperation(api.Operation o) { |
424 buildCounterOperation++; | 424 buildCounterOperation++; |
425 if (buildCounterOperation < 3) { | 425 if (buildCounterOperation < 3) { |
426 unittest.expect(o.done, unittest.isTrue); | 426 unittest.expect(o.done, unittest.isTrue); |
427 checkStatus(o.error); | 427 checkStatus(o.error); |
428 checkUnnamed1397(o.metadata); | 428 checkUnnamed1414(o.metadata); |
429 unittest.expect(o.name, unittest.equals('foo')); | 429 unittest.expect(o.name, unittest.equals('foo')); |
430 checkUnnamed1398(o.response); | 430 checkUnnamed1415(o.response); |
431 } | 431 } |
432 buildCounterOperation--; | 432 buildCounterOperation--; |
433 } | 433 } |
434 | 434 |
435 core.int buildCounterPauseTransferOperationRequest = 0; | 435 core.int buildCounterPauseTransferOperationRequest = 0; |
436 buildPauseTransferOperationRequest() { | 436 buildPauseTransferOperationRequest() { |
437 var o = new api.PauseTransferOperationRequest(); | 437 var o = new api.PauseTransferOperationRequest(); |
438 buildCounterPauseTransferOperationRequest++; | 438 buildCounterPauseTransferOperationRequest++; |
439 if (buildCounterPauseTransferOperationRequest < 3) { | 439 if (buildCounterPauseTransferOperationRequest < 3) { |
440 } | 440 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 checkSchedule(api.Schedule o) { | 482 checkSchedule(api.Schedule o) { |
483 buildCounterSchedule++; | 483 buildCounterSchedule++; |
484 if (buildCounterSchedule < 3) { | 484 if (buildCounterSchedule < 3) { |
485 checkDate(o.scheduleEndDate); | 485 checkDate(o.scheduleEndDate); |
486 checkDate(o.scheduleStartDate); | 486 checkDate(o.scheduleStartDate); |
487 checkTimeOfDay(o.startTimeOfDay); | 487 checkTimeOfDay(o.startTimeOfDay); |
488 } | 488 } |
489 buildCounterSchedule--; | 489 buildCounterSchedule--; |
490 } | 490 } |
491 | 491 |
492 buildUnnamed1399() { | 492 buildUnnamed1416() { |
493 var o = new core.Map<core.String, core.Object>(); | 493 var o = new core.Map<core.String, core.Object>(); |
494 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 494 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
495 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 495 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
496 return o; | 496 return o; |
497 } | 497 } |
498 | 498 |
499 checkUnnamed1399(core.Map<core.String, core.Object> o) { | 499 checkUnnamed1416(core.Map<core.String, core.Object> o) { |
500 unittest.expect(o, unittest.hasLength(2)); | 500 unittest.expect(o, unittest.hasLength(2)); |
501 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 501 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
502 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 502 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
503 } | 503 } |
504 | 504 |
505 buildUnnamed1400() { | 505 buildUnnamed1417() { |
506 var o = new core.List<core.Map<core.String, core.Object>>(); | 506 var o = new core.List<core.Map<core.String, core.Object>>(); |
507 o.add(buildUnnamed1399()); | 507 o.add(buildUnnamed1416()); |
508 o.add(buildUnnamed1399()); | 508 o.add(buildUnnamed1416()); |
509 return o; | 509 return o; |
510 } | 510 } |
511 | 511 |
512 checkUnnamed1400(core.List<core.Map<core.String, core.Object>> o) { | 512 checkUnnamed1417(core.List<core.Map<core.String, core.Object>> o) { |
513 unittest.expect(o, unittest.hasLength(2)); | 513 unittest.expect(o, unittest.hasLength(2)); |
514 checkUnnamed1399(o[0]); | 514 checkUnnamed1416(o[0]); |
515 checkUnnamed1399(o[1]); | 515 checkUnnamed1416(o[1]); |
516 } | 516 } |
517 | 517 |
518 core.int buildCounterStatus = 0; | 518 core.int buildCounterStatus = 0; |
519 buildStatus() { | 519 buildStatus() { |
520 var o = new api.Status(); | 520 var o = new api.Status(); |
521 buildCounterStatus++; | 521 buildCounterStatus++; |
522 if (buildCounterStatus < 3) { | 522 if (buildCounterStatus < 3) { |
523 o.code = 42; | 523 o.code = 42; |
524 o.details = buildUnnamed1400(); | 524 o.details = buildUnnamed1417(); |
525 o.message = "foo"; | 525 o.message = "foo"; |
526 } | 526 } |
527 buildCounterStatus--; | 527 buildCounterStatus--; |
528 return o; | 528 return o; |
529 } | 529 } |
530 | 530 |
531 checkStatus(api.Status o) { | 531 checkStatus(api.Status o) { |
532 buildCounterStatus++; | 532 buildCounterStatus++; |
533 if (buildCounterStatus < 3) { | 533 if (buildCounterStatus < 3) { |
534 unittest.expect(o.code, unittest.equals(42)); | 534 unittest.expect(o.code, unittest.equals(42)); |
535 checkUnnamed1400(o.details); | 535 checkUnnamed1417(o.details); |
536 unittest.expect(o.message, unittest.equals('foo')); | 536 unittest.expect(o.message, unittest.equals('foo')); |
537 } | 537 } |
538 buildCounterStatus--; | 538 buildCounterStatus--; |
539 } | 539 } |
540 | 540 |
541 core.int buildCounterTimeOfDay = 0; | 541 core.int buildCounterTimeOfDay = 0; |
542 buildTimeOfDay() { | 542 buildTimeOfDay() { |
543 var o = new api.TimeOfDay(); | 543 var o = new api.TimeOfDay(); |
544 buildCounterTimeOfDay++; | 544 buildCounterTimeOfDay++; |
545 if (buildCounterTimeOfDay < 3) { | 545 if (buildCounterTimeOfDay < 3) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 unittest.expect(o.lastModificationTime, unittest.equals('foo')); | 640 unittest.expect(o.lastModificationTime, unittest.equals('foo')); |
641 unittest.expect(o.name, unittest.equals('foo')); | 641 unittest.expect(o.name, unittest.equals('foo')); |
642 unittest.expect(o.projectId, unittest.equals('foo')); | 642 unittest.expect(o.projectId, unittest.equals('foo')); |
643 checkSchedule(o.schedule); | 643 checkSchedule(o.schedule); |
644 unittest.expect(o.status, unittest.equals('foo')); | 644 unittest.expect(o.status, unittest.equals('foo')); |
645 checkTransferSpec(o.transferSpec); | 645 checkTransferSpec(o.transferSpec); |
646 } | 646 } |
647 buildCounterTransferJob--; | 647 buildCounterTransferJob--; |
648 } | 648 } |
649 | 649 |
650 buildUnnamed1401() { | 650 buildUnnamed1418() { |
651 var o = new core.List<api.ErrorSummary>(); | 651 var o = new core.List<api.ErrorSummary>(); |
652 o.add(buildErrorSummary()); | 652 o.add(buildErrorSummary()); |
653 o.add(buildErrorSummary()); | 653 o.add(buildErrorSummary()); |
654 return o; | 654 return o; |
655 } | 655 } |
656 | 656 |
657 checkUnnamed1401(core.List<api.ErrorSummary> o) { | 657 checkUnnamed1418(core.List<api.ErrorSummary> o) { |
658 unittest.expect(o, unittest.hasLength(2)); | 658 unittest.expect(o, unittest.hasLength(2)); |
659 checkErrorSummary(o[0]); | 659 checkErrorSummary(o[0]); |
660 checkErrorSummary(o[1]); | 660 checkErrorSummary(o[1]); |
661 } | 661 } |
662 | 662 |
663 core.int buildCounterTransferOperation = 0; | 663 core.int buildCounterTransferOperation = 0; |
664 buildTransferOperation() { | 664 buildTransferOperation() { |
665 var o = new api.TransferOperation(); | 665 var o = new api.TransferOperation(); |
666 buildCounterTransferOperation++; | 666 buildCounterTransferOperation++; |
667 if (buildCounterTransferOperation < 3) { | 667 if (buildCounterTransferOperation < 3) { |
668 o.counters = buildTransferCounters(); | 668 o.counters = buildTransferCounters(); |
669 o.endTime = "foo"; | 669 o.endTime = "foo"; |
670 o.errorBreakdowns = buildUnnamed1401(); | 670 o.errorBreakdowns = buildUnnamed1418(); |
671 o.name = "foo"; | 671 o.name = "foo"; |
672 o.projectId = "foo"; | 672 o.projectId = "foo"; |
673 o.startTime = "foo"; | 673 o.startTime = "foo"; |
674 o.status = "foo"; | 674 o.status = "foo"; |
675 o.transferJobName = "foo"; | 675 o.transferJobName = "foo"; |
676 o.transferSpec = buildTransferSpec(); | 676 o.transferSpec = buildTransferSpec(); |
677 } | 677 } |
678 buildCounterTransferOperation--; | 678 buildCounterTransferOperation--; |
679 return o; | 679 return o; |
680 } | 680 } |
681 | 681 |
682 checkTransferOperation(api.TransferOperation o) { | 682 checkTransferOperation(api.TransferOperation o) { |
683 buildCounterTransferOperation++; | 683 buildCounterTransferOperation++; |
684 if (buildCounterTransferOperation < 3) { | 684 if (buildCounterTransferOperation < 3) { |
685 checkTransferCounters(o.counters); | 685 checkTransferCounters(o.counters); |
686 unittest.expect(o.endTime, unittest.equals('foo')); | 686 unittest.expect(o.endTime, unittest.equals('foo')); |
687 checkUnnamed1401(o.errorBreakdowns); | 687 checkUnnamed1418(o.errorBreakdowns); |
688 unittest.expect(o.name, unittest.equals('foo')); | 688 unittest.expect(o.name, unittest.equals('foo')); |
689 unittest.expect(o.projectId, unittest.equals('foo')); | 689 unittest.expect(o.projectId, unittest.equals('foo')); |
690 unittest.expect(o.startTime, unittest.equals('foo')); | 690 unittest.expect(o.startTime, unittest.equals('foo')); |
691 unittest.expect(o.status, unittest.equals('foo')); | 691 unittest.expect(o.status, unittest.equals('foo')); |
692 unittest.expect(o.transferJobName, unittest.equals('foo')); | 692 unittest.expect(o.transferJobName, unittest.equals('foo')); |
693 checkTransferSpec(o.transferSpec); | 693 checkTransferSpec(o.transferSpec); |
694 } | 694 } |
695 buildCounterTransferOperation--; | 695 buildCounterTransferOperation--; |
696 } | 696 } |
697 | 697 |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 }), true); | 1131 }), true); |
1132 res.get(arg_jobName, projectId: arg_projectId).then(unittest.expectAsync1(
((api.TransferJob response) { | 1132 res.get(arg_jobName, projectId: arg_projectId).then(unittest.expectAsync1(
((api.TransferJob response) { |
1133 checkTransferJob(response); | 1133 checkTransferJob(response); |
1134 }))); | 1134 }))); |
1135 }); | 1135 }); |
1136 | 1136 |
1137 unittest.test("method--list", () { | 1137 unittest.test("method--list", () { |
1138 | 1138 |
1139 var mock = new HttpServerMock(); | 1139 var mock = new HttpServerMock(); |
1140 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1140 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
| 1141 var arg_filter = "foo"; |
1141 var arg_pageToken = "foo"; | 1142 var arg_pageToken = "foo"; |
1142 var arg_pageSize = 42; | 1143 var arg_pageSize = 42; |
1143 var arg_filter = "foo"; | |
1144 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1144 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1145 var path = (req.url).path; | 1145 var path = (req.url).path; |
1146 var pathOffset = 0; | 1146 var pathOffset = 0; |
1147 var index; | 1147 var index; |
1148 var subPart; | 1148 var subPart; |
1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1150 pathOffset += 1; | 1150 pathOffset += 1; |
1151 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); | 1151 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("v1/transferJobs")); |
1152 pathOffset += 15; | 1152 pathOffset += 15; |
1153 | 1153 |
1154 var query = (req.url).query; | 1154 var query = (req.url).query; |
1155 var queryOffset = 0; | 1155 var queryOffset = 0; |
1156 var queryMap = {}; | 1156 var queryMap = {}; |
1157 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1157 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1158 parseBool(n) { | 1158 parseBool(n) { |
1159 if (n == "true") return true; | 1159 if (n == "true") return true; |
1160 if (n == "false") return false; | 1160 if (n == "false") return false; |
1161 if (n == null) return null; | 1161 if (n == null) return null; |
1162 throw new core.ArgumentError("Invalid boolean: $n"); | 1162 throw new core.ArgumentError("Invalid boolean: $n"); |
1163 } | 1163 } |
1164 if (query.length > 0) { | 1164 if (query.length > 0) { |
1165 for (var part in query.split("&")) { | 1165 for (var part in query.split("&")) { |
1166 var keyvalue = part.split("="); | 1166 var keyvalue = part.split("="); |
1167 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1167 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1168 } | 1168 } |
1169 } | 1169 } |
| 1170 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1170 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1171 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1171 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1172 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1172 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
1173 | 1173 |
1174 | 1174 |
1175 var h = { | 1175 var h = { |
1176 "content-type" : "application/json; charset=utf-8", | 1176 "content-type" : "application/json; charset=utf-8", |
1177 }; | 1177 }; |
1178 var resp = convert.JSON.encode(buildListTransferJobsResponse()); | 1178 var resp = convert.JSON.encode(buildListTransferJobsResponse()); |
1179 return new async.Future.value(stringResponse(200, h, resp)); | 1179 return new async.Future.value(stringResponse(200, h, resp)); |
1180 }), true); | 1180 }), true); |
1181 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize, filter: arg_fil
ter).then(unittest.expectAsync1(((api.ListTransferJobsResponse response) { | 1181 res.list(filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync1(((api.ListTransferJobsResponse response) { |
1182 checkListTransferJobsResponse(response); | 1182 checkListTransferJobsResponse(response); |
1183 }))); | 1183 }))); |
1184 }); | 1184 }); |
1185 | 1185 |
1186 unittest.test("method--patch", () { | 1186 unittest.test("method--patch", () { |
1187 | 1187 |
1188 var mock = new HttpServerMock(); | 1188 var mock = new HttpServerMock(); |
1189 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; | 1189 api.TransferJobsResourceApi res = new api.StoragetransferApi(mock).transfe
rJobs; |
1190 var arg_request = buildUpdateTransferJobRequest(); | 1190 var arg_request = buildUpdateTransferJobRequest(); |
1191 var arg_jobName = "foo"; | 1191 var arg_jobName = "foo"; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { | 1369 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
1370 checkOperation(response); | 1370 checkOperation(response); |
1371 }))); | 1371 }))); |
1372 }); | 1372 }); |
1373 | 1373 |
1374 unittest.test("method--list", () { | 1374 unittest.test("method--list", () { |
1375 | 1375 |
1376 var mock = new HttpServerMock(); | 1376 var mock = new HttpServerMock(); |
1377 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1377 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1378 var arg_name = "foo"; | 1378 var arg_name = "foo"; |
1379 var arg_filter = "foo"; | |
1380 var arg_pageToken = "foo"; | 1379 var arg_pageToken = "foo"; |
1381 var arg_pageSize = 42; | 1380 var arg_pageSize = 42; |
| 1381 var arg_filter = "foo"; |
1382 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1382 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1383 var path = (req.url).path; | 1383 var path = (req.url).path; |
1384 var pathOffset = 0; | 1384 var pathOffset = 0; |
1385 var index; | 1385 var index; |
1386 var subPart; | 1386 var subPart; |
1387 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1387 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1388 pathOffset += 1; | 1388 pathOffset += 1; |
1389 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1389 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
1390 pathOffset += 3; | 1390 pathOffset += 3; |
1391 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1391 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1392 | 1392 |
1393 var query = (req.url).query; | 1393 var query = (req.url).query; |
1394 var queryOffset = 0; | 1394 var queryOffset = 0; |
1395 var queryMap = {}; | 1395 var queryMap = {}; |
1396 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1396 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1397 parseBool(n) { | 1397 parseBool(n) { |
1398 if (n == "true") return true; | 1398 if (n == "true") return true; |
1399 if (n == "false") return false; | 1399 if (n == "false") return false; |
1400 if (n == null) return null; | 1400 if (n == null) return null; |
1401 throw new core.ArgumentError("Invalid boolean: $n"); | 1401 throw new core.ArgumentError("Invalid boolean: $n"); |
1402 } | 1402 } |
1403 if (query.length > 0) { | 1403 if (query.length > 0) { |
1404 for (var part in query.split("&")) { | 1404 for (var part in query.split("&")) { |
1405 var keyvalue = part.split("="); | 1405 var keyvalue = part.split("="); |
1406 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1406 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1407 } | 1407 } |
1408 } | 1408 } |
1409 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | |
1410 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1409 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1411 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1410 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1411 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1412 | 1412 |
1413 | 1413 |
1414 var h = { | 1414 var h = { |
1415 "content-type" : "application/json; charset=utf-8", | 1415 "content-type" : "application/json; charset=utf-8", |
1416 }; | 1416 }; |
1417 var resp = convert.JSON.encode(buildListOperationsResponse()); | 1417 var resp = convert.JSON.encode(buildListOperationsResponse()); |
1418 return new async.Future.value(stringResponse(200, h, resp)); | 1418 return new async.Future.value(stringResponse(200, h, resp)); |
1419 }), true); | 1419 }), true); |
1420 res.list(arg_name, filter: arg_filter, pageToken: arg_pageToken, pageSize:
arg_pageSize).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ | 1420 res.list(arg_name, pageToken: arg_pageToken, pageSize: arg_pageSize, filte
r: arg_filter).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ |
1421 checkListOperationsResponse(response); | 1421 checkListOperationsResponse(response); |
1422 }))); | 1422 }))); |
1423 }); | 1423 }); |
1424 | 1424 |
1425 unittest.test("method--pause", () { | 1425 unittest.test("method--pause", () { |
1426 | 1426 |
1427 var mock = new HttpServerMock(); | 1427 var mock = new HttpServerMock(); |
1428 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; | 1428 api.TransferOperationsResourceApi res = new api.StoragetransferApi(mock).t
ransferOperations; |
1429 var arg_request = buildPauseTransferOperationRequest(); | 1429 var arg_request = buildPauseTransferOperationRequest(); |
1430 var arg_name = "foo"; | 1430 var arg_name = "foo"; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 res.resume(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty r
esponse) { | 1518 res.resume(arg_request, arg_name).then(unittest.expectAsync1(((api.Empty r
esponse) { |
1519 checkEmpty(response); | 1519 checkEmpty(response); |
1520 }))); | 1520 }))); |
1521 }); | 1521 }); |
1522 | 1522 |
1523 }); | 1523 }); |
1524 | 1524 |
1525 | 1525 |
1526 } | 1526 } |
1527 | 1527 |
OLD | NEW |