Index: generated/googleapis/test/adexchangebuyer/v1_3.dart |
diff --git a/generated/googleapis/test/adexchangebuyer/v1_3.dart b/generated/googleapis/test/adexchangebuyer/v1_3.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fb371715f7daae3be4fde3d003f9b32e26ff3af8 |
--- /dev/null |
+++ b/generated/googleapis/test/adexchangebuyer/v1_3.dart |
@@ -0,0 +1,2264 @@ |
+library googleapis.adexchangebuyer.v1_3.test; |
+ |
+import "dart:core" as core; |
+import "dart:collection" as collection; |
+import "dart:async" as async; |
+import "dart:convert" as convert; |
+ |
+import 'package:http/http.dart' as http; |
+import 'package:http/testing.dart' as http_testing; |
+import 'package:unittest/unittest.dart' as unittest; |
+import 'package:googleapis/common/common.dart' as common; |
+import 'package:googleapis/src/common_internal.dart' as common_internal; |
+import '../common/common_internal_test.dart' as common_test; |
+ |
+import 'package:googleapis/adexchangebuyer/v1_3.dart' as api; |
+ |
+ |
+ |
+core.int buildCounterAccountBidderLocation = 0; |
+buildAccountBidderLocation() { |
+ var o = new api.AccountBidderLocation(); |
+ buildCounterAccountBidderLocation++; |
+ if (buildCounterAccountBidderLocation < 3) { |
+ o.maximumQps = 42; |
+ o.region = "foo"; |
+ o.url = "foo"; |
+ } |
+ buildCounterAccountBidderLocation--; |
+ return o; |
+} |
+ |
+checkAccountBidderLocation(api.AccountBidderLocation o) { |
+ buildCounterAccountBidderLocation++; |
+ if (buildCounterAccountBidderLocation < 3) { |
+ unittest.expect(o.maximumQps, unittest.equals(42)); |
+ unittest.expect(o.region, unittest.equals('foo')); |
+ unittest.expect(o.url, unittest.equals('foo')); |
+ } |
+ buildCounterAccountBidderLocation--; |
+} |
+ |
+buildUnnamed537() { |
+ var o = new core.List<api.AccountBidderLocation>(); |
+ o.add(buildAccountBidderLocation()); |
+ o.add(buildAccountBidderLocation()); |
+ return o; |
+} |
+ |
+checkUnnamed537(core.List<api.AccountBidderLocation> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkAccountBidderLocation(o[0]); |
+ checkAccountBidderLocation(o[1]); |
+} |
+ |
+core.int buildCounterAccount = 0; |
+buildAccount() { |
+ var o = new api.Account(); |
+ buildCounterAccount++; |
+ if (buildCounterAccount < 3) { |
+ o.bidderLocation = buildUnnamed537(); |
+ o.cookieMatchingNid = "foo"; |
+ o.cookieMatchingUrl = "foo"; |
+ o.id = 42; |
+ o.kind = "foo"; |
+ o.maximumTotalQps = 42; |
+ } |
+ buildCounterAccount--; |
+ return o; |
+} |
+ |
+checkAccount(api.Account o) { |
+ buildCounterAccount++; |
+ if (buildCounterAccount < 3) { |
+ checkUnnamed537(o.bidderLocation); |
+ unittest.expect(o.cookieMatchingNid, unittest.equals('foo')); |
+ unittest.expect(o.cookieMatchingUrl, unittest.equals('foo')); |
+ unittest.expect(o.id, unittest.equals(42)); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ unittest.expect(o.maximumTotalQps, unittest.equals(42)); |
+ } |
+ buildCounterAccount--; |
+} |
+ |
+buildUnnamed538() { |
+ var o = new core.List<api.Account>(); |
+ o.add(buildAccount()); |
+ o.add(buildAccount()); |
+ return o; |
+} |
+ |
+checkUnnamed538(core.List<api.Account> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkAccount(o[0]); |
+ checkAccount(o[1]); |
+} |
+ |
+core.int buildCounterAccountsList = 0; |
+buildAccountsList() { |
+ var o = new api.AccountsList(); |
+ buildCounterAccountsList++; |
+ if (buildCounterAccountsList < 3) { |
+ o.items = buildUnnamed538(); |
+ o.kind = "foo"; |
+ } |
+ buildCounterAccountsList--; |
+ return o; |
+} |
+ |
+checkAccountsList(api.AccountsList o) { |
+ buildCounterAccountsList++; |
+ if (buildCounterAccountsList < 3) { |
+ checkUnnamed538(o.items); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ } |
+ buildCounterAccountsList--; |
+} |
+ |
+buildUnnamed539() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed539(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterBillingInfo = 0; |
+buildBillingInfo() { |
+ var o = new api.BillingInfo(); |
+ buildCounterBillingInfo++; |
+ if (buildCounterBillingInfo < 3) { |
+ o.accountId = 42; |
+ o.accountName = "foo"; |
+ o.billingId = buildUnnamed539(); |
+ o.kind = "foo"; |
+ } |
+ buildCounterBillingInfo--; |
+ return o; |
+} |
+ |
+checkBillingInfo(api.BillingInfo o) { |
+ buildCounterBillingInfo++; |
+ if (buildCounterBillingInfo < 3) { |
+ unittest.expect(o.accountId, unittest.equals(42)); |
+ unittest.expect(o.accountName, unittest.equals('foo')); |
+ checkUnnamed539(o.billingId); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ } |
+ buildCounterBillingInfo--; |
+} |
+ |
+buildUnnamed540() { |
+ var o = new core.List<api.BillingInfo>(); |
+ o.add(buildBillingInfo()); |
+ o.add(buildBillingInfo()); |
+ return o; |
+} |
+ |
+checkUnnamed540(core.List<api.BillingInfo> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkBillingInfo(o[0]); |
+ checkBillingInfo(o[1]); |
+} |
+ |
+core.int buildCounterBillingInfoList = 0; |
+buildBillingInfoList() { |
+ var o = new api.BillingInfoList(); |
+ buildCounterBillingInfoList++; |
+ if (buildCounterBillingInfoList < 3) { |
+ o.items = buildUnnamed540(); |
+ o.kind = "foo"; |
+ } |
+ buildCounterBillingInfoList--; |
+ return o; |
+} |
+ |
+checkBillingInfoList(api.BillingInfoList o) { |
+ buildCounterBillingInfoList++; |
+ if (buildCounterBillingInfoList < 3) { |
+ checkUnnamed540(o.items); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ } |
+ buildCounterBillingInfoList--; |
+} |
+ |
+buildUnnamed541() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed541(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed542() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed542(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+buildUnnamed543() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed543(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed544() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed544(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterCreativeCorrections = 0; |
+buildCreativeCorrections() { |
+ var o = new api.CreativeCorrections(); |
+ buildCounterCreativeCorrections++; |
+ if (buildCounterCreativeCorrections < 3) { |
+ o.details = buildUnnamed544(); |
+ o.reason = "foo"; |
+ } |
+ buildCounterCreativeCorrections--; |
+ return o; |
+} |
+ |
+checkCreativeCorrections(api.CreativeCorrections o) { |
+ buildCounterCreativeCorrections++; |
+ if (buildCounterCreativeCorrections < 3) { |
+ checkUnnamed544(o.details); |
+ unittest.expect(o.reason, unittest.equals('foo')); |
+ } |
+ buildCounterCreativeCorrections--; |
+} |
+ |
+buildUnnamed545() { |
+ var o = new core.List<api.CreativeCorrections>(); |
+ o.add(buildCreativeCorrections()); |
+ o.add(buildCreativeCorrections()); |
+ return o; |
+} |
+ |
+checkUnnamed545(core.List<api.CreativeCorrections> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkCreativeCorrections(o[0]); |
+ checkCreativeCorrections(o[1]); |
+} |
+ |
+buildUnnamed546() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed546(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterCreativeDisapprovalReasons = 0; |
+buildCreativeDisapprovalReasons() { |
+ var o = new api.CreativeDisapprovalReasons(); |
+ buildCounterCreativeDisapprovalReasons++; |
+ if (buildCounterCreativeDisapprovalReasons < 3) { |
+ o.details = buildUnnamed546(); |
+ o.reason = "foo"; |
+ } |
+ buildCounterCreativeDisapprovalReasons--; |
+ return o; |
+} |
+ |
+checkCreativeDisapprovalReasons(api.CreativeDisapprovalReasons o) { |
+ buildCounterCreativeDisapprovalReasons++; |
+ if (buildCounterCreativeDisapprovalReasons < 3) { |
+ checkUnnamed546(o.details); |
+ unittest.expect(o.reason, unittest.equals('foo')); |
+ } |
+ buildCounterCreativeDisapprovalReasons--; |
+} |
+ |
+buildUnnamed547() { |
+ var o = new core.List<api.CreativeDisapprovalReasons>(); |
+ o.add(buildCreativeDisapprovalReasons()); |
+ o.add(buildCreativeDisapprovalReasons()); |
+ return o; |
+} |
+ |
+checkUnnamed547(core.List<api.CreativeDisapprovalReasons> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkCreativeDisapprovalReasons(o[0]); |
+ checkCreativeDisapprovalReasons(o[1]); |
+} |
+ |
+core.int buildCounterCreativeFilteringReasonsReasons = 0; |
+buildCreativeFilteringReasonsReasons() { |
+ var o = new api.CreativeFilteringReasonsReasons(); |
+ buildCounterCreativeFilteringReasonsReasons++; |
+ if (buildCounterCreativeFilteringReasonsReasons < 3) { |
+ o.filteringCount = "foo"; |
+ o.filteringStatus = 42; |
+ } |
+ buildCounterCreativeFilteringReasonsReasons--; |
+ return o; |
+} |
+ |
+checkCreativeFilteringReasonsReasons(api.CreativeFilteringReasonsReasons o) { |
+ buildCounterCreativeFilteringReasonsReasons++; |
+ if (buildCounterCreativeFilteringReasonsReasons < 3) { |
+ unittest.expect(o.filteringCount, unittest.equals('foo')); |
+ unittest.expect(o.filteringStatus, unittest.equals(42)); |
+ } |
+ buildCounterCreativeFilteringReasonsReasons--; |
+} |
+ |
+buildUnnamed548() { |
+ var o = new core.List<api.CreativeFilteringReasonsReasons>(); |
+ o.add(buildCreativeFilteringReasonsReasons()); |
+ o.add(buildCreativeFilteringReasonsReasons()); |
+ return o; |
+} |
+ |
+checkUnnamed548(core.List<api.CreativeFilteringReasonsReasons> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkCreativeFilteringReasonsReasons(o[0]); |
+ checkCreativeFilteringReasonsReasons(o[1]); |
+} |
+ |
+core.int buildCounterCreativeFilteringReasons = 0; |
+buildCreativeFilteringReasons() { |
+ var o = new api.CreativeFilteringReasons(); |
+ buildCounterCreativeFilteringReasons++; |
+ if (buildCounterCreativeFilteringReasons < 3) { |
+ o.date = "foo"; |
+ o.reasons = buildUnnamed548(); |
+ } |
+ buildCounterCreativeFilteringReasons--; |
+ return o; |
+} |
+ |
+checkCreativeFilteringReasons(api.CreativeFilteringReasons o) { |
+ buildCounterCreativeFilteringReasons++; |
+ if (buildCounterCreativeFilteringReasons < 3) { |
+ unittest.expect(o.date, unittest.equals('foo')); |
+ checkUnnamed548(o.reasons); |
+ } |
+ buildCounterCreativeFilteringReasons--; |
+} |
+ |
+buildUnnamed549() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed549(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+buildUnnamed550() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed550(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+buildUnnamed551() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed551(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+buildUnnamed552() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed552(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+core.int buildCounterCreative = 0; |
+buildCreative() { |
+ var o = new api.Creative(); |
+ buildCounterCreative++; |
+ if (buildCounterCreative < 3) { |
+ o.HTMLSnippet = "foo"; |
+ o.accountId = 42; |
+ o.advertiserId = buildUnnamed541(); |
+ o.advertiserName = "foo"; |
+ o.agencyId = "foo"; |
+ o.attribute = buildUnnamed542(); |
+ o.buyerCreativeId = "foo"; |
+ o.clickThroughUrl = buildUnnamed543(); |
+ o.corrections = buildUnnamed545(); |
+ o.disapprovalReasons = buildUnnamed547(); |
+ o.filteringReasons = buildCreativeFilteringReasons(); |
+ o.height = 42; |
+ o.kind = "foo"; |
+ o.productCategories = buildUnnamed549(); |
+ o.restrictedCategories = buildUnnamed550(); |
+ o.sensitiveCategories = buildUnnamed551(); |
+ o.status = "foo"; |
+ o.vendorType = buildUnnamed552(); |
+ o.videoURL = "foo"; |
+ o.width = 42; |
+ } |
+ buildCounterCreative--; |
+ return o; |
+} |
+ |
+checkCreative(api.Creative o) { |
+ buildCounterCreative++; |
+ if (buildCounterCreative < 3) { |
+ unittest.expect(o.HTMLSnippet, unittest.equals('foo')); |
+ unittest.expect(o.accountId, unittest.equals(42)); |
+ checkUnnamed541(o.advertiserId); |
+ unittest.expect(o.advertiserName, unittest.equals('foo')); |
+ unittest.expect(o.agencyId, unittest.equals('foo')); |
+ checkUnnamed542(o.attribute); |
+ unittest.expect(o.buyerCreativeId, unittest.equals('foo')); |
+ checkUnnamed543(o.clickThroughUrl); |
+ checkUnnamed545(o.corrections); |
+ checkUnnamed547(o.disapprovalReasons); |
+ checkCreativeFilteringReasons(o.filteringReasons); |
+ unittest.expect(o.height, unittest.equals(42)); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ checkUnnamed549(o.productCategories); |
+ checkUnnamed550(o.restrictedCategories); |
+ checkUnnamed551(o.sensitiveCategories); |
+ unittest.expect(o.status, unittest.equals('foo')); |
+ checkUnnamed552(o.vendorType); |
+ unittest.expect(o.videoURL, unittest.equals('foo')); |
+ unittest.expect(o.width, unittest.equals(42)); |
+ } |
+ buildCounterCreative--; |
+} |
+ |
+buildUnnamed553() { |
+ var o = new core.List<api.Creative>(); |
+ o.add(buildCreative()); |
+ o.add(buildCreative()); |
+ return o; |
+} |
+ |
+checkUnnamed553(core.List<api.Creative> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkCreative(o[0]); |
+ checkCreative(o[1]); |
+} |
+ |
+core.int buildCounterCreativesList = 0; |
+buildCreativesList() { |
+ var o = new api.CreativesList(); |
+ buildCounterCreativesList++; |
+ if (buildCounterCreativesList < 3) { |
+ o.items = buildUnnamed553(); |
+ o.kind = "foo"; |
+ o.nextPageToken = "foo"; |
+ } |
+ buildCounterCreativesList--; |
+ return o; |
+} |
+ |
+checkCreativesList(api.CreativesList o) { |
+ buildCounterCreativesList++; |
+ if (buildCounterCreativesList < 3) { |
+ checkUnnamed553(o.items); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ unittest.expect(o.nextPageToken, unittest.equals('foo')); |
+ } |
+ buildCounterCreativesList--; |
+} |
+ |
+core.int buildCounterDirectDeal = 0; |
+buildDirectDeal() { |
+ var o = new api.DirectDeal(); |
+ buildCounterDirectDeal++; |
+ if (buildCounterDirectDeal < 3) { |
+ o.accountId = 42; |
+ o.advertiser = "foo"; |
+ o.currencyCode = "foo"; |
+ o.endTime = "foo"; |
+ o.fixedCpm = "foo"; |
+ o.id = "foo"; |
+ o.kind = "foo"; |
+ o.name = "foo"; |
+ o.privateExchangeMinCpm = "foo"; |
+ o.publisherBlocksOverriden = true; |
+ o.sellerNetwork = "foo"; |
+ o.startTime = "foo"; |
+ } |
+ buildCounterDirectDeal--; |
+ return o; |
+} |
+ |
+checkDirectDeal(api.DirectDeal o) { |
+ buildCounterDirectDeal++; |
+ if (buildCounterDirectDeal < 3) { |
+ unittest.expect(o.accountId, unittest.equals(42)); |
+ unittest.expect(o.advertiser, unittest.equals('foo')); |
+ unittest.expect(o.currencyCode, unittest.equals('foo')); |
+ unittest.expect(o.endTime, unittest.equals('foo')); |
+ unittest.expect(o.fixedCpm, unittest.equals('foo')); |
+ unittest.expect(o.id, unittest.equals('foo')); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ unittest.expect(o.name, unittest.equals('foo')); |
+ unittest.expect(o.privateExchangeMinCpm, unittest.equals('foo')); |
+ unittest.expect(o.publisherBlocksOverriden, unittest.isTrue); |
+ unittest.expect(o.sellerNetwork, unittest.equals('foo')); |
+ unittest.expect(o.startTime, unittest.equals('foo')); |
+ } |
+ buildCounterDirectDeal--; |
+} |
+ |
+buildUnnamed554() { |
+ var o = new core.List<api.DirectDeal>(); |
+ o.add(buildDirectDeal()); |
+ o.add(buildDirectDeal()); |
+ return o; |
+} |
+ |
+checkUnnamed554(core.List<api.DirectDeal> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkDirectDeal(o[0]); |
+ checkDirectDeal(o[1]); |
+} |
+ |
+core.int buildCounterDirectDealsList = 0; |
+buildDirectDealsList() { |
+ var o = new api.DirectDealsList(); |
+ buildCounterDirectDealsList++; |
+ if (buildCounterDirectDealsList < 3) { |
+ o.directDeals = buildUnnamed554(); |
+ o.kind = "foo"; |
+ } |
+ buildCounterDirectDealsList--; |
+ return o; |
+} |
+ |
+checkDirectDealsList(api.DirectDealsList o) { |
+ buildCounterDirectDealsList++; |
+ if (buildCounterDirectDealsList < 3) { |
+ checkUnnamed554(o.directDeals); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ } |
+ buildCounterDirectDealsList--; |
+} |
+ |
+buildUnnamed555() { |
+ var o = new core.List<core.Object>(); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ return o; |
+} |
+ |
+checkUnnamed555(core.List<core.Object> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], unittest.equals('foo')); |
+ var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed556() { |
+ var o = new core.List<core.Object>(); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ return o; |
+} |
+ |
+checkUnnamed556(core.List<core.Object> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ var casted3 = (o[0]) as core.Map; unittest.expect(casted3, unittest.hasLength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], unittest.equals('foo')); |
+ var casted4 = (o[1]) as core.Map; unittest.expect(casted4, unittest.hasLength(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed557() { |
+ var o = new core.List<core.Object>(); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ return o; |
+} |
+ |
+checkUnnamed557(core.List<core.Object> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ var casted5 = (o[0]) as core.Map; unittest.expect(casted5, unittest.hasLength(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], unittest.equals('foo')); |
+ var casted6 = (o[1]) as core.Map; unittest.expect(casted6, unittest.hasLength(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed558() { |
+ var o = new core.List<core.Object>(); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); |
+ return o; |
+} |
+ |
+checkUnnamed558(core.List<core.Object> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ var casted7 = (o[0]) as core.Map; unittest.expect(casted7, unittest.hasLength(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.expect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"], unittest.equals('foo')); |
+ var casted8 = (o[1]) as core.Map; unittest.expect(casted8, unittest.hasLength(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.expect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterPerformanceReport = 0; |
+buildPerformanceReport() { |
+ var o = new api.PerformanceReport(); |
+ buildCounterPerformanceReport++; |
+ if (buildCounterPerformanceReport < 3) { |
+ o.calloutStatusRate = buildUnnamed555(); |
+ o.cookieMatcherStatusRate = buildUnnamed556(); |
+ o.creativeStatusRate = buildUnnamed557(); |
+ o.hostedMatchStatusRate = buildUnnamed558(); |
+ o.kind = "foo"; |
+ o.latency50thPercentile = 42.0; |
+ o.latency85thPercentile = 42.0; |
+ o.latency95thPercentile = 42.0; |
+ o.noQuotaInRegion = 42.0; |
+ o.outOfQuota = 42.0; |
+ o.pixelMatchRequests = 42.0; |
+ o.pixelMatchResponses = 42.0; |
+ o.quotaConfiguredLimit = 42.0; |
+ o.quotaThrottledLimit = 42.0; |
+ o.region = "foo"; |
+ o.timestamp = "foo"; |
+ } |
+ buildCounterPerformanceReport--; |
+ return o; |
+} |
+ |
+checkPerformanceReport(api.PerformanceReport o) { |
+ buildCounterPerformanceReport++; |
+ if (buildCounterPerformanceReport < 3) { |
+ checkUnnamed555(o.calloutStatusRate); |
+ checkUnnamed556(o.cookieMatcherStatusRate); |
+ checkUnnamed557(o.creativeStatusRate); |
+ checkUnnamed558(o.hostedMatchStatusRate); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ unittest.expect(o.latency50thPercentile, unittest.equals(42.0)); |
+ unittest.expect(o.latency85thPercentile, unittest.equals(42.0)); |
+ unittest.expect(o.latency95thPercentile, unittest.equals(42.0)); |
+ unittest.expect(o.noQuotaInRegion, unittest.equals(42.0)); |
+ unittest.expect(o.outOfQuota, unittest.equals(42.0)); |
+ unittest.expect(o.pixelMatchRequests, unittest.equals(42.0)); |
+ unittest.expect(o.pixelMatchResponses, unittest.equals(42.0)); |
+ unittest.expect(o.quotaConfiguredLimit, unittest.equals(42.0)); |
+ unittest.expect(o.quotaThrottledLimit, unittest.equals(42.0)); |
+ unittest.expect(o.region, unittest.equals('foo')); |
+ unittest.expect(o.timestamp, unittest.equals('foo')); |
+ } |
+ buildCounterPerformanceReport--; |
+} |
+ |
+buildUnnamed559() { |
+ var o = new core.List<api.PerformanceReport>(); |
+ o.add(buildPerformanceReport()); |
+ o.add(buildPerformanceReport()); |
+ return o; |
+} |
+ |
+checkUnnamed559(core.List<api.PerformanceReport> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkPerformanceReport(o[0]); |
+ checkPerformanceReport(o[1]); |
+} |
+ |
+core.int buildCounterPerformanceReportList = 0; |
+buildPerformanceReportList() { |
+ var o = new api.PerformanceReportList(); |
+ buildCounterPerformanceReportList++; |
+ if (buildCounterPerformanceReportList < 3) { |
+ o.kind = "foo"; |
+ o.performanceReport = buildUnnamed559(); |
+ } |
+ buildCounterPerformanceReportList--; |
+ return o; |
+} |
+ |
+checkPerformanceReportList(api.PerformanceReportList o) { |
+ buildCounterPerformanceReportList++; |
+ if (buildCounterPerformanceReportList < 3) { |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ checkUnnamed559(o.performanceReport); |
+ } |
+ buildCounterPerformanceReportList--; |
+} |
+ |
+buildUnnamed560() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed560(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterPretargetingConfigDimensions = 0; |
+buildPretargetingConfigDimensions() { |
+ var o = new api.PretargetingConfigDimensions(); |
+ buildCounterPretargetingConfigDimensions++; |
+ if (buildCounterPretargetingConfigDimensions < 3) { |
+ o.height = "foo"; |
+ o.width = "foo"; |
+ } |
+ buildCounterPretargetingConfigDimensions--; |
+ return o; |
+} |
+ |
+checkPretargetingConfigDimensions(api.PretargetingConfigDimensions o) { |
+ buildCounterPretargetingConfigDimensions++; |
+ if (buildCounterPretargetingConfigDimensions < 3) { |
+ unittest.expect(o.height, unittest.equals('foo')); |
+ unittest.expect(o.width, unittest.equals('foo')); |
+ } |
+ buildCounterPretargetingConfigDimensions--; |
+} |
+ |
+buildUnnamed561() { |
+ var o = new core.List<api.PretargetingConfigDimensions>(); |
+ o.add(buildPretargetingConfigDimensions()); |
+ o.add(buildPretargetingConfigDimensions()); |
+ return o; |
+} |
+ |
+checkUnnamed561(core.List<api.PretargetingConfigDimensions> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkPretargetingConfigDimensions(o[0]); |
+ checkPretargetingConfigDimensions(o[1]); |
+} |
+ |
+buildUnnamed562() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed562(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed563() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed563(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterPretargetingConfigExcludedPlacements = 0; |
+buildPretargetingConfigExcludedPlacements() { |
+ var o = new api.PretargetingConfigExcludedPlacements(); |
+ buildCounterPretargetingConfigExcludedPlacements++; |
+ if (buildCounterPretargetingConfigExcludedPlacements < 3) { |
+ o.token = "foo"; |
+ o.type = "foo"; |
+ } |
+ buildCounterPretargetingConfigExcludedPlacements--; |
+ return o; |
+} |
+ |
+checkPretargetingConfigExcludedPlacements(api.PretargetingConfigExcludedPlacements o) { |
+ buildCounterPretargetingConfigExcludedPlacements++; |
+ if (buildCounterPretargetingConfigExcludedPlacements < 3) { |
+ unittest.expect(o.token, unittest.equals('foo')); |
+ unittest.expect(o.type, unittest.equals('foo')); |
+ } |
+ buildCounterPretargetingConfigExcludedPlacements--; |
+} |
+ |
+buildUnnamed564() { |
+ var o = new core.List<api.PretargetingConfigExcludedPlacements>(); |
+ o.add(buildPretargetingConfigExcludedPlacements()); |
+ o.add(buildPretargetingConfigExcludedPlacements()); |
+ return o; |
+} |
+ |
+checkUnnamed564(core.List<api.PretargetingConfigExcludedPlacements> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkPretargetingConfigExcludedPlacements(o[0]); |
+ checkPretargetingConfigExcludedPlacements(o[1]); |
+} |
+ |
+buildUnnamed565() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed565(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed566() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed566(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed567() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed567(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed568() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed568(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed569() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed569(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed570() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed570(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed571() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed571(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterPretargetingConfigPlacements = 0; |
+buildPretargetingConfigPlacements() { |
+ var o = new api.PretargetingConfigPlacements(); |
+ buildCounterPretargetingConfigPlacements++; |
+ if (buildCounterPretargetingConfigPlacements < 3) { |
+ o.token = "foo"; |
+ o.type = "foo"; |
+ } |
+ buildCounterPretargetingConfigPlacements--; |
+ return o; |
+} |
+ |
+checkPretargetingConfigPlacements(api.PretargetingConfigPlacements o) { |
+ buildCounterPretargetingConfigPlacements++; |
+ if (buildCounterPretargetingConfigPlacements < 3) { |
+ unittest.expect(o.token, unittest.equals('foo')); |
+ unittest.expect(o.type, unittest.equals('foo')); |
+ } |
+ buildCounterPretargetingConfigPlacements--; |
+} |
+ |
+buildUnnamed572() { |
+ var o = new core.List<api.PretargetingConfigPlacements>(); |
+ o.add(buildPretargetingConfigPlacements()); |
+ o.add(buildPretargetingConfigPlacements()); |
+ return o; |
+} |
+ |
+checkUnnamed572(core.List<api.PretargetingConfigPlacements> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkPretargetingConfigPlacements(o[0]); |
+ checkPretargetingConfigPlacements(o[1]); |
+} |
+ |
+buildUnnamed573() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed573(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed574() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed574(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed575() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed575(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed576() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed576(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+buildUnnamed577() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed577(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+core.int buildCounterPretargetingConfig = 0; |
+buildPretargetingConfig() { |
+ var o = new api.PretargetingConfig(); |
+ buildCounterPretargetingConfig++; |
+ if (buildCounterPretargetingConfig < 3) { |
+ o.billingId = "foo"; |
+ o.configId = "foo"; |
+ o.configName = "foo"; |
+ o.creativeType = buildUnnamed560(); |
+ o.dimensions = buildUnnamed561(); |
+ o.excludedContentLabels = buildUnnamed562(); |
+ o.excludedGeoCriteriaIds = buildUnnamed563(); |
+ o.excludedPlacements = buildUnnamed564(); |
+ o.excludedUserLists = buildUnnamed565(); |
+ o.excludedVerticals = buildUnnamed566(); |
+ o.geoCriteriaIds = buildUnnamed567(); |
+ o.isActive = true; |
+ o.kind = "foo"; |
+ o.languages = buildUnnamed568(); |
+ o.mobileCarriers = buildUnnamed569(); |
+ o.mobileDevices = buildUnnamed570(); |
+ o.mobileOperatingSystemVersions = buildUnnamed571(); |
+ o.placements = buildUnnamed572(); |
+ o.platforms = buildUnnamed573(); |
+ o.supportedCreativeAttributes = buildUnnamed574(); |
+ o.userLists = buildUnnamed575(); |
+ o.vendorTypes = buildUnnamed576(); |
+ o.verticals = buildUnnamed577(); |
+ } |
+ buildCounterPretargetingConfig--; |
+ return o; |
+} |
+ |
+checkPretargetingConfig(api.PretargetingConfig o) { |
+ buildCounterPretargetingConfig++; |
+ if (buildCounterPretargetingConfig < 3) { |
+ unittest.expect(o.billingId, unittest.equals('foo')); |
+ unittest.expect(o.configId, unittest.equals('foo')); |
+ unittest.expect(o.configName, unittest.equals('foo')); |
+ checkUnnamed560(o.creativeType); |
+ checkUnnamed561(o.dimensions); |
+ checkUnnamed562(o.excludedContentLabels); |
+ checkUnnamed563(o.excludedGeoCriteriaIds); |
+ checkUnnamed564(o.excludedPlacements); |
+ checkUnnamed565(o.excludedUserLists); |
+ checkUnnamed566(o.excludedVerticals); |
+ checkUnnamed567(o.geoCriteriaIds); |
+ unittest.expect(o.isActive, unittest.isTrue); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ checkUnnamed568(o.languages); |
+ checkUnnamed569(o.mobileCarriers); |
+ checkUnnamed570(o.mobileDevices); |
+ checkUnnamed571(o.mobileOperatingSystemVersions); |
+ checkUnnamed572(o.placements); |
+ checkUnnamed573(o.platforms); |
+ checkUnnamed574(o.supportedCreativeAttributes); |
+ checkUnnamed575(o.userLists); |
+ checkUnnamed576(o.vendorTypes); |
+ checkUnnamed577(o.verticals); |
+ } |
+ buildCounterPretargetingConfig--; |
+} |
+ |
+buildUnnamed578() { |
+ var o = new core.List<api.PretargetingConfig>(); |
+ o.add(buildPretargetingConfig()); |
+ o.add(buildPretargetingConfig()); |
+ return o; |
+} |
+ |
+checkUnnamed578(core.List<api.PretargetingConfig> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ checkPretargetingConfig(o[0]); |
+ checkPretargetingConfig(o[1]); |
+} |
+ |
+core.int buildCounterPretargetingConfigList = 0; |
+buildPretargetingConfigList() { |
+ var o = new api.PretargetingConfigList(); |
+ buildCounterPretargetingConfigList++; |
+ if (buildCounterPretargetingConfigList < 3) { |
+ o.items = buildUnnamed578(); |
+ o.kind = "foo"; |
+ } |
+ buildCounterPretargetingConfigList--; |
+ return o; |
+} |
+ |
+checkPretargetingConfigList(api.PretargetingConfigList o) { |
+ buildCounterPretargetingConfigList++; |
+ if (buildCounterPretargetingConfigList < 3) { |
+ checkUnnamed578(o.items); |
+ unittest.expect(o.kind, unittest.equals('foo')); |
+ } |
+ buildCounterPretargetingConfigList--; |
+} |
+ |
+buildUnnamed579() { |
+ var o = new core.List<core.int>(); |
+ o.add(42); |
+ o.add(42); |
+ return o; |
+} |
+ |
+checkUnnamed579(core.List<core.int> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals(42)); |
+ unittest.expect(o[1], unittest.equals(42)); |
+} |
+ |
+buildUnnamed580() { |
+ var o = new core.List<core.String>(); |
+ o.add("foo"); |
+ o.add("foo"); |
+ return o; |
+} |
+ |
+checkUnnamed580(core.List<core.String> o) { |
+ unittest.expect(o, unittest.hasLength(2)); |
+ unittest.expect(o[0], unittest.equals('foo')); |
+ unittest.expect(o[1], unittest.equals('foo')); |
+} |
+ |
+ |
+main() { |
+ unittest.group("obj-schema-AccountBidderLocation", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildAccountBidderLocation(); |
+ var od = new api.AccountBidderLocation.fromJson(o.toJson()); |
+ checkAccountBidderLocation(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-Account", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildAccount(); |
+ var od = new api.Account.fromJson(o.toJson()); |
+ checkAccount(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-AccountsList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildAccountsList(); |
+ var od = new api.AccountsList.fromJson(o.toJson()); |
+ checkAccountsList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-BillingInfo", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildBillingInfo(); |
+ var od = new api.BillingInfo.fromJson(o.toJson()); |
+ checkBillingInfo(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-BillingInfoList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildBillingInfoList(); |
+ var od = new api.BillingInfoList.fromJson(o.toJson()); |
+ checkBillingInfoList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-CreativeCorrections", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreativeCorrections(); |
+ var od = new api.CreativeCorrections.fromJson(o.toJson()); |
+ checkCreativeCorrections(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-CreativeDisapprovalReasons", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreativeDisapprovalReasons(); |
+ var od = new api.CreativeDisapprovalReasons.fromJson(o.toJson()); |
+ checkCreativeDisapprovalReasons(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-CreativeFilteringReasonsReasons", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreativeFilteringReasonsReasons(); |
+ var od = new api.CreativeFilteringReasonsReasons.fromJson(o.toJson()); |
+ checkCreativeFilteringReasonsReasons(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-CreativeFilteringReasons", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreativeFilteringReasons(); |
+ var od = new api.CreativeFilteringReasons.fromJson(o.toJson()); |
+ checkCreativeFilteringReasons(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-Creative", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreative(); |
+ var od = new api.Creative.fromJson(o.toJson()); |
+ checkCreative(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-CreativesList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildCreativesList(); |
+ var od = new api.CreativesList.fromJson(o.toJson()); |
+ checkCreativesList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-DirectDeal", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildDirectDeal(); |
+ var od = new api.DirectDeal.fromJson(o.toJson()); |
+ checkDirectDeal(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-DirectDealsList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildDirectDealsList(); |
+ var od = new api.DirectDealsList.fromJson(o.toJson()); |
+ checkDirectDealsList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PerformanceReport", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPerformanceReport(); |
+ var od = new api.PerformanceReport.fromJson(o.toJson()); |
+ checkPerformanceReport(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PerformanceReportList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPerformanceReportList(); |
+ var od = new api.PerformanceReportList.fromJson(o.toJson()); |
+ checkPerformanceReportList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PretargetingConfigDimensions", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPretargetingConfigDimensions(); |
+ var od = new api.PretargetingConfigDimensions.fromJson(o.toJson()); |
+ checkPretargetingConfigDimensions(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PretargetingConfigExcludedPlacements", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPretargetingConfigExcludedPlacements(); |
+ var od = new api.PretargetingConfigExcludedPlacements.fromJson(o.toJson()); |
+ checkPretargetingConfigExcludedPlacements(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PretargetingConfigPlacements", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPretargetingConfigPlacements(); |
+ var od = new api.PretargetingConfigPlacements.fromJson(o.toJson()); |
+ checkPretargetingConfigPlacements(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PretargetingConfig", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPretargetingConfig(); |
+ var od = new api.PretargetingConfig.fromJson(o.toJson()); |
+ checkPretargetingConfig(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("obj-schema-PretargetingConfigList", () { |
+ unittest.test("to-json--from-json", () { |
+ var o = buildPretargetingConfigList(); |
+ var od = new api.PretargetingConfigList.fromJson(o.toJson()); |
+ checkPretargetingConfigList(od); |
+ }); |
+ }); |
+ |
+ |
+ unittest.group("resource-AccountsResourceApi", () { |
+ unittest.test("method--get", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
+ var arg_id = 42; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
+ pathOffset += 9; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_id")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildAccount()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.get(arg_id).then(unittest.expectAsync(((api.Account response) { |
+ checkAccount(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equals("accounts")); |
+ pathOffset += 8; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildAccountsList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list().then(unittest.expectAsync(((api.AccountsList response) { |
+ checkAccountsList(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--patch", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
+ var arg_request = buildAccount(); |
+ var arg_id = 42; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.Account.fromJson(json); |
+ checkAccount(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
+ pathOffset += 9; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_id")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildAccount()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.patch(arg_request, arg_id).then(unittest.expectAsync(((api.Account response) { |
+ checkAccount(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--update", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.AccountsResourceApi res = new api.AdexchangebuyerApi(mock).accounts; |
+ var arg_request = buildAccount(); |
+ var arg_id = 42; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.Account.fromJson(json); |
+ checkAccount(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("accounts/")); |
+ pathOffset += 9; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_id")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildAccount()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.update(arg_request, arg_id).then(unittest.expectAsync(((api.Account response) { |
+ checkAccount(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+ unittest.group("resource-BillingInfoResourceApi", () { |
+ unittest.test("method--get", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingInfo; |
+ var arg_accountId = 42; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("billinginfo/")); |
+ pathOffset += 12; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildBillingInfo()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.get(arg_accountId).then(unittest.expectAsync(((api.BillingInfo response) { |
+ checkBillingInfo(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.BillingInfoResourceApi res = new api.AdexchangebuyerApi(mock).billingInfo; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("billinginfo")); |
+ pathOffset += 11; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildBillingInfoList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list().then(unittest.expectAsync(((api.BillingInfoList response) { |
+ checkBillingInfoList(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+ unittest.group("resource-CreativesResourceApi", () { |
+ unittest.test("method--get", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
+ var arg_accountId = 42; |
+ var arg_buyerCreativeId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.equals("creatives/")); |
+ pathOffset += 10; |
+ index = path.indexOf("/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_buyerCreativeId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildCreative()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.get(arg_accountId, arg_buyerCreativeId).then(unittest.expectAsync(((api.Creative response) { |
+ checkCreative(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--insert", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
+ var arg_request = buildCreative(); |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.Creative.fromJson(json); |
+ checkCreative(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("creatives")); |
+ pathOffset += 9; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildCreative()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.insert(arg_request).then(unittest.expectAsync(((api.Creative response) { |
+ checkCreative(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.CreativesResourceApi res = new api.AdexchangebuyerApi(mock).creatives; |
+ var arg_accountId = buildUnnamed579(); |
+ var arg_buyerCreativeId = buildUnnamed580(); |
+ var arg_maxResults = 42; |
+ var arg_pageToken = "foo"; |
+ var arg_statusFilter = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equals("creatives")); |
+ pathOffset += 9; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ unittest.expect(queryMap["accountId"].map(core.int.parse).toList(), unittest.equals(arg_accountId)); |
+ unittest.expect(queryMap["buyerCreativeId"], unittest.equals(arg_buyerCreativeId)); |
+ unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
+ unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
+ unittest.expect(queryMap["statusFilter"].first, unittest.equals(arg_statusFilter)); |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildCreativesList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list(accountId: arg_accountId, buyerCreativeId: arg_buyerCreativeId, maxResults: arg_maxResults, pageToken: arg_pageToken, statusFilter: arg_statusFilter).then(unittest.expectAsync(((api.CreativesList response) { |
+ checkCreativesList(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+ unittest.group("resource-DirectDealsResourceApi", () { |
+ unittest.test("method--get", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDeals; |
+ var arg_id = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.equals("directdeals/")); |
+ pathOffset += 12; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_id")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildDirectDeal()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.get(arg_id).then(unittest.expectAsync(((api.DirectDeal response) { |
+ checkDirectDeal(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.DirectDealsResourceApi res = new api.AdexchangebuyerApi(mock).directDeals; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.equals("directdeals")); |
+ pathOffset += 11; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildDirectDealsList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list().then(unittest.expectAsync(((api.DirectDealsList response) { |
+ checkDirectDealsList(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+ unittest.group("resource-PerformanceReportResourceApi", () { |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PerformanceReportResourceApi res = new api.AdexchangebuyerApi(mock).performanceReport; |
+ var arg_accountId = "foo"; |
+ var arg_endDateTime = "foo"; |
+ var arg_startDateTime = "foo"; |
+ var arg_maxResults = 42; |
+ var arg_pageToken = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.equals("performancereport")); |
+ pathOffset += 17; |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ unittest.expect(queryMap["accountId"].first, unittest.equals(arg_accountId)); |
+ unittest.expect(queryMap["endDateTime"].first, unittest.equals(arg_endDateTime)); |
+ unittest.expect(queryMap["startDateTime"].first, unittest.equals(arg_startDateTime)); |
+ unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.equals(arg_maxResults)); |
+ unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPerformanceReportList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list(arg_accountId, arg_endDateTime, arg_startDateTime, maxResults: arg_maxResults, pageToken: arg_pageToken).then(unittest.expectAsync(((api.PerformanceReportList response) { |
+ checkPerformanceReportList(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+ unittest.group("resource-PretargetingConfigResourceApi", () { |
+ unittest.test("method--delete", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_accountId = "foo"; |
+ var arg_configId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ index = path.indexOf("/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_configId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = ""; |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.delete(arg_accountId, arg_configId).then(unittest.expectAsync((_) {})); |
+ }); |
+ |
+ unittest.test("method--get", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_accountId = "foo"; |
+ var arg_configId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ index = path.indexOf("/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_configId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPretargetingConfig()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.get(arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
+ checkPretargetingConfig(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--insert", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_request = buildPretargetingConfig(); |
+ var arg_accountId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.PretargetingConfig.fromJson(json); |
+ checkPretargetingConfig(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPretargetingConfig()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
+ checkPretargetingConfig(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--list", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_accountId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPretargetingConfigList()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.list(arg_accountId).then(unittest.expectAsync(((api.PretargetingConfigList response) { |
+ checkPretargetingConfigList(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--patch", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_request = buildPretargetingConfig(); |
+ var arg_accountId = "foo"; |
+ var arg_configId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.PretargetingConfig.fromJson(json); |
+ checkPretargetingConfig(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ index = path.indexOf("/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_configId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPretargetingConfig()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.patch(arg_request, arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
+ checkPretargetingConfig(response); |
+ }))); |
+ }); |
+ |
+ unittest.test("method--update", () { |
+ |
+ var mock = new common_test.HttpServerMock(); |
+ api.PretargetingConfigResourceApi res = new api.AdexchangebuyerApi(mock).pretargetingConfig; |
+ var arg_request = buildPretargetingConfig(); |
+ var arg_accountId = "foo"; |
+ var arg_configId = "foo"; |
+ mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
+ var obj = new api.PretargetingConfig.fromJson(json); |
+ checkPretargetingConfig(obj); |
+ |
+ var path = (req.url).path; |
+ var pathOffset = 0; |
+ var index; |
+ var subPart; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.equals("/adexchangebuyer/v1.3/")); |
+ pathOffset += 22; |
+ unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.equals("pretargetingconfigs/")); |
+ pathOffset += 20; |
+ index = path.indexOf("/", pathOffset); |
+ unittest.expect(index >= 0, unittest.isTrue); |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
+ pathOffset = index; |
+ unittest.expect(subPart, unittest.equals("$arg_accountId")); |
+ unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
+ pathOffset += 1; |
+ subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
+ pathOffset = path.length; |
+ unittest.expect(subPart, unittest.equals("$arg_configId")); |
+ |
+ var query = (req.url).query; |
+ var queryOffset = 0; |
+ var queryMap = {}; |
+ addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
+ parseBool(n) { |
+ if (n == "true") return true; |
+ if (n == "false") return false; |
+ if (n == null) return null; |
+ throw new core.ArgumentError("Invalid boolean: $n"); |
+ } |
+ if (query.length > 0) { |
+ for (var part in query.split("&")) { |
+ var keyvalue = part.split("="); |
+ addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.decodeQueryComponent(keyvalue[1])); |
+ } |
+ } |
+ |
+ |
+ var h = { |
+ "content-type" : "application/json; charset=utf-8", |
+ }; |
+ var resp = convert.JSON.encode(buildPretargetingConfig()); |
+ return new async.Future.value(common_test.stringResponse(200, h, resp)); |
+ }), true); |
+ res.update(arg_request, arg_accountId, arg_configId).then(unittest.expectAsync(((api.PretargetingConfig response) { |
+ checkPretargetingConfig(response); |
+ }))); |
+ }); |
+ |
+ }); |
+ |
+ |
+} |
+ |