OLD | NEW |
| (Empty) |
1 library googleapis.content.v2.test; | |
2 | |
3 import "dart:core" as core; | |
4 import "dart:collection" as collection; | |
5 import "dart:async" as async; | |
6 import "dart:convert" as convert; | |
7 | |
8 import 'package:http/http.dart' as http; | |
9 import 'package:http/testing.dart' as http_testing; | |
10 import 'package:unittest/unittest.dart' as unittest; | |
11 import 'package:googleapis/common/common.dart' as common; | |
12 import 'package:googleapis/src/common_internal.dart' as common_internal; | |
13 import '../common/common_internal_test.dart' as common_test; | |
14 | |
15 import 'package:googleapis/content/v2.dart' as api; | |
16 | |
17 | |
18 | |
19 buildUnnamed299() { | |
20 var o = new core.List<api.AccountAdwordsLink>(); | |
21 o.add(buildAccountAdwordsLink()); | |
22 o.add(buildAccountAdwordsLink()); | |
23 return o; | |
24 } | |
25 | |
26 checkUnnamed299(core.List<api.AccountAdwordsLink> o) { | |
27 unittest.expect(o, unittest.hasLength(2)); | |
28 checkAccountAdwordsLink(o[0]); | |
29 checkAccountAdwordsLink(o[1]); | |
30 } | |
31 | |
32 buildUnnamed300() { | |
33 var o = new core.List<api.AccountUser>(); | |
34 o.add(buildAccountUser()); | |
35 o.add(buildAccountUser()); | |
36 return o; | |
37 } | |
38 | |
39 checkUnnamed300(core.List<api.AccountUser> o) { | |
40 unittest.expect(o, unittest.hasLength(2)); | |
41 checkAccountUser(o[0]); | |
42 checkAccountUser(o[1]); | |
43 } | |
44 | |
45 core.int buildCounterAccount = 0; | |
46 buildAccount() { | |
47 var o = new api.Account(); | |
48 buildCounterAccount++; | |
49 if (buildCounterAccount < 3) { | |
50 o.adultContent = true; | |
51 o.adwordsLinks = buildUnnamed299(); | |
52 o.id = "foo"; | |
53 o.kind = "foo"; | |
54 o.name = "foo"; | |
55 o.reviewsUrl = "foo"; | |
56 o.sellerId = "foo"; | |
57 o.users = buildUnnamed300(); | |
58 o.websiteUrl = "foo"; | |
59 } | |
60 buildCounterAccount--; | |
61 return o; | |
62 } | |
63 | |
64 checkAccount(api.Account o) { | |
65 buildCounterAccount++; | |
66 if (buildCounterAccount < 3) { | |
67 unittest.expect(o.adultContent, unittest.isTrue); | |
68 checkUnnamed299(o.adwordsLinks); | |
69 unittest.expect(o.id, unittest.equals('foo')); | |
70 unittest.expect(o.kind, unittest.equals('foo')); | |
71 unittest.expect(o.name, unittest.equals('foo')); | |
72 unittest.expect(o.reviewsUrl, unittest.equals('foo')); | |
73 unittest.expect(o.sellerId, unittest.equals('foo')); | |
74 checkUnnamed300(o.users); | |
75 unittest.expect(o.websiteUrl, unittest.equals('foo')); | |
76 } | |
77 buildCounterAccount--; | |
78 } | |
79 | |
80 core.int buildCounterAccountAdwordsLink = 0; | |
81 buildAccountAdwordsLink() { | |
82 var o = new api.AccountAdwordsLink(); | |
83 buildCounterAccountAdwordsLink++; | |
84 if (buildCounterAccountAdwordsLink < 3) { | |
85 o.adwordsId = "foo"; | |
86 o.status = "foo"; | |
87 } | |
88 buildCounterAccountAdwordsLink--; | |
89 return o; | |
90 } | |
91 | |
92 checkAccountAdwordsLink(api.AccountAdwordsLink o) { | |
93 buildCounterAccountAdwordsLink++; | |
94 if (buildCounterAccountAdwordsLink < 3) { | |
95 unittest.expect(o.adwordsId, unittest.equals('foo')); | |
96 unittest.expect(o.status, unittest.equals('foo')); | |
97 } | |
98 buildCounterAccountAdwordsLink--; | |
99 } | |
100 | |
101 buildUnnamed301() { | |
102 var o = new core.List<api.AccountStatusDataQualityIssue>(); | |
103 o.add(buildAccountStatusDataQualityIssue()); | |
104 o.add(buildAccountStatusDataQualityIssue()); | |
105 return o; | |
106 } | |
107 | |
108 checkUnnamed301(core.List<api.AccountStatusDataQualityIssue> o) { | |
109 unittest.expect(o, unittest.hasLength(2)); | |
110 checkAccountStatusDataQualityIssue(o[0]); | |
111 checkAccountStatusDataQualityIssue(o[1]); | |
112 } | |
113 | |
114 core.int buildCounterAccountStatus = 0; | |
115 buildAccountStatus() { | |
116 var o = new api.AccountStatus(); | |
117 buildCounterAccountStatus++; | |
118 if (buildCounterAccountStatus < 3) { | |
119 o.accountId = "foo"; | |
120 o.dataQualityIssues = buildUnnamed301(); | |
121 o.kind = "foo"; | |
122 } | |
123 buildCounterAccountStatus--; | |
124 return o; | |
125 } | |
126 | |
127 checkAccountStatus(api.AccountStatus o) { | |
128 buildCounterAccountStatus++; | |
129 if (buildCounterAccountStatus < 3) { | |
130 unittest.expect(o.accountId, unittest.equals('foo')); | |
131 checkUnnamed301(o.dataQualityIssues); | |
132 unittest.expect(o.kind, unittest.equals('foo')); | |
133 } | |
134 buildCounterAccountStatus--; | |
135 } | |
136 | |
137 buildUnnamed302() { | |
138 var o = new core.List<api.AccountStatusExampleItem>(); | |
139 o.add(buildAccountStatusExampleItem()); | |
140 o.add(buildAccountStatusExampleItem()); | |
141 return o; | |
142 } | |
143 | |
144 checkUnnamed302(core.List<api.AccountStatusExampleItem> o) { | |
145 unittest.expect(o, unittest.hasLength(2)); | |
146 checkAccountStatusExampleItem(o[0]); | |
147 checkAccountStatusExampleItem(o[1]); | |
148 } | |
149 | |
150 core.int buildCounterAccountStatusDataQualityIssue = 0; | |
151 buildAccountStatusDataQualityIssue() { | |
152 var o = new api.AccountStatusDataQualityIssue(); | |
153 buildCounterAccountStatusDataQualityIssue++; | |
154 if (buildCounterAccountStatusDataQualityIssue < 3) { | |
155 o.country = "foo"; | |
156 o.displayedValue = "foo"; | |
157 o.exampleItems = buildUnnamed302(); | |
158 o.id = "foo"; | |
159 o.lastChecked = "foo"; | |
160 o.numItems = 42; | |
161 o.severity = "foo"; | |
162 o.submittedValue = "foo"; | |
163 } | |
164 buildCounterAccountStatusDataQualityIssue--; | |
165 return o; | |
166 } | |
167 | |
168 checkAccountStatusDataQualityIssue(api.AccountStatusDataQualityIssue o) { | |
169 buildCounterAccountStatusDataQualityIssue++; | |
170 if (buildCounterAccountStatusDataQualityIssue < 3) { | |
171 unittest.expect(o.country, unittest.equals('foo')); | |
172 unittest.expect(o.displayedValue, unittest.equals('foo')); | |
173 checkUnnamed302(o.exampleItems); | |
174 unittest.expect(o.id, unittest.equals('foo')); | |
175 unittest.expect(o.lastChecked, unittest.equals('foo')); | |
176 unittest.expect(o.numItems, unittest.equals(42)); | |
177 unittest.expect(o.severity, unittest.equals('foo')); | |
178 unittest.expect(o.submittedValue, unittest.equals('foo')); | |
179 } | |
180 buildCounterAccountStatusDataQualityIssue--; | |
181 } | |
182 | |
183 core.int buildCounterAccountStatusExampleItem = 0; | |
184 buildAccountStatusExampleItem() { | |
185 var o = new api.AccountStatusExampleItem(); | |
186 buildCounterAccountStatusExampleItem++; | |
187 if (buildCounterAccountStatusExampleItem < 3) { | |
188 o.itemId = "foo"; | |
189 o.link = "foo"; | |
190 o.submittedValue = "foo"; | |
191 o.title = "foo"; | |
192 o.valueOnLandingPage = "foo"; | |
193 } | |
194 buildCounterAccountStatusExampleItem--; | |
195 return o; | |
196 } | |
197 | |
198 checkAccountStatusExampleItem(api.AccountStatusExampleItem o) { | |
199 buildCounterAccountStatusExampleItem++; | |
200 if (buildCounterAccountStatusExampleItem < 3) { | |
201 unittest.expect(o.itemId, unittest.equals('foo')); | |
202 unittest.expect(o.link, unittest.equals('foo')); | |
203 unittest.expect(o.submittedValue, unittest.equals('foo')); | |
204 unittest.expect(o.title, unittest.equals('foo')); | |
205 unittest.expect(o.valueOnLandingPage, unittest.equals('foo')); | |
206 } | |
207 buildCounterAccountStatusExampleItem--; | |
208 } | |
209 | |
210 core.int buildCounterAccountUser = 0; | |
211 buildAccountUser() { | |
212 var o = new api.AccountUser(); | |
213 buildCounterAccountUser++; | |
214 if (buildCounterAccountUser < 3) { | |
215 o.admin = true; | |
216 o.emailAddress = "foo"; | |
217 } | |
218 buildCounterAccountUser--; | |
219 return o; | |
220 } | |
221 | |
222 checkAccountUser(api.AccountUser o) { | |
223 buildCounterAccountUser++; | |
224 if (buildCounterAccountUser < 3) { | |
225 unittest.expect(o.admin, unittest.isTrue); | |
226 unittest.expect(o.emailAddress, unittest.equals('foo')); | |
227 } | |
228 buildCounterAccountUser--; | |
229 } | |
230 | |
231 buildUnnamed303() { | |
232 var o = new core.List<api.AccountsCustomBatchRequestEntry>(); | |
233 o.add(buildAccountsCustomBatchRequestEntry()); | |
234 o.add(buildAccountsCustomBatchRequestEntry()); | |
235 return o; | |
236 } | |
237 | |
238 checkUnnamed303(core.List<api.AccountsCustomBatchRequestEntry> o) { | |
239 unittest.expect(o, unittest.hasLength(2)); | |
240 checkAccountsCustomBatchRequestEntry(o[0]); | |
241 checkAccountsCustomBatchRequestEntry(o[1]); | |
242 } | |
243 | |
244 core.int buildCounterAccountsCustomBatchRequest = 0; | |
245 buildAccountsCustomBatchRequest() { | |
246 var o = new api.AccountsCustomBatchRequest(); | |
247 buildCounterAccountsCustomBatchRequest++; | |
248 if (buildCounterAccountsCustomBatchRequest < 3) { | |
249 o.entries = buildUnnamed303(); | |
250 } | |
251 buildCounterAccountsCustomBatchRequest--; | |
252 return o; | |
253 } | |
254 | |
255 checkAccountsCustomBatchRequest(api.AccountsCustomBatchRequest o) { | |
256 buildCounterAccountsCustomBatchRequest++; | |
257 if (buildCounterAccountsCustomBatchRequest < 3) { | |
258 checkUnnamed303(o.entries); | |
259 } | |
260 buildCounterAccountsCustomBatchRequest--; | |
261 } | |
262 | |
263 core.int buildCounterAccountsCustomBatchRequestEntry = 0; | |
264 buildAccountsCustomBatchRequestEntry() { | |
265 var o = new api.AccountsCustomBatchRequestEntry(); | |
266 buildCounterAccountsCustomBatchRequestEntry++; | |
267 if (buildCounterAccountsCustomBatchRequestEntry < 3) { | |
268 o.account = buildAccount(); | |
269 o.accountId = "foo"; | |
270 o.batchId = 42; | |
271 o.merchantId = "foo"; | |
272 o.method = "foo"; | |
273 } | |
274 buildCounterAccountsCustomBatchRequestEntry--; | |
275 return o; | |
276 } | |
277 | |
278 checkAccountsCustomBatchRequestEntry(api.AccountsCustomBatchRequestEntry o) { | |
279 buildCounterAccountsCustomBatchRequestEntry++; | |
280 if (buildCounterAccountsCustomBatchRequestEntry < 3) { | |
281 checkAccount(o.account); | |
282 unittest.expect(o.accountId, unittest.equals('foo')); | |
283 unittest.expect(o.batchId, unittest.equals(42)); | |
284 unittest.expect(o.merchantId, unittest.equals('foo')); | |
285 unittest.expect(o.method, unittest.equals('foo')); | |
286 } | |
287 buildCounterAccountsCustomBatchRequestEntry--; | |
288 } | |
289 | |
290 buildUnnamed304() { | |
291 var o = new core.List<api.AccountsCustomBatchResponseEntry>(); | |
292 o.add(buildAccountsCustomBatchResponseEntry()); | |
293 o.add(buildAccountsCustomBatchResponseEntry()); | |
294 return o; | |
295 } | |
296 | |
297 checkUnnamed304(core.List<api.AccountsCustomBatchResponseEntry> o) { | |
298 unittest.expect(o, unittest.hasLength(2)); | |
299 checkAccountsCustomBatchResponseEntry(o[0]); | |
300 checkAccountsCustomBatchResponseEntry(o[1]); | |
301 } | |
302 | |
303 core.int buildCounterAccountsCustomBatchResponse = 0; | |
304 buildAccountsCustomBatchResponse() { | |
305 var o = new api.AccountsCustomBatchResponse(); | |
306 buildCounterAccountsCustomBatchResponse++; | |
307 if (buildCounterAccountsCustomBatchResponse < 3) { | |
308 o.entries = buildUnnamed304(); | |
309 o.kind = "foo"; | |
310 } | |
311 buildCounterAccountsCustomBatchResponse--; | |
312 return o; | |
313 } | |
314 | |
315 checkAccountsCustomBatchResponse(api.AccountsCustomBatchResponse o) { | |
316 buildCounterAccountsCustomBatchResponse++; | |
317 if (buildCounterAccountsCustomBatchResponse < 3) { | |
318 checkUnnamed304(o.entries); | |
319 unittest.expect(o.kind, unittest.equals('foo')); | |
320 } | |
321 buildCounterAccountsCustomBatchResponse--; | |
322 } | |
323 | |
324 core.int buildCounterAccountsCustomBatchResponseEntry = 0; | |
325 buildAccountsCustomBatchResponseEntry() { | |
326 var o = new api.AccountsCustomBatchResponseEntry(); | |
327 buildCounterAccountsCustomBatchResponseEntry++; | |
328 if (buildCounterAccountsCustomBatchResponseEntry < 3) { | |
329 o.account = buildAccount(); | |
330 o.batchId = 42; | |
331 o.errors = buildErrors(); | |
332 o.kind = "foo"; | |
333 } | |
334 buildCounterAccountsCustomBatchResponseEntry--; | |
335 return o; | |
336 } | |
337 | |
338 checkAccountsCustomBatchResponseEntry(api.AccountsCustomBatchResponseEntry o) { | |
339 buildCounterAccountsCustomBatchResponseEntry++; | |
340 if (buildCounterAccountsCustomBatchResponseEntry < 3) { | |
341 checkAccount(o.account); | |
342 unittest.expect(o.batchId, unittest.equals(42)); | |
343 checkErrors(o.errors); | |
344 unittest.expect(o.kind, unittest.equals('foo')); | |
345 } | |
346 buildCounterAccountsCustomBatchResponseEntry--; | |
347 } | |
348 | |
349 buildUnnamed305() { | |
350 var o = new core.List<api.Account>(); | |
351 o.add(buildAccount()); | |
352 o.add(buildAccount()); | |
353 return o; | |
354 } | |
355 | |
356 checkUnnamed305(core.List<api.Account> o) { | |
357 unittest.expect(o, unittest.hasLength(2)); | |
358 checkAccount(o[0]); | |
359 checkAccount(o[1]); | |
360 } | |
361 | |
362 core.int buildCounterAccountsListResponse = 0; | |
363 buildAccountsListResponse() { | |
364 var o = new api.AccountsListResponse(); | |
365 buildCounterAccountsListResponse++; | |
366 if (buildCounterAccountsListResponse < 3) { | |
367 o.kind = "foo"; | |
368 o.nextPageToken = "foo"; | |
369 o.resources = buildUnnamed305(); | |
370 } | |
371 buildCounterAccountsListResponse--; | |
372 return o; | |
373 } | |
374 | |
375 checkAccountsListResponse(api.AccountsListResponse o) { | |
376 buildCounterAccountsListResponse++; | |
377 if (buildCounterAccountsListResponse < 3) { | |
378 unittest.expect(o.kind, unittest.equals('foo')); | |
379 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
380 checkUnnamed305(o.resources); | |
381 } | |
382 buildCounterAccountsListResponse--; | |
383 } | |
384 | |
385 buildUnnamed306() { | |
386 var o = new core.List<api.AccountstatusesCustomBatchRequestEntry>(); | |
387 o.add(buildAccountstatusesCustomBatchRequestEntry()); | |
388 o.add(buildAccountstatusesCustomBatchRequestEntry()); | |
389 return o; | |
390 } | |
391 | |
392 checkUnnamed306(core.List<api.AccountstatusesCustomBatchRequestEntry> o) { | |
393 unittest.expect(o, unittest.hasLength(2)); | |
394 checkAccountstatusesCustomBatchRequestEntry(o[0]); | |
395 checkAccountstatusesCustomBatchRequestEntry(o[1]); | |
396 } | |
397 | |
398 core.int buildCounterAccountstatusesCustomBatchRequest = 0; | |
399 buildAccountstatusesCustomBatchRequest() { | |
400 var o = new api.AccountstatusesCustomBatchRequest(); | |
401 buildCounterAccountstatusesCustomBatchRequest++; | |
402 if (buildCounterAccountstatusesCustomBatchRequest < 3) { | |
403 o.entries = buildUnnamed306(); | |
404 } | |
405 buildCounterAccountstatusesCustomBatchRequest--; | |
406 return o; | |
407 } | |
408 | |
409 checkAccountstatusesCustomBatchRequest(api.AccountstatusesCustomBatchRequest o)
{ | |
410 buildCounterAccountstatusesCustomBatchRequest++; | |
411 if (buildCounterAccountstatusesCustomBatchRequest < 3) { | |
412 checkUnnamed306(o.entries); | |
413 } | |
414 buildCounterAccountstatusesCustomBatchRequest--; | |
415 } | |
416 | |
417 core.int buildCounterAccountstatusesCustomBatchRequestEntry = 0; | |
418 buildAccountstatusesCustomBatchRequestEntry() { | |
419 var o = new api.AccountstatusesCustomBatchRequestEntry(); | |
420 buildCounterAccountstatusesCustomBatchRequestEntry++; | |
421 if (buildCounterAccountstatusesCustomBatchRequestEntry < 3) { | |
422 o.accountId = "foo"; | |
423 o.batchId = 42; | |
424 o.merchantId = "foo"; | |
425 o.method = "foo"; | |
426 } | |
427 buildCounterAccountstatusesCustomBatchRequestEntry--; | |
428 return o; | |
429 } | |
430 | |
431 checkAccountstatusesCustomBatchRequestEntry(api.AccountstatusesCustomBatchReques
tEntry o) { | |
432 buildCounterAccountstatusesCustomBatchRequestEntry++; | |
433 if (buildCounterAccountstatusesCustomBatchRequestEntry < 3) { | |
434 unittest.expect(o.accountId, unittest.equals('foo')); | |
435 unittest.expect(o.batchId, unittest.equals(42)); | |
436 unittest.expect(o.merchantId, unittest.equals('foo')); | |
437 unittest.expect(o.method, unittest.equals('foo')); | |
438 } | |
439 buildCounterAccountstatusesCustomBatchRequestEntry--; | |
440 } | |
441 | |
442 buildUnnamed307() { | |
443 var o = new core.List<api.AccountstatusesCustomBatchResponseEntry>(); | |
444 o.add(buildAccountstatusesCustomBatchResponseEntry()); | |
445 o.add(buildAccountstatusesCustomBatchResponseEntry()); | |
446 return o; | |
447 } | |
448 | |
449 checkUnnamed307(core.List<api.AccountstatusesCustomBatchResponseEntry> o) { | |
450 unittest.expect(o, unittest.hasLength(2)); | |
451 checkAccountstatusesCustomBatchResponseEntry(o[0]); | |
452 checkAccountstatusesCustomBatchResponseEntry(o[1]); | |
453 } | |
454 | |
455 core.int buildCounterAccountstatusesCustomBatchResponse = 0; | |
456 buildAccountstatusesCustomBatchResponse() { | |
457 var o = new api.AccountstatusesCustomBatchResponse(); | |
458 buildCounterAccountstatusesCustomBatchResponse++; | |
459 if (buildCounterAccountstatusesCustomBatchResponse < 3) { | |
460 o.entries = buildUnnamed307(); | |
461 o.kind = "foo"; | |
462 } | |
463 buildCounterAccountstatusesCustomBatchResponse--; | |
464 return o; | |
465 } | |
466 | |
467 checkAccountstatusesCustomBatchResponse(api.AccountstatusesCustomBatchResponse o
) { | |
468 buildCounterAccountstatusesCustomBatchResponse++; | |
469 if (buildCounterAccountstatusesCustomBatchResponse < 3) { | |
470 checkUnnamed307(o.entries); | |
471 unittest.expect(o.kind, unittest.equals('foo')); | |
472 } | |
473 buildCounterAccountstatusesCustomBatchResponse--; | |
474 } | |
475 | |
476 core.int buildCounterAccountstatusesCustomBatchResponseEntry = 0; | |
477 buildAccountstatusesCustomBatchResponseEntry() { | |
478 var o = new api.AccountstatusesCustomBatchResponseEntry(); | |
479 buildCounterAccountstatusesCustomBatchResponseEntry++; | |
480 if (buildCounterAccountstatusesCustomBatchResponseEntry < 3) { | |
481 o.accountStatus = buildAccountStatus(); | |
482 o.batchId = 42; | |
483 o.errors = buildErrors(); | |
484 } | |
485 buildCounterAccountstatusesCustomBatchResponseEntry--; | |
486 return o; | |
487 } | |
488 | |
489 checkAccountstatusesCustomBatchResponseEntry(api.AccountstatusesCustomBatchRespo
nseEntry o) { | |
490 buildCounterAccountstatusesCustomBatchResponseEntry++; | |
491 if (buildCounterAccountstatusesCustomBatchResponseEntry < 3) { | |
492 checkAccountStatus(o.accountStatus); | |
493 unittest.expect(o.batchId, unittest.equals(42)); | |
494 checkErrors(o.errors); | |
495 } | |
496 buildCounterAccountstatusesCustomBatchResponseEntry--; | |
497 } | |
498 | |
499 buildUnnamed308() { | |
500 var o = new core.List<api.AccountStatus>(); | |
501 o.add(buildAccountStatus()); | |
502 o.add(buildAccountStatus()); | |
503 return o; | |
504 } | |
505 | |
506 checkUnnamed308(core.List<api.AccountStatus> o) { | |
507 unittest.expect(o, unittest.hasLength(2)); | |
508 checkAccountStatus(o[0]); | |
509 checkAccountStatus(o[1]); | |
510 } | |
511 | |
512 core.int buildCounterAccountstatusesListResponse = 0; | |
513 buildAccountstatusesListResponse() { | |
514 var o = new api.AccountstatusesListResponse(); | |
515 buildCounterAccountstatusesListResponse++; | |
516 if (buildCounterAccountstatusesListResponse < 3) { | |
517 o.kind = "foo"; | |
518 o.nextPageToken = "foo"; | |
519 o.resources = buildUnnamed308(); | |
520 } | |
521 buildCounterAccountstatusesListResponse--; | |
522 return o; | |
523 } | |
524 | |
525 checkAccountstatusesListResponse(api.AccountstatusesListResponse o) { | |
526 buildCounterAccountstatusesListResponse++; | |
527 if (buildCounterAccountstatusesListResponse < 3) { | |
528 unittest.expect(o.kind, unittest.equals('foo')); | |
529 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
530 checkUnnamed308(o.resources); | |
531 } | |
532 buildCounterAccountstatusesListResponse--; | |
533 } | |
534 | |
535 buildUnnamed309() { | |
536 var o = new core.List<core.String>(); | |
537 o.add("foo"); | |
538 o.add("foo"); | |
539 return o; | |
540 } | |
541 | |
542 checkUnnamed309(core.List<core.String> o) { | |
543 unittest.expect(o, unittest.hasLength(2)); | |
544 unittest.expect(o[0], unittest.equals('foo')); | |
545 unittest.expect(o[1], unittest.equals('foo')); | |
546 } | |
547 | |
548 core.int buildCounterDatafeed = 0; | |
549 buildDatafeed() { | |
550 var o = new api.Datafeed(); | |
551 buildCounterDatafeed++; | |
552 if (buildCounterDatafeed < 3) { | |
553 o.attributeLanguage = "foo"; | |
554 o.contentLanguage = "foo"; | |
555 o.contentType = "foo"; | |
556 o.fetchSchedule = buildDatafeedFetchSchedule(); | |
557 o.fileName = "foo"; | |
558 o.format = buildDatafeedFormat(); | |
559 o.id = "foo"; | |
560 o.intendedDestinations = buildUnnamed309(); | |
561 o.kind = "foo"; | |
562 o.name = "foo"; | |
563 o.targetCountry = "foo"; | |
564 } | |
565 buildCounterDatafeed--; | |
566 return o; | |
567 } | |
568 | |
569 checkDatafeed(api.Datafeed o) { | |
570 buildCounterDatafeed++; | |
571 if (buildCounterDatafeed < 3) { | |
572 unittest.expect(o.attributeLanguage, unittest.equals('foo')); | |
573 unittest.expect(o.contentLanguage, unittest.equals('foo')); | |
574 unittest.expect(o.contentType, unittest.equals('foo')); | |
575 checkDatafeedFetchSchedule(o.fetchSchedule); | |
576 unittest.expect(o.fileName, unittest.equals('foo')); | |
577 checkDatafeedFormat(o.format); | |
578 unittest.expect(o.id, unittest.equals('foo')); | |
579 checkUnnamed309(o.intendedDestinations); | |
580 unittest.expect(o.kind, unittest.equals('foo')); | |
581 unittest.expect(o.name, unittest.equals('foo')); | |
582 unittest.expect(o.targetCountry, unittest.equals('foo')); | |
583 } | |
584 buildCounterDatafeed--; | |
585 } | |
586 | |
587 core.int buildCounterDatafeedFetchSchedule = 0; | |
588 buildDatafeedFetchSchedule() { | |
589 var o = new api.DatafeedFetchSchedule(); | |
590 buildCounterDatafeedFetchSchedule++; | |
591 if (buildCounterDatafeedFetchSchedule < 3) { | |
592 o.dayOfMonth = 42; | |
593 o.fetchUrl = "foo"; | |
594 o.hour = 42; | |
595 o.password = "foo"; | |
596 o.timeZone = "foo"; | |
597 o.username = "foo"; | |
598 o.weekday = "foo"; | |
599 } | |
600 buildCounterDatafeedFetchSchedule--; | |
601 return o; | |
602 } | |
603 | |
604 checkDatafeedFetchSchedule(api.DatafeedFetchSchedule o) { | |
605 buildCounterDatafeedFetchSchedule++; | |
606 if (buildCounterDatafeedFetchSchedule < 3) { | |
607 unittest.expect(o.dayOfMonth, unittest.equals(42)); | |
608 unittest.expect(o.fetchUrl, unittest.equals('foo')); | |
609 unittest.expect(o.hour, unittest.equals(42)); | |
610 unittest.expect(o.password, unittest.equals('foo')); | |
611 unittest.expect(o.timeZone, unittest.equals('foo')); | |
612 unittest.expect(o.username, unittest.equals('foo')); | |
613 unittest.expect(o.weekday, unittest.equals('foo')); | |
614 } | |
615 buildCounterDatafeedFetchSchedule--; | |
616 } | |
617 | |
618 core.int buildCounterDatafeedFormat = 0; | |
619 buildDatafeedFormat() { | |
620 var o = new api.DatafeedFormat(); | |
621 buildCounterDatafeedFormat++; | |
622 if (buildCounterDatafeedFormat < 3) { | |
623 o.columnDelimiter = "foo"; | |
624 o.fileEncoding = "foo"; | |
625 o.quotingMode = "foo"; | |
626 } | |
627 buildCounterDatafeedFormat--; | |
628 return o; | |
629 } | |
630 | |
631 checkDatafeedFormat(api.DatafeedFormat o) { | |
632 buildCounterDatafeedFormat++; | |
633 if (buildCounterDatafeedFormat < 3) { | |
634 unittest.expect(o.columnDelimiter, unittest.equals('foo')); | |
635 unittest.expect(o.fileEncoding, unittest.equals('foo')); | |
636 unittest.expect(o.quotingMode, unittest.equals('foo')); | |
637 } | |
638 buildCounterDatafeedFormat--; | |
639 } | |
640 | |
641 buildUnnamed310() { | |
642 var o = new core.List<api.DatafeedStatusError>(); | |
643 o.add(buildDatafeedStatusError()); | |
644 o.add(buildDatafeedStatusError()); | |
645 return o; | |
646 } | |
647 | |
648 checkUnnamed310(core.List<api.DatafeedStatusError> o) { | |
649 unittest.expect(o, unittest.hasLength(2)); | |
650 checkDatafeedStatusError(o[0]); | |
651 checkDatafeedStatusError(o[1]); | |
652 } | |
653 | |
654 buildUnnamed311() { | |
655 var o = new core.List<api.DatafeedStatusError>(); | |
656 o.add(buildDatafeedStatusError()); | |
657 o.add(buildDatafeedStatusError()); | |
658 return o; | |
659 } | |
660 | |
661 checkUnnamed311(core.List<api.DatafeedStatusError> o) { | |
662 unittest.expect(o, unittest.hasLength(2)); | |
663 checkDatafeedStatusError(o[0]); | |
664 checkDatafeedStatusError(o[1]); | |
665 } | |
666 | |
667 core.int buildCounterDatafeedStatus = 0; | |
668 buildDatafeedStatus() { | |
669 var o = new api.DatafeedStatus(); | |
670 buildCounterDatafeedStatus++; | |
671 if (buildCounterDatafeedStatus < 3) { | |
672 o.datafeedId = "foo"; | |
673 o.errors = buildUnnamed310(); | |
674 o.itemsTotal = "foo"; | |
675 o.itemsValid = "foo"; | |
676 o.kind = "foo"; | |
677 o.processingStatus = "foo"; | |
678 o.warnings = buildUnnamed311(); | |
679 } | |
680 buildCounterDatafeedStatus--; | |
681 return o; | |
682 } | |
683 | |
684 checkDatafeedStatus(api.DatafeedStatus o) { | |
685 buildCounterDatafeedStatus++; | |
686 if (buildCounterDatafeedStatus < 3) { | |
687 unittest.expect(o.datafeedId, unittest.equals('foo')); | |
688 checkUnnamed310(o.errors); | |
689 unittest.expect(o.itemsTotal, unittest.equals('foo')); | |
690 unittest.expect(o.itemsValid, unittest.equals('foo')); | |
691 unittest.expect(o.kind, unittest.equals('foo')); | |
692 unittest.expect(o.processingStatus, unittest.equals('foo')); | |
693 checkUnnamed311(o.warnings); | |
694 } | |
695 buildCounterDatafeedStatus--; | |
696 } | |
697 | |
698 buildUnnamed312() { | |
699 var o = new core.List<api.DatafeedStatusExample>(); | |
700 o.add(buildDatafeedStatusExample()); | |
701 o.add(buildDatafeedStatusExample()); | |
702 return o; | |
703 } | |
704 | |
705 checkUnnamed312(core.List<api.DatafeedStatusExample> o) { | |
706 unittest.expect(o, unittest.hasLength(2)); | |
707 checkDatafeedStatusExample(o[0]); | |
708 checkDatafeedStatusExample(o[1]); | |
709 } | |
710 | |
711 core.int buildCounterDatafeedStatusError = 0; | |
712 buildDatafeedStatusError() { | |
713 var o = new api.DatafeedStatusError(); | |
714 buildCounterDatafeedStatusError++; | |
715 if (buildCounterDatafeedStatusError < 3) { | |
716 o.code = "foo"; | |
717 o.count = "foo"; | |
718 o.examples = buildUnnamed312(); | |
719 o.message = "foo"; | |
720 } | |
721 buildCounterDatafeedStatusError--; | |
722 return o; | |
723 } | |
724 | |
725 checkDatafeedStatusError(api.DatafeedStatusError o) { | |
726 buildCounterDatafeedStatusError++; | |
727 if (buildCounterDatafeedStatusError < 3) { | |
728 unittest.expect(o.code, unittest.equals('foo')); | |
729 unittest.expect(o.count, unittest.equals('foo')); | |
730 checkUnnamed312(o.examples); | |
731 unittest.expect(o.message, unittest.equals('foo')); | |
732 } | |
733 buildCounterDatafeedStatusError--; | |
734 } | |
735 | |
736 core.int buildCounterDatafeedStatusExample = 0; | |
737 buildDatafeedStatusExample() { | |
738 var o = new api.DatafeedStatusExample(); | |
739 buildCounterDatafeedStatusExample++; | |
740 if (buildCounterDatafeedStatusExample < 3) { | |
741 o.itemId = "foo"; | |
742 o.lineNumber = "foo"; | |
743 o.value = "foo"; | |
744 } | |
745 buildCounterDatafeedStatusExample--; | |
746 return o; | |
747 } | |
748 | |
749 checkDatafeedStatusExample(api.DatafeedStatusExample o) { | |
750 buildCounterDatafeedStatusExample++; | |
751 if (buildCounterDatafeedStatusExample < 3) { | |
752 unittest.expect(o.itemId, unittest.equals('foo')); | |
753 unittest.expect(o.lineNumber, unittest.equals('foo')); | |
754 unittest.expect(o.value, unittest.equals('foo')); | |
755 } | |
756 buildCounterDatafeedStatusExample--; | |
757 } | |
758 | |
759 buildUnnamed313() { | |
760 var o = new core.List<api.DatafeedsCustomBatchRequestEntry>(); | |
761 o.add(buildDatafeedsCustomBatchRequestEntry()); | |
762 o.add(buildDatafeedsCustomBatchRequestEntry()); | |
763 return o; | |
764 } | |
765 | |
766 checkUnnamed313(core.List<api.DatafeedsCustomBatchRequestEntry> o) { | |
767 unittest.expect(o, unittest.hasLength(2)); | |
768 checkDatafeedsCustomBatchRequestEntry(o[0]); | |
769 checkDatafeedsCustomBatchRequestEntry(o[1]); | |
770 } | |
771 | |
772 core.int buildCounterDatafeedsCustomBatchRequest = 0; | |
773 buildDatafeedsCustomBatchRequest() { | |
774 var o = new api.DatafeedsCustomBatchRequest(); | |
775 buildCounterDatafeedsCustomBatchRequest++; | |
776 if (buildCounterDatafeedsCustomBatchRequest < 3) { | |
777 o.entries = buildUnnamed313(); | |
778 } | |
779 buildCounterDatafeedsCustomBatchRequest--; | |
780 return o; | |
781 } | |
782 | |
783 checkDatafeedsCustomBatchRequest(api.DatafeedsCustomBatchRequest o) { | |
784 buildCounterDatafeedsCustomBatchRequest++; | |
785 if (buildCounterDatafeedsCustomBatchRequest < 3) { | |
786 checkUnnamed313(o.entries); | |
787 } | |
788 buildCounterDatafeedsCustomBatchRequest--; | |
789 } | |
790 | |
791 core.int buildCounterDatafeedsCustomBatchRequestEntry = 0; | |
792 buildDatafeedsCustomBatchRequestEntry() { | |
793 var o = new api.DatafeedsCustomBatchRequestEntry(); | |
794 buildCounterDatafeedsCustomBatchRequestEntry++; | |
795 if (buildCounterDatafeedsCustomBatchRequestEntry < 3) { | |
796 o.batchId = 42; | |
797 o.datafeed = buildDatafeed(); | |
798 o.datafeedId = "foo"; | |
799 o.merchantId = "foo"; | |
800 o.method = "foo"; | |
801 } | |
802 buildCounterDatafeedsCustomBatchRequestEntry--; | |
803 return o; | |
804 } | |
805 | |
806 checkDatafeedsCustomBatchRequestEntry(api.DatafeedsCustomBatchRequestEntry o) { | |
807 buildCounterDatafeedsCustomBatchRequestEntry++; | |
808 if (buildCounterDatafeedsCustomBatchRequestEntry < 3) { | |
809 unittest.expect(o.batchId, unittest.equals(42)); | |
810 checkDatafeed(o.datafeed); | |
811 unittest.expect(o.datafeedId, unittest.equals('foo')); | |
812 unittest.expect(o.merchantId, unittest.equals('foo')); | |
813 unittest.expect(o.method, unittest.equals('foo')); | |
814 } | |
815 buildCounterDatafeedsCustomBatchRequestEntry--; | |
816 } | |
817 | |
818 buildUnnamed314() { | |
819 var o = new core.List<api.DatafeedsCustomBatchResponseEntry>(); | |
820 o.add(buildDatafeedsCustomBatchResponseEntry()); | |
821 o.add(buildDatafeedsCustomBatchResponseEntry()); | |
822 return o; | |
823 } | |
824 | |
825 checkUnnamed314(core.List<api.DatafeedsCustomBatchResponseEntry> o) { | |
826 unittest.expect(o, unittest.hasLength(2)); | |
827 checkDatafeedsCustomBatchResponseEntry(o[0]); | |
828 checkDatafeedsCustomBatchResponseEntry(o[1]); | |
829 } | |
830 | |
831 core.int buildCounterDatafeedsCustomBatchResponse = 0; | |
832 buildDatafeedsCustomBatchResponse() { | |
833 var o = new api.DatafeedsCustomBatchResponse(); | |
834 buildCounterDatafeedsCustomBatchResponse++; | |
835 if (buildCounterDatafeedsCustomBatchResponse < 3) { | |
836 o.entries = buildUnnamed314(); | |
837 o.kind = "foo"; | |
838 } | |
839 buildCounterDatafeedsCustomBatchResponse--; | |
840 return o; | |
841 } | |
842 | |
843 checkDatafeedsCustomBatchResponse(api.DatafeedsCustomBatchResponse o) { | |
844 buildCounterDatafeedsCustomBatchResponse++; | |
845 if (buildCounterDatafeedsCustomBatchResponse < 3) { | |
846 checkUnnamed314(o.entries); | |
847 unittest.expect(o.kind, unittest.equals('foo')); | |
848 } | |
849 buildCounterDatafeedsCustomBatchResponse--; | |
850 } | |
851 | |
852 core.int buildCounterDatafeedsCustomBatchResponseEntry = 0; | |
853 buildDatafeedsCustomBatchResponseEntry() { | |
854 var o = new api.DatafeedsCustomBatchResponseEntry(); | |
855 buildCounterDatafeedsCustomBatchResponseEntry++; | |
856 if (buildCounterDatafeedsCustomBatchResponseEntry < 3) { | |
857 o.batchId = 42; | |
858 o.datafeed = buildDatafeed(); | |
859 o.errors = buildErrors(); | |
860 } | |
861 buildCounterDatafeedsCustomBatchResponseEntry--; | |
862 return o; | |
863 } | |
864 | |
865 checkDatafeedsCustomBatchResponseEntry(api.DatafeedsCustomBatchResponseEntry o)
{ | |
866 buildCounterDatafeedsCustomBatchResponseEntry++; | |
867 if (buildCounterDatafeedsCustomBatchResponseEntry < 3) { | |
868 unittest.expect(o.batchId, unittest.equals(42)); | |
869 checkDatafeed(o.datafeed); | |
870 checkErrors(o.errors); | |
871 } | |
872 buildCounterDatafeedsCustomBatchResponseEntry--; | |
873 } | |
874 | |
875 buildUnnamed315() { | |
876 var o = new core.List<api.Datafeed>(); | |
877 o.add(buildDatafeed()); | |
878 o.add(buildDatafeed()); | |
879 return o; | |
880 } | |
881 | |
882 checkUnnamed315(core.List<api.Datafeed> o) { | |
883 unittest.expect(o, unittest.hasLength(2)); | |
884 checkDatafeed(o[0]); | |
885 checkDatafeed(o[1]); | |
886 } | |
887 | |
888 core.int buildCounterDatafeedsListResponse = 0; | |
889 buildDatafeedsListResponse() { | |
890 var o = new api.DatafeedsListResponse(); | |
891 buildCounterDatafeedsListResponse++; | |
892 if (buildCounterDatafeedsListResponse < 3) { | |
893 o.kind = "foo"; | |
894 o.resources = buildUnnamed315(); | |
895 } | |
896 buildCounterDatafeedsListResponse--; | |
897 return o; | |
898 } | |
899 | |
900 checkDatafeedsListResponse(api.DatafeedsListResponse o) { | |
901 buildCounterDatafeedsListResponse++; | |
902 if (buildCounterDatafeedsListResponse < 3) { | |
903 unittest.expect(o.kind, unittest.equals('foo')); | |
904 checkUnnamed315(o.resources); | |
905 } | |
906 buildCounterDatafeedsListResponse--; | |
907 } | |
908 | |
909 buildUnnamed316() { | |
910 var o = new core.List<api.DatafeedstatusesCustomBatchRequestEntry>(); | |
911 o.add(buildDatafeedstatusesCustomBatchRequestEntry()); | |
912 o.add(buildDatafeedstatusesCustomBatchRequestEntry()); | |
913 return o; | |
914 } | |
915 | |
916 checkUnnamed316(core.List<api.DatafeedstatusesCustomBatchRequestEntry> o) { | |
917 unittest.expect(o, unittest.hasLength(2)); | |
918 checkDatafeedstatusesCustomBatchRequestEntry(o[0]); | |
919 checkDatafeedstatusesCustomBatchRequestEntry(o[1]); | |
920 } | |
921 | |
922 core.int buildCounterDatafeedstatusesCustomBatchRequest = 0; | |
923 buildDatafeedstatusesCustomBatchRequest() { | |
924 var o = new api.DatafeedstatusesCustomBatchRequest(); | |
925 buildCounterDatafeedstatusesCustomBatchRequest++; | |
926 if (buildCounterDatafeedstatusesCustomBatchRequest < 3) { | |
927 o.entries = buildUnnamed316(); | |
928 } | |
929 buildCounterDatafeedstatusesCustomBatchRequest--; | |
930 return o; | |
931 } | |
932 | |
933 checkDatafeedstatusesCustomBatchRequest(api.DatafeedstatusesCustomBatchRequest o
) { | |
934 buildCounterDatafeedstatusesCustomBatchRequest++; | |
935 if (buildCounterDatafeedstatusesCustomBatchRequest < 3) { | |
936 checkUnnamed316(o.entries); | |
937 } | |
938 buildCounterDatafeedstatusesCustomBatchRequest--; | |
939 } | |
940 | |
941 core.int buildCounterDatafeedstatusesCustomBatchRequestEntry = 0; | |
942 buildDatafeedstatusesCustomBatchRequestEntry() { | |
943 var o = new api.DatafeedstatusesCustomBatchRequestEntry(); | |
944 buildCounterDatafeedstatusesCustomBatchRequestEntry++; | |
945 if (buildCounterDatafeedstatusesCustomBatchRequestEntry < 3) { | |
946 o.batchId = 42; | |
947 o.datafeedId = "foo"; | |
948 o.merchantId = "foo"; | |
949 o.method = "foo"; | |
950 } | |
951 buildCounterDatafeedstatusesCustomBatchRequestEntry--; | |
952 return o; | |
953 } | |
954 | |
955 checkDatafeedstatusesCustomBatchRequestEntry(api.DatafeedstatusesCustomBatchRequ
estEntry o) { | |
956 buildCounterDatafeedstatusesCustomBatchRequestEntry++; | |
957 if (buildCounterDatafeedstatusesCustomBatchRequestEntry < 3) { | |
958 unittest.expect(o.batchId, unittest.equals(42)); | |
959 unittest.expect(o.datafeedId, unittest.equals('foo')); | |
960 unittest.expect(o.merchantId, unittest.equals('foo')); | |
961 unittest.expect(o.method, unittest.equals('foo')); | |
962 } | |
963 buildCounterDatafeedstatusesCustomBatchRequestEntry--; | |
964 } | |
965 | |
966 buildUnnamed317() { | |
967 var o = new core.List<api.DatafeedstatusesCustomBatchResponseEntry>(); | |
968 o.add(buildDatafeedstatusesCustomBatchResponseEntry()); | |
969 o.add(buildDatafeedstatusesCustomBatchResponseEntry()); | |
970 return o; | |
971 } | |
972 | |
973 checkUnnamed317(core.List<api.DatafeedstatusesCustomBatchResponseEntry> o) { | |
974 unittest.expect(o, unittest.hasLength(2)); | |
975 checkDatafeedstatusesCustomBatchResponseEntry(o[0]); | |
976 checkDatafeedstatusesCustomBatchResponseEntry(o[1]); | |
977 } | |
978 | |
979 core.int buildCounterDatafeedstatusesCustomBatchResponse = 0; | |
980 buildDatafeedstatusesCustomBatchResponse() { | |
981 var o = new api.DatafeedstatusesCustomBatchResponse(); | |
982 buildCounterDatafeedstatusesCustomBatchResponse++; | |
983 if (buildCounterDatafeedstatusesCustomBatchResponse < 3) { | |
984 o.entries = buildUnnamed317(); | |
985 o.kind = "foo"; | |
986 } | |
987 buildCounterDatafeedstatusesCustomBatchResponse--; | |
988 return o; | |
989 } | |
990 | |
991 checkDatafeedstatusesCustomBatchResponse(api.DatafeedstatusesCustomBatchResponse
o) { | |
992 buildCounterDatafeedstatusesCustomBatchResponse++; | |
993 if (buildCounterDatafeedstatusesCustomBatchResponse < 3) { | |
994 checkUnnamed317(o.entries); | |
995 unittest.expect(o.kind, unittest.equals('foo')); | |
996 } | |
997 buildCounterDatafeedstatusesCustomBatchResponse--; | |
998 } | |
999 | |
1000 core.int buildCounterDatafeedstatusesCustomBatchResponseEntry = 0; | |
1001 buildDatafeedstatusesCustomBatchResponseEntry() { | |
1002 var o = new api.DatafeedstatusesCustomBatchResponseEntry(); | |
1003 buildCounterDatafeedstatusesCustomBatchResponseEntry++; | |
1004 if (buildCounterDatafeedstatusesCustomBatchResponseEntry < 3) { | |
1005 o.batchId = 42; | |
1006 o.datafeedStatus = buildDatafeedStatus(); | |
1007 o.errors = buildErrors(); | |
1008 } | |
1009 buildCounterDatafeedstatusesCustomBatchResponseEntry--; | |
1010 return o; | |
1011 } | |
1012 | |
1013 checkDatafeedstatusesCustomBatchResponseEntry(api.DatafeedstatusesCustomBatchRes
ponseEntry o) { | |
1014 buildCounterDatafeedstatusesCustomBatchResponseEntry++; | |
1015 if (buildCounterDatafeedstatusesCustomBatchResponseEntry < 3) { | |
1016 unittest.expect(o.batchId, unittest.equals(42)); | |
1017 checkDatafeedStatus(o.datafeedStatus); | |
1018 checkErrors(o.errors); | |
1019 } | |
1020 buildCounterDatafeedstatusesCustomBatchResponseEntry--; | |
1021 } | |
1022 | |
1023 buildUnnamed318() { | |
1024 var o = new core.List<api.DatafeedStatus>(); | |
1025 o.add(buildDatafeedStatus()); | |
1026 o.add(buildDatafeedStatus()); | |
1027 return o; | |
1028 } | |
1029 | |
1030 checkUnnamed318(core.List<api.DatafeedStatus> o) { | |
1031 unittest.expect(o, unittest.hasLength(2)); | |
1032 checkDatafeedStatus(o[0]); | |
1033 checkDatafeedStatus(o[1]); | |
1034 } | |
1035 | |
1036 core.int buildCounterDatafeedstatusesListResponse = 0; | |
1037 buildDatafeedstatusesListResponse() { | |
1038 var o = new api.DatafeedstatusesListResponse(); | |
1039 buildCounterDatafeedstatusesListResponse++; | |
1040 if (buildCounterDatafeedstatusesListResponse < 3) { | |
1041 o.kind = "foo"; | |
1042 o.resources = buildUnnamed318(); | |
1043 } | |
1044 buildCounterDatafeedstatusesListResponse--; | |
1045 return o; | |
1046 } | |
1047 | |
1048 checkDatafeedstatusesListResponse(api.DatafeedstatusesListResponse o) { | |
1049 buildCounterDatafeedstatusesListResponse++; | |
1050 if (buildCounterDatafeedstatusesListResponse < 3) { | |
1051 unittest.expect(o.kind, unittest.equals('foo')); | |
1052 checkUnnamed318(o.resources); | |
1053 } | |
1054 buildCounterDatafeedstatusesListResponse--; | |
1055 } | |
1056 | |
1057 core.int buildCounterError = 0; | |
1058 buildError() { | |
1059 var o = new api.Error(); | |
1060 buildCounterError++; | |
1061 if (buildCounterError < 3) { | |
1062 o.domain = "foo"; | |
1063 o.message = "foo"; | |
1064 o.reason = "foo"; | |
1065 } | |
1066 buildCounterError--; | |
1067 return o; | |
1068 } | |
1069 | |
1070 checkError(api.Error o) { | |
1071 buildCounterError++; | |
1072 if (buildCounterError < 3) { | |
1073 unittest.expect(o.domain, unittest.equals('foo')); | |
1074 unittest.expect(o.message, unittest.equals('foo')); | |
1075 unittest.expect(o.reason, unittest.equals('foo')); | |
1076 } | |
1077 buildCounterError--; | |
1078 } | |
1079 | |
1080 buildUnnamed319() { | |
1081 var o = new core.List<api.Error>(); | |
1082 o.add(buildError()); | |
1083 o.add(buildError()); | |
1084 return o; | |
1085 } | |
1086 | |
1087 checkUnnamed319(core.List<api.Error> o) { | |
1088 unittest.expect(o, unittest.hasLength(2)); | |
1089 checkError(o[0]); | |
1090 checkError(o[1]); | |
1091 } | |
1092 | |
1093 core.int buildCounterErrors = 0; | |
1094 buildErrors() { | |
1095 var o = new api.Errors(); | |
1096 buildCounterErrors++; | |
1097 if (buildCounterErrors < 3) { | |
1098 o.code = 42; | |
1099 o.errors = buildUnnamed319(); | |
1100 o.message = "foo"; | |
1101 } | |
1102 buildCounterErrors--; | |
1103 return o; | |
1104 } | |
1105 | |
1106 checkErrors(api.Errors o) { | |
1107 buildCounterErrors++; | |
1108 if (buildCounterErrors < 3) { | |
1109 unittest.expect(o.code, unittest.equals(42)); | |
1110 checkUnnamed319(o.errors); | |
1111 unittest.expect(o.message, unittest.equals('foo')); | |
1112 } | |
1113 buildCounterErrors--; | |
1114 } | |
1115 | |
1116 core.int buildCounterInventory = 0; | |
1117 buildInventory() { | |
1118 var o = new api.Inventory(); | |
1119 buildCounterInventory++; | |
1120 if (buildCounterInventory < 3) { | |
1121 o.availability = "foo"; | |
1122 o.kind = "foo"; | |
1123 o.price = buildPrice(); | |
1124 o.quantity = 42; | |
1125 o.salePrice = buildPrice(); | |
1126 o.salePriceEffectiveDate = "foo"; | |
1127 } | |
1128 buildCounterInventory--; | |
1129 return o; | |
1130 } | |
1131 | |
1132 checkInventory(api.Inventory o) { | |
1133 buildCounterInventory++; | |
1134 if (buildCounterInventory < 3) { | |
1135 unittest.expect(o.availability, unittest.equals('foo')); | |
1136 unittest.expect(o.kind, unittest.equals('foo')); | |
1137 checkPrice(o.price); | |
1138 unittest.expect(o.quantity, unittest.equals(42)); | |
1139 checkPrice(o.salePrice); | |
1140 unittest.expect(o.salePriceEffectiveDate, unittest.equals('foo')); | |
1141 } | |
1142 buildCounterInventory--; | |
1143 } | |
1144 | |
1145 buildUnnamed320() { | |
1146 var o = new core.List<api.InventoryCustomBatchRequestEntry>(); | |
1147 o.add(buildInventoryCustomBatchRequestEntry()); | |
1148 o.add(buildInventoryCustomBatchRequestEntry()); | |
1149 return o; | |
1150 } | |
1151 | |
1152 checkUnnamed320(core.List<api.InventoryCustomBatchRequestEntry> o) { | |
1153 unittest.expect(o, unittest.hasLength(2)); | |
1154 checkInventoryCustomBatchRequestEntry(o[0]); | |
1155 checkInventoryCustomBatchRequestEntry(o[1]); | |
1156 } | |
1157 | |
1158 core.int buildCounterInventoryCustomBatchRequest = 0; | |
1159 buildInventoryCustomBatchRequest() { | |
1160 var o = new api.InventoryCustomBatchRequest(); | |
1161 buildCounterInventoryCustomBatchRequest++; | |
1162 if (buildCounterInventoryCustomBatchRequest < 3) { | |
1163 o.entries = buildUnnamed320(); | |
1164 } | |
1165 buildCounterInventoryCustomBatchRequest--; | |
1166 return o; | |
1167 } | |
1168 | |
1169 checkInventoryCustomBatchRequest(api.InventoryCustomBatchRequest o) { | |
1170 buildCounterInventoryCustomBatchRequest++; | |
1171 if (buildCounterInventoryCustomBatchRequest < 3) { | |
1172 checkUnnamed320(o.entries); | |
1173 } | |
1174 buildCounterInventoryCustomBatchRequest--; | |
1175 } | |
1176 | |
1177 core.int buildCounterInventoryCustomBatchRequestEntry = 0; | |
1178 buildInventoryCustomBatchRequestEntry() { | |
1179 var o = new api.InventoryCustomBatchRequestEntry(); | |
1180 buildCounterInventoryCustomBatchRequestEntry++; | |
1181 if (buildCounterInventoryCustomBatchRequestEntry < 3) { | |
1182 o.batchId = 42; | |
1183 o.inventory = buildInventory(); | |
1184 o.merchantId = "foo"; | |
1185 o.productId = "foo"; | |
1186 o.storeCode = "foo"; | |
1187 } | |
1188 buildCounterInventoryCustomBatchRequestEntry--; | |
1189 return o; | |
1190 } | |
1191 | |
1192 checkInventoryCustomBatchRequestEntry(api.InventoryCustomBatchRequestEntry o) { | |
1193 buildCounterInventoryCustomBatchRequestEntry++; | |
1194 if (buildCounterInventoryCustomBatchRequestEntry < 3) { | |
1195 unittest.expect(o.batchId, unittest.equals(42)); | |
1196 checkInventory(o.inventory); | |
1197 unittest.expect(o.merchantId, unittest.equals('foo')); | |
1198 unittest.expect(o.productId, unittest.equals('foo')); | |
1199 unittest.expect(o.storeCode, unittest.equals('foo')); | |
1200 } | |
1201 buildCounterInventoryCustomBatchRequestEntry--; | |
1202 } | |
1203 | |
1204 buildUnnamed321() { | |
1205 var o = new core.List<api.InventoryCustomBatchResponseEntry>(); | |
1206 o.add(buildInventoryCustomBatchResponseEntry()); | |
1207 o.add(buildInventoryCustomBatchResponseEntry()); | |
1208 return o; | |
1209 } | |
1210 | |
1211 checkUnnamed321(core.List<api.InventoryCustomBatchResponseEntry> o) { | |
1212 unittest.expect(o, unittest.hasLength(2)); | |
1213 checkInventoryCustomBatchResponseEntry(o[0]); | |
1214 checkInventoryCustomBatchResponseEntry(o[1]); | |
1215 } | |
1216 | |
1217 core.int buildCounterInventoryCustomBatchResponse = 0; | |
1218 buildInventoryCustomBatchResponse() { | |
1219 var o = new api.InventoryCustomBatchResponse(); | |
1220 buildCounterInventoryCustomBatchResponse++; | |
1221 if (buildCounterInventoryCustomBatchResponse < 3) { | |
1222 o.entries = buildUnnamed321(); | |
1223 o.kind = "foo"; | |
1224 } | |
1225 buildCounterInventoryCustomBatchResponse--; | |
1226 return o; | |
1227 } | |
1228 | |
1229 checkInventoryCustomBatchResponse(api.InventoryCustomBatchResponse o) { | |
1230 buildCounterInventoryCustomBatchResponse++; | |
1231 if (buildCounterInventoryCustomBatchResponse < 3) { | |
1232 checkUnnamed321(o.entries); | |
1233 unittest.expect(o.kind, unittest.equals('foo')); | |
1234 } | |
1235 buildCounterInventoryCustomBatchResponse--; | |
1236 } | |
1237 | |
1238 core.int buildCounterInventoryCustomBatchResponseEntry = 0; | |
1239 buildInventoryCustomBatchResponseEntry() { | |
1240 var o = new api.InventoryCustomBatchResponseEntry(); | |
1241 buildCounterInventoryCustomBatchResponseEntry++; | |
1242 if (buildCounterInventoryCustomBatchResponseEntry < 3) { | |
1243 o.batchId = 42; | |
1244 o.errors = buildErrors(); | |
1245 o.kind = "foo"; | |
1246 } | |
1247 buildCounterInventoryCustomBatchResponseEntry--; | |
1248 return o; | |
1249 } | |
1250 | |
1251 checkInventoryCustomBatchResponseEntry(api.InventoryCustomBatchResponseEntry o)
{ | |
1252 buildCounterInventoryCustomBatchResponseEntry++; | |
1253 if (buildCounterInventoryCustomBatchResponseEntry < 3) { | |
1254 unittest.expect(o.batchId, unittest.equals(42)); | |
1255 checkErrors(o.errors); | |
1256 unittest.expect(o.kind, unittest.equals('foo')); | |
1257 } | |
1258 buildCounterInventoryCustomBatchResponseEntry--; | |
1259 } | |
1260 | |
1261 core.int buildCounterInventorySetRequest = 0; | |
1262 buildInventorySetRequest() { | |
1263 var o = new api.InventorySetRequest(); | |
1264 buildCounterInventorySetRequest++; | |
1265 if (buildCounterInventorySetRequest < 3) { | |
1266 o.availability = "foo"; | |
1267 o.price = buildPrice(); | |
1268 o.quantity = 42; | |
1269 o.salePrice = buildPrice(); | |
1270 o.salePriceEffectiveDate = "foo"; | |
1271 } | |
1272 buildCounterInventorySetRequest--; | |
1273 return o; | |
1274 } | |
1275 | |
1276 checkInventorySetRequest(api.InventorySetRequest o) { | |
1277 buildCounterInventorySetRequest++; | |
1278 if (buildCounterInventorySetRequest < 3) { | |
1279 unittest.expect(o.availability, unittest.equals('foo')); | |
1280 checkPrice(o.price); | |
1281 unittest.expect(o.quantity, unittest.equals(42)); | |
1282 checkPrice(o.salePrice); | |
1283 unittest.expect(o.salePriceEffectiveDate, unittest.equals('foo')); | |
1284 } | |
1285 buildCounterInventorySetRequest--; | |
1286 } | |
1287 | |
1288 core.int buildCounterInventorySetResponse = 0; | |
1289 buildInventorySetResponse() { | |
1290 var o = new api.InventorySetResponse(); | |
1291 buildCounterInventorySetResponse++; | |
1292 if (buildCounterInventorySetResponse < 3) { | |
1293 o.kind = "foo"; | |
1294 } | |
1295 buildCounterInventorySetResponse--; | |
1296 return o; | |
1297 } | |
1298 | |
1299 checkInventorySetResponse(api.InventorySetResponse o) { | |
1300 buildCounterInventorySetResponse++; | |
1301 if (buildCounterInventorySetResponse < 3) { | |
1302 unittest.expect(o.kind, unittest.equals('foo')); | |
1303 } | |
1304 buildCounterInventorySetResponse--; | |
1305 } | |
1306 | |
1307 core.int buildCounterLoyaltyPoints = 0; | |
1308 buildLoyaltyPoints() { | |
1309 var o = new api.LoyaltyPoints(); | |
1310 buildCounterLoyaltyPoints++; | |
1311 if (buildCounterLoyaltyPoints < 3) { | |
1312 o.name = "foo"; | |
1313 o.pointsValue = "foo"; | |
1314 o.ratio = 42.0; | |
1315 } | |
1316 buildCounterLoyaltyPoints--; | |
1317 return o; | |
1318 } | |
1319 | |
1320 checkLoyaltyPoints(api.LoyaltyPoints o) { | |
1321 buildCounterLoyaltyPoints++; | |
1322 if (buildCounterLoyaltyPoints < 3) { | |
1323 unittest.expect(o.name, unittest.equals('foo')); | |
1324 unittest.expect(o.pointsValue, unittest.equals('foo')); | |
1325 unittest.expect(o.ratio, unittest.equals(42.0)); | |
1326 } | |
1327 buildCounterLoyaltyPoints--; | |
1328 } | |
1329 | |
1330 core.int buildCounterPrice = 0; | |
1331 buildPrice() { | |
1332 var o = new api.Price(); | |
1333 buildCounterPrice++; | |
1334 if (buildCounterPrice < 3) { | |
1335 o.currency = "foo"; | |
1336 o.value = "foo"; | |
1337 } | |
1338 buildCounterPrice--; | |
1339 return o; | |
1340 } | |
1341 | |
1342 checkPrice(api.Price o) { | |
1343 buildCounterPrice++; | |
1344 if (buildCounterPrice < 3) { | |
1345 unittest.expect(o.currency, unittest.equals('foo')); | |
1346 unittest.expect(o.value, unittest.equals('foo')); | |
1347 } | |
1348 buildCounterPrice--; | |
1349 } | |
1350 | |
1351 buildUnnamed322() { | |
1352 var o = new core.List<core.String>(); | |
1353 o.add("foo"); | |
1354 o.add("foo"); | |
1355 return o; | |
1356 } | |
1357 | |
1358 checkUnnamed322(core.List<core.String> o) { | |
1359 unittest.expect(o, unittest.hasLength(2)); | |
1360 unittest.expect(o[0], unittest.equals('foo')); | |
1361 unittest.expect(o[1], unittest.equals('foo')); | |
1362 } | |
1363 | |
1364 buildUnnamed323() { | |
1365 var o = new core.List<core.String>(); | |
1366 o.add("foo"); | |
1367 o.add("foo"); | |
1368 return o; | |
1369 } | |
1370 | |
1371 checkUnnamed323(core.List<core.String> o) { | |
1372 unittest.expect(o, unittest.hasLength(2)); | |
1373 unittest.expect(o[0], unittest.equals('foo')); | |
1374 unittest.expect(o[1], unittest.equals('foo')); | |
1375 } | |
1376 | |
1377 buildUnnamed324() { | |
1378 var o = new core.List<api.ProductCustomAttribute>(); | |
1379 o.add(buildProductCustomAttribute()); | |
1380 o.add(buildProductCustomAttribute()); | |
1381 return o; | |
1382 } | |
1383 | |
1384 checkUnnamed324(core.List<api.ProductCustomAttribute> o) { | |
1385 unittest.expect(o, unittest.hasLength(2)); | |
1386 checkProductCustomAttribute(o[0]); | |
1387 checkProductCustomAttribute(o[1]); | |
1388 } | |
1389 | |
1390 buildUnnamed325() { | |
1391 var o = new core.List<api.ProductCustomGroup>(); | |
1392 o.add(buildProductCustomGroup()); | |
1393 o.add(buildProductCustomGroup()); | |
1394 return o; | |
1395 } | |
1396 | |
1397 checkUnnamed325(core.List<api.ProductCustomGroup> o) { | |
1398 unittest.expect(o, unittest.hasLength(2)); | |
1399 checkProductCustomGroup(o[0]); | |
1400 checkProductCustomGroup(o[1]); | |
1401 } | |
1402 | |
1403 buildUnnamed326() { | |
1404 var o = new core.List<api.ProductDestination>(); | |
1405 o.add(buildProductDestination()); | |
1406 o.add(buildProductDestination()); | |
1407 return o; | |
1408 } | |
1409 | |
1410 checkUnnamed326(core.List<api.ProductDestination> o) { | |
1411 unittest.expect(o, unittest.hasLength(2)); | |
1412 checkProductDestination(o[0]); | |
1413 checkProductDestination(o[1]); | |
1414 } | |
1415 | |
1416 buildUnnamed327() { | |
1417 var o = new core.List<api.ProductShipping>(); | |
1418 o.add(buildProductShipping()); | |
1419 o.add(buildProductShipping()); | |
1420 return o; | |
1421 } | |
1422 | |
1423 checkUnnamed327(core.List<api.ProductShipping> o) { | |
1424 unittest.expect(o, unittest.hasLength(2)); | |
1425 checkProductShipping(o[0]); | |
1426 checkProductShipping(o[1]); | |
1427 } | |
1428 | |
1429 buildUnnamed328() { | |
1430 var o = new core.List<core.String>(); | |
1431 o.add("foo"); | |
1432 o.add("foo"); | |
1433 return o; | |
1434 } | |
1435 | |
1436 checkUnnamed328(core.List<core.String> o) { | |
1437 unittest.expect(o, unittest.hasLength(2)); | |
1438 unittest.expect(o[0], unittest.equals('foo')); | |
1439 unittest.expect(o[1], unittest.equals('foo')); | |
1440 } | |
1441 | |
1442 buildUnnamed329() { | |
1443 var o = new core.List<api.ProductTax>(); | |
1444 o.add(buildProductTax()); | |
1445 o.add(buildProductTax()); | |
1446 return o; | |
1447 } | |
1448 | |
1449 checkUnnamed329(core.List<api.ProductTax> o) { | |
1450 unittest.expect(o, unittest.hasLength(2)); | |
1451 checkProductTax(o[0]); | |
1452 checkProductTax(o[1]); | |
1453 } | |
1454 | |
1455 buildUnnamed330() { | |
1456 var o = new core.List<core.String>(); | |
1457 o.add("foo"); | |
1458 o.add("foo"); | |
1459 return o; | |
1460 } | |
1461 | |
1462 checkUnnamed330(core.List<core.String> o) { | |
1463 unittest.expect(o, unittest.hasLength(2)); | |
1464 unittest.expect(o[0], unittest.equals('foo')); | |
1465 unittest.expect(o[1], unittest.equals('foo')); | |
1466 } | |
1467 | |
1468 buildUnnamed331() { | |
1469 var o = new core.List<api.Error>(); | |
1470 o.add(buildError()); | |
1471 o.add(buildError()); | |
1472 return o; | |
1473 } | |
1474 | |
1475 checkUnnamed331(core.List<api.Error> o) { | |
1476 unittest.expect(o, unittest.hasLength(2)); | |
1477 checkError(o[0]); | |
1478 checkError(o[1]); | |
1479 } | |
1480 | |
1481 core.int buildCounterProduct = 0; | |
1482 buildProduct() { | |
1483 var o = new api.Product(); | |
1484 buildCounterProduct++; | |
1485 if (buildCounterProduct < 3) { | |
1486 o.additionalImageLinks = buildUnnamed322(); | |
1487 o.adult = true; | |
1488 o.adwordsGrouping = "foo"; | |
1489 o.adwordsLabels = buildUnnamed323(); | |
1490 o.adwordsRedirect = "foo"; | |
1491 o.ageGroup = "foo"; | |
1492 o.availability = "foo"; | |
1493 o.availabilityDate = "foo"; | |
1494 o.brand = "foo"; | |
1495 o.channel = "foo"; | |
1496 o.color = "foo"; | |
1497 o.condition = "foo"; | |
1498 o.contentLanguage = "foo"; | |
1499 o.customAttributes = buildUnnamed324(); | |
1500 o.customGroups = buildUnnamed325(); | |
1501 o.customLabel0 = "foo"; | |
1502 o.customLabel1 = "foo"; | |
1503 o.customLabel2 = "foo"; | |
1504 o.customLabel3 = "foo"; | |
1505 o.customLabel4 = "foo"; | |
1506 o.description = "foo"; | |
1507 o.destinations = buildUnnamed326(); | |
1508 o.energyEfficiencyClass = "foo"; | |
1509 o.expirationDate = "foo"; | |
1510 o.gender = "foo"; | |
1511 o.googleProductCategory = "foo"; | |
1512 o.gtin = "foo"; | |
1513 o.id = "foo"; | |
1514 o.identifierExists = true; | |
1515 o.imageLink = "foo"; | |
1516 o.installment = buildProductInstallment(); | |
1517 o.isBundle = true; | |
1518 o.itemGroupId = "foo"; | |
1519 o.kind = "foo"; | |
1520 o.link = "foo"; | |
1521 o.loyaltyPoints = buildLoyaltyPoints(); | |
1522 o.material = "foo"; | |
1523 o.mobileLink = "foo"; | |
1524 o.mpn = "foo"; | |
1525 o.multipack = "foo"; | |
1526 o.offerId = "foo"; | |
1527 o.onlineOnly = true; | |
1528 o.pattern = "foo"; | |
1529 o.price = buildPrice(); | |
1530 o.productType = "foo"; | |
1531 o.salePrice = buildPrice(); | |
1532 o.salePriceEffectiveDate = "foo"; | |
1533 o.shipping = buildUnnamed327(); | |
1534 o.shippingLabel = "foo"; | |
1535 o.shippingWeight = buildProductShippingWeight(); | |
1536 o.sizeSystem = "foo"; | |
1537 o.sizeType = "foo"; | |
1538 o.sizes = buildUnnamed328(); | |
1539 o.targetCountry = "foo"; | |
1540 o.taxes = buildUnnamed329(); | |
1541 o.title = "foo"; | |
1542 o.unitPricingBaseMeasure = buildProductUnitPricingBaseMeasure(); | |
1543 o.unitPricingMeasure = buildProductUnitPricingMeasure(); | |
1544 o.validatedDestinations = buildUnnamed330(); | |
1545 o.warnings = buildUnnamed331(); | |
1546 } | |
1547 buildCounterProduct--; | |
1548 return o; | |
1549 } | |
1550 | |
1551 checkProduct(api.Product o) { | |
1552 buildCounterProduct++; | |
1553 if (buildCounterProduct < 3) { | |
1554 checkUnnamed322(o.additionalImageLinks); | |
1555 unittest.expect(o.adult, unittest.isTrue); | |
1556 unittest.expect(o.adwordsGrouping, unittest.equals('foo')); | |
1557 checkUnnamed323(o.adwordsLabels); | |
1558 unittest.expect(o.adwordsRedirect, unittest.equals('foo')); | |
1559 unittest.expect(o.ageGroup, unittest.equals('foo')); | |
1560 unittest.expect(o.availability, unittest.equals('foo')); | |
1561 unittest.expect(o.availabilityDate, unittest.equals('foo')); | |
1562 unittest.expect(o.brand, unittest.equals('foo')); | |
1563 unittest.expect(o.channel, unittest.equals('foo')); | |
1564 unittest.expect(o.color, unittest.equals('foo')); | |
1565 unittest.expect(o.condition, unittest.equals('foo')); | |
1566 unittest.expect(o.contentLanguage, unittest.equals('foo')); | |
1567 checkUnnamed324(o.customAttributes); | |
1568 checkUnnamed325(o.customGroups); | |
1569 unittest.expect(o.customLabel0, unittest.equals('foo')); | |
1570 unittest.expect(o.customLabel1, unittest.equals('foo')); | |
1571 unittest.expect(o.customLabel2, unittest.equals('foo')); | |
1572 unittest.expect(o.customLabel3, unittest.equals('foo')); | |
1573 unittest.expect(o.customLabel4, unittest.equals('foo')); | |
1574 unittest.expect(o.description, unittest.equals('foo')); | |
1575 checkUnnamed326(o.destinations); | |
1576 unittest.expect(o.energyEfficiencyClass, unittest.equals('foo')); | |
1577 unittest.expect(o.expirationDate, unittest.equals('foo')); | |
1578 unittest.expect(o.gender, unittest.equals('foo')); | |
1579 unittest.expect(o.googleProductCategory, unittest.equals('foo')); | |
1580 unittest.expect(o.gtin, unittest.equals('foo')); | |
1581 unittest.expect(o.id, unittest.equals('foo')); | |
1582 unittest.expect(o.identifierExists, unittest.isTrue); | |
1583 unittest.expect(o.imageLink, unittest.equals('foo')); | |
1584 checkProductInstallment(o.installment); | |
1585 unittest.expect(o.isBundle, unittest.isTrue); | |
1586 unittest.expect(o.itemGroupId, unittest.equals('foo')); | |
1587 unittest.expect(o.kind, unittest.equals('foo')); | |
1588 unittest.expect(o.link, unittest.equals('foo')); | |
1589 checkLoyaltyPoints(o.loyaltyPoints); | |
1590 unittest.expect(o.material, unittest.equals('foo')); | |
1591 unittest.expect(o.mobileLink, unittest.equals('foo')); | |
1592 unittest.expect(o.mpn, unittest.equals('foo')); | |
1593 unittest.expect(o.multipack, unittest.equals('foo')); | |
1594 unittest.expect(o.offerId, unittest.equals('foo')); | |
1595 unittest.expect(o.onlineOnly, unittest.isTrue); | |
1596 unittest.expect(o.pattern, unittest.equals('foo')); | |
1597 checkPrice(o.price); | |
1598 unittest.expect(o.productType, unittest.equals('foo')); | |
1599 checkPrice(o.salePrice); | |
1600 unittest.expect(o.salePriceEffectiveDate, unittest.equals('foo')); | |
1601 checkUnnamed327(o.shipping); | |
1602 unittest.expect(o.shippingLabel, unittest.equals('foo')); | |
1603 checkProductShippingWeight(o.shippingWeight); | |
1604 unittest.expect(o.sizeSystem, unittest.equals('foo')); | |
1605 unittest.expect(o.sizeType, unittest.equals('foo')); | |
1606 checkUnnamed328(o.sizes); | |
1607 unittest.expect(o.targetCountry, unittest.equals('foo')); | |
1608 checkUnnamed329(o.taxes); | |
1609 unittest.expect(o.title, unittest.equals('foo')); | |
1610 checkProductUnitPricingBaseMeasure(o.unitPricingBaseMeasure); | |
1611 checkProductUnitPricingMeasure(o.unitPricingMeasure); | |
1612 checkUnnamed330(o.validatedDestinations); | |
1613 checkUnnamed331(o.warnings); | |
1614 } | |
1615 buildCounterProduct--; | |
1616 } | |
1617 | |
1618 core.int buildCounterProductCustomAttribute = 0; | |
1619 buildProductCustomAttribute() { | |
1620 var o = new api.ProductCustomAttribute(); | |
1621 buildCounterProductCustomAttribute++; | |
1622 if (buildCounterProductCustomAttribute < 3) { | |
1623 o.name = "foo"; | |
1624 o.type = "foo"; | |
1625 o.unit = "foo"; | |
1626 o.value = "foo"; | |
1627 } | |
1628 buildCounterProductCustomAttribute--; | |
1629 return o; | |
1630 } | |
1631 | |
1632 checkProductCustomAttribute(api.ProductCustomAttribute o) { | |
1633 buildCounterProductCustomAttribute++; | |
1634 if (buildCounterProductCustomAttribute < 3) { | |
1635 unittest.expect(o.name, unittest.equals('foo')); | |
1636 unittest.expect(o.type, unittest.equals('foo')); | |
1637 unittest.expect(o.unit, unittest.equals('foo')); | |
1638 unittest.expect(o.value, unittest.equals('foo')); | |
1639 } | |
1640 buildCounterProductCustomAttribute--; | |
1641 } | |
1642 | |
1643 buildUnnamed332() { | |
1644 var o = new core.List<api.ProductCustomAttribute>(); | |
1645 o.add(buildProductCustomAttribute()); | |
1646 o.add(buildProductCustomAttribute()); | |
1647 return o; | |
1648 } | |
1649 | |
1650 checkUnnamed332(core.List<api.ProductCustomAttribute> o) { | |
1651 unittest.expect(o, unittest.hasLength(2)); | |
1652 checkProductCustomAttribute(o[0]); | |
1653 checkProductCustomAttribute(o[1]); | |
1654 } | |
1655 | |
1656 core.int buildCounterProductCustomGroup = 0; | |
1657 buildProductCustomGroup() { | |
1658 var o = new api.ProductCustomGroup(); | |
1659 buildCounterProductCustomGroup++; | |
1660 if (buildCounterProductCustomGroup < 3) { | |
1661 o.attributes = buildUnnamed332(); | |
1662 o.name = "foo"; | |
1663 } | |
1664 buildCounterProductCustomGroup--; | |
1665 return o; | |
1666 } | |
1667 | |
1668 checkProductCustomGroup(api.ProductCustomGroup o) { | |
1669 buildCounterProductCustomGroup++; | |
1670 if (buildCounterProductCustomGroup < 3) { | |
1671 checkUnnamed332(o.attributes); | |
1672 unittest.expect(o.name, unittest.equals('foo')); | |
1673 } | |
1674 buildCounterProductCustomGroup--; | |
1675 } | |
1676 | |
1677 core.int buildCounterProductDestination = 0; | |
1678 buildProductDestination() { | |
1679 var o = new api.ProductDestination(); | |
1680 buildCounterProductDestination++; | |
1681 if (buildCounterProductDestination < 3) { | |
1682 o.destinationName = "foo"; | |
1683 o.intention = "foo"; | |
1684 } | |
1685 buildCounterProductDestination--; | |
1686 return o; | |
1687 } | |
1688 | |
1689 checkProductDestination(api.ProductDestination o) { | |
1690 buildCounterProductDestination++; | |
1691 if (buildCounterProductDestination < 3) { | |
1692 unittest.expect(o.destinationName, unittest.equals('foo')); | |
1693 unittest.expect(o.intention, unittest.equals('foo')); | |
1694 } | |
1695 buildCounterProductDestination--; | |
1696 } | |
1697 | |
1698 core.int buildCounterProductInstallment = 0; | |
1699 buildProductInstallment() { | |
1700 var o = new api.ProductInstallment(); | |
1701 buildCounterProductInstallment++; | |
1702 if (buildCounterProductInstallment < 3) { | |
1703 o.amount = buildPrice(); | |
1704 o.months = "foo"; | |
1705 } | |
1706 buildCounterProductInstallment--; | |
1707 return o; | |
1708 } | |
1709 | |
1710 checkProductInstallment(api.ProductInstallment o) { | |
1711 buildCounterProductInstallment++; | |
1712 if (buildCounterProductInstallment < 3) { | |
1713 checkPrice(o.amount); | |
1714 unittest.expect(o.months, unittest.equals('foo')); | |
1715 } | |
1716 buildCounterProductInstallment--; | |
1717 } | |
1718 | |
1719 core.int buildCounterProductShipping = 0; | |
1720 buildProductShipping() { | |
1721 var o = new api.ProductShipping(); | |
1722 buildCounterProductShipping++; | |
1723 if (buildCounterProductShipping < 3) { | |
1724 o.country = "foo"; | |
1725 o.locationGroupName = "foo"; | |
1726 o.locationId = "foo"; | |
1727 o.postalCode = "foo"; | |
1728 o.price = buildPrice(); | |
1729 o.region = "foo"; | |
1730 o.service = "foo"; | |
1731 } | |
1732 buildCounterProductShipping--; | |
1733 return o; | |
1734 } | |
1735 | |
1736 checkProductShipping(api.ProductShipping o) { | |
1737 buildCounterProductShipping++; | |
1738 if (buildCounterProductShipping < 3) { | |
1739 unittest.expect(o.country, unittest.equals('foo')); | |
1740 unittest.expect(o.locationGroupName, unittest.equals('foo')); | |
1741 unittest.expect(o.locationId, unittest.equals('foo')); | |
1742 unittest.expect(o.postalCode, unittest.equals('foo')); | |
1743 checkPrice(o.price); | |
1744 unittest.expect(o.region, unittest.equals('foo')); | |
1745 unittest.expect(o.service, unittest.equals('foo')); | |
1746 } | |
1747 buildCounterProductShipping--; | |
1748 } | |
1749 | |
1750 core.int buildCounterProductShippingWeight = 0; | |
1751 buildProductShippingWeight() { | |
1752 var o = new api.ProductShippingWeight(); | |
1753 buildCounterProductShippingWeight++; | |
1754 if (buildCounterProductShippingWeight < 3) { | |
1755 o.unit = "foo"; | |
1756 o.value = 42.0; | |
1757 } | |
1758 buildCounterProductShippingWeight--; | |
1759 return o; | |
1760 } | |
1761 | |
1762 checkProductShippingWeight(api.ProductShippingWeight o) { | |
1763 buildCounterProductShippingWeight++; | |
1764 if (buildCounterProductShippingWeight < 3) { | |
1765 unittest.expect(o.unit, unittest.equals('foo')); | |
1766 unittest.expect(o.value, unittest.equals(42.0)); | |
1767 } | |
1768 buildCounterProductShippingWeight--; | |
1769 } | |
1770 | |
1771 buildUnnamed333() { | |
1772 var o = new core.List<api.ProductStatusDataQualityIssue>(); | |
1773 o.add(buildProductStatusDataQualityIssue()); | |
1774 o.add(buildProductStatusDataQualityIssue()); | |
1775 return o; | |
1776 } | |
1777 | |
1778 checkUnnamed333(core.List<api.ProductStatusDataQualityIssue> o) { | |
1779 unittest.expect(o, unittest.hasLength(2)); | |
1780 checkProductStatusDataQualityIssue(o[0]); | |
1781 checkProductStatusDataQualityIssue(o[1]); | |
1782 } | |
1783 | |
1784 buildUnnamed334() { | |
1785 var o = new core.List<api.ProductStatusDestinationStatus>(); | |
1786 o.add(buildProductStatusDestinationStatus()); | |
1787 o.add(buildProductStatusDestinationStatus()); | |
1788 return o; | |
1789 } | |
1790 | |
1791 checkUnnamed334(core.List<api.ProductStatusDestinationStatus> o) { | |
1792 unittest.expect(o, unittest.hasLength(2)); | |
1793 checkProductStatusDestinationStatus(o[0]); | |
1794 checkProductStatusDestinationStatus(o[1]); | |
1795 } | |
1796 | |
1797 core.int buildCounterProductStatus = 0; | |
1798 buildProductStatus() { | |
1799 var o = new api.ProductStatus(); | |
1800 buildCounterProductStatus++; | |
1801 if (buildCounterProductStatus < 3) { | |
1802 o.dataQualityIssues = buildUnnamed333(); | |
1803 o.destinationStatuses = buildUnnamed334(); | |
1804 o.kind = "foo"; | |
1805 o.link = "foo"; | |
1806 o.productId = "foo"; | |
1807 o.title = "foo"; | |
1808 } | |
1809 buildCounterProductStatus--; | |
1810 return o; | |
1811 } | |
1812 | |
1813 checkProductStatus(api.ProductStatus o) { | |
1814 buildCounterProductStatus++; | |
1815 if (buildCounterProductStatus < 3) { | |
1816 checkUnnamed333(o.dataQualityIssues); | |
1817 checkUnnamed334(o.destinationStatuses); | |
1818 unittest.expect(o.kind, unittest.equals('foo')); | |
1819 unittest.expect(o.link, unittest.equals('foo')); | |
1820 unittest.expect(o.productId, unittest.equals('foo')); | |
1821 unittest.expect(o.title, unittest.equals('foo')); | |
1822 } | |
1823 buildCounterProductStatus--; | |
1824 } | |
1825 | |
1826 core.int buildCounterProductStatusDataQualityIssue = 0; | |
1827 buildProductStatusDataQualityIssue() { | |
1828 var o = new api.ProductStatusDataQualityIssue(); | |
1829 buildCounterProductStatusDataQualityIssue++; | |
1830 if (buildCounterProductStatusDataQualityIssue < 3) { | |
1831 o.detail = "foo"; | |
1832 o.fetchStatus = "foo"; | |
1833 o.id = "foo"; | |
1834 o.location = "foo"; | |
1835 o.timestamp = "foo"; | |
1836 o.valueOnLandingPage = "foo"; | |
1837 o.valueProvided = "foo"; | |
1838 } | |
1839 buildCounterProductStatusDataQualityIssue--; | |
1840 return o; | |
1841 } | |
1842 | |
1843 checkProductStatusDataQualityIssue(api.ProductStatusDataQualityIssue o) { | |
1844 buildCounterProductStatusDataQualityIssue++; | |
1845 if (buildCounterProductStatusDataQualityIssue < 3) { | |
1846 unittest.expect(o.detail, unittest.equals('foo')); | |
1847 unittest.expect(o.fetchStatus, unittest.equals('foo')); | |
1848 unittest.expect(o.id, unittest.equals('foo')); | |
1849 unittest.expect(o.location, unittest.equals('foo')); | |
1850 unittest.expect(o.timestamp, unittest.equals('foo')); | |
1851 unittest.expect(o.valueOnLandingPage, unittest.equals('foo')); | |
1852 unittest.expect(o.valueProvided, unittest.equals('foo')); | |
1853 } | |
1854 buildCounterProductStatusDataQualityIssue--; | |
1855 } | |
1856 | |
1857 core.int buildCounterProductStatusDestinationStatus = 0; | |
1858 buildProductStatusDestinationStatus() { | |
1859 var o = new api.ProductStatusDestinationStatus(); | |
1860 buildCounterProductStatusDestinationStatus++; | |
1861 if (buildCounterProductStatusDestinationStatus < 3) { | |
1862 o.approvalStatus = "foo"; | |
1863 o.destination = "foo"; | |
1864 o.intention = "foo"; | |
1865 } | |
1866 buildCounterProductStatusDestinationStatus--; | |
1867 return o; | |
1868 } | |
1869 | |
1870 checkProductStatusDestinationStatus(api.ProductStatusDestinationStatus o) { | |
1871 buildCounterProductStatusDestinationStatus++; | |
1872 if (buildCounterProductStatusDestinationStatus < 3) { | |
1873 unittest.expect(o.approvalStatus, unittest.equals('foo')); | |
1874 unittest.expect(o.destination, unittest.equals('foo')); | |
1875 unittest.expect(o.intention, unittest.equals('foo')); | |
1876 } | |
1877 buildCounterProductStatusDestinationStatus--; | |
1878 } | |
1879 | |
1880 core.int buildCounterProductTax = 0; | |
1881 buildProductTax() { | |
1882 var o = new api.ProductTax(); | |
1883 buildCounterProductTax++; | |
1884 if (buildCounterProductTax < 3) { | |
1885 o.country = "foo"; | |
1886 o.locationId = "foo"; | |
1887 o.postalCode = "foo"; | |
1888 o.rate = 42.0; | |
1889 o.region = "foo"; | |
1890 o.taxShip = true; | |
1891 } | |
1892 buildCounterProductTax--; | |
1893 return o; | |
1894 } | |
1895 | |
1896 checkProductTax(api.ProductTax o) { | |
1897 buildCounterProductTax++; | |
1898 if (buildCounterProductTax < 3) { | |
1899 unittest.expect(o.country, unittest.equals('foo')); | |
1900 unittest.expect(o.locationId, unittest.equals('foo')); | |
1901 unittest.expect(o.postalCode, unittest.equals('foo')); | |
1902 unittest.expect(o.rate, unittest.equals(42.0)); | |
1903 unittest.expect(o.region, unittest.equals('foo')); | |
1904 unittest.expect(o.taxShip, unittest.isTrue); | |
1905 } | |
1906 buildCounterProductTax--; | |
1907 } | |
1908 | |
1909 core.int buildCounterProductUnitPricingBaseMeasure = 0; | |
1910 buildProductUnitPricingBaseMeasure() { | |
1911 var o = new api.ProductUnitPricingBaseMeasure(); | |
1912 buildCounterProductUnitPricingBaseMeasure++; | |
1913 if (buildCounterProductUnitPricingBaseMeasure < 3) { | |
1914 o.unit = "foo"; | |
1915 o.value = "foo"; | |
1916 } | |
1917 buildCounterProductUnitPricingBaseMeasure--; | |
1918 return o; | |
1919 } | |
1920 | |
1921 checkProductUnitPricingBaseMeasure(api.ProductUnitPricingBaseMeasure o) { | |
1922 buildCounterProductUnitPricingBaseMeasure++; | |
1923 if (buildCounterProductUnitPricingBaseMeasure < 3) { | |
1924 unittest.expect(o.unit, unittest.equals('foo')); | |
1925 unittest.expect(o.value, unittest.equals('foo')); | |
1926 } | |
1927 buildCounterProductUnitPricingBaseMeasure--; | |
1928 } | |
1929 | |
1930 core.int buildCounterProductUnitPricingMeasure = 0; | |
1931 buildProductUnitPricingMeasure() { | |
1932 var o = new api.ProductUnitPricingMeasure(); | |
1933 buildCounterProductUnitPricingMeasure++; | |
1934 if (buildCounterProductUnitPricingMeasure < 3) { | |
1935 o.unit = "foo"; | |
1936 o.value = 42.0; | |
1937 } | |
1938 buildCounterProductUnitPricingMeasure--; | |
1939 return o; | |
1940 } | |
1941 | |
1942 checkProductUnitPricingMeasure(api.ProductUnitPricingMeasure o) { | |
1943 buildCounterProductUnitPricingMeasure++; | |
1944 if (buildCounterProductUnitPricingMeasure < 3) { | |
1945 unittest.expect(o.unit, unittest.equals('foo')); | |
1946 unittest.expect(o.value, unittest.equals(42.0)); | |
1947 } | |
1948 buildCounterProductUnitPricingMeasure--; | |
1949 } | |
1950 | |
1951 buildUnnamed335() { | |
1952 var o = new core.List<api.ProductsCustomBatchRequestEntry>(); | |
1953 o.add(buildProductsCustomBatchRequestEntry()); | |
1954 o.add(buildProductsCustomBatchRequestEntry()); | |
1955 return o; | |
1956 } | |
1957 | |
1958 checkUnnamed335(core.List<api.ProductsCustomBatchRequestEntry> o) { | |
1959 unittest.expect(o, unittest.hasLength(2)); | |
1960 checkProductsCustomBatchRequestEntry(o[0]); | |
1961 checkProductsCustomBatchRequestEntry(o[1]); | |
1962 } | |
1963 | |
1964 core.int buildCounterProductsCustomBatchRequest = 0; | |
1965 buildProductsCustomBatchRequest() { | |
1966 var o = new api.ProductsCustomBatchRequest(); | |
1967 buildCounterProductsCustomBatchRequest++; | |
1968 if (buildCounterProductsCustomBatchRequest < 3) { | |
1969 o.entries = buildUnnamed335(); | |
1970 } | |
1971 buildCounterProductsCustomBatchRequest--; | |
1972 return o; | |
1973 } | |
1974 | |
1975 checkProductsCustomBatchRequest(api.ProductsCustomBatchRequest o) { | |
1976 buildCounterProductsCustomBatchRequest++; | |
1977 if (buildCounterProductsCustomBatchRequest < 3) { | |
1978 checkUnnamed335(o.entries); | |
1979 } | |
1980 buildCounterProductsCustomBatchRequest--; | |
1981 } | |
1982 | |
1983 core.int buildCounterProductsCustomBatchRequestEntry = 0; | |
1984 buildProductsCustomBatchRequestEntry() { | |
1985 var o = new api.ProductsCustomBatchRequestEntry(); | |
1986 buildCounterProductsCustomBatchRequestEntry++; | |
1987 if (buildCounterProductsCustomBatchRequestEntry < 3) { | |
1988 o.batchId = 42; | |
1989 o.merchantId = "foo"; | |
1990 o.method = "foo"; | |
1991 o.product = buildProduct(); | |
1992 o.productId = "foo"; | |
1993 } | |
1994 buildCounterProductsCustomBatchRequestEntry--; | |
1995 return o; | |
1996 } | |
1997 | |
1998 checkProductsCustomBatchRequestEntry(api.ProductsCustomBatchRequestEntry o) { | |
1999 buildCounterProductsCustomBatchRequestEntry++; | |
2000 if (buildCounterProductsCustomBatchRequestEntry < 3) { | |
2001 unittest.expect(o.batchId, unittest.equals(42)); | |
2002 unittest.expect(o.merchantId, unittest.equals('foo')); | |
2003 unittest.expect(o.method, unittest.equals('foo')); | |
2004 checkProduct(o.product); | |
2005 unittest.expect(o.productId, unittest.equals('foo')); | |
2006 } | |
2007 buildCounterProductsCustomBatchRequestEntry--; | |
2008 } | |
2009 | |
2010 buildUnnamed336() { | |
2011 var o = new core.List<api.ProductsCustomBatchResponseEntry>(); | |
2012 o.add(buildProductsCustomBatchResponseEntry()); | |
2013 o.add(buildProductsCustomBatchResponseEntry()); | |
2014 return o; | |
2015 } | |
2016 | |
2017 checkUnnamed336(core.List<api.ProductsCustomBatchResponseEntry> o) { | |
2018 unittest.expect(o, unittest.hasLength(2)); | |
2019 checkProductsCustomBatchResponseEntry(o[0]); | |
2020 checkProductsCustomBatchResponseEntry(o[1]); | |
2021 } | |
2022 | |
2023 core.int buildCounterProductsCustomBatchResponse = 0; | |
2024 buildProductsCustomBatchResponse() { | |
2025 var o = new api.ProductsCustomBatchResponse(); | |
2026 buildCounterProductsCustomBatchResponse++; | |
2027 if (buildCounterProductsCustomBatchResponse < 3) { | |
2028 o.entries = buildUnnamed336(); | |
2029 o.kind = "foo"; | |
2030 } | |
2031 buildCounterProductsCustomBatchResponse--; | |
2032 return o; | |
2033 } | |
2034 | |
2035 checkProductsCustomBatchResponse(api.ProductsCustomBatchResponse o) { | |
2036 buildCounterProductsCustomBatchResponse++; | |
2037 if (buildCounterProductsCustomBatchResponse < 3) { | |
2038 checkUnnamed336(o.entries); | |
2039 unittest.expect(o.kind, unittest.equals('foo')); | |
2040 } | |
2041 buildCounterProductsCustomBatchResponse--; | |
2042 } | |
2043 | |
2044 core.int buildCounterProductsCustomBatchResponseEntry = 0; | |
2045 buildProductsCustomBatchResponseEntry() { | |
2046 var o = new api.ProductsCustomBatchResponseEntry(); | |
2047 buildCounterProductsCustomBatchResponseEntry++; | |
2048 if (buildCounterProductsCustomBatchResponseEntry < 3) { | |
2049 o.batchId = 42; | |
2050 o.errors = buildErrors(); | |
2051 o.kind = "foo"; | |
2052 o.product = buildProduct(); | |
2053 } | |
2054 buildCounterProductsCustomBatchResponseEntry--; | |
2055 return o; | |
2056 } | |
2057 | |
2058 checkProductsCustomBatchResponseEntry(api.ProductsCustomBatchResponseEntry o) { | |
2059 buildCounterProductsCustomBatchResponseEntry++; | |
2060 if (buildCounterProductsCustomBatchResponseEntry < 3) { | |
2061 unittest.expect(o.batchId, unittest.equals(42)); | |
2062 checkErrors(o.errors); | |
2063 unittest.expect(o.kind, unittest.equals('foo')); | |
2064 checkProduct(o.product); | |
2065 } | |
2066 buildCounterProductsCustomBatchResponseEntry--; | |
2067 } | |
2068 | |
2069 buildUnnamed337() { | |
2070 var o = new core.List<api.Product>(); | |
2071 o.add(buildProduct()); | |
2072 o.add(buildProduct()); | |
2073 return o; | |
2074 } | |
2075 | |
2076 checkUnnamed337(core.List<api.Product> o) { | |
2077 unittest.expect(o, unittest.hasLength(2)); | |
2078 checkProduct(o[0]); | |
2079 checkProduct(o[1]); | |
2080 } | |
2081 | |
2082 core.int buildCounterProductsListResponse = 0; | |
2083 buildProductsListResponse() { | |
2084 var o = new api.ProductsListResponse(); | |
2085 buildCounterProductsListResponse++; | |
2086 if (buildCounterProductsListResponse < 3) { | |
2087 o.kind = "foo"; | |
2088 o.nextPageToken = "foo"; | |
2089 o.resources = buildUnnamed337(); | |
2090 } | |
2091 buildCounterProductsListResponse--; | |
2092 return o; | |
2093 } | |
2094 | |
2095 checkProductsListResponse(api.ProductsListResponse o) { | |
2096 buildCounterProductsListResponse++; | |
2097 if (buildCounterProductsListResponse < 3) { | |
2098 unittest.expect(o.kind, unittest.equals('foo')); | |
2099 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
2100 checkUnnamed337(o.resources); | |
2101 } | |
2102 buildCounterProductsListResponse--; | |
2103 } | |
2104 | |
2105 buildUnnamed338() { | |
2106 var o = new core.List<api.ProductstatusesCustomBatchRequestEntry>(); | |
2107 o.add(buildProductstatusesCustomBatchRequestEntry()); | |
2108 o.add(buildProductstatusesCustomBatchRequestEntry()); | |
2109 return o; | |
2110 } | |
2111 | |
2112 checkUnnamed338(core.List<api.ProductstatusesCustomBatchRequestEntry> o) { | |
2113 unittest.expect(o, unittest.hasLength(2)); | |
2114 checkProductstatusesCustomBatchRequestEntry(o[0]); | |
2115 checkProductstatusesCustomBatchRequestEntry(o[1]); | |
2116 } | |
2117 | |
2118 core.int buildCounterProductstatusesCustomBatchRequest = 0; | |
2119 buildProductstatusesCustomBatchRequest() { | |
2120 var o = new api.ProductstatusesCustomBatchRequest(); | |
2121 buildCounterProductstatusesCustomBatchRequest++; | |
2122 if (buildCounterProductstatusesCustomBatchRequest < 3) { | |
2123 o.entries = buildUnnamed338(); | |
2124 } | |
2125 buildCounterProductstatusesCustomBatchRequest--; | |
2126 return o; | |
2127 } | |
2128 | |
2129 checkProductstatusesCustomBatchRequest(api.ProductstatusesCustomBatchRequest o)
{ | |
2130 buildCounterProductstatusesCustomBatchRequest++; | |
2131 if (buildCounterProductstatusesCustomBatchRequest < 3) { | |
2132 checkUnnamed338(o.entries); | |
2133 } | |
2134 buildCounterProductstatusesCustomBatchRequest--; | |
2135 } | |
2136 | |
2137 core.int buildCounterProductstatusesCustomBatchRequestEntry = 0; | |
2138 buildProductstatusesCustomBatchRequestEntry() { | |
2139 var o = new api.ProductstatusesCustomBatchRequestEntry(); | |
2140 buildCounterProductstatusesCustomBatchRequestEntry++; | |
2141 if (buildCounterProductstatusesCustomBatchRequestEntry < 3) { | |
2142 o.batchId = 42; | |
2143 o.merchantId = "foo"; | |
2144 o.method = "foo"; | |
2145 o.productId = "foo"; | |
2146 } | |
2147 buildCounterProductstatusesCustomBatchRequestEntry--; | |
2148 return o; | |
2149 } | |
2150 | |
2151 checkProductstatusesCustomBatchRequestEntry(api.ProductstatusesCustomBatchReques
tEntry o) { | |
2152 buildCounterProductstatusesCustomBatchRequestEntry++; | |
2153 if (buildCounterProductstatusesCustomBatchRequestEntry < 3) { | |
2154 unittest.expect(o.batchId, unittest.equals(42)); | |
2155 unittest.expect(o.merchantId, unittest.equals('foo')); | |
2156 unittest.expect(o.method, unittest.equals('foo')); | |
2157 unittest.expect(o.productId, unittest.equals('foo')); | |
2158 } | |
2159 buildCounterProductstatusesCustomBatchRequestEntry--; | |
2160 } | |
2161 | |
2162 buildUnnamed339() { | |
2163 var o = new core.List<api.ProductstatusesCustomBatchResponseEntry>(); | |
2164 o.add(buildProductstatusesCustomBatchResponseEntry()); | |
2165 o.add(buildProductstatusesCustomBatchResponseEntry()); | |
2166 return o; | |
2167 } | |
2168 | |
2169 checkUnnamed339(core.List<api.ProductstatusesCustomBatchResponseEntry> o) { | |
2170 unittest.expect(o, unittest.hasLength(2)); | |
2171 checkProductstatusesCustomBatchResponseEntry(o[0]); | |
2172 checkProductstatusesCustomBatchResponseEntry(o[1]); | |
2173 } | |
2174 | |
2175 core.int buildCounterProductstatusesCustomBatchResponse = 0; | |
2176 buildProductstatusesCustomBatchResponse() { | |
2177 var o = new api.ProductstatusesCustomBatchResponse(); | |
2178 buildCounterProductstatusesCustomBatchResponse++; | |
2179 if (buildCounterProductstatusesCustomBatchResponse < 3) { | |
2180 o.entries = buildUnnamed339(); | |
2181 o.kind = "foo"; | |
2182 } | |
2183 buildCounterProductstatusesCustomBatchResponse--; | |
2184 return o; | |
2185 } | |
2186 | |
2187 checkProductstatusesCustomBatchResponse(api.ProductstatusesCustomBatchResponse o
) { | |
2188 buildCounterProductstatusesCustomBatchResponse++; | |
2189 if (buildCounterProductstatusesCustomBatchResponse < 3) { | |
2190 checkUnnamed339(o.entries); | |
2191 unittest.expect(o.kind, unittest.equals('foo')); | |
2192 } | |
2193 buildCounterProductstatusesCustomBatchResponse--; | |
2194 } | |
2195 | |
2196 core.int buildCounterProductstatusesCustomBatchResponseEntry = 0; | |
2197 buildProductstatusesCustomBatchResponseEntry() { | |
2198 var o = new api.ProductstatusesCustomBatchResponseEntry(); | |
2199 buildCounterProductstatusesCustomBatchResponseEntry++; | |
2200 if (buildCounterProductstatusesCustomBatchResponseEntry < 3) { | |
2201 o.batchId = 42; | |
2202 o.errors = buildErrors(); | |
2203 o.kind = "foo"; | |
2204 o.productStatus = buildProductStatus(); | |
2205 } | |
2206 buildCounterProductstatusesCustomBatchResponseEntry--; | |
2207 return o; | |
2208 } | |
2209 | |
2210 checkProductstatusesCustomBatchResponseEntry(api.ProductstatusesCustomBatchRespo
nseEntry o) { | |
2211 buildCounterProductstatusesCustomBatchResponseEntry++; | |
2212 if (buildCounterProductstatusesCustomBatchResponseEntry < 3) { | |
2213 unittest.expect(o.batchId, unittest.equals(42)); | |
2214 checkErrors(o.errors); | |
2215 unittest.expect(o.kind, unittest.equals('foo')); | |
2216 checkProductStatus(o.productStatus); | |
2217 } | |
2218 buildCounterProductstatusesCustomBatchResponseEntry--; | |
2219 } | |
2220 | |
2221 buildUnnamed340() { | |
2222 var o = new core.List<api.ProductStatus>(); | |
2223 o.add(buildProductStatus()); | |
2224 o.add(buildProductStatus()); | |
2225 return o; | |
2226 } | |
2227 | |
2228 checkUnnamed340(core.List<api.ProductStatus> o) { | |
2229 unittest.expect(o, unittest.hasLength(2)); | |
2230 checkProductStatus(o[0]); | |
2231 checkProductStatus(o[1]); | |
2232 } | |
2233 | |
2234 core.int buildCounterProductstatusesListResponse = 0; | |
2235 buildProductstatusesListResponse() { | |
2236 var o = new api.ProductstatusesListResponse(); | |
2237 buildCounterProductstatusesListResponse++; | |
2238 if (buildCounterProductstatusesListResponse < 3) { | |
2239 o.kind = "foo"; | |
2240 o.nextPageToken = "foo"; | |
2241 o.resources = buildUnnamed340(); | |
2242 } | |
2243 buildCounterProductstatusesListResponse--; | |
2244 return o; | |
2245 } | |
2246 | |
2247 checkProductstatusesListResponse(api.ProductstatusesListResponse o) { | |
2248 buildCounterProductstatusesListResponse++; | |
2249 if (buildCounterProductstatusesListResponse < 3) { | |
2250 unittest.expect(o.kind, unittest.equals('foo')); | |
2251 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
2252 checkUnnamed340(o.resources); | |
2253 } | |
2254 buildCounterProductstatusesListResponse--; | |
2255 } | |
2256 | |
2257 | |
2258 main() { | |
2259 unittest.group("obj-schema-Account", () { | |
2260 unittest.test("to-json--from-json", () { | |
2261 var o = buildAccount(); | |
2262 var od = new api.Account.fromJson(o.toJson()); | |
2263 checkAccount(od); | |
2264 }); | |
2265 }); | |
2266 | |
2267 | |
2268 unittest.group("obj-schema-AccountAdwordsLink", () { | |
2269 unittest.test("to-json--from-json", () { | |
2270 var o = buildAccountAdwordsLink(); | |
2271 var od = new api.AccountAdwordsLink.fromJson(o.toJson()); | |
2272 checkAccountAdwordsLink(od); | |
2273 }); | |
2274 }); | |
2275 | |
2276 | |
2277 unittest.group("obj-schema-AccountStatus", () { | |
2278 unittest.test("to-json--from-json", () { | |
2279 var o = buildAccountStatus(); | |
2280 var od = new api.AccountStatus.fromJson(o.toJson()); | |
2281 checkAccountStatus(od); | |
2282 }); | |
2283 }); | |
2284 | |
2285 | |
2286 unittest.group("obj-schema-AccountStatusDataQualityIssue", () { | |
2287 unittest.test("to-json--from-json", () { | |
2288 var o = buildAccountStatusDataQualityIssue(); | |
2289 var od = new api.AccountStatusDataQualityIssue.fromJson(o.toJson()); | |
2290 checkAccountStatusDataQualityIssue(od); | |
2291 }); | |
2292 }); | |
2293 | |
2294 | |
2295 unittest.group("obj-schema-AccountStatusExampleItem", () { | |
2296 unittest.test("to-json--from-json", () { | |
2297 var o = buildAccountStatusExampleItem(); | |
2298 var od = new api.AccountStatusExampleItem.fromJson(o.toJson()); | |
2299 checkAccountStatusExampleItem(od); | |
2300 }); | |
2301 }); | |
2302 | |
2303 | |
2304 unittest.group("obj-schema-AccountUser", () { | |
2305 unittest.test("to-json--from-json", () { | |
2306 var o = buildAccountUser(); | |
2307 var od = new api.AccountUser.fromJson(o.toJson()); | |
2308 checkAccountUser(od); | |
2309 }); | |
2310 }); | |
2311 | |
2312 | |
2313 unittest.group("obj-schema-AccountsCustomBatchRequest", () { | |
2314 unittest.test("to-json--from-json", () { | |
2315 var o = buildAccountsCustomBatchRequest(); | |
2316 var od = new api.AccountsCustomBatchRequest.fromJson(o.toJson()); | |
2317 checkAccountsCustomBatchRequest(od); | |
2318 }); | |
2319 }); | |
2320 | |
2321 | |
2322 unittest.group("obj-schema-AccountsCustomBatchRequestEntry", () { | |
2323 unittest.test("to-json--from-json", () { | |
2324 var o = buildAccountsCustomBatchRequestEntry(); | |
2325 var od = new api.AccountsCustomBatchRequestEntry.fromJson(o.toJson()); | |
2326 checkAccountsCustomBatchRequestEntry(od); | |
2327 }); | |
2328 }); | |
2329 | |
2330 | |
2331 unittest.group("obj-schema-AccountsCustomBatchResponse", () { | |
2332 unittest.test("to-json--from-json", () { | |
2333 var o = buildAccountsCustomBatchResponse(); | |
2334 var od = new api.AccountsCustomBatchResponse.fromJson(o.toJson()); | |
2335 checkAccountsCustomBatchResponse(od); | |
2336 }); | |
2337 }); | |
2338 | |
2339 | |
2340 unittest.group("obj-schema-AccountsCustomBatchResponseEntry", () { | |
2341 unittest.test("to-json--from-json", () { | |
2342 var o = buildAccountsCustomBatchResponseEntry(); | |
2343 var od = new api.AccountsCustomBatchResponseEntry.fromJson(o.toJson()); | |
2344 checkAccountsCustomBatchResponseEntry(od); | |
2345 }); | |
2346 }); | |
2347 | |
2348 | |
2349 unittest.group("obj-schema-AccountsListResponse", () { | |
2350 unittest.test("to-json--from-json", () { | |
2351 var o = buildAccountsListResponse(); | |
2352 var od = new api.AccountsListResponse.fromJson(o.toJson()); | |
2353 checkAccountsListResponse(od); | |
2354 }); | |
2355 }); | |
2356 | |
2357 | |
2358 unittest.group("obj-schema-AccountstatusesCustomBatchRequest", () { | |
2359 unittest.test("to-json--from-json", () { | |
2360 var o = buildAccountstatusesCustomBatchRequest(); | |
2361 var od = new api.AccountstatusesCustomBatchRequest.fromJson(o.toJson()); | |
2362 checkAccountstatusesCustomBatchRequest(od); | |
2363 }); | |
2364 }); | |
2365 | |
2366 | |
2367 unittest.group("obj-schema-AccountstatusesCustomBatchRequestEntry", () { | |
2368 unittest.test("to-json--from-json", () { | |
2369 var o = buildAccountstatusesCustomBatchRequestEntry(); | |
2370 var od = new api.AccountstatusesCustomBatchRequestEntry.fromJson(o.toJson(
)); | |
2371 checkAccountstatusesCustomBatchRequestEntry(od); | |
2372 }); | |
2373 }); | |
2374 | |
2375 | |
2376 unittest.group("obj-schema-AccountstatusesCustomBatchResponse", () { | |
2377 unittest.test("to-json--from-json", () { | |
2378 var o = buildAccountstatusesCustomBatchResponse(); | |
2379 var od = new api.AccountstatusesCustomBatchResponse.fromJson(o.toJson()); | |
2380 checkAccountstatusesCustomBatchResponse(od); | |
2381 }); | |
2382 }); | |
2383 | |
2384 | |
2385 unittest.group("obj-schema-AccountstatusesCustomBatchResponseEntry", () { | |
2386 unittest.test("to-json--from-json", () { | |
2387 var o = buildAccountstatusesCustomBatchResponseEntry(); | |
2388 var od = new api.AccountstatusesCustomBatchResponseEntry.fromJson(o.toJson
()); | |
2389 checkAccountstatusesCustomBatchResponseEntry(od); | |
2390 }); | |
2391 }); | |
2392 | |
2393 | |
2394 unittest.group("obj-schema-AccountstatusesListResponse", () { | |
2395 unittest.test("to-json--from-json", () { | |
2396 var o = buildAccountstatusesListResponse(); | |
2397 var od = new api.AccountstatusesListResponse.fromJson(o.toJson()); | |
2398 checkAccountstatusesListResponse(od); | |
2399 }); | |
2400 }); | |
2401 | |
2402 | |
2403 unittest.group("obj-schema-Datafeed", () { | |
2404 unittest.test("to-json--from-json", () { | |
2405 var o = buildDatafeed(); | |
2406 var od = new api.Datafeed.fromJson(o.toJson()); | |
2407 checkDatafeed(od); | |
2408 }); | |
2409 }); | |
2410 | |
2411 | |
2412 unittest.group("obj-schema-DatafeedFetchSchedule", () { | |
2413 unittest.test("to-json--from-json", () { | |
2414 var o = buildDatafeedFetchSchedule(); | |
2415 var od = new api.DatafeedFetchSchedule.fromJson(o.toJson()); | |
2416 checkDatafeedFetchSchedule(od); | |
2417 }); | |
2418 }); | |
2419 | |
2420 | |
2421 unittest.group("obj-schema-DatafeedFormat", () { | |
2422 unittest.test("to-json--from-json", () { | |
2423 var o = buildDatafeedFormat(); | |
2424 var od = new api.DatafeedFormat.fromJson(o.toJson()); | |
2425 checkDatafeedFormat(od); | |
2426 }); | |
2427 }); | |
2428 | |
2429 | |
2430 unittest.group("obj-schema-DatafeedStatus", () { | |
2431 unittest.test("to-json--from-json", () { | |
2432 var o = buildDatafeedStatus(); | |
2433 var od = new api.DatafeedStatus.fromJson(o.toJson()); | |
2434 checkDatafeedStatus(od); | |
2435 }); | |
2436 }); | |
2437 | |
2438 | |
2439 unittest.group("obj-schema-DatafeedStatusError", () { | |
2440 unittest.test("to-json--from-json", () { | |
2441 var o = buildDatafeedStatusError(); | |
2442 var od = new api.DatafeedStatusError.fromJson(o.toJson()); | |
2443 checkDatafeedStatusError(od); | |
2444 }); | |
2445 }); | |
2446 | |
2447 | |
2448 unittest.group("obj-schema-DatafeedStatusExample", () { | |
2449 unittest.test("to-json--from-json", () { | |
2450 var o = buildDatafeedStatusExample(); | |
2451 var od = new api.DatafeedStatusExample.fromJson(o.toJson()); | |
2452 checkDatafeedStatusExample(od); | |
2453 }); | |
2454 }); | |
2455 | |
2456 | |
2457 unittest.group("obj-schema-DatafeedsCustomBatchRequest", () { | |
2458 unittest.test("to-json--from-json", () { | |
2459 var o = buildDatafeedsCustomBatchRequest(); | |
2460 var od = new api.DatafeedsCustomBatchRequest.fromJson(o.toJson()); | |
2461 checkDatafeedsCustomBatchRequest(od); | |
2462 }); | |
2463 }); | |
2464 | |
2465 | |
2466 unittest.group("obj-schema-DatafeedsCustomBatchRequestEntry", () { | |
2467 unittest.test("to-json--from-json", () { | |
2468 var o = buildDatafeedsCustomBatchRequestEntry(); | |
2469 var od = new api.DatafeedsCustomBatchRequestEntry.fromJson(o.toJson()); | |
2470 checkDatafeedsCustomBatchRequestEntry(od); | |
2471 }); | |
2472 }); | |
2473 | |
2474 | |
2475 unittest.group("obj-schema-DatafeedsCustomBatchResponse", () { | |
2476 unittest.test("to-json--from-json", () { | |
2477 var o = buildDatafeedsCustomBatchResponse(); | |
2478 var od = new api.DatafeedsCustomBatchResponse.fromJson(o.toJson()); | |
2479 checkDatafeedsCustomBatchResponse(od); | |
2480 }); | |
2481 }); | |
2482 | |
2483 | |
2484 unittest.group("obj-schema-DatafeedsCustomBatchResponseEntry", () { | |
2485 unittest.test("to-json--from-json", () { | |
2486 var o = buildDatafeedsCustomBatchResponseEntry(); | |
2487 var od = new api.DatafeedsCustomBatchResponseEntry.fromJson(o.toJson()); | |
2488 checkDatafeedsCustomBatchResponseEntry(od); | |
2489 }); | |
2490 }); | |
2491 | |
2492 | |
2493 unittest.group("obj-schema-DatafeedsListResponse", () { | |
2494 unittest.test("to-json--from-json", () { | |
2495 var o = buildDatafeedsListResponse(); | |
2496 var od = new api.DatafeedsListResponse.fromJson(o.toJson()); | |
2497 checkDatafeedsListResponse(od); | |
2498 }); | |
2499 }); | |
2500 | |
2501 | |
2502 unittest.group("obj-schema-DatafeedstatusesCustomBatchRequest", () { | |
2503 unittest.test("to-json--from-json", () { | |
2504 var o = buildDatafeedstatusesCustomBatchRequest(); | |
2505 var od = new api.DatafeedstatusesCustomBatchRequest.fromJson(o.toJson()); | |
2506 checkDatafeedstatusesCustomBatchRequest(od); | |
2507 }); | |
2508 }); | |
2509 | |
2510 | |
2511 unittest.group("obj-schema-DatafeedstatusesCustomBatchRequestEntry", () { | |
2512 unittest.test("to-json--from-json", () { | |
2513 var o = buildDatafeedstatusesCustomBatchRequestEntry(); | |
2514 var od = new api.DatafeedstatusesCustomBatchRequestEntry.fromJson(o.toJson
()); | |
2515 checkDatafeedstatusesCustomBatchRequestEntry(od); | |
2516 }); | |
2517 }); | |
2518 | |
2519 | |
2520 unittest.group("obj-schema-DatafeedstatusesCustomBatchResponse", () { | |
2521 unittest.test("to-json--from-json", () { | |
2522 var o = buildDatafeedstatusesCustomBatchResponse(); | |
2523 var od = new api.DatafeedstatusesCustomBatchResponse.fromJson(o.toJson()); | |
2524 checkDatafeedstatusesCustomBatchResponse(od); | |
2525 }); | |
2526 }); | |
2527 | |
2528 | |
2529 unittest.group("obj-schema-DatafeedstatusesCustomBatchResponseEntry", () { | |
2530 unittest.test("to-json--from-json", () { | |
2531 var o = buildDatafeedstatusesCustomBatchResponseEntry(); | |
2532 var od = new api.DatafeedstatusesCustomBatchResponseEntry.fromJson(o.toJso
n()); | |
2533 checkDatafeedstatusesCustomBatchResponseEntry(od); | |
2534 }); | |
2535 }); | |
2536 | |
2537 | |
2538 unittest.group("obj-schema-DatafeedstatusesListResponse", () { | |
2539 unittest.test("to-json--from-json", () { | |
2540 var o = buildDatafeedstatusesListResponse(); | |
2541 var od = new api.DatafeedstatusesListResponse.fromJson(o.toJson()); | |
2542 checkDatafeedstatusesListResponse(od); | |
2543 }); | |
2544 }); | |
2545 | |
2546 | |
2547 unittest.group("obj-schema-Error", () { | |
2548 unittest.test("to-json--from-json", () { | |
2549 var o = buildError(); | |
2550 var od = new api.Error.fromJson(o.toJson()); | |
2551 checkError(od); | |
2552 }); | |
2553 }); | |
2554 | |
2555 | |
2556 unittest.group("obj-schema-Errors", () { | |
2557 unittest.test("to-json--from-json", () { | |
2558 var o = buildErrors(); | |
2559 var od = new api.Errors.fromJson(o.toJson()); | |
2560 checkErrors(od); | |
2561 }); | |
2562 }); | |
2563 | |
2564 | |
2565 unittest.group("obj-schema-Inventory", () { | |
2566 unittest.test("to-json--from-json", () { | |
2567 var o = buildInventory(); | |
2568 var od = new api.Inventory.fromJson(o.toJson()); | |
2569 checkInventory(od); | |
2570 }); | |
2571 }); | |
2572 | |
2573 | |
2574 unittest.group("obj-schema-InventoryCustomBatchRequest", () { | |
2575 unittest.test("to-json--from-json", () { | |
2576 var o = buildInventoryCustomBatchRequest(); | |
2577 var od = new api.InventoryCustomBatchRequest.fromJson(o.toJson()); | |
2578 checkInventoryCustomBatchRequest(od); | |
2579 }); | |
2580 }); | |
2581 | |
2582 | |
2583 unittest.group("obj-schema-InventoryCustomBatchRequestEntry", () { | |
2584 unittest.test("to-json--from-json", () { | |
2585 var o = buildInventoryCustomBatchRequestEntry(); | |
2586 var od = new api.InventoryCustomBatchRequestEntry.fromJson(o.toJson()); | |
2587 checkInventoryCustomBatchRequestEntry(od); | |
2588 }); | |
2589 }); | |
2590 | |
2591 | |
2592 unittest.group("obj-schema-InventoryCustomBatchResponse", () { | |
2593 unittest.test("to-json--from-json", () { | |
2594 var o = buildInventoryCustomBatchResponse(); | |
2595 var od = new api.InventoryCustomBatchResponse.fromJson(o.toJson()); | |
2596 checkInventoryCustomBatchResponse(od); | |
2597 }); | |
2598 }); | |
2599 | |
2600 | |
2601 unittest.group("obj-schema-InventoryCustomBatchResponseEntry", () { | |
2602 unittest.test("to-json--from-json", () { | |
2603 var o = buildInventoryCustomBatchResponseEntry(); | |
2604 var od = new api.InventoryCustomBatchResponseEntry.fromJson(o.toJson()); | |
2605 checkInventoryCustomBatchResponseEntry(od); | |
2606 }); | |
2607 }); | |
2608 | |
2609 | |
2610 unittest.group("obj-schema-InventorySetRequest", () { | |
2611 unittest.test("to-json--from-json", () { | |
2612 var o = buildInventorySetRequest(); | |
2613 var od = new api.InventorySetRequest.fromJson(o.toJson()); | |
2614 checkInventorySetRequest(od); | |
2615 }); | |
2616 }); | |
2617 | |
2618 | |
2619 unittest.group("obj-schema-InventorySetResponse", () { | |
2620 unittest.test("to-json--from-json", () { | |
2621 var o = buildInventorySetResponse(); | |
2622 var od = new api.InventorySetResponse.fromJson(o.toJson()); | |
2623 checkInventorySetResponse(od); | |
2624 }); | |
2625 }); | |
2626 | |
2627 | |
2628 unittest.group("obj-schema-LoyaltyPoints", () { | |
2629 unittest.test("to-json--from-json", () { | |
2630 var o = buildLoyaltyPoints(); | |
2631 var od = new api.LoyaltyPoints.fromJson(o.toJson()); | |
2632 checkLoyaltyPoints(od); | |
2633 }); | |
2634 }); | |
2635 | |
2636 | |
2637 unittest.group("obj-schema-Price", () { | |
2638 unittest.test("to-json--from-json", () { | |
2639 var o = buildPrice(); | |
2640 var od = new api.Price.fromJson(o.toJson()); | |
2641 checkPrice(od); | |
2642 }); | |
2643 }); | |
2644 | |
2645 | |
2646 unittest.group("obj-schema-Product", () { | |
2647 unittest.test("to-json--from-json", () { | |
2648 var o = buildProduct(); | |
2649 var od = new api.Product.fromJson(o.toJson()); | |
2650 checkProduct(od); | |
2651 }); | |
2652 }); | |
2653 | |
2654 | |
2655 unittest.group("obj-schema-ProductCustomAttribute", () { | |
2656 unittest.test("to-json--from-json", () { | |
2657 var o = buildProductCustomAttribute(); | |
2658 var od = new api.ProductCustomAttribute.fromJson(o.toJson()); | |
2659 checkProductCustomAttribute(od); | |
2660 }); | |
2661 }); | |
2662 | |
2663 | |
2664 unittest.group("obj-schema-ProductCustomGroup", () { | |
2665 unittest.test("to-json--from-json", () { | |
2666 var o = buildProductCustomGroup(); | |
2667 var od = new api.ProductCustomGroup.fromJson(o.toJson()); | |
2668 checkProductCustomGroup(od); | |
2669 }); | |
2670 }); | |
2671 | |
2672 | |
2673 unittest.group("obj-schema-ProductDestination", () { | |
2674 unittest.test("to-json--from-json", () { | |
2675 var o = buildProductDestination(); | |
2676 var od = new api.ProductDestination.fromJson(o.toJson()); | |
2677 checkProductDestination(od); | |
2678 }); | |
2679 }); | |
2680 | |
2681 | |
2682 unittest.group("obj-schema-ProductInstallment", () { | |
2683 unittest.test("to-json--from-json", () { | |
2684 var o = buildProductInstallment(); | |
2685 var od = new api.ProductInstallment.fromJson(o.toJson()); | |
2686 checkProductInstallment(od); | |
2687 }); | |
2688 }); | |
2689 | |
2690 | |
2691 unittest.group("obj-schema-ProductShipping", () { | |
2692 unittest.test("to-json--from-json", () { | |
2693 var o = buildProductShipping(); | |
2694 var od = new api.ProductShipping.fromJson(o.toJson()); | |
2695 checkProductShipping(od); | |
2696 }); | |
2697 }); | |
2698 | |
2699 | |
2700 unittest.group("obj-schema-ProductShippingWeight", () { | |
2701 unittest.test("to-json--from-json", () { | |
2702 var o = buildProductShippingWeight(); | |
2703 var od = new api.ProductShippingWeight.fromJson(o.toJson()); | |
2704 checkProductShippingWeight(od); | |
2705 }); | |
2706 }); | |
2707 | |
2708 | |
2709 unittest.group("obj-schema-ProductStatus", () { | |
2710 unittest.test("to-json--from-json", () { | |
2711 var o = buildProductStatus(); | |
2712 var od = new api.ProductStatus.fromJson(o.toJson()); | |
2713 checkProductStatus(od); | |
2714 }); | |
2715 }); | |
2716 | |
2717 | |
2718 unittest.group("obj-schema-ProductStatusDataQualityIssue", () { | |
2719 unittest.test("to-json--from-json", () { | |
2720 var o = buildProductStatusDataQualityIssue(); | |
2721 var od = new api.ProductStatusDataQualityIssue.fromJson(o.toJson()); | |
2722 checkProductStatusDataQualityIssue(od); | |
2723 }); | |
2724 }); | |
2725 | |
2726 | |
2727 unittest.group("obj-schema-ProductStatusDestinationStatus", () { | |
2728 unittest.test("to-json--from-json", () { | |
2729 var o = buildProductStatusDestinationStatus(); | |
2730 var od = new api.ProductStatusDestinationStatus.fromJson(o.toJson()); | |
2731 checkProductStatusDestinationStatus(od); | |
2732 }); | |
2733 }); | |
2734 | |
2735 | |
2736 unittest.group("obj-schema-ProductTax", () { | |
2737 unittest.test("to-json--from-json", () { | |
2738 var o = buildProductTax(); | |
2739 var od = new api.ProductTax.fromJson(o.toJson()); | |
2740 checkProductTax(od); | |
2741 }); | |
2742 }); | |
2743 | |
2744 | |
2745 unittest.group("obj-schema-ProductUnitPricingBaseMeasure", () { | |
2746 unittest.test("to-json--from-json", () { | |
2747 var o = buildProductUnitPricingBaseMeasure(); | |
2748 var od = new api.ProductUnitPricingBaseMeasure.fromJson(o.toJson()); | |
2749 checkProductUnitPricingBaseMeasure(od); | |
2750 }); | |
2751 }); | |
2752 | |
2753 | |
2754 unittest.group("obj-schema-ProductUnitPricingMeasure", () { | |
2755 unittest.test("to-json--from-json", () { | |
2756 var o = buildProductUnitPricingMeasure(); | |
2757 var od = new api.ProductUnitPricingMeasure.fromJson(o.toJson()); | |
2758 checkProductUnitPricingMeasure(od); | |
2759 }); | |
2760 }); | |
2761 | |
2762 | |
2763 unittest.group("obj-schema-ProductsCustomBatchRequest", () { | |
2764 unittest.test("to-json--from-json", () { | |
2765 var o = buildProductsCustomBatchRequest(); | |
2766 var od = new api.ProductsCustomBatchRequest.fromJson(o.toJson()); | |
2767 checkProductsCustomBatchRequest(od); | |
2768 }); | |
2769 }); | |
2770 | |
2771 | |
2772 unittest.group("obj-schema-ProductsCustomBatchRequestEntry", () { | |
2773 unittest.test("to-json--from-json", () { | |
2774 var o = buildProductsCustomBatchRequestEntry(); | |
2775 var od = new api.ProductsCustomBatchRequestEntry.fromJson(o.toJson()); | |
2776 checkProductsCustomBatchRequestEntry(od); | |
2777 }); | |
2778 }); | |
2779 | |
2780 | |
2781 unittest.group("obj-schema-ProductsCustomBatchResponse", () { | |
2782 unittest.test("to-json--from-json", () { | |
2783 var o = buildProductsCustomBatchResponse(); | |
2784 var od = new api.ProductsCustomBatchResponse.fromJson(o.toJson()); | |
2785 checkProductsCustomBatchResponse(od); | |
2786 }); | |
2787 }); | |
2788 | |
2789 | |
2790 unittest.group("obj-schema-ProductsCustomBatchResponseEntry", () { | |
2791 unittest.test("to-json--from-json", () { | |
2792 var o = buildProductsCustomBatchResponseEntry(); | |
2793 var od = new api.ProductsCustomBatchResponseEntry.fromJson(o.toJson()); | |
2794 checkProductsCustomBatchResponseEntry(od); | |
2795 }); | |
2796 }); | |
2797 | |
2798 | |
2799 unittest.group("obj-schema-ProductsListResponse", () { | |
2800 unittest.test("to-json--from-json", () { | |
2801 var o = buildProductsListResponse(); | |
2802 var od = new api.ProductsListResponse.fromJson(o.toJson()); | |
2803 checkProductsListResponse(od); | |
2804 }); | |
2805 }); | |
2806 | |
2807 | |
2808 unittest.group("obj-schema-ProductstatusesCustomBatchRequest", () { | |
2809 unittest.test("to-json--from-json", () { | |
2810 var o = buildProductstatusesCustomBatchRequest(); | |
2811 var od = new api.ProductstatusesCustomBatchRequest.fromJson(o.toJson()); | |
2812 checkProductstatusesCustomBatchRequest(od); | |
2813 }); | |
2814 }); | |
2815 | |
2816 | |
2817 unittest.group("obj-schema-ProductstatusesCustomBatchRequestEntry", () { | |
2818 unittest.test("to-json--from-json", () { | |
2819 var o = buildProductstatusesCustomBatchRequestEntry(); | |
2820 var od = new api.ProductstatusesCustomBatchRequestEntry.fromJson(o.toJson(
)); | |
2821 checkProductstatusesCustomBatchRequestEntry(od); | |
2822 }); | |
2823 }); | |
2824 | |
2825 | |
2826 unittest.group("obj-schema-ProductstatusesCustomBatchResponse", () { | |
2827 unittest.test("to-json--from-json", () { | |
2828 var o = buildProductstatusesCustomBatchResponse(); | |
2829 var od = new api.ProductstatusesCustomBatchResponse.fromJson(o.toJson()); | |
2830 checkProductstatusesCustomBatchResponse(od); | |
2831 }); | |
2832 }); | |
2833 | |
2834 | |
2835 unittest.group("obj-schema-ProductstatusesCustomBatchResponseEntry", () { | |
2836 unittest.test("to-json--from-json", () { | |
2837 var o = buildProductstatusesCustomBatchResponseEntry(); | |
2838 var od = new api.ProductstatusesCustomBatchResponseEntry.fromJson(o.toJson
()); | |
2839 checkProductstatusesCustomBatchResponseEntry(od); | |
2840 }); | |
2841 }); | |
2842 | |
2843 | |
2844 unittest.group("obj-schema-ProductstatusesListResponse", () { | |
2845 unittest.test("to-json--from-json", () { | |
2846 var o = buildProductstatusesListResponse(); | |
2847 var od = new api.ProductstatusesListResponse.fromJson(o.toJson()); | |
2848 checkProductstatusesListResponse(od); | |
2849 }); | |
2850 }); | |
2851 | |
2852 | |
2853 unittest.group("resource-AccountsResourceApi", () { | |
2854 unittest.test("method--custombatch", () { | |
2855 | |
2856 var mock = new common_test.HttpServerMock(); | |
2857 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
2858 var arg_request = buildAccountsCustomBatchRequest(); | |
2859 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
2860 var obj = new api.AccountsCustomBatchRequest.fromJson(json); | |
2861 checkAccountsCustomBatchRequest(obj); | |
2862 | |
2863 var path = (req.url).path; | |
2864 var pathOffset = 0; | |
2865 var index; | |
2866 var subPart; | |
2867 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
2868 pathOffset += 12; | |
2869 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("accounts/batch")); | |
2870 pathOffset += 14; | |
2871 | |
2872 var query = (req.url).query; | |
2873 var queryOffset = 0; | |
2874 var queryMap = {}; | |
2875 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2876 parseBool(n) { | |
2877 if (n == "true") return true; | |
2878 if (n == "false") return false; | |
2879 if (n == null) return null; | |
2880 throw new core.ArgumentError("Invalid boolean: $n"); | |
2881 } | |
2882 if (query.length > 0) { | |
2883 for (var part in query.split("&")) { | |
2884 var keyvalue = part.split("="); | |
2885 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2886 } | |
2887 } | |
2888 | |
2889 | |
2890 var h = { | |
2891 "content-type" : "application/json; charset=utf-8", | |
2892 }; | |
2893 var resp = convert.JSON.encode(buildAccountsCustomBatchResponse()); | |
2894 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
2895 }), true); | |
2896 res.custombatch(arg_request).then(unittest.expectAsync(((api.AccountsCusto
mBatchResponse response) { | |
2897 checkAccountsCustomBatchResponse(response); | |
2898 }))); | |
2899 }); | |
2900 | |
2901 unittest.test("method--delete", () { | |
2902 | |
2903 var mock = new common_test.HttpServerMock(); | |
2904 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
2905 var arg_merchantId = "foo"; | |
2906 var arg_accountId = "foo"; | |
2907 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
2908 var path = (req.url).path; | |
2909 var pathOffset = 0; | |
2910 var index; | |
2911 var subPart; | |
2912 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
2913 pathOffset += 12; | |
2914 index = path.indexOf("/accounts/", pathOffset); | |
2915 unittest.expect(index >= 0, unittest.isTrue); | |
2916 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2917 pathOffset = index; | |
2918 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
2919 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/accounts/")); | |
2920 pathOffset += 10; | |
2921 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2922 pathOffset = path.length; | |
2923 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
2924 | |
2925 var query = (req.url).query; | |
2926 var queryOffset = 0; | |
2927 var queryMap = {}; | |
2928 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2929 parseBool(n) { | |
2930 if (n == "true") return true; | |
2931 if (n == "false") return false; | |
2932 if (n == null) return null; | |
2933 throw new core.ArgumentError("Invalid boolean: $n"); | |
2934 } | |
2935 if (query.length > 0) { | |
2936 for (var part in query.split("&")) { | |
2937 var keyvalue = part.split("="); | |
2938 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2939 } | |
2940 } | |
2941 | |
2942 | |
2943 var h = { | |
2944 "content-type" : "application/json; charset=utf-8", | |
2945 }; | |
2946 var resp = ""; | |
2947 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
2948 }), true); | |
2949 res.delete(arg_merchantId, arg_accountId).then(unittest.expectAsync((_) {}
)); | |
2950 }); | |
2951 | |
2952 unittest.test("method--get", () { | |
2953 | |
2954 var mock = new common_test.HttpServerMock(); | |
2955 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
2956 var arg_merchantId = "foo"; | |
2957 var arg_accountId = "foo"; | |
2958 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
2959 var path = (req.url).path; | |
2960 var pathOffset = 0; | |
2961 var index; | |
2962 var subPart; | |
2963 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
2964 pathOffset += 12; | |
2965 index = path.indexOf("/accounts/", pathOffset); | |
2966 unittest.expect(index >= 0, unittest.isTrue); | |
2967 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
2968 pathOffset = index; | |
2969 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
2970 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/accounts/")); | |
2971 pathOffset += 10; | |
2972 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
2973 pathOffset = path.length; | |
2974 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
2975 | |
2976 var query = (req.url).query; | |
2977 var queryOffset = 0; | |
2978 var queryMap = {}; | |
2979 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2980 parseBool(n) { | |
2981 if (n == "true") return true; | |
2982 if (n == "false") return false; | |
2983 if (n == null) return null; | |
2984 throw new core.ArgumentError("Invalid boolean: $n"); | |
2985 } | |
2986 if (query.length > 0) { | |
2987 for (var part in query.split("&")) { | |
2988 var keyvalue = part.split("="); | |
2989 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2990 } | |
2991 } | |
2992 | |
2993 | |
2994 var h = { | |
2995 "content-type" : "application/json; charset=utf-8", | |
2996 }; | |
2997 var resp = convert.JSON.encode(buildAccount()); | |
2998 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
2999 }), true); | |
3000 res.get(arg_merchantId, arg_accountId).then(unittest.expectAsync(((api.Acc
ount response) { | |
3001 checkAccount(response); | |
3002 }))); | |
3003 }); | |
3004 | |
3005 unittest.test("method--insert", () { | |
3006 | |
3007 var mock = new common_test.HttpServerMock(); | |
3008 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
3009 var arg_request = buildAccount(); | |
3010 var arg_merchantId = "foo"; | |
3011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3012 var obj = new api.Account.fromJson(json); | |
3013 checkAccount(obj); | |
3014 | |
3015 var path = (req.url).path; | |
3016 var pathOffset = 0; | |
3017 var index; | |
3018 var subPart; | |
3019 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3020 pathOffset += 12; | |
3021 index = path.indexOf("/accounts", pathOffset); | |
3022 unittest.expect(index >= 0, unittest.isTrue); | |
3023 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3024 pathOffset = index; | |
3025 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3026 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/accounts")); | |
3027 pathOffset += 9; | |
3028 | |
3029 var query = (req.url).query; | |
3030 var queryOffset = 0; | |
3031 var queryMap = {}; | |
3032 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3033 parseBool(n) { | |
3034 if (n == "true") return true; | |
3035 if (n == "false") return false; | |
3036 if (n == null) return null; | |
3037 throw new core.ArgumentError("Invalid boolean: $n"); | |
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]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3043 } | |
3044 } | |
3045 | |
3046 | |
3047 var h = { | |
3048 "content-type" : "application/json; charset=utf-8", | |
3049 }; | |
3050 var resp = convert.JSON.encode(buildAccount()); | |
3051 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3052 }), true); | |
3053 res.insert(arg_request, arg_merchantId).then(unittest.expectAsync(((api.Ac
count response) { | |
3054 checkAccount(response); | |
3055 }))); | |
3056 }); | |
3057 | |
3058 unittest.test("method--list", () { | |
3059 | |
3060 var mock = new common_test.HttpServerMock(); | |
3061 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
3062 var arg_merchantId = "foo"; | |
3063 var arg_maxResults = 42; | |
3064 var arg_pageToken = "foo"; | |
3065 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3066 var path = (req.url).path; | |
3067 var pathOffset = 0; | |
3068 var index; | |
3069 var subPart; | |
3070 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3071 pathOffset += 12; | |
3072 index = path.indexOf("/accounts", pathOffset); | |
3073 unittest.expect(index >= 0, unittest.isTrue); | |
3074 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3075 pathOffset = index; | |
3076 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3077 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/accounts")); | |
3078 pathOffset += 9; | |
3079 | |
3080 var query = (req.url).query; | |
3081 var queryOffset = 0; | |
3082 var queryMap = {}; | |
3083 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3084 parseBool(n) { | |
3085 if (n == "true") return true; | |
3086 if (n == "false") return false; | |
3087 if (n == null) return null; | |
3088 throw new core.ArgumentError("Invalid boolean: $n"); | |
3089 } | |
3090 if (query.length > 0) { | |
3091 for (var part in query.split("&")) { | |
3092 var keyvalue = part.split("="); | |
3093 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3094 } | |
3095 } | |
3096 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
3097 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
3098 | |
3099 | |
3100 var h = { | |
3101 "content-type" : "application/json; charset=utf-8", | |
3102 }; | |
3103 var resp = convert.JSON.encode(buildAccountsListResponse()); | |
3104 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3105 }), true); | |
3106 res.list(arg_merchantId, maxResults: arg_maxResults, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.AccountsListResponse response) { | |
3107 checkAccountsListResponse(response); | |
3108 }))); | |
3109 }); | |
3110 | |
3111 unittest.test("method--patch", () { | |
3112 | |
3113 var mock = new common_test.HttpServerMock(); | |
3114 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
3115 var arg_request = buildAccount(); | |
3116 var arg_merchantId = "foo"; | |
3117 var arg_accountId = "foo"; | |
3118 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3119 var obj = new api.Account.fromJson(json); | |
3120 checkAccount(obj); | |
3121 | |
3122 var path = (req.url).path; | |
3123 var pathOffset = 0; | |
3124 var index; | |
3125 var subPart; | |
3126 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3127 pathOffset += 12; | |
3128 index = path.indexOf("/accounts/", pathOffset); | |
3129 unittest.expect(index >= 0, unittest.isTrue); | |
3130 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3131 pathOffset = index; | |
3132 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3133 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/accounts/")); | |
3134 pathOffset += 10; | |
3135 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3136 pathOffset = path.length; | |
3137 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
3138 | |
3139 var query = (req.url).query; | |
3140 var queryOffset = 0; | |
3141 var queryMap = {}; | |
3142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3143 parseBool(n) { | |
3144 if (n == "true") return true; | |
3145 if (n == "false") return false; | |
3146 if (n == null) return null; | |
3147 throw new core.ArgumentError("Invalid boolean: $n"); | |
3148 } | |
3149 if (query.length > 0) { | |
3150 for (var part in query.split("&")) { | |
3151 var keyvalue = part.split("="); | |
3152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3153 } | |
3154 } | |
3155 | |
3156 | |
3157 var h = { | |
3158 "content-type" : "application/json; charset=utf-8", | |
3159 }; | |
3160 var resp = convert.JSON.encode(buildAccount()); | |
3161 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3162 }), true); | |
3163 res.patch(arg_request, arg_merchantId, arg_accountId).then(unittest.expect
Async(((api.Account response) { | |
3164 checkAccount(response); | |
3165 }))); | |
3166 }); | |
3167 | |
3168 unittest.test("method--update", () { | |
3169 | |
3170 var mock = new common_test.HttpServerMock(); | |
3171 api.AccountsResourceApi res = new api.ContentApi(mock).accounts; | |
3172 var arg_request = buildAccount(); | |
3173 var arg_merchantId = "foo"; | |
3174 var arg_accountId = "foo"; | |
3175 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3176 var obj = new api.Account.fromJson(json); | |
3177 checkAccount(obj); | |
3178 | |
3179 var path = (req.url).path; | |
3180 var pathOffset = 0; | |
3181 var index; | |
3182 var subPart; | |
3183 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3184 pathOffset += 12; | |
3185 index = path.indexOf("/accounts/", pathOffset); | |
3186 unittest.expect(index >= 0, unittest.isTrue); | |
3187 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3188 pathOffset = index; | |
3189 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3190 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/accounts/")); | |
3191 pathOffset += 10; | |
3192 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3193 pathOffset = path.length; | |
3194 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
3195 | |
3196 var query = (req.url).query; | |
3197 var queryOffset = 0; | |
3198 var queryMap = {}; | |
3199 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3200 parseBool(n) { | |
3201 if (n == "true") return true; | |
3202 if (n == "false") return false; | |
3203 if (n == null) return null; | |
3204 throw new core.ArgumentError("Invalid boolean: $n"); | |
3205 } | |
3206 if (query.length > 0) { | |
3207 for (var part in query.split("&")) { | |
3208 var keyvalue = part.split("="); | |
3209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3210 } | |
3211 } | |
3212 | |
3213 | |
3214 var h = { | |
3215 "content-type" : "application/json; charset=utf-8", | |
3216 }; | |
3217 var resp = convert.JSON.encode(buildAccount()); | |
3218 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3219 }), true); | |
3220 res.update(arg_request, arg_merchantId, arg_accountId).then(unittest.expec
tAsync(((api.Account response) { | |
3221 checkAccount(response); | |
3222 }))); | |
3223 }); | |
3224 | |
3225 }); | |
3226 | |
3227 | |
3228 unittest.group("resource-AccountstatusesResourceApi", () { | |
3229 unittest.test("method--custombatch", () { | |
3230 | |
3231 var mock = new common_test.HttpServerMock(); | |
3232 api.AccountstatusesResourceApi res = new api.ContentApi(mock).accountstatu
ses; | |
3233 var arg_request = buildAccountstatusesCustomBatchRequest(); | |
3234 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3235 var obj = new api.AccountstatusesCustomBatchRequest.fromJson(json); | |
3236 checkAccountstatusesCustomBatchRequest(obj); | |
3237 | |
3238 var path = (req.url).path; | |
3239 var pathOffset = 0; | |
3240 var index; | |
3241 var subPart; | |
3242 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3243 pathOffset += 12; | |
3244 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("accountstatuses/batch")); | |
3245 pathOffset += 21; | |
3246 | |
3247 var query = (req.url).query; | |
3248 var queryOffset = 0; | |
3249 var queryMap = {}; | |
3250 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3251 parseBool(n) { | |
3252 if (n == "true") return true; | |
3253 if (n == "false") return false; | |
3254 if (n == null) return null; | |
3255 throw new core.ArgumentError("Invalid boolean: $n"); | |
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]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3261 } | |
3262 } | |
3263 | |
3264 | |
3265 var h = { | |
3266 "content-type" : "application/json; charset=utf-8", | |
3267 }; | |
3268 var resp = convert.JSON.encode(buildAccountstatusesCustomBatchResponse()
); | |
3269 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3270 }), true); | |
3271 res.custombatch(arg_request).then(unittest.expectAsync(((api.Accountstatus
esCustomBatchResponse response) { | |
3272 checkAccountstatusesCustomBatchResponse(response); | |
3273 }))); | |
3274 }); | |
3275 | |
3276 unittest.test("method--get", () { | |
3277 | |
3278 var mock = new common_test.HttpServerMock(); | |
3279 api.AccountstatusesResourceApi res = new api.ContentApi(mock).accountstatu
ses; | |
3280 var arg_merchantId = "foo"; | |
3281 var arg_accountId = "foo"; | |
3282 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3283 var path = (req.url).path; | |
3284 var pathOffset = 0; | |
3285 var index; | |
3286 var subPart; | |
3287 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3288 pathOffset += 12; | |
3289 index = path.indexOf("/accountstatuses/", pathOffset); | |
3290 unittest.expect(index >= 0, unittest.isTrue); | |
3291 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3292 pathOffset = index; | |
3293 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3294 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/accountstatuses/")); | |
3295 pathOffset += 17; | |
3296 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3297 pathOffset = path.length; | |
3298 unittest.expect(subPart, unittest.equals("$arg_accountId")); | |
3299 | |
3300 var query = (req.url).query; | |
3301 var queryOffset = 0; | |
3302 var queryMap = {}; | |
3303 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3304 parseBool(n) { | |
3305 if (n == "true") return true; | |
3306 if (n == "false") return false; | |
3307 if (n == null) return null; | |
3308 throw new core.ArgumentError("Invalid boolean: $n"); | |
3309 } | |
3310 if (query.length > 0) { | |
3311 for (var part in query.split("&")) { | |
3312 var keyvalue = part.split("="); | |
3313 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3314 } | |
3315 } | |
3316 | |
3317 | |
3318 var h = { | |
3319 "content-type" : "application/json; charset=utf-8", | |
3320 }; | |
3321 var resp = convert.JSON.encode(buildAccountStatus()); | |
3322 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3323 }), true); | |
3324 res.get(arg_merchantId, arg_accountId).then(unittest.expectAsync(((api.Acc
ountStatus response) { | |
3325 checkAccountStatus(response); | |
3326 }))); | |
3327 }); | |
3328 | |
3329 unittest.test("method--list", () { | |
3330 | |
3331 var mock = new common_test.HttpServerMock(); | |
3332 api.AccountstatusesResourceApi res = new api.ContentApi(mock).accountstatu
ses; | |
3333 var arg_merchantId = "foo"; | |
3334 var arg_maxResults = 42; | |
3335 var arg_pageToken = "foo"; | |
3336 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3337 var path = (req.url).path; | |
3338 var pathOffset = 0; | |
3339 var index; | |
3340 var subPart; | |
3341 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3342 pathOffset += 12; | |
3343 index = path.indexOf("/accountstatuses", pathOffset); | |
3344 unittest.expect(index >= 0, unittest.isTrue); | |
3345 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3346 pathOffset = index; | |
3347 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3348 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/accountstatuses")); | |
3349 pathOffset += 16; | |
3350 | |
3351 var query = (req.url).query; | |
3352 var queryOffset = 0; | |
3353 var queryMap = {}; | |
3354 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3355 parseBool(n) { | |
3356 if (n == "true") return true; | |
3357 if (n == "false") return false; | |
3358 if (n == null) return null; | |
3359 throw new core.ArgumentError("Invalid boolean: $n"); | |
3360 } | |
3361 if (query.length > 0) { | |
3362 for (var part in query.split("&")) { | |
3363 var keyvalue = part.split("="); | |
3364 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3365 } | |
3366 } | |
3367 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
3368 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
3369 | |
3370 | |
3371 var h = { | |
3372 "content-type" : "application/json; charset=utf-8", | |
3373 }; | |
3374 var resp = convert.JSON.encode(buildAccountstatusesListResponse()); | |
3375 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3376 }), true); | |
3377 res.list(arg_merchantId, maxResults: arg_maxResults, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.AccountstatusesListResponse response) { | |
3378 checkAccountstatusesListResponse(response); | |
3379 }))); | |
3380 }); | |
3381 | |
3382 }); | |
3383 | |
3384 | |
3385 unittest.group("resource-DatafeedsResourceApi", () { | |
3386 unittest.test("method--custombatch", () { | |
3387 | |
3388 var mock = new common_test.HttpServerMock(); | |
3389 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3390 var arg_request = buildDatafeedsCustomBatchRequest(); | |
3391 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3392 var obj = new api.DatafeedsCustomBatchRequest.fromJson(json); | |
3393 checkDatafeedsCustomBatchRequest(obj); | |
3394 | |
3395 var path = (req.url).path; | |
3396 var pathOffset = 0; | |
3397 var index; | |
3398 var subPart; | |
3399 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3400 pathOffset += 12; | |
3401 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("datafeeds/batch")); | |
3402 pathOffset += 15; | |
3403 | |
3404 var query = (req.url).query; | |
3405 var queryOffset = 0; | |
3406 var queryMap = {}; | |
3407 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3408 parseBool(n) { | |
3409 if (n == "true") return true; | |
3410 if (n == "false") return false; | |
3411 if (n == null) return null; | |
3412 throw new core.ArgumentError("Invalid boolean: $n"); | |
3413 } | |
3414 if (query.length > 0) { | |
3415 for (var part in query.split("&")) { | |
3416 var keyvalue = part.split("="); | |
3417 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3418 } | |
3419 } | |
3420 | |
3421 | |
3422 var h = { | |
3423 "content-type" : "application/json; charset=utf-8", | |
3424 }; | |
3425 var resp = convert.JSON.encode(buildDatafeedsCustomBatchResponse()); | |
3426 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3427 }), true); | |
3428 res.custombatch(arg_request).then(unittest.expectAsync(((api.DatafeedsCust
omBatchResponse response) { | |
3429 checkDatafeedsCustomBatchResponse(response); | |
3430 }))); | |
3431 }); | |
3432 | |
3433 unittest.test("method--delete", () { | |
3434 | |
3435 var mock = new common_test.HttpServerMock(); | |
3436 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3437 var arg_merchantId = "foo"; | |
3438 var arg_datafeedId = "foo"; | |
3439 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3440 var path = (req.url).path; | |
3441 var pathOffset = 0; | |
3442 var index; | |
3443 var subPart; | |
3444 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3445 pathOffset += 12; | |
3446 index = path.indexOf("/datafeeds/", pathOffset); | |
3447 unittest.expect(index >= 0, unittest.isTrue); | |
3448 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3449 pathOffset = index; | |
3450 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3451 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/datafeeds/")); | |
3452 pathOffset += 11; | |
3453 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3454 pathOffset = path.length; | |
3455 unittest.expect(subPart, unittest.equals("$arg_datafeedId")); | |
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 if (query.length > 0) { | |
3468 for (var part in query.split("&")) { | |
3469 var keyvalue = part.split("="); | |
3470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3471 } | |
3472 } | |
3473 | |
3474 | |
3475 var h = { | |
3476 "content-type" : "application/json; charset=utf-8", | |
3477 }; | |
3478 var resp = ""; | |
3479 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3480 }), true); | |
3481 res.delete(arg_merchantId, arg_datafeedId).then(unittest.expectAsync((_) {
})); | |
3482 }); | |
3483 | |
3484 unittest.test("method--get", () { | |
3485 | |
3486 var mock = new common_test.HttpServerMock(); | |
3487 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3488 var arg_merchantId = "foo"; | |
3489 var arg_datafeedId = "foo"; | |
3490 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3491 var path = (req.url).path; | |
3492 var pathOffset = 0; | |
3493 var index; | |
3494 var subPart; | |
3495 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3496 pathOffset += 12; | |
3497 index = path.indexOf("/datafeeds/", pathOffset); | |
3498 unittest.expect(index >= 0, unittest.isTrue); | |
3499 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3500 pathOffset = index; | |
3501 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3502 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/datafeeds/")); | |
3503 pathOffset += 11; | |
3504 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3505 pathOffset = path.length; | |
3506 unittest.expect(subPart, unittest.equals("$arg_datafeedId")); | |
3507 | |
3508 var query = (req.url).query; | |
3509 var queryOffset = 0; | |
3510 var queryMap = {}; | |
3511 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3512 parseBool(n) { | |
3513 if (n == "true") return true; | |
3514 if (n == "false") return false; | |
3515 if (n == null) return null; | |
3516 throw new core.ArgumentError("Invalid boolean: $n"); | |
3517 } | |
3518 if (query.length > 0) { | |
3519 for (var part in query.split("&")) { | |
3520 var keyvalue = part.split("="); | |
3521 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3522 } | |
3523 } | |
3524 | |
3525 | |
3526 var h = { | |
3527 "content-type" : "application/json; charset=utf-8", | |
3528 }; | |
3529 var resp = convert.JSON.encode(buildDatafeed()); | |
3530 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3531 }), true); | |
3532 res.get(arg_merchantId, arg_datafeedId).then(unittest.expectAsync(((api.Da
tafeed response) { | |
3533 checkDatafeed(response); | |
3534 }))); | |
3535 }); | |
3536 | |
3537 unittest.test("method--insert", () { | |
3538 | |
3539 var mock = new common_test.HttpServerMock(); | |
3540 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3541 var arg_request = buildDatafeed(); | |
3542 var arg_merchantId = "foo"; | |
3543 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3544 var obj = new api.Datafeed.fromJson(json); | |
3545 checkDatafeed(obj); | |
3546 | |
3547 var path = (req.url).path; | |
3548 var pathOffset = 0; | |
3549 var index; | |
3550 var subPart; | |
3551 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3552 pathOffset += 12; | |
3553 index = path.indexOf("/datafeeds", pathOffset); | |
3554 unittest.expect(index >= 0, unittest.isTrue); | |
3555 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3556 pathOffset = index; | |
3557 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3558 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datafeeds")); | |
3559 pathOffset += 10; | |
3560 | |
3561 var query = (req.url).query; | |
3562 var queryOffset = 0; | |
3563 var queryMap = {}; | |
3564 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3565 parseBool(n) { | |
3566 if (n == "true") return true; | |
3567 if (n == "false") return false; | |
3568 if (n == null) return null; | |
3569 throw new core.ArgumentError("Invalid boolean: $n"); | |
3570 } | |
3571 if (query.length > 0) { | |
3572 for (var part in query.split("&")) { | |
3573 var keyvalue = part.split("="); | |
3574 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3575 } | |
3576 } | |
3577 | |
3578 | |
3579 var h = { | |
3580 "content-type" : "application/json; charset=utf-8", | |
3581 }; | |
3582 var resp = convert.JSON.encode(buildDatafeed()); | |
3583 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3584 }), true); | |
3585 res.insert(arg_request, arg_merchantId).then(unittest.expectAsync(((api.Da
tafeed response) { | |
3586 checkDatafeed(response); | |
3587 }))); | |
3588 }); | |
3589 | |
3590 unittest.test("method--list", () { | |
3591 | |
3592 var mock = new common_test.HttpServerMock(); | |
3593 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3594 var arg_merchantId = "foo"; | |
3595 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3596 var path = (req.url).path; | |
3597 var pathOffset = 0; | |
3598 var index; | |
3599 var subPart; | |
3600 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3601 pathOffset += 12; | |
3602 index = path.indexOf("/datafeeds", pathOffset); | |
3603 unittest.expect(index >= 0, unittest.isTrue); | |
3604 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3605 pathOffset = index; | |
3606 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3607 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datafeeds")); | |
3608 pathOffset += 10; | |
3609 | |
3610 var query = (req.url).query; | |
3611 var queryOffset = 0; | |
3612 var queryMap = {}; | |
3613 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3614 parseBool(n) { | |
3615 if (n == "true") return true; | |
3616 if (n == "false") return false; | |
3617 if (n == null) return null; | |
3618 throw new core.ArgumentError("Invalid boolean: $n"); | |
3619 } | |
3620 if (query.length > 0) { | |
3621 for (var part in query.split("&")) { | |
3622 var keyvalue = part.split("="); | |
3623 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3624 } | |
3625 } | |
3626 | |
3627 | |
3628 var h = { | |
3629 "content-type" : "application/json; charset=utf-8", | |
3630 }; | |
3631 var resp = convert.JSON.encode(buildDatafeedsListResponse()); | |
3632 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3633 }), true); | |
3634 res.list(arg_merchantId).then(unittest.expectAsync(((api.DatafeedsListResp
onse response) { | |
3635 checkDatafeedsListResponse(response); | |
3636 }))); | |
3637 }); | |
3638 | |
3639 unittest.test("method--patch", () { | |
3640 | |
3641 var mock = new common_test.HttpServerMock(); | |
3642 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3643 var arg_request = buildDatafeed(); | |
3644 var arg_merchantId = "foo"; | |
3645 var arg_datafeedId = "foo"; | |
3646 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3647 var obj = new api.Datafeed.fromJson(json); | |
3648 checkDatafeed(obj); | |
3649 | |
3650 var path = (req.url).path; | |
3651 var pathOffset = 0; | |
3652 var index; | |
3653 var subPart; | |
3654 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3655 pathOffset += 12; | |
3656 index = path.indexOf("/datafeeds/", pathOffset); | |
3657 unittest.expect(index >= 0, unittest.isTrue); | |
3658 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3659 pathOffset = index; | |
3660 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3661 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/datafeeds/")); | |
3662 pathOffset += 11; | |
3663 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3664 pathOffset = path.length; | |
3665 unittest.expect(subPart, unittest.equals("$arg_datafeedId")); | |
3666 | |
3667 var query = (req.url).query; | |
3668 var queryOffset = 0; | |
3669 var queryMap = {}; | |
3670 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3671 parseBool(n) { | |
3672 if (n == "true") return true; | |
3673 if (n == "false") return false; | |
3674 if (n == null) return null; | |
3675 throw new core.ArgumentError("Invalid boolean: $n"); | |
3676 } | |
3677 if (query.length > 0) { | |
3678 for (var part in query.split("&")) { | |
3679 var keyvalue = part.split("="); | |
3680 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3681 } | |
3682 } | |
3683 | |
3684 | |
3685 var h = { | |
3686 "content-type" : "application/json; charset=utf-8", | |
3687 }; | |
3688 var resp = convert.JSON.encode(buildDatafeed()); | |
3689 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3690 }), true); | |
3691 res.patch(arg_request, arg_merchantId, arg_datafeedId).then(unittest.expec
tAsync(((api.Datafeed response) { | |
3692 checkDatafeed(response); | |
3693 }))); | |
3694 }); | |
3695 | |
3696 unittest.test("method--update", () { | |
3697 | |
3698 var mock = new common_test.HttpServerMock(); | |
3699 api.DatafeedsResourceApi res = new api.ContentApi(mock).datafeeds; | |
3700 var arg_request = buildDatafeed(); | |
3701 var arg_merchantId = "foo"; | |
3702 var arg_datafeedId = "foo"; | |
3703 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3704 var obj = new api.Datafeed.fromJson(json); | |
3705 checkDatafeed(obj); | |
3706 | |
3707 var path = (req.url).path; | |
3708 var pathOffset = 0; | |
3709 var index; | |
3710 var subPart; | |
3711 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3712 pathOffset += 12; | |
3713 index = path.indexOf("/datafeeds/", pathOffset); | |
3714 unittest.expect(index >= 0, unittest.isTrue); | |
3715 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3716 pathOffset = index; | |
3717 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3718 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/datafeeds/")); | |
3719 pathOffset += 11; | |
3720 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3721 pathOffset = path.length; | |
3722 unittest.expect(subPart, unittest.equals("$arg_datafeedId")); | |
3723 | |
3724 var query = (req.url).query; | |
3725 var queryOffset = 0; | |
3726 var queryMap = {}; | |
3727 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3728 parseBool(n) { | |
3729 if (n == "true") return true; | |
3730 if (n == "false") return false; | |
3731 if (n == null) return null; | |
3732 throw new core.ArgumentError("Invalid boolean: $n"); | |
3733 } | |
3734 if (query.length > 0) { | |
3735 for (var part in query.split("&")) { | |
3736 var keyvalue = part.split("="); | |
3737 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3738 } | |
3739 } | |
3740 | |
3741 | |
3742 var h = { | |
3743 "content-type" : "application/json; charset=utf-8", | |
3744 }; | |
3745 var resp = convert.JSON.encode(buildDatafeed()); | |
3746 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3747 }), true); | |
3748 res.update(arg_request, arg_merchantId, arg_datafeedId).then(unittest.expe
ctAsync(((api.Datafeed response) { | |
3749 checkDatafeed(response); | |
3750 }))); | |
3751 }); | |
3752 | |
3753 }); | |
3754 | |
3755 | |
3756 unittest.group("resource-DatafeedstatusesResourceApi", () { | |
3757 unittest.test("method--custombatch", () { | |
3758 | |
3759 var mock = new common_test.HttpServerMock(); | |
3760 api.DatafeedstatusesResourceApi res = new api.ContentApi(mock).datafeedsta
tuses; | |
3761 var arg_request = buildDatafeedstatusesCustomBatchRequest(); | |
3762 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3763 var obj = new api.DatafeedstatusesCustomBatchRequest.fromJson(json); | |
3764 checkDatafeedstatusesCustomBatchRequest(obj); | |
3765 | |
3766 var path = (req.url).path; | |
3767 var pathOffset = 0; | |
3768 var index; | |
3769 var subPart; | |
3770 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3771 pathOffset += 12; | |
3772 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("datafeedstatuses/batch")); | |
3773 pathOffset += 22; | |
3774 | |
3775 var query = (req.url).query; | |
3776 var queryOffset = 0; | |
3777 var queryMap = {}; | |
3778 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3779 parseBool(n) { | |
3780 if (n == "true") return true; | |
3781 if (n == "false") return false; | |
3782 if (n == null) return null; | |
3783 throw new core.ArgumentError("Invalid boolean: $n"); | |
3784 } | |
3785 if (query.length > 0) { | |
3786 for (var part in query.split("&")) { | |
3787 var keyvalue = part.split("="); | |
3788 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3789 } | |
3790 } | |
3791 | |
3792 | |
3793 var h = { | |
3794 "content-type" : "application/json; charset=utf-8", | |
3795 }; | |
3796 var resp = convert.JSON.encode(buildDatafeedstatusesCustomBatchResponse(
)); | |
3797 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3798 }), true); | |
3799 res.custombatch(arg_request).then(unittest.expectAsync(((api.Datafeedstatu
sesCustomBatchResponse response) { | |
3800 checkDatafeedstatusesCustomBatchResponse(response); | |
3801 }))); | |
3802 }); | |
3803 | |
3804 unittest.test("method--get", () { | |
3805 | |
3806 var mock = new common_test.HttpServerMock(); | |
3807 api.DatafeedstatusesResourceApi res = new api.ContentApi(mock).datafeedsta
tuses; | |
3808 var arg_merchantId = "foo"; | |
3809 var arg_datafeedId = "foo"; | |
3810 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3811 var path = (req.url).path; | |
3812 var pathOffset = 0; | |
3813 var index; | |
3814 var subPart; | |
3815 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3816 pathOffset += 12; | |
3817 index = path.indexOf("/datafeedstatuses/", pathOffset); | |
3818 unittest.expect(index >= 0, unittest.isTrue); | |
3819 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3820 pathOffset = index; | |
3821 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3822 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("/datafeedstatuses/")); | |
3823 pathOffset += 18; | |
3824 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3825 pathOffset = path.length; | |
3826 unittest.expect(subPart, unittest.equals("$arg_datafeedId")); | |
3827 | |
3828 var query = (req.url).query; | |
3829 var queryOffset = 0; | |
3830 var queryMap = {}; | |
3831 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3832 parseBool(n) { | |
3833 if (n == "true") return true; | |
3834 if (n == "false") return false; | |
3835 if (n == null) return null; | |
3836 throw new core.ArgumentError("Invalid boolean: $n"); | |
3837 } | |
3838 if (query.length > 0) { | |
3839 for (var part in query.split("&")) { | |
3840 var keyvalue = part.split("="); | |
3841 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3842 } | |
3843 } | |
3844 | |
3845 | |
3846 var h = { | |
3847 "content-type" : "application/json; charset=utf-8", | |
3848 }; | |
3849 var resp = convert.JSON.encode(buildDatafeedStatus()); | |
3850 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3851 }), true); | |
3852 res.get(arg_merchantId, arg_datafeedId).then(unittest.expectAsync(((api.Da
tafeedStatus response) { | |
3853 checkDatafeedStatus(response); | |
3854 }))); | |
3855 }); | |
3856 | |
3857 unittest.test("method--list", () { | |
3858 | |
3859 var mock = new common_test.HttpServerMock(); | |
3860 api.DatafeedstatusesResourceApi res = new api.ContentApi(mock).datafeedsta
tuses; | |
3861 var arg_merchantId = "foo"; | |
3862 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3863 var path = (req.url).path; | |
3864 var pathOffset = 0; | |
3865 var index; | |
3866 var subPart; | |
3867 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3868 pathOffset += 12; | |
3869 index = path.indexOf("/datafeedstatuses", pathOffset); | |
3870 unittest.expect(index >= 0, unittest.isTrue); | |
3871 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3872 pathOffset = index; | |
3873 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3874 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/datafeedstatuses")); | |
3875 pathOffset += 17; | |
3876 | |
3877 var query = (req.url).query; | |
3878 var queryOffset = 0; | |
3879 var queryMap = {}; | |
3880 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3881 parseBool(n) { | |
3882 if (n == "true") return true; | |
3883 if (n == "false") return false; | |
3884 if (n == null) return null; | |
3885 throw new core.ArgumentError("Invalid boolean: $n"); | |
3886 } | |
3887 if (query.length > 0) { | |
3888 for (var part in query.split("&")) { | |
3889 var keyvalue = part.split("="); | |
3890 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3891 } | |
3892 } | |
3893 | |
3894 | |
3895 var h = { | |
3896 "content-type" : "application/json; charset=utf-8", | |
3897 }; | |
3898 var resp = convert.JSON.encode(buildDatafeedstatusesListResponse()); | |
3899 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3900 }), true); | |
3901 res.list(arg_merchantId).then(unittest.expectAsync(((api.DatafeedstatusesL
istResponse response) { | |
3902 checkDatafeedstatusesListResponse(response); | |
3903 }))); | |
3904 }); | |
3905 | |
3906 }); | |
3907 | |
3908 | |
3909 unittest.group("resource-InventoryResourceApi", () { | |
3910 unittest.test("method--custombatch", () { | |
3911 | |
3912 var mock = new common_test.HttpServerMock(); | |
3913 api.InventoryResourceApi res = new api.ContentApi(mock).inventory; | |
3914 var arg_request = buildInventoryCustomBatchRequest(); | |
3915 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3916 var obj = new api.InventoryCustomBatchRequest.fromJson(json); | |
3917 checkInventoryCustomBatchRequest(obj); | |
3918 | |
3919 var path = (req.url).path; | |
3920 var pathOffset = 0; | |
3921 var index; | |
3922 var subPart; | |
3923 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3924 pathOffset += 12; | |
3925 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("inventory/batch")); | |
3926 pathOffset += 15; | |
3927 | |
3928 var query = (req.url).query; | |
3929 var queryOffset = 0; | |
3930 var queryMap = {}; | |
3931 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3932 parseBool(n) { | |
3933 if (n == "true") return true; | |
3934 if (n == "false") return false; | |
3935 if (n == null) return null; | |
3936 throw new core.ArgumentError("Invalid boolean: $n"); | |
3937 } | |
3938 if (query.length > 0) { | |
3939 for (var part in query.split("&")) { | |
3940 var keyvalue = part.split("="); | |
3941 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
3942 } | |
3943 } | |
3944 | |
3945 | |
3946 var h = { | |
3947 "content-type" : "application/json; charset=utf-8", | |
3948 }; | |
3949 var resp = convert.JSON.encode(buildInventoryCustomBatchResponse()); | |
3950 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
3951 }), true); | |
3952 res.custombatch(arg_request).then(unittest.expectAsync(((api.InventoryCust
omBatchResponse response) { | |
3953 checkInventoryCustomBatchResponse(response); | |
3954 }))); | |
3955 }); | |
3956 | |
3957 unittest.test("method--set", () { | |
3958 | |
3959 var mock = new common_test.HttpServerMock(); | |
3960 api.InventoryResourceApi res = new api.ContentApi(mock).inventory; | |
3961 var arg_request = buildInventorySetRequest(); | |
3962 var arg_merchantId = "foo"; | |
3963 var arg_storeCode = "foo"; | |
3964 var arg_productId = "foo"; | |
3965 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
3966 var obj = new api.InventorySetRequest.fromJson(json); | |
3967 checkInventorySetRequest(obj); | |
3968 | |
3969 var path = (req.url).path; | |
3970 var pathOffset = 0; | |
3971 var index; | |
3972 var subPart; | |
3973 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
3974 pathOffset += 12; | |
3975 index = path.indexOf("/inventory/", pathOffset); | |
3976 unittest.expect(index >= 0, unittest.isTrue); | |
3977 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3978 pathOffset = index; | |
3979 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
3980 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/inventory/")); | |
3981 pathOffset += 11; | |
3982 index = path.indexOf("/products/", pathOffset); | |
3983 unittest.expect(index >= 0, unittest.isTrue); | |
3984 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
3985 pathOffset = index; | |
3986 unittest.expect(subPart, unittest.equals("$arg_storeCode")); | |
3987 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/products/")); | |
3988 pathOffset += 10; | |
3989 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
3990 pathOffset = path.length; | |
3991 unittest.expect(subPart, unittest.equals("$arg_productId")); | |
3992 | |
3993 var query = (req.url).query; | |
3994 var queryOffset = 0; | |
3995 var queryMap = {}; | |
3996 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
3997 parseBool(n) { | |
3998 if (n == "true") return true; | |
3999 if (n == "false") return false; | |
4000 if (n == null) return null; | |
4001 throw new core.ArgumentError("Invalid boolean: $n"); | |
4002 } | |
4003 if (query.length > 0) { | |
4004 for (var part in query.split("&")) { | |
4005 var keyvalue = part.split("="); | |
4006 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4007 } | |
4008 } | |
4009 | |
4010 | |
4011 var h = { | |
4012 "content-type" : "application/json; charset=utf-8", | |
4013 }; | |
4014 var resp = convert.JSON.encode(buildInventorySetResponse()); | |
4015 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4016 }), true); | |
4017 res.set(arg_request, arg_merchantId, arg_storeCode, arg_productId).then(un
ittest.expectAsync(((api.InventorySetResponse response) { | |
4018 checkInventorySetResponse(response); | |
4019 }))); | |
4020 }); | |
4021 | |
4022 }); | |
4023 | |
4024 | |
4025 unittest.group("resource-ProductsResourceApi", () { | |
4026 unittest.test("method--custombatch", () { | |
4027 | |
4028 var mock = new common_test.HttpServerMock(); | |
4029 api.ProductsResourceApi res = new api.ContentApi(mock).products; | |
4030 var arg_request = buildProductsCustomBatchRequest(); | |
4031 var arg_dryRun = true; | |
4032 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4033 var obj = new api.ProductsCustomBatchRequest.fromJson(json); | |
4034 checkProductsCustomBatchRequest(obj); | |
4035 | |
4036 var path = (req.url).path; | |
4037 var pathOffset = 0; | |
4038 var index; | |
4039 var subPart; | |
4040 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4041 pathOffset += 12; | |
4042 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("products/batch")); | |
4043 pathOffset += 14; | |
4044 | |
4045 var query = (req.url).query; | |
4046 var queryOffset = 0; | |
4047 var queryMap = {}; | |
4048 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4049 parseBool(n) { | |
4050 if (n == "true") return true; | |
4051 if (n == "false") return false; | |
4052 if (n == null) return null; | |
4053 throw new core.ArgumentError("Invalid boolean: $n"); | |
4054 } | |
4055 if (query.length > 0) { | |
4056 for (var part in query.split("&")) { | |
4057 var keyvalue = part.split("="); | |
4058 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4059 } | |
4060 } | |
4061 unittest.expect(queryMap["dryRun"].first, unittest.equals("$arg_dryRun")
); | |
4062 | |
4063 | |
4064 var h = { | |
4065 "content-type" : "application/json; charset=utf-8", | |
4066 }; | |
4067 var resp = convert.JSON.encode(buildProductsCustomBatchResponse()); | |
4068 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4069 }), true); | |
4070 res.custombatch(arg_request, dryRun: arg_dryRun).then(unittest.expectAsync
(((api.ProductsCustomBatchResponse response) { | |
4071 checkProductsCustomBatchResponse(response); | |
4072 }))); | |
4073 }); | |
4074 | |
4075 unittest.test("method--delete", () { | |
4076 | |
4077 var mock = new common_test.HttpServerMock(); | |
4078 api.ProductsResourceApi res = new api.ContentApi(mock).products; | |
4079 var arg_merchantId = "foo"; | |
4080 var arg_productId = "foo"; | |
4081 var arg_dryRun = true; | |
4082 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4083 var path = (req.url).path; | |
4084 var pathOffset = 0; | |
4085 var index; | |
4086 var subPart; | |
4087 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4088 pathOffset += 12; | |
4089 index = path.indexOf("/products/", pathOffset); | |
4090 unittest.expect(index >= 0, unittest.isTrue); | |
4091 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4092 pathOffset = index; | |
4093 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4094 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/products/")); | |
4095 pathOffset += 10; | |
4096 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4097 pathOffset = path.length; | |
4098 unittest.expect(subPart, unittest.equals("$arg_productId")); | |
4099 | |
4100 var query = (req.url).query; | |
4101 var queryOffset = 0; | |
4102 var queryMap = {}; | |
4103 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4104 parseBool(n) { | |
4105 if (n == "true") return true; | |
4106 if (n == "false") return false; | |
4107 if (n == null) return null; | |
4108 throw new core.ArgumentError("Invalid boolean: $n"); | |
4109 } | |
4110 if (query.length > 0) { | |
4111 for (var part in query.split("&")) { | |
4112 var keyvalue = part.split("="); | |
4113 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4114 } | |
4115 } | |
4116 unittest.expect(queryMap["dryRun"].first, unittest.equals("$arg_dryRun")
); | |
4117 | |
4118 | |
4119 var h = { | |
4120 "content-type" : "application/json; charset=utf-8", | |
4121 }; | |
4122 var resp = ""; | |
4123 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4124 }), true); | |
4125 res.delete(arg_merchantId, arg_productId, dryRun: arg_dryRun).then(unittes
t.expectAsync((_) {})); | |
4126 }); | |
4127 | |
4128 unittest.test("method--get", () { | |
4129 | |
4130 var mock = new common_test.HttpServerMock(); | |
4131 api.ProductsResourceApi res = new api.ContentApi(mock).products; | |
4132 var arg_merchantId = "foo"; | |
4133 var arg_productId = "foo"; | |
4134 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4135 var path = (req.url).path; | |
4136 var pathOffset = 0; | |
4137 var index; | |
4138 var subPart; | |
4139 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4140 pathOffset += 12; | |
4141 index = path.indexOf("/products/", pathOffset); | |
4142 unittest.expect(index >= 0, unittest.isTrue); | |
4143 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4144 pathOffset = index; | |
4145 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4146 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/products/")); | |
4147 pathOffset += 10; | |
4148 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4149 pathOffset = path.length; | |
4150 unittest.expect(subPart, unittest.equals("$arg_productId")); | |
4151 | |
4152 var query = (req.url).query; | |
4153 var queryOffset = 0; | |
4154 var queryMap = {}; | |
4155 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4156 parseBool(n) { | |
4157 if (n == "true") return true; | |
4158 if (n == "false") return false; | |
4159 if (n == null) return null; | |
4160 throw new core.ArgumentError("Invalid boolean: $n"); | |
4161 } | |
4162 if (query.length > 0) { | |
4163 for (var part in query.split("&")) { | |
4164 var keyvalue = part.split("="); | |
4165 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4166 } | |
4167 } | |
4168 | |
4169 | |
4170 var h = { | |
4171 "content-type" : "application/json; charset=utf-8", | |
4172 }; | |
4173 var resp = convert.JSON.encode(buildProduct()); | |
4174 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4175 }), true); | |
4176 res.get(arg_merchantId, arg_productId).then(unittest.expectAsync(((api.Pro
duct response) { | |
4177 checkProduct(response); | |
4178 }))); | |
4179 }); | |
4180 | |
4181 unittest.test("method--insert", () { | |
4182 | |
4183 var mock = new common_test.HttpServerMock(); | |
4184 api.ProductsResourceApi res = new api.ContentApi(mock).products; | |
4185 var arg_request = buildProduct(); | |
4186 var arg_merchantId = "foo"; | |
4187 var arg_dryRun = true; | |
4188 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4189 var obj = new api.Product.fromJson(json); | |
4190 checkProduct(obj); | |
4191 | |
4192 var path = (req.url).path; | |
4193 var pathOffset = 0; | |
4194 var index; | |
4195 var subPart; | |
4196 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4197 pathOffset += 12; | |
4198 index = path.indexOf("/products", pathOffset); | |
4199 unittest.expect(index >= 0, unittest.isTrue); | |
4200 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4201 pathOffset = index; | |
4202 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4203 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/products")); | |
4204 pathOffset += 9; | |
4205 | |
4206 var query = (req.url).query; | |
4207 var queryOffset = 0; | |
4208 var queryMap = {}; | |
4209 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4210 parseBool(n) { | |
4211 if (n == "true") return true; | |
4212 if (n == "false") return false; | |
4213 if (n == null) return null; | |
4214 throw new core.ArgumentError("Invalid boolean: $n"); | |
4215 } | |
4216 if (query.length > 0) { | |
4217 for (var part in query.split("&")) { | |
4218 var keyvalue = part.split("="); | |
4219 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4220 } | |
4221 } | |
4222 unittest.expect(queryMap["dryRun"].first, unittest.equals("$arg_dryRun")
); | |
4223 | |
4224 | |
4225 var h = { | |
4226 "content-type" : "application/json; charset=utf-8", | |
4227 }; | |
4228 var resp = convert.JSON.encode(buildProduct()); | |
4229 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4230 }), true); | |
4231 res.insert(arg_request, arg_merchantId, dryRun: arg_dryRun).then(unittest.
expectAsync(((api.Product response) { | |
4232 checkProduct(response); | |
4233 }))); | |
4234 }); | |
4235 | |
4236 unittest.test("method--list", () { | |
4237 | |
4238 var mock = new common_test.HttpServerMock(); | |
4239 api.ProductsResourceApi res = new api.ContentApi(mock).products; | |
4240 var arg_merchantId = "foo"; | |
4241 var arg_maxResults = 42; | |
4242 var arg_pageToken = "foo"; | |
4243 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4244 var path = (req.url).path; | |
4245 var pathOffset = 0; | |
4246 var index; | |
4247 var subPart; | |
4248 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4249 pathOffset += 12; | |
4250 index = path.indexOf("/products", pathOffset); | |
4251 unittest.expect(index >= 0, unittest.isTrue); | |
4252 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4253 pathOffset = index; | |
4254 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4255 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/products")); | |
4256 pathOffset += 9; | |
4257 | |
4258 var query = (req.url).query; | |
4259 var queryOffset = 0; | |
4260 var queryMap = {}; | |
4261 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4262 parseBool(n) { | |
4263 if (n == "true") return true; | |
4264 if (n == "false") return false; | |
4265 if (n == null) return null; | |
4266 throw new core.ArgumentError("Invalid boolean: $n"); | |
4267 } | |
4268 if (query.length > 0) { | |
4269 for (var part in query.split("&")) { | |
4270 var keyvalue = part.split("="); | |
4271 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4272 } | |
4273 } | |
4274 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
4275 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
4276 | |
4277 | |
4278 var h = { | |
4279 "content-type" : "application/json; charset=utf-8", | |
4280 }; | |
4281 var resp = convert.JSON.encode(buildProductsListResponse()); | |
4282 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4283 }), true); | |
4284 res.list(arg_merchantId, maxResults: arg_maxResults, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ProductsListResponse response) { | |
4285 checkProductsListResponse(response); | |
4286 }))); | |
4287 }); | |
4288 | |
4289 }); | |
4290 | |
4291 | |
4292 unittest.group("resource-ProductstatusesResourceApi", () { | |
4293 unittest.test("method--custombatch", () { | |
4294 | |
4295 var mock = new common_test.HttpServerMock(); | |
4296 api.ProductstatusesResourceApi res = new api.ContentApi(mock).productstatu
ses; | |
4297 var arg_request = buildProductstatusesCustomBatchRequest(); | |
4298 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4299 var obj = new api.ProductstatusesCustomBatchRequest.fromJson(json); | |
4300 checkProductstatusesCustomBatchRequest(obj); | |
4301 | |
4302 var path = (req.url).path; | |
4303 var pathOffset = 0; | |
4304 var index; | |
4305 var subPart; | |
4306 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4307 pathOffset += 12; | |
4308 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("productstatuses/batch")); | |
4309 pathOffset += 21; | |
4310 | |
4311 var query = (req.url).query; | |
4312 var queryOffset = 0; | |
4313 var queryMap = {}; | |
4314 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4315 parseBool(n) { | |
4316 if (n == "true") return true; | |
4317 if (n == "false") return false; | |
4318 if (n == null) return null; | |
4319 throw new core.ArgumentError("Invalid boolean: $n"); | |
4320 } | |
4321 if (query.length > 0) { | |
4322 for (var part in query.split("&")) { | |
4323 var keyvalue = part.split("="); | |
4324 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4325 } | |
4326 } | |
4327 | |
4328 | |
4329 var h = { | |
4330 "content-type" : "application/json; charset=utf-8", | |
4331 }; | |
4332 var resp = convert.JSON.encode(buildProductstatusesCustomBatchResponse()
); | |
4333 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4334 }), true); | |
4335 res.custombatch(arg_request).then(unittest.expectAsync(((api.Productstatus
esCustomBatchResponse response) { | |
4336 checkProductstatusesCustomBatchResponse(response); | |
4337 }))); | |
4338 }); | |
4339 | |
4340 unittest.test("method--get", () { | |
4341 | |
4342 var mock = new common_test.HttpServerMock(); | |
4343 api.ProductstatusesResourceApi res = new api.ContentApi(mock).productstatu
ses; | |
4344 var arg_merchantId = "foo"; | |
4345 var arg_productId = "foo"; | |
4346 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4347 var path = (req.url).path; | |
4348 var pathOffset = 0; | |
4349 var index; | |
4350 var subPart; | |
4351 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4352 pathOffset += 12; | |
4353 index = path.indexOf("/productstatuses/", pathOffset); | |
4354 unittest.expect(index >= 0, unittest.isTrue); | |
4355 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4356 pathOffset = index; | |
4357 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4358 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/productstatuses/")); | |
4359 pathOffset += 17; | |
4360 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
4361 pathOffset = path.length; | |
4362 unittest.expect(subPart, unittest.equals("$arg_productId")); | |
4363 | |
4364 var query = (req.url).query; | |
4365 var queryOffset = 0; | |
4366 var queryMap = {}; | |
4367 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4368 parseBool(n) { | |
4369 if (n == "true") return true; | |
4370 if (n == "false") return false; | |
4371 if (n == null) return null; | |
4372 throw new core.ArgumentError("Invalid boolean: $n"); | |
4373 } | |
4374 if (query.length > 0) { | |
4375 for (var part in query.split("&")) { | |
4376 var keyvalue = part.split("="); | |
4377 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4378 } | |
4379 } | |
4380 | |
4381 | |
4382 var h = { | |
4383 "content-type" : "application/json; charset=utf-8", | |
4384 }; | |
4385 var resp = convert.JSON.encode(buildProductStatus()); | |
4386 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4387 }), true); | |
4388 res.get(arg_merchantId, arg_productId).then(unittest.expectAsync(((api.Pro
ductStatus response) { | |
4389 checkProductStatus(response); | |
4390 }))); | |
4391 }); | |
4392 | |
4393 unittest.test("method--list", () { | |
4394 | |
4395 var mock = new common_test.HttpServerMock(); | |
4396 api.ProductstatusesResourceApi res = new api.ContentApi(mock).productstatu
ses; | |
4397 var arg_merchantId = "foo"; | |
4398 var arg_maxResults = 42; | |
4399 var arg_pageToken = "foo"; | |
4400 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
4401 var path = (req.url).path; | |
4402 var pathOffset = 0; | |
4403 var index; | |
4404 var subPart; | |
4405 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/content/v2/")); | |
4406 pathOffset += 12; | |
4407 index = path.indexOf("/productstatuses", pathOffset); | |
4408 unittest.expect(index >= 0, unittest.isTrue); | |
4409 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
4410 pathOffset = index; | |
4411 unittest.expect(subPart, unittest.equals("$arg_merchantId")); | |
4412 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/productstatuses")); | |
4413 pathOffset += 16; | |
4414 | |
4415 var query = (req.url).query; | |
4416 var queryOffset = 0; | |
4417 var queryMap = {}; | |
4418 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
4419 parseBool(n) { | |
4420 if (n == "true") return true; | |
4421 if (n == "false") return false; | |
4422 if (n == null) return null; | |
4423 throw new core.ArgumentError("Invalid boolean: $n"); | |
4424 } | |
4425 if (query.length > 0) { | |
4426 for (var part in query.split("&")) { | |
4427 var keyvalue = part.split("="); | |
4428 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
4429 } | |
4430 } | |
4431 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | |
4432 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
4433 | |
4434 | |
4435 var h = { | |
4436 "content-type" : "application/json; charset=utf-8", | |
4437 }; | |
4438 var resp = convert.JSON.encode(buildProductstatusesListResponse()); | |
4439 return new async.Future.value(common_test.stringResponse(200, h, resp)); | |
4440 }), true); | |
4441 res.list(arg_merchantId, maxResults: arg_maxResults, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ProductstatusesListResponse response) { | |
4442 checkProductstatusesListResponse(response); | |
4443 }))); | |
4444 }); | |
4445 | |
4446 }); | |
4447 | |
4448 | |
4449 } | |
4450 | |
OLD | NEW |