blob: 77c5991fe79b3b6edb71dad111da59ee7d734c0d [file] [log] [blame]
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001library googleapis.bigquery.v2.test;
2
3import "dart:core" as core;
4import "dart:async" as async;
5import "dart:convert" as convert;
6
7import 'package:http/http.dart' as http;
8import 'package:test/test.dart' as unittest;
9
10import 'package:googleapis/bigquery/v2.dart' as api;
11
12class HttpServerMock extends http.BaseClient {
13 core.Function _callback;
14 core.bool _expectJson;
15
16 void register(core.Function callback, core.bool expectJson) {
17 _callback = callback;
18 _expectJson = expectJson;
19 }
20
21 async.Future<http.StreamedResponse> send(http.BaseRequest request) {
22 if (_expectJson) {
23 return request
24 .finalize()
25 .transform(convert.UTF8.decoder)
26 .join('')
27 .then((core.String jsonString) {
28 if (jsonString.isEmpty) {
29 return _callback(request, null);
30 } else {
31 return _callback(request, convert.JSON.decode(jsonString));
32 }
33 });
34 } else {
35 var stream = request.finalize();
36 if (stream == null) {
37 return _callback(request, []);
38 } else {
39 return stream.toBytes().then((data) {
40 return _callback(request, data);
41 });
42 }
43 }
44 }
45}
46
47http.StreamedResponse stringResponse(core.int status,
48 core.Map<core.String, core.String> headers, core.String body) {
49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
50 return new http.StreamedResponse(stream, status, headers: headers);
51}
52
53core.int buildCounterBigtableColumn = 0;
54buildBigtableColumn() {
55 var o = new api.BigtableColumn();
56 buildCounterBigtableColumn++;
57 if (buildCounterBigtableColumn < 3) {
58 o.encoding = "foo";
59 o.fieldName = "foo";
60 o.onlyReadLatest = true;
61 o.qualifierEncoded = "foo";
62 o.qualifierString = "foo";
63 o.type = "foo";
64 }
65 buildCounterBigtableColumn--;
66 return o;
67}
68
69checkBigtableColumn(api.BigtableColumn o) {
70 buildCounterBigtableColumn++;
71 if (buildCounterBigtableColumn < 3) {
72 unittest.expect(o.encoding, unittest.equals('foo'));
73 unittest.expect(o.fieldName, unittest.equals('foo'));
74 unittest.expect(o.onlyReadLatest, unittest.isTrue);
75 unittest.expect(o.qualifierEncoded, unittest.equals('foo'));
76 unittest.expect(o.qualifierString, unittest.equals('foo'));
77 unittest.expect(o.type, unittest.equals('foo'));
78 }
79 buildCounterBigtableColumn--;
80}
81
Martin Kustermann2a131182017-11-13 13:50:07 +010082buildUnnamed3168() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020083 var o = new core.List<api.BigtableColumn>();
84 o.add(buildBigtableColumn());
85 o.add(buildBigtableColumn());
86 return o;
87}
88
Martin Kustermann2a131182017-11-13 13:50:07 +010089checkUnnamed3168(core.List<api.BigtableColumn> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020090 unittest.expect(o, unittest.hasLength(2));
91 checkBigtableColumn(o[0]);
92 checkBigtableColumn(o[1]);
93}
94
95core.int buildCounterBigtableColumnFamily = 0;
96buildBigtableColumnFamily() {
97 var o = new api.BigtableColumnFamily();
98 buildCounterBigtableColumnFamily++;
99 if (buildCounterBigtableColumnFamily < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100100 o.columns = buildUnnamed3168();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200101 o.encoding = "foo";
102 o.familyId = "foo";
103 o.onlyReadLatest = true;
104 o.type = "foo";
105 }
106 buildCounterBigtableColumnFamily--;
107 return o;
108}
109
110checkBigtableColumnFamily(api.BigtableColumnFamily o) {
111 buildCounterBigtableColumnFamily++;
112 if (buildCounterBigtableColumnFamily < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100113 checkUnnamed3168(o.columns);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200114 unittest.expect(o.encoding, unittest.equals('foo'));
115 unittest.expect(o.familyId, unittest.equals('foo'));
116 unittest.expect(o.onlyReadLatest, unittest.isTrue);
117 unittest.expect(o.type, unittest.equals('foo'));
118 }
119 buildCounterBigtableColumnFamily--;
120}
121
Martin Kustermann2a131182017-11-13 13:50:07 +0100122buildUnnamed3169() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200123 var o = new core.List<api.BigtableColumnFamily>();
124 o.add(buildBigtableColumnFamily());
125 o.add(buildBigtableColumnFamily());
126 return o;
127}
128
Martin Kustermann2a131182017-11-13 13:50:07 +0100129checkUnnamed3169(core.List<api.BigtableColumnFamily> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200130 unittest.expect(o, unittest.hasLength(2));
131 checkBigtableColumnFamily(o[0]);
132 checkBigtableColumnFamily(o[1]);
133}
134
135core.int buildCounterBigtableOptions = 0;
136buildBigtableOptions() {
137 var o = new api.BigtableOptions();
138 buildCounterBigtableOptions++;
139 if (buildCounterBigtableOptions < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100140 o.columnFamilies = buildUnnamed3169();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200141 o.ignoreUnspecifiedColumnFamilies = true;
142 o.readRowkeyAsString = true;
143 }
144 buildCounterBigtableOptions--;
145 return o;
146}
147
148checkBigtableOptions(api.BigtableOptions o) {
149 buildCounterBigtableOptions++;
150 if (buildCounterBigtableOptions < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100151 checkUnnamed3169(o.columnFamilies);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200152 unittest.expect(o.ignoreUnspecifiedColumnFamilies, unittest.isTrue);
153 unittest.expect(o.readRowkeyAsString, unittest.isTrue);
154 }
155 buildCounterBigtableOptions--;
156}
157
158core.int buildCounterCsvOptions = 0;
159buildCsvOptions() {
160 var o = new api.CsvOptions();
161 buildCounterCsvOptions++;
162 if (buildCounterCsvOptions < 3) {
163 o.allowJaggedRows = true;
164 o.allowQuotedNewlines = true;
165 o.encoding = "foo";
166 o.fieldDelimiter = "foo";
167 o.quote = "foo";
168 o.skipLeadingRows = "foo";
169 }
170 buildCounterCsvOptions--;
171 return o;
172}
173
174checkCsvOptions(api.CsvOptions o) {
175 buildCounterCsvOptions++;
176 if (buildCounterCsvOptions < 3) {
177 unittest.expect(o.allowJaggedRows, unittest.isTrue);
178 unittest.expect(o.allowQuotedNewlines, unittest.isTrue);
179 unittest.expect(o.encoding, unittest.equals('foo'));
180 unittest.expect(o.fieldDelimiter, unittest.equals('foo'));
181 unittest.expect(o.quote, unittest.equals('foo'));
182 unittest.expect(o.skipLeadingRows, unittest.equals('foo'));
183 }
184 buildCounterCsvOptions--;
185}
186
187core.int buildCounterDatasetAccess = 0;
188buildDatasetAccess() {
189 var o = new api.DatasetAccess();
190 buildCounterDatasetAccess++;
191 if (buildCounterDatasetAccess < 3) {
192 o.domain = "foo";
193 o.groupByEmail = "foo";
194 o.role = "foo";
195 o.specialGroup = "foo";
196 o.userByEmail = "foo";
197 o.view = buildTableReference();
198 }
199 buildCounterDatasetAccess--;
200 return o;
201}
202
203checkDatasetAccess(api.DatasetAccess o) {
204 buildCounterDatasetAccess++;
205 if (buildCounterDatasetAccess < 3) {
206 unittest.expect(o.domain, unittest.equals('foo'));
207 unittest.expect(o.groupByEmail, unittest.equals('foo'));
208 unittest.expect(o.role, unittest.equals('foo'));
209 unittest.expect(o.specialGroup, unittest.equals('foo'));
210 unittest.expect(o.userByEmail, unittest.equals('foo'));
211 checkTableReference(o.view);
212 }
213 buildCounterDatasetAccess--;
214}
215
Martin Kustermann2a131182017-11-13 13:50:07 +0100216buildUnnamed3170() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200217 var o = new core.List<api.DatasetAccess>();
218 o.add(buildDatasetAccess());
219 o.add(buildDatasetAccess());
220 return o;
221}
222
Martin Kustermann2a131182017-11-13 13:50:07 +0100223checkUnnamed3170(core.List<api.DatasetAccess> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200224 unittest.expect(o, unittest.hasLength(2));
225 checkDatasetAccess(o[0]);
226 checkDatasetAccess(o[1]);
227}
228
Martin Kustermann2a131182017-11-13 13:50:07 +0100229buildUnnamed3171() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200230 var o = new core.Map<core.String, core.String>();
231 o["x"] = "foo";
232 o["y"] = "foo";
233 return o;
234}
235
Martin Kustermann2a131182017-11-13 13:50:07 +0100236checkUnnamed3171(core.Map<core.String, core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200237 unittest.expect(o, unittest.hasLength(2));
238 unittest.expect(o["x"], unittest.equals('foo'));
239 unittest.expect(o["y"], unittest.equals('foo'));
240}
241
242core.int buildCounterDataset = 0;
243buildDataset() {
244 var o = new api.Dataset();
245 buildCounterDataset++;
246 if (buildCounterDataset < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100247 o.access = buildUnnamed3170();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200248 o.creationTime = "foo";
249 o.datasetReference = buildDatasetReference();
250 o.defaultTableExpirationMs = "foo";
251 o.description = "foo";
252 o.etag = "foo";
253 o.friendlyName = "foo";
254 o.id = "foo";
255 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100256 o.labels = buildUnnamed3171();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200257 o.lastModifiedTime = "foo";
258 o.location = "foo";
259 o.selfLink = "foo";
260 }
261 buildCounterDataset--;
262 return o;
263}
264
265checkDataset(api.Dataset o) {
266 buildCounterDataset++;
267 if (buildCounterDataset < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100268 checkUnnamed3170(o.access);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200269 unittest.expect(o.creationTime, unittest.equals('foo'));
270 checkDatasetReference(o.datasetReference);
271 unittest.expect(o.defaultTableExpirationMs, unittest.equals('foo'));
272 unittest.expect(o.description, unittest.equals('foo'));
273 unittest.expect(o.etag, unittest.equals('foo'));
274 unittest.expect(o.friendlyName, unittest.equals('foo'));
275 unittest.expect(o.id, unittest.equals('foo'));
276 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100277 checkUnnamed3171(o.labels);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200278 unittest.expect(o.lastModifiedTime, unittest.equals('foo'));
279 unittest.expect(o.location, unittest.equals('foo'));
280 unittest.expect(o.selfLink, unittest.equals('foo'));
281 }
282 buildCounterDataset--;
283}
284
Martin Kustermann2a131182017-11-13 13:50:07 +0100285buildUnnamed3172() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200286 var o = new core.Map<core.String, core.String>();
287 o["x"] = "foo";
288 o["y"] = "foo";
289 return o;
290}
291
Martin Kustermann2a131182017-11-13 13:50:07 +0100292checkUnnamed3172(core.Map<core.String, core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200293 unittest.expect(o, unittest.hasLength(2));
294 unittest.expect(o["x"], unittest.equals('foo'));
295 unittest.expect(o["y"], unittest.equals('foo'));
296}
297
298core.int buildCounterDatasetListDatasets = 0;
299buildDatasetListDatasets() {
300 var o = new api.DatasetListDatasets();
301 buildCounterDatasetListDatasets++;
302 if (buildCounterDatasetListDatasets < 3) {
303 o.datasetReference = buildDatasetReference();
304 o.friendlyName = "foo";
305 o.id = "foo";
306 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100307 o.labels = buildUnnamed3172();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200308 }
309 buildCounterDatasetListDatasets--;
310 return o;
311}
312
313checkDatasetListDatasets(api.DatasetListDatasets o) {
314 buildCounterDatasetListDatasets++;
315 if (buildCounterDatasetListDatasets < 3) {
316 checkDatasetReference(o.datasetReference);
317 unittest.expect(o.friendlyName, unittest.equals('foo'));
318 unittest.expect(o.id, unittest.equals('foo'));
319 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100320 checkUnnamed3172(o.labels);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200321 }
322 buildCounterDatasetListDatasets--;
323}
324
Martin Kustermann2a131182017-11-13 13:50:07 +0100325buildUnnamed3173() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200326 var o = new core.List<api.DatasetListDatasets>();
327 o.add(buildDatasetListDatasets());
328 o.add(buildDatasetListDatasets());
329 return o;
330}
331
Martin Kustermann2a131182017-11-13 13:50:07 +0100332checkUnnamed3173(core.List<api.DatasetListDatasets> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200333 unittest.expect(o, unittest.hasLength(2));
334 checkDatasetListDatasets(o[0]);
335 checkDatasetListDatasets(o[1]);
336}
337
338core.int buildCounterDatasetList = 0;
339buildDatasetList() {
340 var o = new api.DatasetList();
341 buildCounterDatasetList++;
342 if (buildCounterDatasetList < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100343 o.datasets = buildUnnamed3173();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200344 o.etag = "foo";
345 o.kind = "foo";
346 o.nextPageToken = "foo";
347 }
348 buildCounterDatasetList--;
349 return o;
350}
351
352checkDatasetList(api.DatasetList o) {
353 buildCounterDatasetList++;
354 if (buildCounterDatasetList < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +0100355 checkUnnamed3173(o.datasets);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200356 unittest.expect(o.etag, unittest.equals('foo'));
357 unittest.expect(o.kind, unittest.equals('foo'));
358 unittest.expect(o.nextPageToken, unittest.equals('foo'));
359 }
360 buildCounterDatasetList--;
361}
362
363core.int buildCounterDatasetReference = 0;
364buildDatasetReference() {
365 var o = new api.DatasetReference();
366 buildCounterDatasetReference++;
367 if (buildCounterDatasetReference < 3) {
368 o.datasetId = "foo";
369 o.projectId = "foo";
370 }
371 buildCounterDatasetReference--;
372 return o;
373}
374
375checkDatasetReference(api.DatasetReference o) {
376 buildCounterDatasetReference++;
377 if (buildCounterDatasetReference < 3) {
378 unittest.expect(o.datasetId, unittest.equals('foo'));
379 unittest.expect(o.projectId, unittest.equals('foo'));
380 }
381 buildCounterDatasetReference--;
382}
383
384core.int buildCounterEncryptionConfiguration = 0;
385buildEncryptionConfiguration() {
386 var o = new api.EncryptionConfiguration();
387 buildCounterEncryptionConfiguration++;
388 if (buildCounterEncryptionConfiguration < 3) {
389 o.kmsKeyName = "foo";
390 }
391 buildCounterEncryptionConfiguration--;
392 return o;
393}
394
395checkEncryptionConfiguration(api.EncryptionConfiguration o) {
396 buildCounterEncryptionConfiguration++;
397 if (buildCounterEncryptionConfiguration < 3) {
398 unittest.expect(o.kmsKeyName, unittest.equals('foo'));
399 }
400 buildCounterEncryptionConfiguration--;
401}
402
403core.int buildCounterErrorProto = 0;
404buildErrorProto() {
405 var o = new api.ErrorProto();
406 buildCounterErrorProto++;
407 if (buildCounterErrorProto < 3) {
408 o.debugInfo = "foo";
409 o.location = "foo";
410 o.message = "foo";
411 o.reason = "foo";
412 }
413 buildCounterErrorProto--;
414 return o;
415}
416
417checkErrorProto(api.ErrorProto o) {
418 buildCounterErrorProto++;
419 if (buildCounterErrorProto < 3) {
420 unittest.expect(o.debugInfo, unittest.equals('foo'));
421 unittest.expect(o.location, unittest.equals('foo'));
422 unittest.expect(o.message, unittest.equals('foo'));
423 unittest.expect(o.reason, unittest.equals('foo'));
424 }
425 buildCounterErrorProto--;
426}
427
Martin Kustermann2a131182017-11-13 13:50:07 +0100428buildUnnamed3174() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200429 var o = new core.List<api.ExplainQueryStep>();
430 o.add(buildExplainQueryStep());
431 o.add(buildExplainQueryStep());
432 return o;
433}
434
Martin Kustermann2a131182017-11-13 13:50:07 +0100435checkUnnamed3174(core.List<api.ExplainQueryStep> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200436 unittest.expect(o, unittest.hasLength(2));
437 checkExplainQueryStep(o[0]);
438 checkExplainQueryStep(o[1]);
439}
440
441core.int buildCounterExplainQueryStage = 0;
442buildExplainQueryStage() {
443 var o = new api.ExplainQueryStage();
444 buildCounterExplainQueryStage++;
445 if (buildCounterExplainQueryStage < 3) {
446 o.computeMsAvg = "foo";
447 o.computeMsMax = "foo";
448 o.computeRatioAvg = 42.0;
449 o.computeRatioMax = 42.0;
450 o.id = "foo";
451 o.name = "foo";
452 o.readMsAvg = "foo";
453 o.readMsMax = "foo";
454 o.readRatioAvg = 42.0;
455 o.readRatioMax = 42.0;
456 o.recordsRead = "foo";
457 o.recordsWritten = "foo";
458 o.shuffleOutputBytes = "foo";
459 o.shuffleOutputBytesSpilled = "foo";
460 o.status = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100461 o.steps = buildUnnamed3174();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200462 o.waitMsAvg = "foo";
463 o.waitMsMax = "foo";
464 o.waitRatioAvg = 42.0;
465 o.waitRatioMax = 42.0;
466 o.writeMsAvg = "foo";
467 o.writeMsMax = "foo";
468 o.writeRatioAvg = 42.0;
469 o.writeRatioMax = 42.0;
470 }
471 buildCounterExplainQueryStage--;
472 return o;
473}
474
475checkExplainQueryStage(api.ExplainQueryStage o) {
476 buildCounterExplainQueryStage++;
477 if (buildCounterExplainQueryStage < 3) {
478 unittest.expect(o.computeMsAvg, unittest.equals('foo'));
479 unittest.expect(o.computeMsMax, unittest.equals('foo'));
480 unittest.expect(o.computeRatioAvg, unittest.equals(42.0));
481 unittest.expect(o.computeRatioMax, unittest.equals(42.0));
482 unittest.expect(o.id, unittest.equals('foo'));
483 unittest.expect(o.name, unittest.equals('foo'));
484 unittest.expect(o.readMsAvg, unittest.equals('foo'));
485 unittest.expect(o.readMsMax, unittest.equals('foo'));
486 unittest.expect(o.readRatioAvg, unittest.equals(42.0));
487 unittest.expect(o.readRatioMax, unittest.equals(42.0));
488 unittest.expect(o.recordsRead, unittest.equals('foo'));
489 unittest.expect(o.recordsWritten, unittest.equals('foo'));
490 unittest.expect(o.shuffleOutputBytes, unittest.equals('foo'));
491 unittest.expect(o.shuffleOutputBytesSpilled, unittest.equals('foo'));
492 unittest.expect(o.status, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100493 checkUnnamed3174(o.steps);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200494 unittest.expect(o.waitMsAvg, unittest.equals('foo'));
495 unittest.expect(o.waitMsMax, unittest.equals('foo'));
496 unittest.expect(o.waitRatioAvg, unittest.equals(42.0));
497 unittest.expect(o.waitRatioMax, unittest.equals(42.0));
498 unittest.expect(o.writeMsAvg, unittest.equals('foo'));
499 unittest.expect(o.writeMsMax, unittest.equals('foo'));
500 unittest.expect(o.writeRatioAvg, unittest.equals(42.0));
501 unittest.expect(o.writeRatioMax, unittest.equals(42.0));
502 }
503 buildCounterExplainQueryStage--;
504}
505
Martin Kustermann2a131182017-11-13 13:50:07 +0100506buildUnnamed3175() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200507 var o = new core.List<core.String>();
508 o.add("foo");
509 o.add("foo");
510 return o;
511}
512
Martin Kustermann2a131182017-11-13 13:50:07 +0100513checkUnnamed3175(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200514 unittest.expect(o, unittest.hasLength(2));
515 unittest.expect(o[0], unittest.equals('foo'));
516 unittest.expect(o[1], unittest.equals('foo'));
517}
518
519core.int buildCounterExplainQueryStep = 0;
520buildExplainQueryStep() {
521 var o = new api.ExplainQueryStep();
522 buildCounterExplainQueryStep++;
523 if (buildCounterExplainQueryStep < 3) {
524 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100525 o.substeps = buildUnnamed3175();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200526 }
527 buildCounterExplainQueryStep--;
528 return o;
529}
530
531checkExplainQueryStep(api.ExplainQueryStep o) {
532 buildCounterExplainQueryStep++;
533 if (buildCounterExplainQueryStep < 3) {
534 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100535 checkUnnamed3175(o.substeps);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200536 }
537 buildCounterExplainQueryStep--;
538}
539
Martin Kustermann2a131182017-11-13 13:50:07 +0100540buildUnnamed3176() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200541 var o = new core.List<core.String>();
542 o.add("foo");
543 o.add("foo");
544 return o;
545}
546
Martin Kustermann2a131182017-11-13 13:50:07 +0100547checkUnnamed3176(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200548 unittest.expect(o, unittest.hasLength(2));
549 unittest.expect(o[0], unittest.equals('foo'));
550 unittest.expect(o[1], unittest.equals('foo'));
551}
552
553core.int buildCounterExternalDataConfiguration = 0;
554buildExternalDataConfiguration() {
555 var o = new api.ExternalDataConfiguration();
556 buildCounterExternalDataConfiguration++;
557 if (buildCounterExternalDataConfiguration < 3) {
558 o.autodetect = true;
559 o.bigtableOptions = buildBigtableOptions();
560 o.compression = "foo";
561 o.csvOptions = buildCsvOptions();
562 o.googleSheetsOptions = buildGoogleSheetsOptions();
563 o.ignoreUnknownValues = true;
564 o.maxBadRecords = 42;
565 o.schema = buildTableSchema();
566 o.sourceFormat = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100567 o.sourceUris = buildUnnamed3176();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200568 }
569 buildCounterExternalDataConfiguration--;
570 return o;
571}
572
573checkExternalDataConfiguration(api.ExternalDataConfiguration o) {
574 buildCounterExternalDataConfiguration++;
575 if (buildCounterExternalDataConfiguration < 3) {
576 unittest.expect(o.autodetect, unittest.isTrue);
577 checkBigtableOptions(o.bigtableOptions);
578 unittest.expect(o.compression, unittest.equals('foo'));
579 checkCsvOptions(o.csvOptions);
580 checkGoogleSheetsOptions(o.googleSheetsOptions);
581 unittest.expect(o.ignoreUnknownValues, unittest.isTrue);
582 unittest.expect(o.maxBadRecords, unittest.equals(42));
583 checkTableSchema(o.schema);
584 unittest.expect(o.sourceFormat, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100585 checkUnnamed3176(o.sourceUris);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200586 }
587 buildCounterExternalDataConfiguration--;
588}
589
Martin Kustermann2a131182017-11-13 13:50:07 +0100590buildUnnamed3177() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200591 var o = new core.List<api.ErrorProto>();
592 o.add(buildErrorProto());
593 o.add(buildErrorProto());
594 return o;
595}
596
Martin Kustermann2a131182017-11-13 13:50:07 +0100597checkUnnamed3177(core.List<api.ErrorProto> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200598 unittest.expect(o, unittest.hasLength(2));
599 checkErrorProto(o[0]);
600 checkErrorProto(o[1]);
601}
602
Martin Kustermann2a131182017-11-13 13:50:07 +0100603buildUnnamed3178() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200604 var o = new core.List<api.TableRow>();
605 o.add(buildTableRow());
606 o.add(buildTableRow());
607 return o;
608}
609
Martin Kustermann2a131182017-11-13 13:50:07 +0100610checkUnnamed3178(core.List<api.TableRow> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200611 unittest.expect(o, unittest.hasLength(2));
612 checkTableRow(o[0]);
613 checkTableRow(o[1]);
614}
615
616core.int buildCounterGetQueryResultsResponse = 0;
617buildGetQueryResultsResponse() {
618 var o = new api.GetQueryResultsResponse();
619 buildCounterGetQueryResultsResponse++;
620 if (buildCounterGetQueryResultsResponse < 3) {
621 o.cacheHit = true;
Martin Kustermann2a131182017-11-13 13:50:07 +0100622 o.errors = buildUnnamed3177();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200623 o.etag = "foo";
624 o.jobComplete = true;
625 o.jobReference = buildJobReference();
626 o.kind = "foo";
627 o.numDmlAffectedRows = "foo";
628 o.pageToken = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100629 o.rows = buildUnnamed3178();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200630 o.schema = buildTableSchema();
631 o.totalBytesProcessed = "foo";
632 o.totalRows = "foo";
633 }
634 buildCounterGetQueryResultsResponse--;
635 return o;
636}
637
638checkGetQueryResultsResponse(api.GetQueryResultsResponse o) {
639 buildCounterGetQueryResultsResponse++;
640 if (buildCounterGetQueryResultsResponse < 3) {
641 unittest.expect(o.cacheHit, unittest.isTrue);
Martin Kustermann2a131182017-11-13 13:50:07 +0100642 checkUnnamed3177(o.errors);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200643 unittest.expect(o.etag, unittest.equals('foo'));
644 unittest.expect(o.jobComplete, unittest.isTrue);
645 checkJobReference(o.jobReference);
646 unittest.expect(o.kind, unittest.equals('foo'));
647 unittest.expect(o.numDmlAffectedRows, unittest.equals('foo'));
648 unittest.expect(o.pageToken, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100649 checkUnnamed3178(o.rows);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200650 checkTableSchema(o.schema);
651 unittest.expect(o.totalBytesProcessed, unittest.equals('foo'));
652 unittest.expect(o.totalRows, unittest.equals('foo'));
653 }
654 buildCounterGetQueryResultsResponse--;
655}
656
657core.int buildCounterGetServiceAccountResponse = 0;
658buildGetServiceAccountResponse() {
659 var o = new api.GetServiceAccountResponse();
660 buildCounterGetServiceAccountResponse++;
661 if (buildCounterGetServiceAccountResponse < 3) {
662 o.email = "foo";
663 o.kind = "foo";
664 }
665 buildCounterGetServiceAccountResponse--;
666 return o;
667}
668
669checkGetServiceAccountResponse(api.GetServiceAccountResponse o) {
670 buildCounterGetServiceAccountResponse++;
671 if (buildCounterGetServiceAccountResponse < 3) {
672 unittest.expect(o.email, unittest.equals('foo'));
673 unittest.expect(o.kind, unittest.equals('foo'));
674 }
675 buildCounterGetServiceAccountResponse--;
676}
677
678core.int buildCounterGoogleSheetsOptions = 0;
679buildGoogleSheetsOptions() {
680 var o = new api.GoogleSheetsOptions();
681 buildCounterGoogleSheetsOptions++;
682 if (buildCounterGoogleSheetsOptions < 3) {
683 o.skipLeadingRows = "foo";
684 }
685 buildCounterGoogleSheetsOptions--;
686 return o;
687}
688
689checkGoogleSheetsOptions(api.GoogleSheetsOptions o) {
690 buildCounterGoogleSheetsOptions++;
691 if (buildCounterGoogleSheetsOptions < 3) {
692 unittest.expect(o.skipLeadingRows, unittest.equals('foo'));
693 }
694 buildCounterGoogleSheetsOptions--;
695}
696
697core.int buildCounterJob = 0;
698buildJob() {
699 var o = new api.Job();
700 buildCounterJob++;
701 if (buildCounterJob < 3) {
702 o.configuration = buildJobConfiguration();
703 o.etag = "foo";
704 o.id = "foo";
705 o.jobReference = buildJobReference();
706 o.kind = "foo";
707 o.selfLink = "foo";
708 o.statistics = buildJobStatistics();
709 o.status = buildJobStatus();
710 o.userEmail = "foo";
711 }
712 buildCounterJob--;
713 return o;
714}
715
716checkJob(api.Job o) {
717 buildCounterJob++;
718 if (buildCounterJob < 3) {
719 checkJobConfiguration(o.configuration);
720 unittest.expect(o.etag, unittest.equals('foo'));
721 unittest.expect(o.id, unittest.equals('foo'));
722 checkJobReference(o.jobReference);
723 unittest.expect(o.kind, unittest.equals('foo'));
724 unittest.expect(o.selfLink, unittest.equals('foo'));
725 checkJobStatistics(o.statistics);
726 checkJobStatus(o.status);
727 unittest.expect(o.userEmail, unittest.equals('foo'));
728 }
729 buildCounterJob--;
730}
731
732core.int buildCounterJobCancelResponse = 0;
733buildJobCancelResponse() {
734 var o = new api.JobCancelResponse();
735 buildCounterJobCancelResponse++;
736 if (buildCounterJobCancelResponse < 3) {
737 o.job = buildJob();
738 o.kind = "foo";
739 }
740 buildCounterJobCancelResponse--;
741 return o;
742}
743
744checkJobCancelResponse(api.JobCancelResponse o) {
745 buildCounterJobCancelResponse++;
746 if (buildCounterJobCancelResponse < 3) {
747 checkJob(o.job);
748 unittest.expect(o.kind, unittest.equals('foo'));
749 }
750 buildCounterJobCancelResponse--;
751}
752
Martin Kustermann2a131182017-11-13 13:50:07 +0100753buildUnnamed3179() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200754 var o = new core.Map<core.String, core.String>();
755 o["x"] = "foo";
756 o["y"] = "foo";
757 return o;
758}
759
Martin Kustermann2a131182017-11-13 13:50:07 +0100760checkUnnamed3179(core.Map<core.String, core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200761 unittest.expect(o, unittest.hasLength(2));
762 unittest.expect(o["x"], unittest.equals('foo'));
763 unittest.expect(o["y"], unittest.equals('foo'));
764}
765
766core.int buildCounterJobConfiguration = 0;
767buildJobConfiguration() {
768 var o = new api.JobConfiguration();
769 buildCounterJobConfiguration++;
770 if (buildCounterJobConfiguration < 3) {
771 o.copy = buildJobConfigurationTableCopy();
772 o.dryRun = true;
773 o.extract = buildJobConfigurationExtract();
Martin Kustermann2a131182017-11-13 13:50:07 +0100774 o.labels = buildUnnamed3179();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200775 o.load = buildJobConfigurationLoad();
776 o.query = buildJobConfigurationQuery();
777 }
778 buildCounterJobConfiguration--;
779 return o;
780}
781
782checkJobConfiguration(api.JobConfiguration o) {
783 buildCounterJobConfiguration++;
784 if (buildCounterJobConfiguration < 3) {
785 checkJobConfigurationTableCopy(o.copy);
786 unittest.expect(o.dryRun, unittest.isTrue);
787 checkJobConfigurationExtract(o.extract);
Martin Kustermann2a131182017-11-13 13:50:07 +0100788 checkUnnamed3179(o.labels);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200789 checkJobConfigurationLoad(o.load);
790 checkJobConfigurationQuery(o.query);
791 }
792 buildCounterJobConfiguration--;
793}
794
Martin Kustermann2a131182017-11-13 13:50:07 +0100795buildUnnamed3180() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200796 var o = new core.List<core.String>();
797 o.add("foo");
798 o.add("foo");
799 return o;
800}
801
Martin Kustermann2a131182017-11-13 13:50:07 +0100802checkUnnamed3180(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200803 unittest.expect(o, unittest.hasLength(2));
804 unittest.expect(o[0], unittest.equals('foo'));
805 unittest.expect(o[1], unittest.equals('foo'));
806}
807
808core.int buildCounterJobConfigurationExtract = 0;
809buildJobConfigurationExtract() {
810 var o = new api.JobConfigurationExtract();
811 buildCounterJobConfigurationExtract++;
812 if (buildCounterJobConfigurationExtract < 3) {
813 o.compression = "foo";
814 o.destinationFormat = "foo";
815 o.destinationUri = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100816 o.destinationUris = buildUnnamed3180();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200817 o.fieldDelimiter = "foo";
818 o.printHeader = true;
819 o.sourceTable = buildTableReference();
820 }
821 buildCounterJobConfigurationExtract--;
822 return o;
823}
824
825checkJobConfigurationExtract(api.JobConfigurationExtract o) {
826 buildCounterJobConfigurationExtract++;
827 if (buildCounterJobConfigurationExtract < 3) {
828 unittest.expect(o.compression, unittest.equals('foo'));
829 unittest.expect(o.destinationFormat, unittest.equals('foo'));
830 unittest.expect(o.destinationUri, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100831 checkUnnamed3180(o.destinationUris);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200832 unittest.expect(o.fieldDelimiter, unittest.equals('foo'));
833 unittest.expect(o.printHeader, unittest.isTrue);
834 checkTableReference(o.sourceTable);
835 }
836 buildCounterJobConfigurationExtract--;
837}
838
Martin Kustermann2a131182017-11-13 13:50:07 +0100839buildUnnamed3181() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200840 var o = new core.List<core.String>();
841 o.add("foo");
842 o.add("foo");
843 return o;
844}
845
Martin Kustermann2a131182017-11-13 13:50:07 +0100846checkUnnamed3181(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200847 unittest.expect(o, unittest.hasLength(2));
848 unittest.expect(o[0], unittest.equals('foo'));
849 unittest.expect(o[1], unittest.equals('foo'));
850}
851
Martin Kustermann2a131182017-11-13 13:50:07 +0100852buildUnnamed3182() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200853 var o = new core.List<core.String>();
854 o.add("foo");
855 o.add("foo");
856 return o;
857}
858
Martin Kustermann2a131182017-11-13 13:50:07 +0100859checkUnnamed3182(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200860 unittest.expect(o, unittest.hasLength(2));
861 unittest.expect(o[0], unittest.equals('foo'));
862 unittest.expect(o[1], unittest.equals('foo'));
863}
864
Martin Kustermann2a131182017-11-13 13:50:07 +0100865buildUnnamed3183() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200866 var o = new core.List<core.String>();
867 o.add("foo");
868 o.add("foo");
869 return o;
870}
871
Martin Kustermann2a131182017-11-13 13:50:07 +0100872checkUnnamed3183(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200873 unittest.expect(o, unittest.hasLength(2));
874 unittest.expect(o[0], unittest.equals('foo'));
875 unittest.expect(o[1], unittest.equals('foo'));
876}
877
878core.int buildCounterJobConfigurationLoad = 0;
879buildJobConfigurationLoad() {
880 var o = new api.JobConfigurationLoad();
881 buildCounterJobConfigurationLoad++;
882 if (buildCounterJobConfigurationLoad < 3) {
883 o.allowJaggedRows = true;
884 o.allowQuotedNewlines = true;
885 o.autodetect = true;
886 o.createDisposition = "foo";
887 o.destinationEncryptionConfiguration = buildEncryptionConfiguration();
888 o.destinationTable = buildTableReference();
889 o.encoding = "foo";
890 o.fieldDelimiter = "foo";
891 o.ignoreUnknownValues = true;
892 o.maxBadRecords = 42;
893 o.nullMarker = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100894 o.projectionFields = buildUnnamed3181();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200895 o.quote = "foo";
896 o.schema = buildTableSchema();
897 o.schemaInline = "foo";
898 o.schemaInlineFormat = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100899 o.schemaUpdateOptions = buildUnnamed3182();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200900 o.skipLeadingRows = 42;
901 o.sourceFormat = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +0100902 o.sourceUris = buildUnnamed3183();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200903 o.timePartitioning = buildTimePartitioning();
904 o.writeDisposition = "foo";
905 }
906 buildCounterJobConfigurationLoad--;
907 return o;
908}
909
910checkJobConfigurationLoad(api.JobConfigurationLoad o) {
911 buildCounterJobConfigurationLoad++;
912 if (buildCounterJobConfigurationLoad < 3) {
913 unittest.expect(o.allowJaggedRows, unittest.isTrue);
914 unittest.expect(o.allowQuotedNewlines, unittest.isTrue);
915 unittest.expect(o.autodetect, unittest.isTrue);
916 unittest.expect(o.createDisposition, unittest.equals('foo'));
917 checkEncryptionConfiguration(o.destinationEncryptionConfiguration);
918 checkTableReference(o.destinationTable);
919 unittest.expect(o.encoding, unittest.equals('foo'));
920 unittest.expect(o.fieldDelimiter, unittest.equals('foo'));
921 unittest.expect(o.ignoreUnknownValues, unittest.isTrue);
922 unittest.expect(o.maxBadRecords, unittest.equals(42));
923 unittest.expect(o.nullMarker, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100924 checkUnnamed3181(o.projectionFields);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200925 unittest.expect(o.quote, unittest.equals('foo'));
926 checkTableSchema(o.schema);
927 unittest.expect(o.schemaInline, unittest.equals('foo'));
928 unittest.expect(o.schemaInlineFormat, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100929 checkUnnamed3182(o.schemaUpdateOptions);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200930 unittest.expect(o.skipLeadingRows, unittest.equals(42));
931 unittest.expect(o.sourceFormat, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +0100932 checkUnnamed3183(o.sourceUris);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200933 checkTimePartitioning(o.timePartitioning);
934 unittest.expect(o.writeDisposition, unittest.equals('foo'));
935 }
936 buildCounterJobConfigurationLoad--;
937}
938
Martin Kustermann2a131182017-11-13 13:50:07 +0100939buildUnnamed3184() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200940 var o = new core.List<api.QueryParameter>();
941 o.add(buildQueryParameter());
942 o.add(buildQueryParameter());
943 return o;
944}
945
Martin Kustermann2a131182017-11-13 13:50:07 +0100946checkUnnamed3184(core.List<api.QueryParameter> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200947 unittest.expect(o, unittest.hasLength(2));
948 checkQueryParameter(o[0]);
949 checkQueryParameter(o[1]);
950}
951
Martin Kustermann2a131182017-11-13 13:50:07 +0100952buildUnnamed3185() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200953 var o = new core.List<core.String>();
954 o.add("foo");
955 o.add("foo");
956 return o;
957}
958
Martin Kustermann2a131182017-11-13 13:50:07 +0100959checkUnnamed3185(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200960 unittest.expect(o, unittest.hasLength(2));
961 unittest.expect(o[0], unittest.equals('foo'));
962 unittest.expect(o[1], unittest.equals('foo'));
963}
964
Martin Kustermann2a131182017-11-13 13:50:07 +0100965buildUnnamed3186() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200966 var o = new core.Map<core.String, api.ExternalDataConfiguration>();
967 o["x"] = buildExternalDataConfiguration();
968 o["y"] = buildExternalDataConfiguration();
969 return o;
970}
971
Martin Kustermann2a131182017-11-13 13:50:07 +0100972checkUnnamed3186(core.Map<core.String, api.ExternalDataConfiguration> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200973 unittest.expect(o, unittest.hasLength(2));
974 checkExternalDataConfiguration(o["x"]);
975 checkExternalDataConfiguration(o["y"]);
976}
977
Martin Kustermann2a131182017-11-13 13:50:07 +0100978buildUnnamed3187() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200979 var o = new core.List<api.UserDefinedFunctionResource>();
980 o.add(buildUserDefinedFunctionResource());
981 o.add(buildUserDefinedFunctionResource());
982 return o;
983}
984
Martin Kustermann2a131182017-11-13 13:50:07 +0100985checkUnnamed3187(core.List<api.UserDefinedFunctionResource> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200986 unittest.expect(o, unittest.hasLength(2));
987 checkUserDefinedFunctionResource(o[0]);
988 checkUserDefinedFunctionResource(o[1]);
989}
990
991core.int buildCounterJobConfigurationQuery = 0;
992buildJobConfigurationQuery() {
993 var o = new api.JobConfigurationQuery();
994 buildCounterJobConfigurationQuery++;
995 if (buildCounterJobConfigurationQuery < 3) {
996 o.allowLargeResults = true;
997 o.createDisposition = "foo";
998 o.defaultDataset = buildDatasetReference();
999 o.destinationEncryptionConfiguration = buildEncryptionConfiguration();
1000 o.destinationTable = buildTableReference();
1001 o.flattenResults = true;
1002 o.maximumBillingTier = 42;
1003 o.maximumBytesBilled = "foo";
1004 o.parameterMode = "foo";
1005 o.preserveNulls = true;
1006 o.priority = "foo";
1007 o.query = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001008 o.queryParameters = buildUnnamed3184();
1009 o.schemaUpdateOptions = buildUnnamed3185();
1010 o.tableDefinitions = buildUnnamed3186();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001011 o.timePartitioning = buildTimePartitioning();
1012 o.useLegacySql = true;
1013 o.useQueryCache = true;
Martin Kustermann2a131182017-11-13 13:50:07 +01001014 o.userDefinedFunctionResources = buildUnnamed3187();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001015 o.writeDisposition = "foo";
1016 }
1017 buildCounterJobConfigurationQuery--;
1018 return o;
1019}
1020
1021checkJobConfigurationQuery(api.JobConfigurationQuery o) {
1022 buildCounterJobConfigurationQuery++;
1023 if (buildCounterJobConfigurationQuery < 3) {
1024 unittest.expect(o.allowLargeResults, unittest.isTrue);
1025 unittest.expect(o.createDisposition, unittest.equals('foo'));
1026 checkDatasetReference(o.defaultDataset);
1027 checkEncryptionConfiguration(o.destinationEncryptionConfiguration);
1028 checkTableReference(o.destinationTable);
1029 unittest.expect(o.flattenResults, unittest.isTrue);
1030 unittest.expect(o.maximumBillingTier, unittest.equals(42));
1031 unittest.expect(o.maximumBytesBilled, unittest.equals('foo'));
1032 unittest.expect(o.parameterMode, unittest.equals('foo'));
1033 unittest.expect(o.preserveNulls, unittest.isTrue);
1034 unittest.expect(o.priority, unittest.equals('foo'));
1035 unittest.expect(o.query, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001036 checkUnnamed3184(o.queryParameters);
1037 checkUnnamed3185(o.schemaUpdateOptions);
1038 checkUnnamed3186(o.tableDefinitions);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001039 checkTimePartitioning(o.timePartitioning);
1040 unittest.expect(o.useLegacySql, unittest.isTrue);
1041 unittest.expect(o.useQueryCache, unittest.isTrue);
Martin Kustermann2a131182017-11-13 13:50:07 +01001042 checkUnnamed3187(o.userDefinedFunctionResources);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001043 unittest.expect(o.writeDisposition, unittest.equals('foo'));
1044 }
1045 buildCounterJobConfigurationQuery--;
1046}
1047
Martin Kustermann2a131182017-11-13 13:50:07 +01001048buildUnnamed3188() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001049 var o = new core.List<api.TableReference>();
1050 o.add(buildTableReference());
1051 o.add(buildTableReference());
1052 return o;
1053}
1054
Martin Kustermann2a131182017-11-13 13:50:07 +01001055checkUnnamed3188(core.List<api.TableReference> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001056 unittest.expect(o, unittest.hasLength(2));
1057 checkTableReference(o[0]);
1058 checkTableReference(o[1]);
1059}
1060
1061core.int buildCounterJobConfigurationTableCopy = 0;
1062buildJobConfigurationTableCopy() {
1063 var o = new api.JobConfigurationTableCopy();
1064 buildCounterJobConfigurationTableCopy++;
1065 if (buildCounterJobConfigurationTableCopy < 3) {
1066 o.createDisposition = "foo";
1067 o.destinationEncryptionConfiguration = buildEncryptionConfiguration();
1068 o.destinationTable = buildTableReference();
1069 o.sourceTable = buildTableReference();
Martin Kustermann2a131182017-11-13 13:50:07 +01001070 o.sourceTables = buildUnnamed3188();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001071 o.writeDisposition = "foo";
1072 }
1073 buildCounterJobConfigurationTableCopy--;
1074 return o;
1075}
1076
1077checkJobConfigurationTableCopy(api.JobConfigurationTableCopy o) {
1078 buildCounterJobConfigurationTableCopy++;
1079 if (buildCounterJobConfigurationTableCopy < 3) {
1080 unittest.expect(o.createDisposition, unittest.equals('foo'));
1081 checkEncryptionConfiguration(o.destinationEncryptionConfiguration);
1082 checkTableReference(o.destinationTable);
1083 checkTableReference(o.sourceTable);
Martin Kustermann2a131182017-11-13 13:50:07 +01001084 checkUnnamed3188(o.sourceTables);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001085 unittest.expect(o.writeDisposition, unittest.equals('foo'));
1086 }
1087 buildCounterJobConfigurationTableCopy--;
1088}
1089
1090core.int buildCounterJobListJobs = 0;
1091buildJobListJobs() {
1092 var o = new api.JobListJobs();
1093 buildCounterJobListJobs++;
1094 if (buildCounterJobListJobs < 3) {
1095 o.configuration = buildJobConfiguration();
1096 o.errorResult = buildErrorProto();
1097 o.id = "foo";
1098 o.jobReference = buildJobReference();
1099 o.kind = "foo";
1100 o.state = "foo";
1101 o.statistics = buildJobStatistics();
1102 o.status = buildJobStatus();
1103 o.userEmail = "foo";
1104 }
1105 buildCounterJobListJobs--;
1106 return o;
1107}
1108
1109checkJobListJobs(api.JobListJobs o) {
1110 buildCounterJobListJobs++;
1111 if (buildCounterJobListJobs < 3) {
1112 checkJobConfiguration(o.configuration);
1113 checkErrorProto(o.errorResult);
1114 unittest.expect(o.id, unittest.equals('foo'));
1115 checkJobReference(o.jobReference);
1116 unittest.expect(o.kind, unittest.equals('foo'));
1117 unittest.expect(o.state, unittest.equals('foo'));
1118 checkJobStatistics(o.statistics);
1119 checkJobStatus(o.status);
1120 unittest.expect(o.userEmail, unittest.equals('foo'));
1121 }
1122 buildCounterJobListJobs--;
1123}
1124
Martin Kustermann2a131182017-11-13 13:50:07 +01001125buildUnnamed3189() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001126 var o = new core.List<api.JobListJobs>();
1127 o.add(buildJobListJobs());
1128 o.add(buildJobListJobs());
1129 return o;
1130}
1131
Martin Kustermann2a131182017-11-13 13:50:07 +01001132checkUnnamed3189(core.List<api.JobListJobs> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001133 unittest.expect(o, unittest.hasLength(2));
1134 checkJobListJobs(o[0]);
1135 checkJobListJobs(o[1]);
1136}
1137
1138core.int buildCounterJobList = 0;
1139buildJobList() {
1140 var o = new api.JobList();
1141 buildCounterJobList++;
1142 if (buildCounterJobList < 3) {
1143 o.etag = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001144 o.jobs = buildUnnamed3189();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001145 o.kind = "foo";
1146 o.nextPageToken = "foo";
1147 }
1148 buildCounterJobList--;
1149 return o;
1150}
1151
1152checkJobList(api.JobList o) {
1153 buildCounterJobList++;
1154 if (buildCounterJobList < 3) {
1155 unittest.expect(o.etag, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001156 checkUnnamed3189(o.jobs);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001157 unittest.expect(o.kind, unittest.equals('foo'));
1158 unittest.expect(o.nextPageToken, unittest.equals('foo'));
1159 }
1160 buildCounterJobList--;
1161}
1162
1163core.int buildCounterJobReference = 0;
1164buildJobReference() {
1165 var o = new api.JobReference();
1166 buildCounterJobReference++;
1167 if (buildCounterJobReference < 3) {
1168 o.jobId = "foo";
1169 o.projectId = "foo";
1170 }
1171 buildCounterJobReference--;
1172 return o;
1173}
1174
1175checkJobReference(api.JobReference o) {
1176 buildCounterJobReference++;
1177 if (buildCounterJobReference < 3) {
1178 unittest.expect(o.jobId, unittest.equals('foo'));
1179 unittest.expect(o.projectId, unittest.equals('foo'));
1180 }
1181 buildCounterJobReference--;
1182}
1183
1184core.int buildCounterJobStatistics = 0;
1185buildJobStatistics() {
1186 var o = new api.JobStatistics();
1187 buildCounterJobStatistics++;
1188 if (buildCounterJobStatistics < 3) {
1189 o.creationTime = "foo";
1190 o.endTime = "foo";
1191 o.extract = buildJobStatistics4();
1192 o.load = buildJobStatistics3();
1193 o.query = buildJobStatistics2();
1194 o.startTime = "foo";
1195 o.totalBytesProcessed = "foo";
1196 }
1197 buildCounterJobStatistics--;
1198 return o;
1199}
1200
1201checkJobStatistics(api.JobStatistics o) {
1202 buildCounterJobStatistics++;
1203 if (buildCounterJobStatistics < 3) {
1204 unittest.expect(o.creationTime, unittest.equals('foo'));
1205 unittest.expect(o.endTime, unittest.equals('foo'));
1206 checkJobStatistics4(o.extract);
1207 checkJobStatistics3(o.load);
1208 checkJobStatistics2(o.query);
1209 unittest.expect(o.startTime, unittest.equals('foo'));
1210 unittest.expect(o.totalBytesProcessed, unittest.equals('foo'));
1211 }
1212 buildCounterJobStatistics--;
1213}
1214
Martin Kustermann2a131182017-11-13 13:50:07 +01001215buildUnnamed3190() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001216 var o = new core.List<api.ExplainQueryStage>();
1217 o.add(buildExplainQueryStage());
1218 o.add(buildExplainQueryStage());
1219 return o;
1220}
1221
Martin Kustermann2a131182017-11-13 13:50:07 +01001222checkUnnamed3190(core.List<api.ExplainQueryStage> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001223 unittest.expect(o, unittest.hasLength(2));
1224 checkExplainQueryStage(o[0]);
1225 checkExplainQueryStage(o[1]);
1226}
1227
Martin Kustermann2a131182017-11-13 13:50:07 +01001228buildUnnamed3191() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001229 var o = new core.List<api.TableReference>();
1230 o.add(buildTableReference());
1231 o.add(buildTableReference());
1232 return o;
1233}
1234
Martin Kustermann2a131182017-11-13 13:50:07 +01001235checkUnnamed3191(core.List<api.TableReference> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001236 unittest.expect(o, unittest.hasLength(2));
1237 checkTableReference(o[0]);
1238 checkTableReference(o[1]);
1239}
1240
Martin Kustermann2a131182017-11-13 13:50:07 +01001241buildUnnamed3192() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001242 var o = new core.List<api.QueryParameter>();
1243 o.add(buildQueryParameter());
1244 o.add(buildQueryParameter());
1245 return o;
1246}
1247
Martin Kustermann2a131182017-11-13 13:50:07 +01001248checkUnnamed3192(core.List<api.QueryParameter> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001249 unittest.expect(o, unittest.hasLength(2));
1250 checkQueryParameter(o[0]);
1251 checkQueryParameter(o[1]);
1252}
1253
1254core.int buildCounterJobStatistics2 = 0;
1255buildJobStatistics2() {
1256 var o = new api.JobStatistics2();
1257 buildCounterJobStatistics2++;
1258 if (buildCounterJobStatistics2 < 3) {
1259 o.billingTier = 42;
1260 o.cacheHit = true;
Martin Kustermann2a131182017-11-13 13:50:07 +01001261 o.ddlOperationPerformed = "foo";
1262 o.ddlTargetTable = buildTableReference();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001263 o.numDmlAffectedRows = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001264 o.queryPlan = buildUnnamed3190();
1265 o.referencedTables = buildUnnamed3191();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001266 o.schema = buildTableSchema();
1267 o.statementType = "foo";
1268 o.totalBytesBilled = "foo";
1269 o.totalBytesProcessed = "foo";
1270 o.totalSlotMs = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001271 o.undeclaredQueryParameters = buildUnnamed3192();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001272 }
1273 buildCounterJobStatistics2--;
1274 return o;
1275}
1276
1277checkJobStatistics2(api.JobStatistics2 o) {
1278 buildCounterJobStatistics2++;
1279 if (buildCounterJobStatistics2 < 3) {
1280 unittest.expect(o.billingTier, unittest.equals(42));
1281 unittest.expect(o.cacheHit, unittest.isTrue);
Martin Kustermann2a131182017-11-13 13:50:07 +01001282 unittest.expect(o.ddlOperationPerformed, unittest.equals('foo'));
1283 checkTableReference(o.ddlTargetTable);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001284 unittest.expect(o.numDmlAffectedRows, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001285 checkUnnamed3190(o.queryPlan);
1286 checkUnnamed3191(o.referencedTables);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001287 checkTableSchema(o.schema);
1288 unittest.expect(o.statementType, unittest.equals('foo'));
1289 unittest.expect(o.totalBytesBilled, unittest.equals('foo'));
1290 unittest.expect(o.totalBytesProcessed, unittest.equals('foo'));
1291 unittest.expect(o.totalSlotMs, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001292 checkUnnamed3192(o.undeclaredQueryParameters);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001293 }
1294 buildCounterJobStatistics2--;
1295}
1296
1297core.int buildCounterJobStatistics3 = 0;
1298buildJobStatistics3() {
1299 var o = new api.JobStatistics3();
1300 buildCounterJobStatistics3++;
1301 if (buildCounterJobStatistics3 < 3) {
1302 o.badRecords = "foo";
1303 o.inputFileBytes = "foo";
1304 o.inputFiles = "foo";
1305 o.outputBytes = "foo";
1306 o.outputRows = "foo";
1307 }
1308 buildCounterJobStatistics3--;
1309 return o;
1310}
1311
1312checkJobStatistics3(api.JobStatistics3 o) {
1313 buildCounterJobStatistics3++;
1314 if (buildCounterJobStatistics3 < 3) {
1315 unittest.expect(o.badRecords, unittest.equals('foo'));
1316 unittest.expect(o.inputFileBytes, unittest.equals('foo'));
1317 unittest.expect(o.inputFiles, unittest.equals('foo'));
1318 unittest.expect(o.outputBytes, unittest.equals('foo'));
1319 unittest.expect(o.outputRows, unittest.equals('foo'));
1320 }
1321 buildCounterJobStatistics3--;
1322}
1323
Martin Kustermann2a131182017-11-13 13:50:07 +01001324buildUnnamed3193() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001325 var o = new core.List<core.String>();
1326 o.add("foo");
1327 o.add("foo");
1328 return o;
1329}
1330
Martin Kustermann2a131182017-11-13 13:50:07 +01001331checkUnnamed3193(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001332 unittest.expect(o, unittest.hasLength(2));
1333 unittest.expect(o[0], unittest.equals('foo'));
1334 unittest.expect(o[1], unittest.equals('foo'));
1335}
1336
1337core.int buildCounterJobStatistics4 = 0;
1338buildJobStatistics4() {
1339 var o = new api.JobStatistics4();
1340 buildCounterJobStatistics4++;
1341 if (buildCounterJobStatistics4 < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001342 o.destinationUriFileCounts = buildUnnamed3193();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001343 }
1344 buildCounterJobStatistics4--;
1345 return o;
1346}
1347
1348checkJobStatistics4(api.JobStatistics4 o) {
1349 buildCounterJobStatistics4++;
1350 if (buildCounterJobStatistics4 < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001351 checkUnnamed3193(o.destinationUriFileCounts);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001352 }
1353 buildCounterJobStatistics4--;
1354}
1355
Martin Kustermann2a131182017-11-13 13:50:07 +01001356buildUnnamed3194() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001357 var o = new core.List<api.ErrorProto>();
1358 o.add(buildErrorProto());
1359 o.add(buildErrorProto());
1360 return o;
1361}
1362
Martin Kustermann2a131182017-11-13 13:50:07 +01001363checkUnnamed3194(core.List<api.ErrorProto> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001364 unittest.expect(o, unittest.hasLength(2));
1365 checkErrorProto(o[0]);
1366 checkErrorProto(o[1]);
1367}
1368
1369core.int buildCounterJobStatus = 0;
1370buildJobStatus() {
1371 var o = new api.JobStatus();
1372 buildCounterJobStatus++;
1373 if (buildCounterJobStatus < 3) {
1374 o.errorResult = buildErrorProto();
Martin Kustermann2a131182017-11-13 13:50:07 +01001375 o.errors = buildUnnamed3194();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001376 o.state = "foo";
1377 }
1378 buildCounterJobStatus--;
1379 return o;
1380}
1381
1382checkJobStatus(api.JobStatus o) {
1383 buildCounterJobStatus++;
1384 if (buildCounterJobStatus < 3) {
1385 checkErrorProto(o.errorResult);
Martin Kustermann2a131182017-11-13 13:50:07 +01001386 checkUnnamed3194(o.errors);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001387 unittest.expect(o.state, unittest.equals('foo'));
1388 }
1389 buildCounterJobStatus--;
1390}
1391
1392buildJsonObject() {
1393 var o = new api.JsonObject();
1394 o["a"] = {
1395 'list': [1, 2, 3],
1396 'bool': true,
1397 'string': 'foo'
1398 };
1399 o["b"] = {
1400 'list': [1, 2, 3],
1401 'bool': true,
1402 'string': 'foo'
1403 };
1404 return o;
1405}
1406
1407checkJsonObject(api.JsonObject o) {
1408 unittest.expect(o, unittest.hasLength(2));
1409 var casted1 = (o["a"]) as core.Map;
1410 unittest.expect(casted1, unittest.hasLength(3));
1411 unittest.expect(casted1["list"], unittest.equals([1, 2, 3]));
1412 unittest.expect(casted1["bool"], unittest.equals(true));
1413 unittest.expect(casted1["string"], unittest.equals('foo'));
1414 var casted2 = (o["b"]) as core.Map;
1415 unittest.expect(casted2, unittest.hasLength(3));
1416 unittest.expect(casted2["list"], unittest.equals([1, 2, 3]));
1417 unittest.expect(casted2["bool"], unittest.equals(true));
1418 unittest.expect(casted2["string"], unittest.equals('foo'));
1419}
1420
1421core.int buildCounterProjectListProjects = 0;
1422buildProjectListProjects() {
1423 var o = new api.ProjectListProjects();
1424 buildCounterProjectListProjects++;
1425 if (buildCounterProjectListProjects < 3) {
1426 o.friendlyName = "foo";
1427 o.id = "foo";
1428 o.kind = "foo";
1429 o.numericId = "foo";
1430 o.projectReference = buildProjectReference();
1431 }
1432 buildCounterProjectListProjects--;
1433 return o;
1434}
1435
1436checkProjectListProjects(api.ProjectListProjects o) {
1437 buildCounterProjectListProjects++;
1438 if (buildCounterProjectListProjects < 3) {
1439 unittest.expect(o.friendlyName, unittest.equals('foo'));
1440 unittest.expect(o.id, unittest.equals('foo'));
1441 unittest.expect(o.kind, unittest.equals('foo'));
1442 unittest.expect(o.numericId, unittest.equals('foo'));
1443 checkProjectReference(o.projectReference);
1444 }
1445 buildCounterProjectListProjects--;
1446}
1447
Martin Kustermann2a131182017-11-13 13:50:07 +01001448buildUnnamed3195() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001449 var o = new core.List<api.ProjectListProjects>();
1450 o.add(buildProjectListProjects());
1451 o.add(buildProjectListProjects());
1452 return o;
1453}
1454
Martin Kustermann2a131182017-11-13 13:50:07 +01001455checkUnnamed3195(core.List<api.ProjectListProjects> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001456 unittest.expect(o, unittest.hasLength(2));
1457 checkProjectListProjects(o[0]);
1458 checkProjectListProjects(o[1]);
1459}
1460
1461core.int buildCounterProjectList = 0;
1462buildProjectList() {
1463 var o = new api.ProjectList();
1464 buildCounterProjectList++;
1465 if (buildCounterProjectList < 3) {
1466 o.etag = "foo";
1467 o.kind = "foo";
1468 o.nextPageToken = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001469 o.projects = buildUnnamed3195();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001470 o.totalItems = 42;
1471 }
1472 buildCounterProjectList--;
1473 return o;
1474}
1475
1476checkProjectList(api.ProjectList o) {
1477 buildCounterProjectList++;
1478 if (buildCounterProjectList < 3) {
1479 unittest.expect(o.etag, unittest.equals('foo'));
1480 unittest.expect(o.kind, unittest.equals('foo'));
1481 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001482 checkUnnamed3195(o.projects);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001483 unittest.expect(o.totalItems, unittest.equals(42));
1484 }
1485 buildCounterProjectList--;
1486}
1487
1488core.int buildCounterProjectReference = 0;
1489buildProjectReference() {
1490 var o = new api.ProjectReference();
1491 buildCounterProjectReference++;
1492 if (buildCounterProjectReference < 3) {
1493 o.projectId = "foo";
1494 }
1495 buildCounterProjectReference--;
1496 return o;
1497}
1498
1499checkProjectReference(api.ProjectReference o) {
1500 buildCounterProjectReference++;
1501 if (buildCounterProjectReference < 3) {
1502 unittest.expect(o.projectId, unittest.equals('foo'));
1503 }
1504 buildCounterProjectReference--;
1505}
1506
1507core.int buildCounterQueryParameter = 0;
1508buildQueryParameter() {
1509 var o = new api.QueryParameter();
1510 buildCounterQueryParameter++;
1511 if (buildCounterQueryParameter < 3) {
1512 o.name = "foo";
1513 o.parameterType = buildQueryParameterType();
1514 o.parameterValue = buildQueryParameterValue();
1515 }
1516 buildCounterQueryParameter--;
1517 return o;
1518}
1519
1520checkQueryParameter(api.QueryParameter o) {
1521 buildCounterQueryParameter++;
1522 if (buildCounterQueryParameter < 3) {
1523 unittest.expect(o.name, unittest.equals('foo'));
1524 checkQueryParameterType(o.parameterType);
1525 checkQueryParameterValue(o.parameterValue);
1526 }
1527 buildCounterQueryParameter--;
1528}
1529
1530core.int buildCounterQueryParameterTypeStructTypes = 0;
1531buildQueryParameterTypeStructTypes() {
1532 var o = new api.QueryParameterTypeStructTypes();
1533 buildCounterQueryParameterTypeStructTypes++;
1534 if (buildCounterQueryParameterTypeStructTypes < 3) {
1535 o.description = "foo";
1536 o.name = "foo";
1537 o.type = buildQueryParameterType();
1538 }
1539 buildCounterQueryParameterTypeStructTypes--;
1540 return o;
1541}
1542
1543checkQueryParameterTypeStructTypes(api.QueryParameterTypeStructTypes o) {
1544 buildCounterQueryParameterTypeStructTypes++;
1545 if (buildCounterQueryParameterTypeStructTypes < 3) {
1546 unittest.expect(o.description, unittest.equals('foo'));
1547 unittest.expect(o.name, unittest.equals('foo'));
1548 checkQueryParameterType(o.type);
1549 }
1550 buildCounterQueryParameterTypeStructTypes--;
1551}
1552
Martin Kustermann2a131182017-11-13 13:50:07 +01001553buildUnnamed3196() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001554 var o = new core.List<api.QueryParameterTypeStructTypes>();
1555 o.add(buildQueryParameterTypeStructTypes());
1556 o.add(buildQueryParameterTypeStructTypes());
1557 return o;
1558}
1559
Martin Kustermann2a131182017-11-13 13:50:07 +01001560checkUnnamed3196(core.List<api.QueryParameterTypeStructTypes> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001561 unittest.expect(o, unittest.hasLength(2));
1562 checkQueryParameterTypeStructTypes(o[0]);
1563 checkQueryParameterTypeStructTypes(o[1]);
1564}
1565
1566core.int buildCounterQueryParameterType = 0;
1567buildQueryParameterType() {
1568 var o = new api.QueryParameterType();
1569 buildCounterQueryParameterType++;
1570 if (buildCounterQueryParameterType < 3) {
1571 o.arrayType = buildQueryParameterType();
Martin Kustermann2a131182017-11-13 13:50:07 +01001572 o.structTypes = buildUnnamed3196();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001573 o.type = "foo";
1574 }
1575 buildCounterQueryParameterType--;
1576 return o;
1577}
1578
1579checkQueryParameterType(api.QueryParameterType o) {
1580 buildCounterQueryParameterType++;
1581 if (buildCounterQueryParameterType < 3) {
1582 checkQueryParameterType(o.arrayType);
Martin Kustermann2a131182017-11-13 13:50:07 +01001583 checkUnnamed3196(o.structTypes);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001584 unittest.expect(o.type, unittest.equals('foo'));
1585 }
1586 buildCounterQueryParameterType--;
1587}
1588
Martin Kustermann2a131182017-11-13 13:50:07 +01001589buildUnnamed3197() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001590 var o = new core.List<api.QueryParameterValue>();
1591 o.add(buildQueryParameterValue());
1592 o.add(buildQueryParameterValue());
1593 return o;
1594}
1595
Martin Kustermann2a131182017-11-13 13:50:07 +01001596checkUnnamed3197(core.List<api.QueryParameterValue> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001597 unittest.expect(o, unittest.hasLength(2));
1598 checkQueryParameterValue(o[0]);
1599 checkQueryParameterValue(o[1]);
1600}
1601
Martin Kustermann2a131182017-11-13 13:50:07 +01001602buildUnnamed3198() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001603 var o = new core.Map<core.String, api.QueryParameterValue>();
1604 o["x"] = buildQueryParameterValue();
1605 o["y"] = buildQueryParameterValue();
1606 return o;
1607}
1608
Martin Kustermann2a131182017-11-13 13:50:07 +01001609checkUnnamed3198(core.Map<core.String, api.QueryParameterValue> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001610 unittest.expect(o, unittest.hasLength(2));
1611 checkQueryParameterValue(o["x"]);
1612 checkQueryParameterValue(o["y"]);
1613}
1614
1615core.int buildCounterQueryParameterValue = 0;
1616buildQueryParameterValue() {
1617 var o = new api.QueryParameterValue();
1618 buildCounterQueryParameterValue++;
1619 if (buildCounterQueryParameterValue < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001620 o.arrayValues = buildUnnamed3197();
1621 o.structValues = buildUnnamed3198();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001622 o.value = "foo";
1623 }
1624 buildCounterQueryParameterValue--;
1625 return o;
1626}
1627
1628checkQueryParameterValue(api.QueryParameterValue o) {
1629 buildCounterQueryParameterValue++;
1630 if (buildCounterQueryParameterValue < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001631 checkUnnamed3197(o.arrayValues);
1632 checkUnnamed3198(o.structValues);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001633 unittest.expect(o.value, unittest.equals('foo'));
1634 }
1635 buildCounterQueryParameterValue--;
1636}
1637
Martin Kustermann2a131182017-11-13 13:50:07 +01001638buildUnnamed3199() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001639 var o = new core.List<api.QueryParameter>();
1640 o.add(buildQueryParameter());
1641 o.add(buildQueryParameter());
1642 return o;
1643}
1644
Martin Kustermann2a131182017-11-13 13:50:07 +01001645checkUnnamed3199(core.List<api.QueryParameter> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001646 unittest.expect(o, unittest.hasLength(2));
1647 checkQueryParameter(o[0]);
1648 checkQueryParameter(o[1]);
1649}
1650
1651core.int buildCounterQueryRequest = 0;
1652buildQueryRequest() {
1653 var o = new api.QueryRequest();
1654 buildCounterQueryRequest++;
1655 if (buildCounterQueryRequest < 3) {
1656 o.defaultDataset = buildDatasetReference();
1657 o.dryRun = true;
1658 o.kind = "foo";
1659 o.maxResults = 42;
1660 o.parameterMode = "foo";
1661 o.preserveNulls = true;
1662 o.query = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001663 o.queryParameters = buildUnnamed3199();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001664 o.timeoutMs = 42;
1665 o.useLegacySql = true;
1666 o.useQueryCache = true;
1667 }
1668 buildCounterQueryRequest--;
1669 return o;
1670}
1671
1672checkQueryRequest(api.QueryRequest o) {
1673 buildCounterQueryRequest++;
1674 if (buildCounterQueryRequest < 3) {
1675 checkDatasetReference(o.defaultDataset);
1676 unittest.expect(o.dryRun, unittest.isTrue);
1677 unittest.expect(o.kind, unittest.equals('foo'));
1678 unittest.expect(o.maxResults, unittest.equals(42));
1679 unittest.expect(o.parameterMode, unittest.equals('foo'));
1680 unittest.expect(o.preserveNulls, unittest.isTrue);
1681 unittest.expect(o.query, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001682 checkUnnamed3199(o.queryParameters);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001683 unittest.expect(o.timeoutMs, unittest.equals(42));
1684 unittest.expect(o.useLegacySql, unittest.isTrue);
1685 unittest.expect(o.useQueryCache, unittest.isTrue);
1686 }
1687 buildCounterQueryRequest--;
1688}
1689
Martin Kustermann2a131182017-11-13 13:50:07 +01001690buildUnnamed3200() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001691 var o = new core.List<api.ErrorProto>();
1692 o.add(buildErrorProto());
1693 o.add(buildErrorProto());
1694 return o;
1695}
1696
Martin Kustermann2a131182017-11-13 13:50:07 +01001697checkUnnamed3200(core.List<api.ErrorProto> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001698 unittest.expect(o, unittest.hasLength(2));
1699 checkErrorProto(o[0]);
1700 checkErrorProto(o[1]);
1701}
1702
Martin Kustermann2a131182017-11-13 13:50:07 +01001703buildUnnamed3201() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001704 var o = new core.List<api.TableRow>();
1705 o.add(buildTableRow());
1706 o.add(buildTableRow());
1707 return o;
1708}
1709
Martin Kustermann2a131182017-11-13 13:50:07 +01001710checkUnnamed3201(core.List<api.TableRow> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001711 unittest.expect(o, unittest.hasLength(2));
1712 checkTableRow(o[0]);
1713 checkTableRow(o[1]);
1714}
1715
1716core.int buildCounterQueryResponse = 0;
1717buildQueryResponse() {
1718 var o = new api.QueryResponse();
1719 buildCounterQueryResponse++;
1720 if (buildCounterQueryResponse < 3) {
1721 o.cacheHit = true;
Martin Kustermann2a131182017-11-13 13:50:07 +01001722 o.errors = buildUnnamed3200();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001723 o.jobComplete = true;
1724 o.jobReference = buildJobReference();
1725 o.kind = "foo";
1726 o.numDmlAffectedRows = "foo";
1727 o.pageToken = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001728 o.rows = buildUnnamed3201();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001729 o.schema = buildTableSchema();
1730 o.totalBytesProcessed = "foo";
1731 o.totalRows = "foo";
1732 }
1733 buildCounterQueryResponse--;
1734 return o;
1735}
1736
1737checkQueryResponse(api.QueryResponse o) {
1738 buildCounterQueryResponse++;
1739 if (buildCounterQueryResponse < 3) {
1740 unittest.expect(o.cacheHit, unittest.isTrue);
Martin Kustermann2a131182017-11-13 13:50:07 +01001741 checkUnnamed3200(o.errors);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001742 unittest.expect(o.jobComplete, unittest.isTrue);
1743 checkJobReference(o.jobReference);
1744 unittest.expect(o.kind, unittest.equals('foo'));
1745 unittest.expect(o.numDmlAffectedRows, unittest.equals('foo'));
1746 unittest.expect(o.pageToken, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001747 checkUnnamed3201(o.rows);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001748 checkTableSchema(o.schema);
1749 unittest.expect(o.totalBytesProcessed, unittest.equals('foo'));
1750 unittest.expect(o.totalRows, unittest.equals('foo'));
1751 }
1752 buildCounterQueryResponse--;
1753}
1754
1755core.int buildCounterStreamingbuffer = 0;
1756buildStreamingbuffer() {
1757 var o = new api.Streamingbuffer();
1758 buildCounterStreamingbuffer++;
1759 if (buildCounterStreamingbuffer < 3) {
1760 o.estimatedBytes = "foo";
1761 o.estimatedRows = "foo";
1762 o.oldestEntryTime = "foo";
1763 }
1764 buildCounterStreamingbuffer--;
1765 return o;
1766}
1767
1768checkStreamingbuffer(api.Streamingbuffer o) {
1769 buildCounterStreamingbuffer++;
1770 if (buildCounterStreamingbuffer < 3) {
1771 unittest.expect(o.estimatedBytes, unittest.equals('foo'));
1772 unittest.expect(o.estimatedRows, unittest.equals('foo'));
1773 unittest.expect(o.oldestEntryTime, unittest.equals('foo'));
1774 }
1775 buildCounterStreamingbuffer--;
1776}
1777
Martin Kustermann2a131182017-11-13 13:50:07 +01001778buildUnnamed3202() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001779 var o = new core.Map<core.String, core.String>();
1780 o["x"] = "foo";
1781 o["y"] = "foo";
1782 return o;
1783}
1784
Martin Kustermann2a131182017-11-13 13:50:07 +01001785checkUnnamed3202(core.Map<core.String, core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001786 unittest.expect(o, unittest.hasLength(2));
1787 unittest.expect(o["x"], unittest.equals('foo'));
1788 unittest.expect(o["y"], unittest.equals('foo'));
1789}
1790
1791core.int buildCounterTable = 0;
1792buildTable() {
1793 var o = new api.Table();
1794 buildCounterTable++;
1795 if (buildCounterTable < 3) {
1796 o.creationTime = "foo";
1797 o.description = "foo";
1798 o.encryptionConfiguration = buildEncryptionConfiguration();
1799 o.etag = "foo";
1800 o.expirationTime = "foo";
1801 o.externalDataConfiguration = buildExternalDataConfiguration();
1802 o.friendlyName = "foo";
1803 o.id = "foo";
1804 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001805 o.labels = buildUnnamed3202();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001806 o.lastModifiedTime = "foo";
1807 o.location = "foo";
1808 o.numBytes = "foo";
1809 o.numLongTermBytes = "foo";
1810 o.numRows = "foo";
1811 o.schema = buildTableSchema();
1812 o.selfLink = "foo";
1813 o.streamingBuffer = buildStreamingbuffer();
1814 o.tableReference = buildTableReference();
1815 o.timePartitioning = buildTimePartitioning();
1816 o.type = "foo";
1817 o.view = buildViewDefinition();
1818 }
1819 buildCounterTable--;
1820 return o;
1821}
1822
1823checkTable(api.Table o) {
1824 buildCounterTable++;
1825 if (buildCounterTable < 3) {
1826 unittest.expect(o.creationTime, unittest.equals('foo'));
1827 unittest.expect(o.description, unittest.equals('foo'));
1828 checkEncryptionConfiguration(o.encryptionConfiguration);
1829 unittest.expect(o.etag, unittest.equals('foo'));
1830 unittest.expect(o.expirationTime, unittest.equals('foo'));
1831 checkExternalDataConfiguration(o.externalDataConfiguration);
1832 unittest.expect(o.friendlyName, unittest.equals('foo'));
1833 unittest.expect(o.id, unittest.equals('foo'));
1834 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001835 checkUnnamed3202(o.labels);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001836 unittest.expect(o.lastModifiedTime, unittest.equals('foo'));
1837 unittest.expect(o.location, unittest.equals('foo'));
1838 unittest.expect(o.numBytes, unittest.equals('foo'));
1839 unittest.expect(o.numLongTermBytes, unittest.equals('foo'));
1840 unittest.expect(o.numRows, unittest.equals('foo'));
1841 checkTableSchema(o.schema);
1842 unittest.expect(o.selfLink, unittest.equals('foo'));
1843 checkStreamingbuffer(o.streamingBuffer);
1844 checkTableReference(o.tableReference);
1845 checkTimePartitioning(o.timePartitioning);
1846 unittest.expect(o.type, unittest.equals('foo'));
1847 checkViewDefinition(o.view);
1848 }
1849 buildCounterTable--;
1850}
1851
1852core.int buildCounterTableCell = 0;
1853buildTableCell() {
1854 var o = new api.TableCell();
1855 buildCounterTableCell++;
1856 if (buildCounterTableCell < 3) {
1857 o.v = {
1858 'list': [1, 2, 3],
1859 'bool': true,
1860 'string': 'foo'
1861 };
1862 }
1863 buildCounterTableCell--;
1864 return o;
1865}
1866
1867checkTableCell(api.TableCell o) {
1868 buildCounterTableCell++;
1869 if (buildCounterTableCell < 3) {
1870 var casted3 = (o.v) as core.Map;
1871 unittest.expect(casted3, unittest.hasLength(3));
1872 unittest.expect(casted3["list"], unittest.equals([1, 2, 3]));
1873 unittest.expect(casted3["bool"], unittest.equals(true));
1874 unittest.expect(casted3["string"], unittest.equals('foo'));
1875 }
1876 buildCounterTableCell--;
1877}
1878
1879core.int buildCounterTableDataInsertAllRequestRows = 0;
1880buildTableDataInsertAllRequestRows() {
1881 var o = new api.TableDataInsertAllRequestRows();
1882 buildCounterTableDataInsertAllRequestRows++;
1883 if (buildCounterTableDataInsertAllRequestRows < 3) {
1884 o.insertId = "foo";
1885 o.json = buildJsonObject();
1886 }
1887 buildCounterTableDataInsertAllRequestRows--;
1888 return o;
1889}
1890
1891checkTableDataInsertAllRequestRows(api.TableDataInsertAllRequestRows o) {
1892 buildCounterTableDataInsertAllRequestRows++;
1893 if (buildCounterTableDataInsertAllRequestRows < 3) {
1894 unittest.expect(o.insertId, unittest.equals('foo'));
1895 checkJsonObject(o.json);
1896 }
1897 buildCounterTableDataInsertAllRequestRows--;
1898}
1899
Martin Kustermann2a131182017-11-13 13:50:07 +01001900buildUnnamed3203() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001901 var o = new core.List<api.TableDataInsertAllRequestRows>();
1902 o.add(buildTableDataInsertAllRequestRows());
1903 o.add(buildTableDataInsertAllRequestRows());
1904 return o;
1905}
1906
Martin Kustermann2a131182017-11-13 13:50:07 +01001907checkUnnamed3203(core.List<api.TableDataInsertAllRequestRows> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001908 unittest.expect(o, unittest.hasLength(2));
1909 checkTableDataInsertAllRequestRows(o[0]);
1910 checkTableDataInsertAllRequestRows(o[1]);
1911}
1912
1913core.int buildCounterTableDataInsertAllRequest = 0;
1914buildTableDataInsertAllRequest() {
1915 var o = new api.TableDataInsertAllRequest();
1916 buildCounterTableDataInsertAllRequest++;
1917 if (buildCounterTableDataInsertAllRequest < 3) {
1918 o.ignoreUnknownValues = true;
1919 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01001920 o.rows = buildUnnamed3203();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001921 o.skipInvalidRows = true;
1922 o.templateSuffix = "foo";
1923 }
1924 buildCounterTableDataInsertAllRequest--;
1925 return o;
1926}
1927
1928checkTableDataInsertAllRequest(api.TableDataInsertAllRequest o) {
1929 buildCounterTableDataInsertAllRequest++;
1930 if (buildCounterTableDataInsertAllRequest < 3) {
1931 unittest.expect(o.ignoreUnknownValues, unittest.isTrue);
1932 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01001933 checkUnnamed3203(o.rows);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001934 unittest.expect(o.skipInvalidRows, unittest.isTrue);
1935 unittest.expect(o.templateSuffix, unittest.equals('foo'));
1936 }
1937 buildCounterTableDataInsertAllRequest--;
1938}
1939
Martin Kustermann2a131182017-11-13 13:50:07 +01001940buildUnnamed3204() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001941 var o = new core.List<api.ErrorProto>();
1942 o.add(buildErrorProto());
1943 o.add(buildErrorProto());
1944 return o;
1945}
1946
Martin Kustermann2a131182017-11-13 13:50:07 +01001947checkUnnamed3204(core.List<api.ErrorProto> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001948 unittest.expect(o, unittest.hasLength(2));
1949 checkErrorProto(o[0]);
1950 checkErrorProto(o[1]);
1951}
1952
1953core.int buildCounterTableDataInsertAllResponseInsertErrors = 0;
1954buildTableDataInsertAllResponseInsertErrors() {
1955 var o = new api.TableDataInsertAllResponseInsertErrors();
1956 buildCounterTableDataInsertAllResponseInsertErrors++;
1957 if (buildCounterTableDataInsertAllResponseInsertErrors < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001958 o.errors = buildUnnamed3204();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001959 o.index = 42;
1960 }
1961 buildCounterTableDataInsertAllResponseInsertErrors--;
1962 return o;
1963}
1964
1965checkTableDataInsertAllResponseInsertErrors(
1966 api.TableDataInsertAllResponseInsertErrors o) {
1967 buildCounterTableDataInsertAllResponseInsertErrors++;
1968 if (buildCounterTableDataInsertAllResponseInsertErrors < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001969 checkUnnamed3204(o.errors);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001970 unittest.expect(o.index, unittest.equals(42));
1971 }
1972 buildCounterTableDataInsertAllResponseInsertErrors--;
1973}
1974
Martin Kustermann2a131182017-11-13 13:50:07 +01001975buildUnnamed3205() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001976 var o = new core.List<api.TableDataInsertAllResponseInsertErrors>();
1977 o.add(buildTableDataInsertAllResponseInsertErrors());
1978 o.add(buildTableDataInsertAllResponseInsertErrors());
1979 return o;
1980}
1981
Martin Kustermann2a131182017-11-13 13:50:07 +01001982checkUnnamed3205(core.List<api.TableDataInsertAllResponseInsertErrors> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001983 unittest.expect(o, unittest.hasLength(2));
1984 checkTableDataInsertAllResponseInsertErrors(o[0]);
1985 checkTableDataInsertAllResponseInsertErrors(o[1]);
1986}
1987
1988core.int buildCounterTableDataInsertAllResponse = 0;
1989buildTableDataInsertAllResponse() {
1990 var o = new api.TableDataInsertAllResponse();
1991 buildCounterTableDataInsertAllResponse++;
1992 if (buildCounterTableDataInsertAllResponse < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01001993 o.insertErrors = buildUnnamed3205();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02001994 o.kind = "foo";
1995 }
1996 buildCounterTableDataInsertAllResponse--;
1997 return o;
1998}
1999
2000checkTableDataInsertAllResponse(api.TableDataInsertAllResponse o) {
2001 buildCounterTableDataInsertAllResponse++;
2002 if (buildCounterTableDataInsertAllResponse < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01002003 checkUnnamed3205(o.insertErrors);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002004 unittest.expect(o.kind, unittest.equals('foo'));
2005 }
2006 buildCounterTableDataInsertAllResponse--;
2007}
2008
Martin Kustermann2a131182017-11-13 13:50:07 +01002009buildUnnamed3206() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002010 var o = new core.List<api.TableRow>();
2011 o.add(buildTableRow());
2012 o.add(buildTableRow());
2013 return o;
2014}
2015
Martin Kustermann2a131182017-11-13 13:50:07 +01002016checkUnnamed3206(core.List<api.TableRow> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002017 unittest.expect(o, unittest.hasLength(2));
2018 checkTableRow(o[0]);
2019 checkTableRow(o[1]);
2020}
2021
2022core.int buildCounterTableDataList = 0;
2023buildTableDataList() {
2024 var o = new api.TableDataList();
2025 buildCounterTableDataList++;
2026 if (buildCounterTableDataList < 3) {
2027 o.etag = "foo";
2028 o.kind = "foo";
2029 o.pageToken = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01002030 o.rows = buildUnnamed3206();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002031 o.totalRows = "foo";
2032 }
2033 buildCounterTableDataList--;
2034 return o;
2035}
2036
2037checkTableDataList(api.TableDataList o) {
2038 buildCounterTableDataList++;
2039 if (buildCounterTableDataList < 3) {
2040 unittest.expect(o.etag, unittest.equals('foo'));
2041 unittest.expect(o.kind, unittest.equals('foo'));
2042 unittest.expect(o.pageToken, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01002043 checkUnnamed3206(o.rows);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002044 unittest.expect(o.totalRows, unittest.equals('foo'));
2045 }
2046 buildCounterTableDataList--;
2047}
2048
Martin Kustermann2a131182017-11-13 13:50:07 +01002049buildUnnamed3207() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002050 var o = new core.List<api.TableFieldSchema>();
2051 o.add(buildTableFieldSchema());
2052 o.add(buildTableFieldSchema());
2053 return o;
2054}
2055
Martin Kustermann2a131182017-11-13 13:50:07 +01002056checkUnnamed3207(core.List<api.TableFieldSchema> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002057 unittest.expect(o, unittest.hasLength(2));
2058 checkTableFieldSchema(o[0]);
2059 checkTableFieldSchema(o[1]);
2060}
2061
2062core.int buildCounterTableFieldSchema = 0;
2063buildTableFieldSchema() {
2064 var o = new api.TableFieldSchema();
2065 buildCounterTableFieldSchema++;
2066 if (buildCounterTableFieldSchema < 3) {
2067 o.description = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01002068 o.fields = buildUnnamed3207();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002069 o.mode = "foo";
2070 o.name = "foo";
2071 o.type = "foo";
2072 }
2073 buildCounterTableFieldSchema--;
2074 return o;
2075}
2076
2077checkTableFieldSchema(api.TableFieldSchema o) {
2078 buildCounterTableFieldSchema++;
2079 if (buildCounterTableFieldSchema < 3) {
2080 unittest.expect(o.description, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01002081 checkUnnamed3207(o.fields);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002082 unittest.expect(o.mode, unittest.equals('foo'));
2083 unittest.expect(o.name, unittest.equals('foo'));
2084 unittest.expect(o.type, unittest.equals('foo'));
2085 }
2086 buildCounterTableFieldSchema--;
2087}
2088
Martin Kustermann2a131182017-11-13 13:50:07 +01002089buildUnnamed3208() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002090 var o = new core.Map<core.String, core.String>();
2091 o["x"] = "foo";
2092 o["y"] = "foo";
2093 return o;
2094}
2095
Martin Kustermann2a131182017-11-13 13:50:07 +01002096checkUnnamed3208(core.Map<core.String, core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002097 unittest.expect(o, unittest.hasLength(2));
2098 unittest.expect(o["x"], unittest.equals('foo'));
2099 unittest.expect(o["y"], unittest.equals('foo'));
2100}
2101
2102core.int buildCounterTableListTablesView = 0;
2103buildTableListTablesView() {
2104 var o = new api.TableListTablesView();
2105 buildCounterTableListTablesView++;
2106 if (buildCounterTableListTablesView < 3) {
2107 o.useLegacySql = true;
2108 }
2109 buildCounterTableListTablesView--;
2110 return o;
2111}
2112
2113checkTableListTablesView(api.TableListTablesView o) {
2114 buildCounterTableListTablesView++;
2115 if (buildCounterTableListTablesView < 3) {
2116 unittest.expect(o.useLegacySql, unittest.isTrue);
2117 }
2118 buildCounterTableListTablesView--;
2119}
2120
2121core.int buildCounterTableListTables = 0;
2122buildTableListTables() {
2123 var o = new api.TableListTables();
2124 buildCounterTableListTables++;
2125 if (buildCounterTableListTables < 3) {
2126 o.creationTime = "foo";
2127 o.expirationTime = "foo";
2128 o.friendlyName = "foo";
2129 o.id = "foo";
2130 o.kind = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01002131 o.labels = buildUnnamed3208();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002132 o.tableReference = buildTableReference();
2133 o.timePartitioning = buildTimePartitioning();
2134 o.type = "foo";
2135 o.view = buildTableListTablesView();
2136 }
2137 buildCounterTableListTables--;
2138 return o;
2139}
2140
2141checkTableListTables(api.TableListTables o) {
2142 buildCounterTableListTables++;
2143 if (buildCounterTableListTables < 3) {
2144 unittest.expect(o.creationTime, unittest.equals('foo'));
2145 unittest.expect(o.expirationTime, unittest.equals('foo'));
2146 unittest.expect(o.friendlyName, unittest.equals('foo'));
2147 unittest.expect(o.id, unittest.equals('foo'));
2148 unittest.expect(o.kind, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01002149 checkUnnamed3208(o.labels);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002150 checkTableReference(o.tableReference);
2151 checkTimePartitioning(o.timePartitioning);
2152 unittest.expect(o.type, unittest.equals('foo'));
2153 checkTableListTablesView(o.view);
2154 }
2155 buildCounterTableListTables--;
2156}
2157
Martin Kustermann2a131182017-11-13 13:50:07 +01002158buildUnnamed3209() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002159 var o = new core.List<api.TableListTables>();
2160 o.add(buildTableListTables());
2161 o.add(buildTableListTables());
2162 return o;
2163}
2164
Martin Kustermann2a131182017-11-13 13:50:07 +01002165checkUnnamed3209(core.List<api.TableListTables> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002166 unittest.expect(o, unittest.hasLength(2));
2167 checkTableListTables(o[0]);
2168 checkTableListTables(o[1]);
2169}
2170
2171core.int buildCounterTableList = 0;
2172buildTableList() {
2173 var o = new api.TableList();
2174 buildCounterTableList++;
2175 if (buildCounterTableList < 3) {
2176 o.etag = "foo";
2177 o.kind = "foo";
2178 o.nextPageToken = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01002179 o.tables = buildUnnamed3209();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002180 o.totalItems = 42;
2181 }
2182 buildCounterTableList--;
2183 return o;
2184}
2185
2186checkTableList(api.TableList o) {
2187 buildCounterTableList++;
2188 if (buildCounterTableList < 3) {
2189 unittest.expect(o.etag, unittest.equals('foo'));
2190 unittest.expect(o.kind, unittest.equals('foo'));
2191 unittest.expect(o.nextPageToken, unittest.equals('foo'));
Martin Kustermann2a131182017-11-13 13:50:07 +01002192 checkUnnamed3209(o.tables);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002193 unittest.expect(o.totalItems, unittest.equals(42));
2194 }
2195 buildCounterTableList--;
2196}
2197
2198core.int buildCounterTableReference = 0;
2199buildTableReference() {
2200 var o = new api.TableReference();
2201 buildCounterTableReference++;
2202 if (buildCounterTableReference < 3) {
2203 o.datasetId = "foo";
2204 o.projectId = "foo";
2205 o.tableId = "foo";
2206 }
2207 buildCounterTableReference--;
2208 return o;
2209}
2210
2211checkTableReference(api.TableReference o) {
2212 buildCounterTableReference++;
2213 if (buildCounterTableReference < 3) {
2214 unittest.expect(o.datasetId, unittest.equals('foo'));
2215 unittest.expect(o.projectId, unittest.equals('foo'));
2216 unittest.expect(o.tableId, unittest.equals('foo'));
2217 }
2218 buildCounterTableReference--;
2219}
2220
Martin Kustermann2a131182017-11-13 13:50:07 +01002221buildUnnamed3210() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002222 var o = new core.List<api.TableCell>();
2223 o.add(buildTableCell());
2224 o.add(buildTableCell());
2225 return o;
2226}
2227
Martin Kustermann2a131182017-11-13 13:50:07 +01002228checkUnnamed3210(core.List<api.TableCell> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002229 unittest.expect(o, unittest.hasLength(2));
2230 checkTableCell(o[0]);
2231 checkTableCell(o[1]);
2232}
2233
2234core.int buildCounterTableRow = 0;
2235buildTableRow() {
2236 var o = new api.TableRow();
2237 buildCounterTableRow++;
2238 if (buildCounterTableRow < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01002239 o.f = buildUnnamed3210();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002240 }
2241 buildCounterTableRow--;
2242 return o;
2243}
2244
2245checkTableRow(api.TableRow o) {
2246 buildCounterTableRow++;
2247 if (buildCounterTableRow < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01002248 checkUnnamed3210(o.f);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002249 }
2250 buildCounterTableRow--;
2251}
2252
Martin Kustermann2a131182017-11-13 13:50:07 +01002253buildUnnamed3211() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002254 var o = new core.List<api.TableFieldSchema>();
2255 o.add(buildTableFieldSchema());
2256 o.add(buildTableFieldSchema());
2257 return o;
2258}
2259
Martin Kustermann2a131182017-11-13 13:50:07 +01002260checkUnnamed3211(core.List<api.TableFieldSchema> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002261 unittest.expect(o, unittest.hasLength(2));
2262 checkTableFieldSchema(o[0]);
2263 checkTableFieldSchema(o[1]);
2264}
2265
2266core.int buildCounterTableSchema = 0;
2267buildTableSchema() {
2268 var o = new api.TableSchema();
2269 buildCounterTableSchema++;
2270 if (buildCounterTableSchema < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01002271 o.fields = buildUnnamed3211();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002272 }
2273 buildCounterTableSchema--;
2274 return o;
2275}
2276
2277checkTableSchema(api.TableSchema o) {
2278 buildCounterTableSchema++;
2279 if (buildCounterTableSchema < 3) {
Martin Kustermann2a131182017-11-13 13:50:07 +01002280 checkUnnamed3211(o.fields);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002281 }
2282 buildCounterTableSchema--;
2283}
2284
2285core.int buildCounterTimePartitioning = 0;
2286buildTimePartitioning() {
2287 var o = new api.TimePartitioning();
2288 buildCounterTimePartitioning++;
2289 if (buildCounterTimePartitioning < 3) {
2290 o.expirationMs = "foo";
2291 o.field = "foo";
2292 o.type = "foo";
2293 }
2294 buildCounterTimePartitioning--;
2295 return o;
2296}
2297
2298checkTimePartitioning(api.TimePartitioning o) {
2299 buildCounterTimePartitioning++;
2300 if (buildCounterTimePartitioning < 3) {
2301 unittest.expect(o.expirationMs, unittest.equals('foo'));
2302 unittest.expect(o.field, unittest.equals('foo'));
2303 unittest.expect(o.type, unittest.equals('foo'));
2304 }
2305 buildCounterTimePartitioning--;
2306}
2307
2308core.int buildCounterUserDefinedFunctionResource = 0;
2309buildUserDefinedFunctionResource() {
2310 var o = new api.UserDefinedFunctionResource();
2311 buildCounterUserDefinedFunctionResource++;
2312 if (buildCounterUserDefinedFunctionResource < 3) {
2313 o.inlineCode = "foo";
2314 o.resourceUri = "foo";
2315 }
2316 buildCounterUserDefinedFunctionResource--;
2317 return o;
2318}
2319
2320checkUserDefinedFunctionResource(api.UserDefinedFunctionResource o) {
2321 buildCounterUserDefinedFunctionResource++;
2322 if (buildCounterUserDefinedFunctionResource < 3) {
2323 unittest.expect(o.inlineCode, unittest.equals('foo'));
2324 unittest.expect(o.resourceUri, unittest.equals('foo'));
2325 }
2326 buildCounterUserDefinedFunctionResource--;
2327}
2328
Martin Kustermann2a131182017-11-13 13:50:07 +01002329buildUnnamed3212() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002330 var o = new core.List<api.UserDefinedFunctionResource>();
2331 o.add(buildUserDefinedFunctionResource());
2332 o.add(buildUserDefinedFunctionResource());
2333 return o;
2334}
2335
Martin Kustermann2a131182017-11-13 13:50:07 +01002336checkUnnamed3212(core.List<api.UserDefinedFunctionResource> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002337 unittest.expect(o, unittest.hasLength(2));
2338 checkUserDefinedFunctionResource(o[0]);
2339 checkUserDefinedFunctionResource(o[1]);
2340}
2341
2342core.int buildCounterViewDefinition = 0;
2343buildViewDefinition() {
2344 var o = new api.ViewDefinition();
2345 buildCounterViewDefinition++;
2346 if (buildCounterViewDefinition < 3) {
2347 o.query = "foo";
2348 o.useLegacySql = true;
Martin Kustermann2a131182017-11-13 13:50:07 +01002349 o.userDefinedFunctionResources = buildUnnamed3212();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002350 }
2351 buildCounterViewDefinition--;
2352 return o;
2353}
2354
2355checkViewDefinition(api.ViewDefinition o) {
2356 buildCounterViewDefinition++;
2357 if (buildCounterViewDefinition < 3) {
2358 unittest.expect(o.query, unittest.equals('foo'));
2359 unittest.expect(o.useLegacySql, unittest.isTrue);
Martin Kustermann2a131182017-11-13 13:50:07 +01002360 checkUnnamed3212(o.userDefinedFunctionResources);
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002361 }
2362 buildCounterViewDefinition--;
2363}
2364
Martin Kustermann2a131182017-11-13 13:50:07 +01002365buildUnnamed3213() {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002366 var o = new core.List<core.String>();
2367 o.add("foo");
2368 o.add("foo");
2369 return o;
2370}
2371
Martin Kustermann2a131182017-11-13 13:50:07 +01002372checkUnnamed3213(core.List<core.String> o) {
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02002373 unittest.expect(o, unittest.hasLength(2));
2374 unittest.expect(o[0], unittest.equals('foo'));
2375 unittest.expect(o[1], unittest.equals('foo'));
2376}
2377
2378main() {
2379 unittest.group("obj-schema-BigtableColumn", () {
2380 unittest.test("to-json--from-json", () {
2381 var o = buildBigtableColumn();
2382 var od = new api.BigtableColumn.fromJson(o.toJson());
2383 checkBigtableColumn(od);
2384 });
2385 });
2386
2387 unittest.group("obj-schema-BigtableColumnFamily", () {
2388 unittest.test("to-json--from-json", () {
2389 var o = buildBigtableColumnFamily();
2390 var od = new api.BigtableColumnFamily.fromJson(o.toJson());
2391 checkBigtableColumnFamily(od);
2392 });
2393 });
2394
2395 unittest.group("obj-schema-BigtableOptions", () {
2396 unittest.test("to-json--from-json", () {
2397 var o = buildBigtableOptions();
2398 var od = new api.BigtableOptions.fromJson(o.toJson());
2399 checkBigtableOptions(od);
2400 });
2401 });
2402
2403 unittest.group("obj-schema-CsvOptions", () {
2404 unittest.test("to-json--from-json", () {
2405 var o = buildCsvOptions();
2406 var od = new api.CsvOptions.fromJson(o.toJson());
2407 checkCsvOptions(od);
2408 });
2409 });
2410
2411 unittest.group("obj-schema-DatasetAccess", () {
2412 unittest.test("to-json--from-json", () {
2413 var o = buildDatasetAccess();
2414 var od = new api.DatasetAccess.fromJson(o.toJson());
2415 checkDatasetAccess(od);
2416 });
2417 });
2418
2419 unittest.group("obj-schema-Dataset", () {
2420 unittest.test("to-json--from-json", () {
2421 var o = buildDataset();
2422 var od = new api.Dataset.fromJson(o.toJson());
2423 checkDataset(od);
2424 });
2425 });
2426
2427 unittest.group("obj-schema-DatasetListDatasets", () {
2428 unittest.test("to-json--from-json", () {
2429 var o = buildDatasetListDatasets();
2430 var od = new api.DatasetListDatasets.fromJson(o.toJson());
2431 checkDatasetListDatasets(od);
2432 });
2433 });
2434
2435 unittest.group("obj-schema-DatasetList", () {
2436 unittest.test("to-json--from-json", () {
2437 var o = buildDatasetList();
2438 var od = new api.DatasetList.fromJson(o.toJson());
2439 checkDatasetList(od);
2440 });
2441 });
2442
2443 unittest.group("obj-schema-DatasetReference", () {
2444 unittest.test("to-json--from-json", () {
2445 var o = buildDatasetReference();
2446 var od = new api.DatasetReference.fromJson(o.toJson());
2447 checkDatasetReference(od);
2448 });
2449 });
2450
2451 unittest.group("obj-schema-EncryptionConfiguration", () {
2452 unittest.test("to-json--from-json", () {
2453 var o = buildEncryptionConfiguration();
2454 var od = new api.EncryptionConfiguration.fromJson(o.toJson());
2455 checkEncryptionConfiguration(od);
2456 });
2457 });
2458
2459 unittest.group("obj-schema-ErrorProto", () {
2460 unittest.test("to-json--from-json", () {
2461 var o = buildErrorProto();
2462 var od = new api.ErrorProto.fromJson(o.toJson());
2463 checkErrorProto(od);
2464 });
2465 });
2466
2467 unittest.group("obj-schema-ExplainQueryStage", () {
2468 unittest.test("to-json--from-json", () {
2469 var o = buildExplainQueryStage();
2470 var od = new api.ExplainQueryStage.fromJson(o.toJson());
2471 checkExplainQueryStage(od);
2472 });
2473 });
2474
2475 unittest.group("obj-schema-ExplainQueryStep", () {
2476 unittest.test("to-json--from-json", () {
2477 var o = buildExplainQueryStep();
2478 var od = new api.ExplainQueryStep.fromJson(o.toJson());
2479 checkExplainQueryStep(od);
2480 });
2481 });
2482
2483 unittest.group("obj-schema-ExternalDataConfiguration", () {
2484 unittest.test("to-json--from-json", () {
2485 var o = buildExternalDataConfiguration();
2486 var od = new api.ExternalDataConfiguration.fromJson(o.toJson());
2487 checkExternalDataConfiguration(od);
2488 });
2489 });
2490
2491 unittest.group("obj-schema-GetQueryResultsResponse", () {
2492 unittest.test("to-json--from-json", () {
2493 var o = buildGetQueryResultsResponse();
2494 var od = new api.GetQueryResultsResponse.fromJson(o.toJson());
2495 checkGetQueryResultsResponse(od);
2496 });
2497 });
2498
2499 unittest.group("obj-schema-GetServiceAccountResponse", () {
2500 unittest.test("to-json--from-json", () {
2501 var o = buildGetServiceAccountResponse();
2502 var od = new api.GetServiceAccountResponse.fromJson(o.toJson());
2503 checkGetServiceAccountResponse(od);
2504 });
2505 });
2506
2507 unittest.group("obj-schema-GoogleSheetsOptions", () {
2508 unittest.test("to-json--from-json", () {
2509 var o = buildGoogleSheetsOptions();
2510 var od = new api.GoogleSheetsOptions.fromJson(o.toJson());
2511 checkGoogleSheetsOptions(od);
2512 });
2513 });
2514
2515 unittest.group("obj-schema-Job", () {
2516 unittest.test("to-json--from-json", () {
2517 var o = buildJob();
2518 var od = new api.Job.fromJson(o.toJson());
2519 checkJob(od);
2520 });
2521 });
2522
2523 unittest.group("obj-schema-JobCancelResponse", () {
2524 unittest.test("to-json--from-json", () {
2525 var o = buildJobCancelResponse();
2526 var od = new api.JobCancelResponse.fromJson(o.toJson());
2527 checkJobCancelResponse(od);
2528 });
2529 });
2530
2531 unittest.group("obj-schema-JobConfiguration", () {
2532 unittest.test("to-json--from-json", () {
2533 var o = buildJobConfiguration();
2534 var od = new api.JobConfiguration.fromJson(o.toJson());
2535 checkJobConfiguration(od);
2536 });
2537 });
2538
2539 unittest.group("obj-schema-JobConfigurationExtract", () {
2540 unittest.test("to-json--from-json", () {
2541 var o = buildJobConfigurationExtract();
2542 var od = new api.JobConfigurationExtract.fromJson(o.toJson());
2543 checkJobConfigurationExtract(od);
2544 });
2545 });
2546
2547 unittest.group("obj-schema-JobConfigurationLoad", () {
2548 unittest.test("to-json--from-json", () {
2549 var o = buildJobConfigurationLoad();
2550 var od = new api.JobConfigurationLoad.fromJson(o.toJson());
2551 checkJobConfigurationLoad(od);
2552 });
2553 });
2554
2555 unittest.group("obj-schema-JobConfigurationQuery", () {
2556 unittest.test("to-json--from-json", () {
2557 var o = buildJobConfigurationQuery();
2558 var od = new api.JobConfigurationQuery.fromJson(o.toJson());
2559 checkJobConfigurationQuery(od);
2560 });
2561 });
2562
2563 unittest.group("obj-schema-JobConfigurationTableCopy", () {
2564 unittest.test("to-json--from-json", () {
2565 var o = buildJobConfigurationTableCopy();
2566 var od = new api.JobConfigurationTableCopy.fromJson(o.toJson());
2567 checkJobConfigurationTableCopy(od);
2568 });
2569 });
2570
2571 unittest.group("obj-schema-JobListJobs", () {
2572 unittest.test("to-json--from-json", () {
2573 var o = buildJobListJobs();
2574 var od = new api.JobListJobs.fromJson(o.toJson());
2575 checkJobListJobs(od);
2576 });
2577 });
2578
2579 unittest.group("obj-schema-JobList", () {
2580 unittest.test("to-json--from-json", () {
2581 var o = buildJobList();
2582 var od = new api.JobList.fromJson(o.toJson());
2583 checkJobList(od);
2584 });
2585 });
2586
2587 unittest.group("obj-schema-JobReference", () {
2588 unittest.test("to-json--from-json", () {
2589 var o = buildJobReference();
2590 var od = new api.JobReference.fromJson(o.toJson());
2591 checkJobReference(od);
2592 });
2593 });
2594
2595 unittest.group("obj-schema-JobStatistics", () {
2596 unittest.test("to-json--from-json", () {
2597 var o = buildJobStatistics();
2598 var od = new api.JobStatistics.fromJson(o.toJson());
2599 checkJobStatistics(od);
2600 });
2601 });
2602
2603 unittest.group("obj-schema-JobStatistics2", () {
2604 unittest.test("to-json--from-json", () {
2605 var o = buildJobStatistics2();
2606 var od = new api.JobStatistics2.fromJson(o.toJson());
2607 checkJobStatistics2(od);
2608 });
2609 });
2610
2611 unittest.group("obj-schema-JobStatistics3", () {
2612 unittest.test("to-json--from-json", () {
2613 var o = buildJobStatistics3();
2614 var od = new api.JobStatistics3.fromJson(o.toJson());
2615 checkJobStatistics3(od);
2616 });
2617 });
2618
2619 unittest.group("obj-schema-JobStatistics4", () {
2620 unittest.test("to-json--from-json", () {
2621 var o = buildJobStatistics4();
2622 var od = new api.JobStatistics4.fromJson(o.toJson());
2623 checkJobStatistics4(od);
2624 });
2625 });
2626
2627 unittest.group("obj-schema-JobStatus", () {
2628 unittest.test("to-json--from-json", () {
2629 var o = buildJobStatus();
2630 var od = new api.JobStatus.fromJson(o.toJson());
2631 checkJobStatus(od);
2632 });
2633 });
2634
2635 unittest.group("obj-schema-JsonObject", () {
2636 unittest.test("to-json--from-json", () {
2637 var o = buildJsonObject();
2638 var od = new api.JsonObject.fromJson(o.toJson());
2639 checkJsonObject(od);
2640 });
2641 });
2642
2643 unittest.group("obj-schema-ProjectListProjects", () {
2644 unittest.test("to-json--from-json", () {
2645 var o = buildProjectListProjects();
2646 var od = new api.ProjectListProjects.fromJson(o.toJson());
2647 checkProjectListProjects(od);
2648 });
2649 });
2650
2651 unittest.group("obj-schema-ProjectList", () {
2652 unittest.test("to-json--from-json", () {
2653 var o = buildProjectList();
2654 var od = new api.ProjectList.fromJson(o.toJson());
2655 checkProjectList(od);
2656 });
2657 });
2658
2659 unittest.group("obj-schema-ProjectReference", () {
2660 unittest.test("to-json--from-json", () {
2661 var o = buildProjectReference();
2662 var od = new api.ProjectReference.fromJson(o.toJson());
2663 checkProjectReference(od);
2664 });
2665 });
2666
2667 unittest.group("obj-schema-QueryParameter", () {
2668 unittest.test("to-json--from-json", () {
2669 var o = buildQueryParameter();
2670 var od = new api.QueryParameter.fromJson(o.toJson());
2671 checkQueryParameter(od);
2672 });
2673 });
2674
2675 unittest.group("obj-schema-QueryParameterTypeStructTypes", () {
2676 unittest.test("to-json--from-json", () {
2677 var o = buildQueryParameterTypeStructTypes();
2678 var od = new api.QueryParameterTypeStructTypes.fromJson(o.toJson());
2679 checkQueryParameterTypeStructTypes(od);
2680 });
2681 });
2682
2683 unittest.group("obj-schema-QueryParameterType", () {
2684 unittest.test("to-json--from-json", () {
2685 var o = buildQueryParameterType();
2686 var od = new api.QueryParameterType.fromJson(o.toJson());
2687 checkQueryParameterType(od);
2688 });
2689 });
2690
2691 unittest.group("obj-schema-QueryParameterValue", () {
2692 unittest.test("to-json--from-json", () {
2693 var o = buildQueryParameterValue();
2694 var od = new api.QueryParameterValue.fromJson(o.toJson());
2695 checkQueryParameterValue(od);
2696 });
2697 });
2698
2699 unittest.group("obj-schema-QueryRequest", () {
2700 unittest.test("to-json--from-json", () {
2701 var o = buildQueryRequest();
2702 var od = new api.QueryRequest.fromJson(o.toJson());
2703 checkQueryRequest(od);
2704 });
2705 });
2706
2707 unittest.group("obj-schema-QueryResponse", () {
2708 unittest.test("to-json--from-json", () {
2709 var o = buildQueryResponse();
2710 var od = new api.QueryResponse.fromJson(o.toJson());
2711 checkQueryResponse(od);
2712 });
2713 });
2714
2715 unittest.group("obj-schema-Streamingbuffer", () {
2716 unittest.test("to-json--from-json", () {
2717 var o = buildStreamingbuffer();
2718 var od = new api.Streamingbuffer.fromJson(o.toJson());
2719 checkStreamingbuffer(od);
2720 });
2721 });
2722
2723 unittest.group("obj-schema-Table", () {
2724 unittest.test("to-json--from-json", () {
2725 var o = buildTable();
2726 var od = new api.Table.fromJson(o.toJson());
2727 checkTable(od);
2728 });
2729 });
2730
2731 unittest.group("obj-schema-TableCell", () {
2732 unittest.test("to-json--from-json", () {
2733 var o = buildTableCell();
2734 var od = new api.TableCell.fromJson(o.toJson());
2735 checkTableCell(od);
2736 });
2737 });
2738
2739 unittest.group("obj-schema-TableDataInsertAllRequestRows", () {
2740 unittest.test("to-json--from-json", () {
2741 var o = buildTableDataInsertAllRequestRows();
2742 var od = new api.TableDataInsertAllRequestRows.fromJson(o.toJson());
2743 checkTableDataInsertAllRequestRows(od);
2744 });
2745 });
2746
2747 unittest.group("obj-schema-TableDataInsertAllRequest", () {
2748 unittest.test("to-json--from-json", () {
2749 var o = buildTableDataInsertAllRequest();
2750 var od = new api.TableDataInsertAllRequest.fromJson(o.toJson());
2751 checkTableDataInsertAllRequest(od);
2752 });
2753 });
2754
2755 unittest.group("obj-schema-TableDataInsertAllResponseInsertErrors", () {
2756 unittest.test("to-json--from-json", () {
2757 var o = buildTableDataInsertAllResponseInsertErrors();
2758 var od =
2759 new api.TableDataInsertAllResponseInsertErrors.fromJson(o.toJson());
2760 checkTableDataInsertAllResponseInsertErrors(od);
2761 });
2762 });
2763
2764 unittest.group("obj-schema-TableDataInsertAllResponse", () {
2765 unittest.test("to-json--from-json", () {
2766 var o = buildTableDataInsertAllResponse();
2767 var od = new api.TableDataInsertAllResponse.fromJson(o.toJson());
2768 checkTableDataInsertAllResponse(od);
2769 });
2770 });
2771
2772 unittest.group("obj-schema-TableDataList", () {
2773 unittest.test("to-json--from-json", () {
2774 var o = buildTableDataList();
2775 var od = new api.TableDataList.fromJson(o.toJson());
2776 checkTableDataList(od);
2777 });
2778 });
2779
2780 unittest.group("obj-schema-TableFieldSchema", () {
2781 unittest.test("to-json--from-json", () {
2782 var o = buildTableFieldSchema();
2783 var od = new api.TableFieldSchema.fromJson(o.toJson());
2784 checkTableFieldSchema(od);
2785 });
2786 });
2787
2788 unittest.group("obj-schema-TableListTablesView", () {
2789 unittest.test("to-json--from-json", () {
2790 var o = buildTableListTablesView();
2791 var od = new api.TableListTablesView.fromJson(o.toJson());
2792 checkTableListTablesView(od);
2793 });
2794 });
2795
2796 unittest.group("obj-schema-TableListTables", () {
2797 unittest.test("to-json--from-json", () {
2798 var o = buildTableListTables();
2799 var od = new api.TableListTables.fromJson(o.toJson());
2800 checkTableListTables(od);
2801 });
2802 });
2803
2804 unittest.group("obj-schema-TableList", () {
2805 unittest.test("to-json--from-json", () {
2806 var o = buildTableList();
2807 var od = new api.TableList.fromJson(o.toJson());
2808 checkTableList(od);
2809 });
2810 });
2811
2812 unittest.group("obj-schema-TableReference", () {
2813 unittest.test("to-json--from-json", () {
2814 var o = buildTableReference();
2815 var od = new api.TableReference.fromJson(o.toJson());
2816 checkTableReference(od);
2817 });
2818 });
2819
2820 unittest.group("obj-schema-TableRow", () {
2821 unittest.test("to-json--from-json", () {
2822 var o = buildTableRow();
2823 var od = new api.TableRow.fromJson(o.toJson());
2824 checkTableRow(od);
2825 });
2826 });
2827
2828 unittest.group("obj-schema-TableSchema", () {
2829 unittest.test("to-json--from-json", () {
2830 var o = buildTableSchema();
2831 var od = new api.TableSchema.fromJson(o.toJson());
2832 checkTableSchema(od);
2833 });
2834 });
2835
2836 unittest.group("obj-schema-TimePartitioning", () {
2837 unittest.test("to-json--from-json", () {
2838 var o = buildTimePartitioning();
2839 var od = new api.TimePartitioning.fromJson(o.toJson());
2840 checkTimePartitioning(od);
2841 });
2842 });
2843
2844 unittest.group("obj-schema-UserDefinedFunctionResource", () {
2845 unittest.test("to-json--from-json", () {
2846 var o = buildUserDefinedFunctionResource();
2847 var od = new api.UserDefinedFunctionResource.fromJson(o.toJson());
2848 checkUserDefinedFunctionResource(od);
2849 });
2850 });
2851
2852 unittest.group("obj-schema-ViewDefinition", () {
2853 unittest.test("to-json--from-json", () {
2854 var o = buildViewDefinition();
2855 var od = new api.ViewDefinition.fromJson(o.toJson());
2856 checkViewDefinition(od);
2857 });
2858 });
2859
2860 unittest.group("resource-DatasetsResourceApi", () {
2861 unittest.test("method--delete", () {
2862 var mock = new HttpServerMock();
2863 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
2864 var arg_projectId = "foo";
2865 var arg_datasetId = "foo";
2866 var arg_deleteContents = true;
2867 var arg_$fields = "foo";
2868 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2869 var path = (req.url).path;
2870 var pathOffset = 0;
2871 var index;
2872 var subPart;
2873 unittest.expect(
2874 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2875 pathOffset += 1;
2876 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2877 unittest.equals("bigquery/v2/"));
2878 pathOffset += 12;
2879 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2880 unittest.equals("projects/"));
2881 pathOffset += 9;
2882 index = path.indexOf("/datasets/", pathOffset);
2883 unittest.expect(index >= 0, unittest.isTrue);
2884 subPart =
2885 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2886 pathOffset = index;
2887 unittest.expect(subPart, unittest.equals("$arg_projectId"));
2888 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2889 unittest.equals("/datasets/"));
2890 pathOffset += 10;
2891 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2892 pathOffset = path.length;
2893 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
2894
2895 var query = (req.url).query;
2896 var queryOffset = 0;
2897 var queryMap = {};
2898 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2899 parseBool(n) {
2900 if (n == "true") return true;
2901 if (n == "false") return false;
2902 if (n == null) return null;
2903 throw new core.ArgumentError("Invalid boolean: $n");
2904 }
2905
2906 if (query.length > 0) {
2907 for (var part in query.split("&")) {
2908 var keyvalue = part.split("=");
2909 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2910 core.Uri.decodeQueryComponent(keyvalue[1]));
2911 }
2912 }
2913 unittest.expect(queryMap["deleteContents"].first,
2914 unittest.equals("$arg_deleteContents"));
2915 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2916
2917 var h = {
2918 "content-type": "application/json; charset=utf-8",
2919 };
2920 var resp = "";
2921 return new async.Future.value(stringResponse(200, h, resp));
2922 }), true);
2923 res
2924 .delete(arg_projectId, arg_datasetId,
2925 deleteContents: arg_deleteContents, $fields: arg_$fields)
2926 .then(unittest.expectAsync1((_) {}));
2927 });
2928
2929 unittest.test("method--get", () {
2930 var mock = new HttpServerMock();
2931 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
2932 var arg_projectId = "foo";
2933 var arg_datasetId = "foo";
2934 var arg_$fields = "foo";
2935 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
2936 var path = (req.url).path;
2937 var pathOffset = 0;
2938 var index;
2939 var subPart;
2940 unittest.expect(
2941 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
2942 pathOffset += 1;
2943 unittest.expect(path.substring(pathOffset, pathOffset + 12),
2944 unittest.equals("bigquery/v2/"));
2945 pathOffset += 12;
2946 unittest.expect(path.substring(pathOffset, pathOffset + 9),
2947 unittest.equals("projects/"));
2948 pathOffset += 9;
2949 index = path.indexOf("/datasets/", pathOffset);
2950 unittest.expect(index >= 0, unittest.isTrue);
2951 subPart =
2952 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
2953 pathOffset = index;
2954 unittest.expect(subPart, unittest.equals("$arg_projectId"));
2955 unittest.expect(path.substring(pathOffset, pathOffset + 10),
2956 unittest.equals("/datasets/"));
2957 pathOffset += 10;
2958 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
2959 pathOffset = path.length;
2960 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
2961
2962 var query = (req.url).query;
2963 var queryOffset = 0;
2964 var queryMap = {};
2965 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
2966 parseBool(n) {
2967 if (n == "true") return true;
2968 if (n == "false") return false;
2969 if (n == null) return null;
2970 throw new core.ArgumentError("Invalid boolean: $n");
2971 }
2972
2973 if (query.length > 0) {
2974 for (var part in query.split("&")) {
2975 var keyvalue = part.split("=");
2976 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
2977 core.Uri.decodeQueryComponent(keyvalue[1]));
2978 }
2979 }
2980 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
2981
2982 var h = {
2983 "content-type": "application/json; charset=utf-8",
2984 };
2985 var resp = convert.JSON.encode(buildDataset());
2986 return new async.Future.value(stringResponse(200, h, resp));
2987 }), true);
2988 res
2989 .get(arg_projectId, arg_datasetId, $fields: arg_$fields)
2990 .then(unittest.expectAsync1(((api.Dataset response) {
2991 checkDataset(response);
2992 })));
2993 });
2994
2995 unittest.test("method--insert", () {
2996 var mock = new HttpServerMock();
2997 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
2998 var arg_request = buildDataset();
2999 var arg_projectId = "foo";
3000 var arg_$fields = "foo";
3001 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3002 var obj = new api.Dataset.fromJson(json);
3003 checkDataset(obj);
3004
3005 var path = (req.url).path;
3006 var pathOffset = 0;
3007 var index;
3008 var subPart;
3009 unittest.expect(
3010 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3011 pathOffset += 1;
3012 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3013 unittest.equals("bigquery/v2/"));
3014 pathOffset += 12;
3015 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3016 unittest.equals("projects/"));
3017 pathOffset += 9;
3018 index = path.indexOf("/datasets", pathOffset);
3019 unittest.expect(index >= 0, unittest.isTrue);
3020 subPart =
3021 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3022 pathOffset = index;
3023 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3024 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3025 unittest.equals("/datasets"));
3026 pathOffset += 9;
3027
3028 var query = (req.url).query;
3029 var queryOffset = 0;
3030 var queryMap = {};
3031 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3032 parseBool(n) {
3033 if (n == "true") return true;
3034 if (n == "false") return false;
3035 if (n == null) return null;
3036 throw new core.ArgumentError("Invalid boolean: $n");
3037 }
3038
3039 if (query.length > 0) {
3040 for (var part in query.split("&")) {
3041 var keyvalue = part.split("=");
3042 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3043 core.Uri.decodeQueryComponent(keyvalue[1]));
3044 }
3045 }
3046 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3047
3048 var h = {
3049 "content-type": "application/json; charset=utf-8",
3050 };
3051 var resp = convert.JSON.encode(buildDataset());
3052 return new async.Future.value(stringResponse(200, h, resp));
3053 }), true);
3054 res
3055 .insert(arg_request, arg_projectId, $fields: arg_$fields)
3056 .then(unittest.expectAsync1(((api.Dataset response) {
3057 checkDataset(response);
3058 })));
3059 });
3060
3061 unittest.test("method--list", () {
3062 var mock = new HttpServerMock();
3063 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
3064 var arg_projectId = "foo";
3065 var arg_all = true;
3066 var arg_filter = "foo";
3067 var arg_maxResults = 42;
3068 var arg_pageToken = "foo";
3069 var arg_$fields = "foo";
3070 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3071 var path = (req.url).path;
3072 var pathOffset = 0;
3073 var index;
3074 var subPart;
3075 unittest.expect(
3076 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3077 pathOffset += 1;
3078 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3079 unittest.equals("bigquery/v2/"));
3080 pathOffset += 12;
3081 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3082 unittest.equals("projects/"));
3083 pathOffset += 9;
3084 index = path.indexOf("/datasets", pathOffset);
3085 unittest.expect(index >= 0, unittest.isTrue);
3086 subPart =
3087 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3088 pathOffset = index;
3089 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3090 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3091 unittest.equals("/datasets"));
3092 pathOffset += 9;
3093
3094 var query = (req.url).query;
3095 var queryOffset = 0;
3096 var queryMap = {};
3097 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3098 parseBool(n) {
3099 if (n == "true") return true;
3100 if (n == "false") return false;
3101 if (n == null) return null;
3102 throw new core.ArgumentError("Invalid boolean: $n");
3103 }
3104
3105 if (query.length > 0) {
3106 for (var part in query.split("&")) {
3107 var keyvalue = part.split("=");
3108 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3109 core.Uri.decodeQueryComponent(keyvalue[1]));
3110 }
3111 }
3112 unittest.expect(queryMap["all"].first, unittest.equals("$arg_all"));
3113 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
3114 unittest.expect(core.int.parse(queryMap["maxResults"].first),
3115 unittest.equals(arg_maxResults));
3116 unittest.expect(
3117 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3118 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3119
3120 var h = {
3121 "content-type": "application/json; charset=utf-8",
3122 };
3123 var resp = convert.JSON.encode(buildDatasetList());
3124 return new async.Future.value(stringResponse(200, h, resp));
3125 }), true);
3126 res
3127 .list(arg_projectId,
3128 all: arg_all,
3129 filter: arg_filter,
3130 maxResults: arg_maxResults,
3131 pageToken: arg_pageToken,
3132 $fields: arg_$fields)
3133 .then(unittest.expectAsync1(((api.DatasetList response) {
3134 checkDatasetList(response);
3135 })));
3136 });
3137
3138 unittest.test("method--patch", () {
3139 var mock = new HttpServerMock();
3140 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
3141 var arg_request = buildDataset();
3142 var arg_projectId = "foo";
3143 var arg_datasetId = "foo";
3144 var arg_$fields = "foo";
3145 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3146 var obj = new api.Dataset.fromJson(json);
3147 checkDataset(obj);
3148
3149 var path = (req.url).path;
3150 var pathOffset = 0;
3151 var index;
3152 var subPart;
3153 unittest.expect(
3154 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3155 pathOffset += 1;
3156 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3157 unittest.equals("bigquery/v2/"));
3158 pathOffset += 12;
3159 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3160 unittest.equals("projects/"));
3161 pathOffset += 9;
3162 index = path.indexOf("/datasets/", pathOffset);
3163 unittest.expect(index >= 0, unittest.isTrue);
3164 subPart =
3165 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3166 pathOffset = index;
3167 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3168 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3169 unittest.equals("/datasets/"));
3170 pathOffset += 10;
3171 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3172 pathOffset = path.length;
3173 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
3174
3175 var query = (req.url).query;
3176 var queryOffset = 0;
3177 var queryMap = {};
3178 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3179 parseBool(n) {
3180 if (n == "true") return true;
3181 if (n == "false") return false;
3182 if (n == null) return null;
3183 throw new core.ArgumentError("Invalid boolean: $n");
3184 }
3185
3186 if (query.length > 0) {
3187 for (var part in query.split("&")) {
3188 var keyvalue = part.split("=");
3189 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3190 core.Uri.decodeQueryComponent(keyvalue[1]));
3191 }
3192 }
3193 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3194
3195 var h = {
3196 "content-type": "application/json; charset=utf-8",
3197 };
3198 var resp = convert.JSON.encode(buildDataset());
3199 return new async.Future.value(stringResponse(200, h, resp));
3200 }), true);
3201 res
3202 .patch(arg_request, arg_projectId, arg_datasetId,
3203 $fields: arg_$fields)
3204 .then(unittest.expectAsync1(((api.Dataset response) {
3205 checkDataset(response);
3206 })));
3207 });
3208
3209 unittest.test("method--update", () {
3210 var mock = new HttpServerMock();
3211 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets;
3212 var arg_request = buildDataset();
3213 var arg_projectId = "foo";
3214 var arg_datasetId = "foo";
3215 var arg_$fields = "foo";
3216 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3217 var obj = new api.Dataset.fromJson(json);
3218 checkDataset(obj);
3219
3220 var path = (req.url).path;
3221 var pathOffset = 0;
3222 var index;
3223 var subPart;
3224 unittest.expect(
3225 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3226 pathOffset += 1;
3227 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3228 unittest.equals("bigquery/v2/"));
3229 pathOffset += 12;
3230 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3231 unittest.equals("projects/"));
3232 pathOffset += 9;
3233 index = path.indexOf("/datasets/", pathOffset);
3234 unittest.expect(index >= 0, unittest.isTrue);
3235 subPart =
3236 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3237 pathOffset = index;
3238 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3239 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3240 unittest.equals("/datasets/"));
3241 pathOffset += 10;
3242 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3243 pathOffset = path.length;
3244 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
3245
3246 var query = (req.url).query;
3247 var queryOffset = 0;
3248 var queryMap = {};
3249 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3250 parseBool(n) {
3251 if (n == "true") return true;
3252 if (n == "false") return false;
3253 if (n == null) return null;
3254 throw new core.ArgumentError("Invalid boolean: $n");
3255 }
3256
3257 if (query.length > 0) {
3258 for (var part in query.split("&")) {
3259 var keyvalue = part.split("=");
3260 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3261 core.Uri.decodeQueryComponent(keyvalue[1]));
3262 }
3263 }
3264 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3265
3266 var h = {
3267 "content-type": "application/json; charset=utf-8",
3268 };
3269 var resp = convert.JSON.encode(buildDataset());
3270 return new async.Future.value(stringResponse(200, h, resp));
3271 }), true);
3272 res
3273 .update(arg_request, arg_projectId, arg_datasetId,
3274 $fields: arg_$fields)
3275 .then(unittest.expectAsync1(((api.Dataset response) {
3276 checkDataset(response);
3277 })));
3278 });
3279 });
3280
3281 unittest.group("resource-JobsResourceApi", () {
3282 unittest.test("method--cancel", () {
3283 var mock = new HttpServerMock();
3284 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3285 var arg_projectId = "foo";
3286 var arg_jobId = "foo";
3287 var arg_$fields = "foo";
3288 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3289 var path = (req.url).path;
3290 var pathOffset = 0;
3291 var index;
3292 var subPart;
3293 unittest.expect(
3294 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3295 pathOffset += 1;
3296 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3297 unittest.equals("bigquery/v2/"));
3298 pathOffset += 12;
3299 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3300 unittest.equals("projects/"));
3301 pathOffset += 9;
3302 index = path.indexOf("/jobs/", pathOffset);
3303 unittest.expect(index >= 0, unittest.isTrue);
3304 subPart =
3305 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3306 pathOffset = index;
3307 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3308 unittest.expect(path.substring(pathOffset, pathOffset + 6),
3309 unittest.equals("/jobs/"));
3310 pathOffset += 6;
3311 index = path.indexOf("/cancel", pathOffset);
3312 unittest.expect(index >= 0, unittest.isTrue);
3313 subPart =
3314 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3315 pathOffset = index;
3316 unittest.expect(subPart, unittest.equals("$arg_jobId"));
3317 unittest.expect(path.substring(pathOffset, pathOffset + 7),
3318 unittest.equals("/cancel"));
3319 pathOffset += 7;
3320
3321 var query = (req.url).query;
3322 var queryOffset = 0;
3323 var queryMap = {};
3324 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3325 parseBool(n) {
3326 if (n == "true") return true;
3327 if (n == "false") return false;
3328 if (n == null) return null;
3329 throw new core.ArgumentError("Invalid boolean: $n");
3330 }
3331
3332 if (query.length > 0) {
3333 for (var part in query.split("&")) {
3334 var keyvalue = part.split("=");
3335 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3336 core.Uri.decodeQueryComponent(keyvalue[1]));
3337 }
3338 }
3339 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3340
3341 var h = {
3342 "content-type": "application/json; charset=utf-8",
3343 };
3344 var resp = convert.JSON.encode(buildJobCancelResponse());
3345 return new async.Future.value(stringResponse(200, h, resp));
3346 }), true);
3347 res
3348 .cancel(arg_projectId, arg_jobId, $fields: arg_$fields)
3349 .then(unittest.expectAsync1(((api.JobCancelResponse response) {
3350 checkJobCancelResponse(response);
3351 })));
3352 });
3353
3354 unittest.test("method--get", () {
3355 var mock = new HttpServerMock();
3356 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3357 var arg_projectId = "foo";
3358 var arg_jobId = "foo";
3359 var arg_$fields = "foo";
3360 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3361 var path = (req.url).path;
3362 var pathOffset = 0;
3363 var index;
3364 var subPart;
3365 unittest.expect(
3366 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3367 pathOffset += 1;
3368 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3369 unittest.equals("bigquery/v2/"));
3370 pathOffset += 12;
3371 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3372 unittest.equals("projects/"));
3373 pathOffset += 9;
3374 index = path.indexOf("/jobs/", pathOffset);
3375 unittest.expect(index >= 0, unittest.isTrue);
3376 subPart =
3377 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3378 pathOffset = index;
3379 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3380 unittest.expect(path.substring(pathOffset, pathOffset + 6),
3381 unittest.equals("/jobs/"));
3382 pathOffset += 6;
3383 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3384 pathOffset = path.length;
3385 unittest.expect(subPart, unittest.equals("$arg_jobId"));
3386
3387 var query = (req.url).query;
3388 var queryOffset = 0;
3389 var queryMap = {};
3390 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3391 parseBool(n) {
3392 if (n == "true") return true;
3393 if (n == "false") return false;
3394 if (n == null) return null;
3395 throw new core.ArgumentError("Invalid boolean: $n");
3396 }
3397
3398 if (query.length > 0) {
3399 for (var part in query.split("&")) {
3400 var keyvalue = part.split("=");
3401 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3402 core.Uri.decodeQueryComponent(keyvalue[1]));
3403 }
3404 }
3405 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3406
3407 var h = {
3408 "content-type": "application/json; charset=utf-8",
3409 };
3410 var resp = convert.JSON.encode(buildJob());
3411 return new async.Future.value(stringResponse(200, h, resp));
3412 }), true);
3413 res
3414 .get(arg_projectId, arg_jobId, $fields: arg_$fields)
3415 .then(unittest.expectAsync1(((api.Job response) {
3416 checkJob(response);
3417 })));
3418 });
3419
3420 unittest.test("method--getQueryResults", () {
3421 var mock = new HttpServerMock();
3422 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3423 var arg_projectId = "foo";
3424 var arg_jobId = "foo";
3425 var arg_maxResults = 42;
3426 var arg_pageToken = "foo";
3427 var arg_startIndex = "foo";
3428 var arg_timeoutMs = 42;
3429 var arg_$fields = "foo";
3430 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3431 var path = (req.url).path;
3432 var pathOffset = 0;
3433 var index;
3434 var subPart;
3435 unittest.expect(
3436 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3437 pathOffset += 1;
3438 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3439 unittest.equals("bigquery/v2/"));
3440 pathOffset += 12;
3441 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3442 unittest.equals("projects/"));
3443 pathOffset += 9;
3444 index = path.indexOf("/queries/", pathOffset);
3445 unittest.expect(index >= 0, unittest.isTrue);
3446 subPart =
3447 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3448 pathOffset = index;
3449 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3450 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3451 unittest.equals("/queries/"));
3452 pathOffset += 9;
3453 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
3454 pathOffset = path.length;
3455 unittest.expect(subPart, unittest.equals("$arg_jobId"));
3456
3457 var query = (req.url).query;
3458 var queryOffset = 0;
3459 var queryMap = {};
3460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3461 parseBool(n) {
3462 if (n == "true") return true;
3463 if (n == "false") return false;
3464 if (n == null) return null;
3465 throw new core.ArgumentError("Invalid boolean: $n");
3466 }
3467
3468 if (query.length > 0) {
3469 for (var part in query.split("&")) {
3470 var keyvalue = part.split("=");
3471 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3472 core.Uri.decodeQueryComponent(keyvalue[1]));
3473 }
3474 }
3475 unittest.expect(core.int.parse(queryMap["maxResults"].first),
3476 unittest.equals(arg_maxResults));
3477 unittest.expect(
3478 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3479 unittest.expect(
3480 queryMap["startIndex"].first, unittest.equals(arg_startIndex));
3481 unittest.expect(core.int.parse(queryMap["timeoutMs"].first),
3482 unittest.equals(arg_timeoutMs));
3483 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3484
3485 var h = {
3486 "content-type": "application/json; charset=utf-8",
3487 };
3488 var resp = convert.JSON.encode(buildGetQueryResultsResponse());
3489 return new async.Future.value(stringResponse(200, h, resp));
3490 }), true);
3491 res
3492 .getQueryResults(arg_projectId, arg_jobId,
3493 maxResults: arg_maxResults,
3494 pageToken: arg_pageToken,
3495 startIndex: arg_startIndex,
3496 timeoutMs: arg_timeoutMs,
3497 $fields: arg_$fields)
3498 .then(unittest.expectAsync1(((api.GetQueryResultsResponse response) {
3499 checkGetQueryResultsResponse(response);
3500 })));
3501 });
3502
3503 unittest.test("method--insert", () {
3504 // TODO: Implement tests for media upload;
3505 // TODO: Implement tests for media download;
3506
3507 var mock = new HttpServerMock();
3508 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3509 var arg_request = buildJob();
3510 var arg_projectId = "foo";
3511 var arg_$fields = "foo";
3512 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3513 var obj = new api.Job.fromJson(json);
3514 checkJob(obj);
3515
3516 var path = (req.url).path;
3517 var pathOffset = 0;
3518 var index;
3519 var subPart;
3520 unittest.expect(
3521 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3522 pathOffset += 1;
3523 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3524 unittest.equals("bigquery/v2/"));
3525 pathOffset += 12;
3526 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3527 unittest.equals("projects/"));
3528 pathOffset += 9;
3529 index = path.indexOf("/jobs", pathOffset);
3530 unittest.expect(index >= 0, unittest.isTrue);
3531 subPart =
3532 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3533 pathOffset = index;
3534 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3535 unittest.expect(path.substring(pathOffset, pathOffset + 5),
3536 unittest.equals("/jobs"));
3537 pathOffset += 5;
3538
3539 var query = (req.url).query;
3540 var queryOffset = 0;
3541 var queryMap = {};
3542 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3543 parseBool(n) {
3544 if (n == "true") return true;
3545 if (n == "false") return false;
3546 if (n == null) return null;
3547 throw new core.ArgumentError("Invalid boolean: $n");
3548 }
3549
3550 if (query.length > 0) {
3551 for (var part in query.split("&")) {
3552 var keyvalue = part.split("=");
3553 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3554 core.Uri.decodeQueryComponent(keyvalue[1]));
3555 }
3556 }
3557 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3558
3559 var h = {
3560 "content-type": "application/json; charset=utf-8",
3561 };
3562 var resp = convert.JSON.encode(buildJob());
3563 return new async.Future.value(stringResponse(200, h, resp));
3564 }), true);
3565 res
3566 .insert(arg_request, arg_projectId, $fields: arg_$fields)
3567 .then(unittest.expectAsync1(((api.Job response) {
3568 checkJob(response);
3569 })));
3570 });
3571
3572 unittest.test("method--list", () {
3573 var mock = new HttpServerMock();
3574 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3575 var arg_projectId = "foo";
3576 var arg_allUsers = true;
3577 var arg_maxResults = 42;
3578 var arg_pageToken = "foo";
3579 var arg_projection = "foo";
Martin Kustermann2a131182017-11-13 13:50:07 +01003580 var arg_stateFilter = buildUnnamed3213();
Martin Kustermann7a3b5f52017-10-23 11:34:19 +02003581 var arg_$fields = "foo";
3582 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3583 var path = (req.url).path;
3584 var pathOffset = 0;
3585 var index;
3586 var subPart;
3587 unittest.expect(
3588 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3589 pathOffset += 1;
3590 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3591 unittest.equals("bigquery/v2/"));
3592 pathOffset += 12;
3593 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3594 unittest.equals("projects/"));
3595 pathOffset += 9;
3596 index = path.indexOf("/jobs", pathOffset);
3597 unittest.expect(index >= 0, unittest.isTrue);
3598 subPart =
3599 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3600 pathOffset = index;
3601 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3602 unittest.expect(path.substring(pathOffset, pathOffset + 5),
3603 unittest.equals("/jobs"));
3604 pathOffset += 5;
3605
3606 var query = (req.url).query;
3607 var queryOffset = 0;
3608 var queryMap = {};
3609 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3610 parseBool(n) {
3611 if (n == "true") return true;
3612 if (n == "false") return false;
3613 if (n == null) return null;
3614 throw new core.ArgumentError("Invalid boolean: $n");
3615 }
3616
3617 if (query.length > 0) {
3618 for (var part in query.split("&")) {
3619 var keyvalue = part.split("=");
3620 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3621 core.Uri.decodeQueryComponent(keyvalue[1]));
3622 }
3623 }
3624 unittest.expect(
3625 queryMap["allUsers"].first, unittest.equals("$arg_allUsers"));
3626 unittest.expect(core.int.parse(queryMap["maxResults"].first),
3627 unittest.equals(arg_maxResults));
3628 unittest.expect(
3629 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3630 unittest.expect(
3631 queryMap["projection"].first, unittest.equals(arg_projection));
3632 unittest.expect(
3633 queryMap["stateFilter"], unittest.equals(arg_stateFilter));
3634 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3635
3636 var h = {
3637 "content-type": "application/json; charset=utf-8",
3638 };
3639 var resp = convert.JSON.encode(buildJobList());
3640 return new async.Future.value(stringResponse(200, h, resp));
3641 }), true);
3642 res
3643 .list(arg_projectId,
3644 allUsers: arg_allUsers,
3645 maxResults: arg_maxResults,
3646 pageToken: arg_pageToken,
3647 projection: arg_projection,
3648 stateFilter: arg_stateFilter,
3649 $fields: arg_$fields)
3650 .then(unittest.expectAsync1(((api.JobList response) {
3651 checkJobList(response);
3652 })));
3653 });
3654
3655 unittest.test("method--query", () {
3656 var mock = new HttpServerMock();
3657 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs;
3658 var arg_request = buildQueryRequest();
3659 var arg_projectId = "foo";
3660 var arg_$fields = "foo";
3661 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3662 var obj = new api.QueryRequest.fromJson(json);
3663 checkQueryRequest(obj);
3664
3665 var path = (req.url).path;
3666 var pathOffset = 0;
3667 var index;
3668 var subPart;
3669 unittest.expect(
3670 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3671 pathOffset += 1;
3672 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3673 unittest.equals("bigquery/v2/"));
3674 pathOffset += 12;
3675 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3676 unittest.equals("projects/"));
3677 pathOffset += 9;
3678 index = path.indexOf("/queries", pathOffset);
3679 unittest.expect(index >= 0, unittest.isTrue);
3680 subPart =
3681 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3682 pathOffset = index;
3683 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3684 unittest.expect(path.substring(pathOffset, pathOffset + 8),
3685 unittest.equals("/queries"));
3686 pathOffset += 8;
3687
3688 var query = (req.url).query;
3689 var queryOffset = 0;
3690 var queryMap = {};
3691 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3692 parseBool(n) {
3693 if (n == "true") return true;
3694 if (n == "false") return false;
3695 if (n == null) return null;
3696 throw new core.ArgumentError("Invalid boolean: $n");
3697 }
3698
3699 if (query.length > 0) {
3700 for (var part in query.split("&")) {
3701 var keyvalue = part.split("=");
3702 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3703 core.Uri.decodeQueryComponent(keyvalue[1]));
3704 }
3705 }
3706 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3707
3708 var h = {
3709 "content-type": "application/json; charset=utf-8",
3710 };
3711 var resp = convert.JSON.encode(buildQueryResponse());
3712 return new async.Future.value(stringResponse(200, h, resp));
3713 }), true);
3714 res
3715 .query(arg_request, arg_projectId, $fields: arg_$fields)
3716 .then(unittest.expectAsync1(((api.QueryResponse response) {
3717 checkQueryResponse(response);
3718 })));
3719 });
3720 });
3721
3722 unittest.group("resource-ProjectsResourceApi", () {
3723 unittest.test("method--getServiceAccount", () {
3724 var mock = new HttpServerMock();
3725 api.ProjectsResourceApi res = new api.BigqueryApi(mock).projects;
3726 var arg_projectId = "foo";
3727 var arg_$fields = "foo";
3728 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3729 var path = (req.url).path;
3730 var pathOffset = 0;
3731 var index;
3732 var subPart;
3733 unittest.expect(
3734 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3735 pathOffset += 1;
3736 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3737 unittest.equals("bigquery/v2/"));
3738 pathOffset += 12;
3739 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3740 unittest.equals("projects/"));
3741 pathOffset += 9;
3742 index = path.indexOf("/serviceAccount", pathOffset);
3743 unittest.expect(index >= 0, unittest.isTrue);
3744 subPart =
3745 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3746 pathOffset = index;
3747 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3748 unittest.expect(path.substring(pathOffset, pathOffset + 15),
3749 unittest.equals("/serviceAccount"));
3750 pathOffset += 15;
3751
3752 var query = (req.url).query;
3753 var queryOffset = 0;
3754 var queryMap = {};
3755 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3756 parseBool(n) {
3757 if (n == "true") return true;
3758 if (n == "false") return false;
3759 if (n == null) return null;
3760 throw new core.ArgumentError("Invalid boolean: $n");
3761 }
3762
3763 if (query.length > 0) {
3764 for (var part in query.split("&")) {
3765 var keyvalue = part.split("=");
3766 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3767 core.Uri.decodeQueryComponent(keyvalue[1]));
3768 }
3769 }
3770 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3771
3772 var h = {
3773 "content-type": "application/json; charset=utf-8",
3774 };
3775 var resp = convert.JSON.encode(buildGetServiceAccountResponse());
3776 return new async.Future.value(stringResponse(200, h, resp));
3777 }), true);
3778 res.getServiceAccount(arg_projectId, $fields: arg_$fields).then(
3779 unittest.expectAsync1(((api.GetServiceAccountResponse response) {
3780 checkGetServiceAccountResponse(response);
3781 })));
3782 });
3783
3784 unittest.test("method--list", () {
3785 var mock = new HttpServerMock();
3786 api.ProjectsResourceApi res = new api.BigqueryApi(mock).projects;
3787 var arg_maxResults = 42;
3788 var arg_pageToken = "foo";
3789 var arg_$fields = "foo";
3790 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3791 var path = (req.url).path;
3792 var pathOffset = 0;
3793 var index;
3794 var subPart;
3795 unittest.expect(
3796 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3797 pathOffset += 1;
3798 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3799 unittest.equals("bigquery/v2/"));
3800 pathOffset += 12;
3801 unittest.expect(path.substring(pathOffset, pathOffset + 8),
3802 unittest.equals("projects"));
3803 pathOffset += 8;
3804
3805 var query = (req.url).query;
3806 var queryOffset = 0;
3807 var queryMap = {};
3808 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3809 parseBool(n) {
3810 if (n == "true") return true;
3811 if (n == "false") return false;
3812 if (n == null) return null;
3813 throw new core.ArgumentError("Invalid boolean: $n");
3814 }
3815
3816 if (query.length > 0) {
3817 for (var part in query.split("&")) {
3818 var keyvalue = part.split("=");
3819 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3820 core.Uri.decodeQueryComponent(keyvalue[1]));
3821 }
3822 }
3823 unittest.expect(core.int.parse(queryMap["maxResults"].first),
3824 unittest.equals(arg_maxResults));
3825 unittest.expect(
3826 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
3827 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3828
3829 var h = {
3830 "content-type": "application/json; charset=utf-8",
3831 };
3832 var resp = convert.JSON.encode(buildProjectList());
3833 return new async.Future.value(stringResponse(200, h, resp));
3834 }), true);
3835 res
3836 .list(
3837 maxResults: arg_maxResults,
3838 pageToken: arg_pageToken,
3839 $fields: arg_$fields)
3840 .then(unittest.expectAsync1(((api.ProjectList response) {
3841 checkProjectList(response);
3842 })));
3843 });
3844 });
3845
3846 unittest.group("resource-TabledataResourceApi", () {
3847 unittest.test("method--insertAll", () {
3848 var mock = new HttpServerMock();
3849 api.TabledataResourceApi res = new api.BigqueryApi(mock).tabledata;
3850 var arg_request = buildTableDataInsertAllRequest();
3851 var arg_projectId = "foo";
3852 var arg_datasetId = "foo";
3853 var arg_tableId = "foo";
3854 var arg_$fields = "foo";
3855 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3856 var obj = new api.TableDataInsertAllRequest.fromJson(json);
3857 checkTableDataInsertAllRequest(obj);
3858
3859 var path = (req.url).path;
3860 var pathOffset = 0;
3861 var index;
3862 var subPart;
3863 unittest.expect(
3864 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3865 pathOffset += 1;
3866 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3867 unittest.equals("bigquery/v2/"));
3868 pathOffset += 12;
3869 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3870 unittest.equals("projects/"));
3871 pathOffset += 9;
3872 index = path.indexOf("/datasets/", pathOffset);
3873 unittest.expect(index >= 0, unittest.isTrue);
3874 subPart =
3875 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3876 pathOffset = index;
3877 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3878 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3879 unittest.equals("/datasets/"));
3880 pathOffset += 10;
3881 index = path.indexOf("/tables/", pathOffset);
3882 unittest.expect(index >= 0, unittest.isTrue);
3883 subPart =
3884 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3885 pathOffset = index;
3886 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
3887 unittest.expect(path.substring(pathOffset, pathOffset + 8),
3888 unittest.equals("/tables/"));
3889 pathOffset += 8;
3890 index = path.indexOf("/insertAll", pathOffset);
3891 unittest.expect(index >= 0, unittest.isTrue);
3892 subPart =
3893 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3894 pathOffset = index;
3895 unittest.expect(subPart, unittest.equals("$arg_tableId"));
3896 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3897 unittest.equals("/insertAll"));
3898 pathOffset += 10;
3899
3900 var query = (req.url).query;
3901 var queryOffset = 0;
3902 var queryMap = {};
3903 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3904 parseBool(n) {
3905 if (n == "true") return true;
3906 if (n == "false") return false;
3907 if (n == null) return null;
3908 throw new core.ArgumentError("Invalid boolean: $n");
3909 }
3910
3911 if (query.length > 0) {
3912 for (var part in query.split("&")) {
3913 var keyvalue = part.split("=");
3914 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
3915 core.Uri.decodeQueryComponent(keyvalue[1]));
3916 }
3917 }
3918 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
3919
3920 var h = {
3921 "content-type": "application/json; charset=utf-8",
3922 };
3923 var resp = convert.JSON.encode(buildTableDataInsertAllResponse());
3924 return new async.Future.value(stringResponse(200, h, resp));
3925 }), true);
3926 res
3927 .insertAll(arg_request, arg_projectId, arg_datasetId, arg_tableId,
3928 $fields: arg_$fields)
3929 .then(
3930 unittest.expectAsync1(((api.TableDataInsertAllResponse response) {
3931 checkTableDataInsertAllResponse(response);
3932 })));
3933 });
3934
3935 unittest.test("method--list", () {
3936 var mock = new HttpServerMock();
3937 api.TabledataResourceApi res = new api.BigqueryApi(mock).tabledata;
3938 var arg_projectId = "foo";
3939 var arg_datasetId = "foo";
3940 var arg_tableId = "foo";
3941 var arg_maxResults = 42;
3942 var arg_pageToken = "foo";
3943 var arg_selectedFields = "foo";
3944 var arg_startIndex = "foo";
3945 var arg_$fields = "foo";
3946 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
3947 var path = (req.url).path;
3948 var pathOffset = 0;
3949 var index;
3950 var subPart;
3951 unittest.expect(
3952 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
3953 pathOffset += 1;
3954 unittest.expect(path.substring(pathOffset, pathOffset + 12),
3955 unittest.equals("bigquery/v2/"));
3956 pathOffset += 12;
3957 unittest.expect(path.substring(pathOffset, pathOffset + 9),
3958 unittest.equals("projects/"));
3959 pathOffset += 9;
3960 index = path.indexOf("/datasets/", pathOffset);
3961 unittest.expect(index >= 0, unittest.isTrue);
3962 subPart =
3963 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3964 pathOffset = index;
3965 unittest.expect(subPart, unittest.equals("$arg_projectId"));
3966 unittest.expect(path.substring(pathOffset, pathOffset + 10),
3967 unittest.equals("/datasets/"));
3968 pathOffset += 10;
3969 index = path.indexOf("/tables/", pathOffset);
3970 unittest.expect(index >= 0, unittest.isTrue);
3971 subPart =
3972 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3973 pathOffset = index;
3974 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
3975 unittest.expect(path.substring(pathOffset, pathOffset + 8),
3976 unittest.equals("/tables/"));
3977 pathOffset += 8;
3978 index = path.indexOf("/data", pathOffset);
3979 unittest.expect(index >= 0, unittest.isTrue);
3980 subPart =
3981 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
3982 pathOffset = index;
3983 unittest.expect(subPart, unittest.equals("$arg_tableId"));
3984 unittest.expect(path.substring(pathOffset, pathOffset + 5),
3985 unittest.equals("/data"));
3986 pathOffset += 5;
3987
3988 var query = (req.url).query;
3989 var queryOffset = 0;
3990 var queryMap = {};
3991 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
3992 parseBool(n) {
3993 if (n == "true") return true;
3994 if (n == "false") return false;
3995 if (n == null) return null;
3996 throw new core.ArgumentError("Invalid boolean: $n");
3997 }
3998
3999 if (query.length > 0) {
4000 for (var part in query.split("&")) {
4001 var keyvalue = part.split("=");
4002 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4003 core.Uri.decodeQueryComponent(keyvalue[1]));
4004 }
4005 }
4006 unittest.expect(core.int.parse(queryMap["maxResults"].first),
4007 unittest.equals(arg_maxResults));
4008 unittest.expect(
4009 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
4010 unittest.expect(queryMap["selectedFields"].first,
4011 unittest.equals(arg_selectedFields));
4012 unittest.expect(
4013 queryMap["startIndex"].first, unittest.equals(arg_startIndex));
4014 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4015
4016 var h = {
4017 "content-type": "application/json; charset=utf-8",
4018 };
4019 var resp = convert.JSON.encode(buildTableDataList());
4020 return new async.Future.value(stringResponse(200, h, resp));
4021 }), true);
4022 res
4023 .list(arg_projectId, arg_datasetId, arg_tableId,
4024 maxResults: arg_maxResults,
4025 pageToken: arg_pageToken,
4026 selectedFields: arg_selectedFields,
4027 startIndex: arg_startIndex,
4028 $fields: arg_$fields)
4029 .then(unittest.expectAsync1(((api.TableDataList response) {
4030 checkTableDataList(response);
4031 })));
4032 });
4033 });
4034
4035 unittest.group("resource-TablesResourceApi", () {
4036 unittest.test("method--delete", () {
4037 var mock = new HttpServerMock();
4038 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4039 var arg_projectId = "foo";
4040 var arg_datasetId = "foo";
4041 var arg_tableId = "foo";
4042 var arg_$fields = "foo";
4043 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4044 var path = (req.url).path;
4045 var pathOffset = 0;
4046 var index;
4047 var subPart;
4048 unittest.expect(
4049 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4050 pathOffset += 1;
4051 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4052 unittest.equals("bigquery/v2/"));
4053 pathOffset += 12;
4054 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4055 unittest.equals("projects/"));
4056 pathOffset += 9;
4057 index = path.indexOf("/datasets/", pathOffset);
4058 unittest.expect(index >= 0, unittest.isTrue);
4059 subPart =
4060 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4061 pathOffset = index;
4062 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4063 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4064 unittest.equals("/datasets/"));
4065 pathOffset += 10;
4066 index = path.indexOf("/tables/", pathOffset);
4067 unittest.expect(index >= 0, unittest.isTrue);
4068 subPart =
4069 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4070 pathOffset = index;
4071 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4072 unittest.expect(path.substring(pathOffset, pathOffset + 8),
4073 unittest.equals("/tables/"));
4074 pathOffset += 8;
4075 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4076 pathOffset = path.length;
4077 unittest.expect(subPart, unittest.equals("$arg_tableId"));
4078
4079 var query = (req.url).query;
4080 var queryOffset = 0;
4081 var queryMap = {};
4082 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4083 parseBool(n) {
4084 if (n == "true") return true;
4085 if (n == "false") return false;
4086 if (n == null) return null;
4087 throw new core.ArgumentError("Invalid boolean: $n");
4088 }
4089
4090 if (query.length > 0) {
4091 for (var part in query.split("&")) {
4092 var keyvalue = part.split("=");
4093 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4094 core.Uri.decodeQueryComponent(keyvalue[1]));
4095 }
4096 }
4097 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4098
4099 var h = {
4100 "content-type": "application/json; charset=utf-8",
4101 };
4102 var resp = "";
4103 return new async.Future.value(stringResponse(200, h, resp));
4104 }), true);
4105 res
4106 .delete(arg_projectId, arg_datasetId, arg_tableId,
4107 $fields: arg_$fields)
4108 .then(unittest.expectAsync1((_) {}));
4109 });
4110
4111 unittest.test("method--get", () {
4112 var mock = new HttpServerMock();
4113 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4114 var arg_projectId = "foo";
4115 var arg_datasetId = "foo";
4116 var arg_tableId = "foo";
4117 var arg_selectedFields = "foo";
4118 var arg_$fields = "foo";
4119 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4120 var path = (req.url).path;
4121 var pathOffset = 0;
4122 var index;
4123 var subPart;
4124 unittest.expect(
4125 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4126 pathOffset += 1;
4127 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4128 unittest.equals("bigquery/v2/"));
4129 pathOffset += 12;
4130 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4131 unittest.equals("projects/"));
4132 pathOffset += 9;
4133 index = path.indexOf("/datasets/", pathOffset);
4134 unittest.expect(index >= 0, unittest.isTrue);
4135 subPart =
4136 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4137 pathOffset = index;
4138 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4139 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4140 unittest.equals("/datasets/"));
4141 pathOffset += 10;
4142 index = path.indexOf("/tables/", pathOffset);
4143 unittest.expect(index >= 0, unittest.isTrue);
4144 subPart =
4145 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4146 pathOffset = index;
4147 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4148 unittest.expect(path.substring(pathOffset, pathOffset + 8),
4149 unittest.equals("/tables/"));
4150 pathOffset += 8;
4151 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4152 pathOffset = path.length;
4153 unittest.expect(subPart, unittest.equals("$arg_tableId"));
4154
4155 var query = (req.url).query;
4156 var queryOffset = 0;
4157 var queryMap = {};
4158 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4159 parseBool(n) {
4160 if (n == "true") return true;
4161 if (n == "false") return false;
4162 if (n == null) return null;
4163 throw new core.ArgumentError("Invalid boolean: $n");
4164 }
4165
4166 if (query.length > 0) {
4167 for (var part in query.split("&")) {
4168 var keyvalue = part.split("=");
4169 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4170 core.Uri.decodeQueryComponent(keyvalue[1]));
4171 }
4172 }
4173 unittest.expect(queryMap["selectedFields"].first,
4174 unittest.equals(arg_selectedFields));
4175 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4176
4177 var h = {
4178 "content-type": "application/json; charset=utf-8",
4179 };
4180 var resp = convert.JSON.encode(buildTable());
4181 return new async.Future.value(stringResponse(200, h, resp));
4182 }), true);
4183 res
4184 .get(arg_projectId, arg_datasetId, arg_tableId,
4185 selectedFields: arg_selectedFields, $fields: arg_$fields)
4186 .then(unittest.expectAsync1(((api.Table response) {
4187 checkTable(response);
4188 })));
4189 });
4190
4191 unittest.test("method--insert", () {
4192 var mock = new HttpServerMock();
4193 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4194 var arg_request = buildTable();
4195 var arg_projectId = "foo";
4196 var arg_datasetId = "foo";
4197 var arg_$fields = "foo";
4198 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4199 var obj = new api.Table.fromJson(json);
4200 checkTable(obj);
4201
4202 var path = (req.url).path;
4203 var pathOffset = 0;
4204 var index;
4205 var subPart;
4206 unittest.expect(
4207 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4208 pathOffset += 1;
4209 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4210 unittest.equals("bigquery/v2/"));
4211 pathOffset += 12;
4212 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4213 unittest.equals("projects/"));
4214 pathOffset += 9;
4215 index = path.indexOf("/datasets/", pathOffset);
4216 unittest.expect(index >= 0, unittest.isTrue);
4217 subPart =
4218 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4219 pathOffset = index;
4220 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4221 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4222 unittest.equals("/datasets/"));
4223 pathOffset += 10;
4224 index = path.indexOf("/tables", pathOffset);
4225 unittest.expect(index >= 0, unittest.isTrue);
4226 subPart =
4227 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4228 pathOffset = index;
4229 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4230 unittest.expect(path.substring(pathOffset, pathOffset + 7),
4231 unittest.equals("/tables"));
4232 pathOffset += 7;
4233
4234 var query = (req.url).query;
4235 var queryOffset = 0;
4236 var queryMap = {};
4237 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4238 parseBool(n) {
4239 if (n == "true") return true;
4240 if (n == "false") return false;
4241 if (n == null) return null;
4242 throw new core.ArgumentError("Invalid boolean: $n");
4243 }
4244
4245 if (query.length > 0) {
4246 for (var part in query.split("&")) {
4247 var keyvalue = part.split("=");
4248 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4249 core.Uri.decodeQueryComponent(keyvalue[1]));
4250 }
4251 }
4252 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4253
4254 var h = {
4255 "content-type": "application/json; charset=utf-8",
4256 };
4257 var resp = convert.JSON.encode(buildTable());
4258 return new async.Future.value(stringResponse(200, h, resp));
4259 }), true);
4260 res
4261 .insert(arg_request, arg_projectId, arg_datasetId,
4262 $fields: arg_$fields)
4263 .then(unittest.expectAsync1(((api.Table response) {
4264 checkTable(response);
4265 })));
4266 });
4267
4268 unittest.test("method--list", () {
4269 var mock = new HttpServerMock();
4270 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4271 var arg_projectId = "foo";
4272 var arg_datasetId = "foo";
4273 var arg_maxResults = 42;
4274 var arg_pageToken = "foo";
4275 var arg_$fields = "foo";
4276 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4277 var path = (req.url).path;
4278 var pathOffset = 0;
4279 var index;
4280 var subPart;
4281 unittest.expect(
4282 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4283 pathOffset += 1;
4284 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4285 unittest.equals("bigquery/v2/"));
4286 pathOffset += 12;
4287 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4288 unittest.equals("projects/"));
4289 pathOffset += 9;
4290 index = path.indexOf("/datasets/", pathOffset);
4291 unittest.expect(index >= 0, unittest.isTrue);
4292 subPart =
4293 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4294 pathOffset = index;
4295 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4296 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4297 unittest.equals("/datasets/"));
4298 pathOffset += 10;
4299 index = path.indexOf("/tables", pathOffset);
4300 unittest.expect(index >= 0, unittest.isTrue);
4301 subPart =
4302 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4303 pathOffset = index;
4304 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4305 unittest.expect(path.substring(pathOffset, pathOffset + 7),
4306 unittest.equals("/tables"));
4307 pathOffset += 7;
4308
4309 var query = (req.url).query;
4310 var queryOffset = 0;
4311 var queryMap = {};
4312 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4313 parseBool(n) {
4314 if (n == "true") return true;
4315 if (n == "false") return false;
4316 if (n == null) return null;
4317 throw new core.ArgumentError("Invalid boolean: $n");
4318 }
4319
4320 if (query.length > 0) {
4321 for (var part in query.split("&")) {
4322 var keyvalue = part.split("=");
4323 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4324 core.Uri.decodeQueryComponent(keyvalue[1]));
4325 }
4326 }
4327 unittest.expect(core.int.parse(queryMap["maxResults"].first),
4328 unittest.equals(arg_maxResults));
4329 unittest.expect(
4330 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
4331 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4332
4333 var h = {
4334 "content-type": "application/json; charset=utf-8",
4335 };
4336 var resp = convert.JSON.encode(buildTableList());
4337 return new async.Future.value(stringResponse(200, h, resp));
4338 }), true);
4339 res
4340 .list(arg_projectId, arg_datasetId,
4341 maxResults: arg_maxResults,
4342 pageToken: arg_pageToken,
4343 $fields: arg_$fields)
4344 .then(unittest.expectAsync1(((api.TableList response) {
4345 checkTableList(response);
4346 })));
4347 });
4348
4349 unittest.test("method--patch", () {
4350 var mock = new HttpServerMock();
4351 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4352 var arg_request = buildTable();
4353 var arg_projectId = "foo";
4354 var arg_datasetId = "foo";
4355 var arg_tableId = "foo";
4356 var arg_$fields = "foo";
4357 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4358 var obj = new api.Table.fromJson(json);
4359 checkTable(obj);
4360
4361 var path = (req.url).path;
4362 var pathOffset = 0;
4363 var index;
4364 var subPart;
4365 unittest.expect(
4366 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4367 pathOffset += 1;
4368 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4369 unittest.equals("bigquery/v2/"));
4370 pathOffset += 12;
4371 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4372 unittest.equals("projects/"));
4373 pathOffset += 9;
4374 index = path.indexOf("/datasets/", pathOffset);
4375 unittest.expect(index >= 0, unittest.isTrue);
4376 subPart =
4377 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4378 pathOffset = index;
4379 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4380 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4381 unittest.equals("/datasets/"));
4382 pathOffset += 10;
4383 index = path.indexOf("/tables/", pathOffset);
4384 unittest.expect(index >= 0, unittest.isTrue);
4385 subPart =
4386 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4387 pathOffset = index;
4388 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4389 unittest.expect(path.substring(pathOffset, pathOffset + 8),
4390 unittest.equals("/tables/"));
4391 pathOffset += 8;
4392 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4393 pathOffset = path.length;
4394 unittest.expect(subPart, unittest.equals("$arg_tableId"));
4395
4396 var query = (req.url).query;
4397 var queryOffset = 0;
4398 var queryMap = {};
4399 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4400 parseBool(n) {
4401 if (n == "true") return true;
4402 if (n == "false") return false;
4403 if (n == null) return null;
4404 throw new core.ArgumentError("Invalid boolean: $n");
4405 }
4406
4407 if (query.length > 0) {
4408 for (var part in query.split("&")) {
4409 var keyvalue = part.split("=");
4410 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4411 core.Uri.decodeQueryComponent(keyvalue[1]));
4412 }
4413 }
4414 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4415
4416 var h = {
4417 "content-type": "application/json; charset=utf-8",
4418 };
4419 var resp = convert.JSON.encode(buildTable());
4420 return new async.Future.value(stringResponse(200, h, resp));
4421 }), true);
4422 res
4423 .patch(arg_request, arg_projectId, arg_datasetId, arg_tableId,
4424 $fields: arg_$fields)
4425 .then(unittest.expectAsync1(((api.Table response) {
4426 checkTable(response);
4427 })));
4428 });
4429
4430 unittest.test("method--update", () {
4431 var mock = new HttpServerMock();
4432 api.TablesResourceApi res = new api.BigqueryApi(mock).tables;
4433 var arg_request = buildTable();
4434 var arg_projectId = "foo";
4435 var arg_datasetId = "foo";
4436 var arg_tableId = "foo";
4437 var arg_$fields = "foo";
4438 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
4439 var obj = new api.Table.fromJson(json);
4440 checkTable(obj);
4441
4442 var path = (req.url).path;
4443 var pathOffset = 0;
4444 var index;
4445 var subPart;
4446 unittest.expect(
4447 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
4448 pathOffset += 1;
4449 unittest.expect(path.substring(pathOffset, pathOffset + 12),
4450 unittest.equals("bigquery/v2/"));
4451 pathOffset += 12;
4452 unittest.expect(path.substring(pathOffset, pathOffset + 9),
4453 unittest.equals("projects/"));
4454 pathOffset += 9;
4455 index = path.indexOf("/datasets/", pathOffset);
4456 unittest.expect(index >= 0, unittest.isTrue);
4457 subPart =
4458 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4459 pathOffset = index;
4460 unittest.expect(subPart, unittest.equals("$arg_projectId"));
4461 unittest.expect(path.substring(pathOffset, pathOffset + 10),
4462 unittest.equals("/datasets/"));
4463 pathOffset += 10;
4464 index = path.indexOf("/tables/", pathOffset);
4465 unittest.expect(index >= 0, unittest.isTrue);
4466 subPart =
4467 core.Uri.decodeQueryComponent(path.substring(pathOffset, index));
4468 pathOffset = index;
4469 unittest.expect(subPart, unittest.equals("$arg_datasetId"));
4470 unittest.expect(path.substring(pathOffset, pathOffset + 8),
4471 unittest.equals("/tables/"));
4472 pathOffset += 8;
4473 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset));
4474 pathOffset = path.length;
4475 unittest.expect(subPart, unittest.equals("$arg_tableId"));
4476
4477 var query = (req.url).query;
4478 var queryOffset = 0;
4479 var queryMap = {};
4480 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
4481 parseBool(n) {
4482 if (n == "true") return true;
4483 if (n == "false") return false;
4484 if (n == null) return null;
4485 throw new core.ArgumentError("Invalid boolean: $n");
4486 }
4487
4488 if (query.length > 0) {
4489 for (var part in query.split("&")) {
4490 var keyvalue = part.split("=");
4491 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
4492 core.Uri.decodeQueryComponent(keyvalue[1]));
4493 }
4494 }
4495 unittest.expect(queryMap["fields"].first, unittest.equals(arg_$fields));
4496
4497 var h = {
4498 "content-type": "application/json; charset=utf-8",
4499 };
4500 var resp = convert.JSON.encode(buildTable());
4501 return new async.Future.value(stringResponse(200, h, resp));
4502 }), true);
4503 res
4504 .update(arg_request, arg_projectId, arg_datasetId, arg_tableId,
4505 $fields: arg_$fields)
4506 .then(unittest.expectAsync1(((api.Table response) {
4507 checkTable(response);
4508 })));
4509 });
4510 });
4511}