OLD | NEW |
1 library googleapis.servicecontrol.v1.test; | 1 library googleapis.servicecontrol.v1.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | |
5 import "dart:async" as async; | 4 import "dart:async" as async; |
6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
7 | 6 |
8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | |
10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
11 | 9 |
12 import 'package:googleapis/servicecontrol/v1.dart' as api; | 10 import 'package:googleapis/servicecontrol/v1.dart' as api; |
13 | 11 |
14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
15 core.Function _callback; | 13 core.Function _callback; |
16 core.bool _expectJson; | 14 core.bool _expectJson; |
17 | 15 |
18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
19 _callback = callback; | 17 _callback = callback; |
20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
21 } | 19 } |
22 | 20 |
23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
24 if (_expectJson) { | 22 if (_expectJson) { |
25 return request.finalize() | 23 return request |
| 24 .finalize() |
26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
27 .join('') | 26 .join('') |
28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
30 return _callback(request, null); | 29 return _callback(request, null); |
31 } else { | 30 } else { |
32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
33 } | 32 } |
34 }); | 33 }); |
35 } else { | 34 } else { |
36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
37 if (stream == null) { | 36 if (stream == null) { |
38 return _callback(request, []); | 37 return _callback(request, []); |
39 } else { | 38 } else { |
40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
41 return _callback(request, data); | 40 return _callback(request, data); |
42 }); | 41 }); |
43 } | 42 } |
44 } | 43 } |
45 } | 44 } |
46 } | 45 } |
47 | 46 |
48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 51 } |
53 | 52 |
54 core.int buildCounterAllocateQuotaRequest = 0; | 53 core.int buildCounterAllocateQuotaRequest = 0; |
55 buildAllocateQuotaRequest() { | 54 buildAllocateQuotaRequest() { |
56 var o = new api.AllocateQuotaRequest(); | 55 var o = new api.AllocateQuotaRequest(); |
57 buildCounterAllocateQuotaRequest++; | 56 buildCounterAllocateQuotaRequest++; |
58 if (buildCounterAllocateQuotaRequest < 3) { | 57 if (buildCounterAllocateQuotaRequest < 3) { |
59 o.allocateOperation = buildQuotaOperation(); | 58 o.allocateOperation = buildQuotaOperation(); |
60 o.allocationMode = "foo"; | 59 o.allocationMode = "foo"; |
61 o.serviceConfigId = "foo"; | 60 o.serviceConfigId = "foo"; |
62 } | 61 } |
63 buildCounterAllocateQuotaRequest--; | 62 buildCounterAllocateQuotaRequest--; |
64 return o; | 63 return o; |
65 } | 64 } |
66 | 65 |
67 checkAllocateQuotaRequest(api.AllocateQuotaRequest o) { | 66 checkAllocateQuotaRequest(api.AllocateQuotaRequest o) { |
68 buildCounterAllocateQuotaRequest++; | 67 buildCounterAllocateQuotaRequest++; |
69 if (buildCounterAllocateQuotaRequest < 3) { | 68 if (buildCounterAllocateQuotaRequest < 3) { |
70 checkQuotaOperation(o.allocateOperation); | 69 checkQuotaOperation(o.allocateOperation); |
71 unittest.expect(o.allocationMode, unittest.equals('foo')); | 70 unittest.expect(o.allocationMode, unittest.equals('foo')); |
72 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 71 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
73 } | 72 } |
74 buildCounterAllocateQuotaRequest--; | 73 buildCounterAllocateQuotaRequest--; |
75 } | 74 } |
76 | 75 |
77 buildUnnamed1694() { | 76 buildUnnamed1690() { |
78 var o = new core.List<api.QuotaError>(); | 77 var o = new core.List<api.QuotaError>(); |
79 o.add(buildQuotaError()); | 78 o.add(buildQuotaError()); |
80 o.add(buildQuotaError()); | 79 o.add(buildQuotaError()); |
81 return o; | 80 return o; |
82 } | 81 } |
83 | 82 |
84 checkUnnamed1694(core.List<api.QuotaError> o) { | 83 checkUnnamed1690(core.List<api.QuotaError> o) { |
85 unittest.expect(o, unittest.hasLength(2)); | 84 unittest.expect(o, unittest.hasLength(2)); |
86 checkQuotaError(o[0]); | 85 checkQuotaError(o[0]); |
87 checkQuotaError(o[1]); | 86 checkQuotaError(o[1]); |
88 } | 87 } |
89 | 88 |
90 buildUnnamed1695() { | 89 buildUnnamed1691() { |
91 var o = new core.List<api.MetricValueSet>(); | 90 var o = new core.List<api.MetricValueSet>(); |
92 o.add(buildMetricValueSet()); | 91 o.add(buildMetricValueSet()); |
93 o.add(buildMetricValueSet()); | 92 o.add(buildMetricValueSet()); |
94 return o; | 93 return o; |
95 } | 94 } |
96 | 95 |
97 checkUnnamed1695(core.List<api.MetricValueSet> o) { | 96 checkUnnamed1691(core.List<api.MetricValueSet> o) { |
98 unittest.expect(o, unittest.hasLength(2)); | 97 unittest.expect(o, unittest.hasLength(2)); |
99 checkMetricValueSet(o[0]); | 98 checkMetricValueSet(o[0]); |
100 checkMetricValueSet(o[1]); | 99 checkMetricValueSet(o[1]); |
101 } | 100 } |
102 | 101 |
103 core.int buildCounterAllocateQuotaResponse = 0; | 102 core.int buildCounterAllocateQuotaResponse = 0; |
104 buildAllocateQuotaResponse() { | 103 buildAllocateQuotaResponse() { |
105 var o = new api.AllocateQuotaResponse(); | 104 var o = new api.AllocateQuotaResponse(); |
106 buildCounterAllocateQuotaResponse++; | 105 buildCounterAllocateQuotaResponse++; |
107 if (buildCounterAllocateQuotaResponse < 3) { | 106 if (buildCounterAllocateQuotaResponse < 3) { |
108 o.allocateErrors = buildUnnamed1694(); | 107 o.allocateErrors = buildUnnamed1690(); |
109 o.operationId = "foo"; | 108 o.operationId = "foo"; |
110 o.quotaMetrics = buildUnnamed1695(); | 109 o.quotaMetrics = buildUnnamed1691(); |
111 o.serviceConfigId = "foo"; | 110 o.serviceConfigId = "foo"; |
112 } | 111 } |
113 buildCounterAllocateQuotaResponse--; | 112 buildCounterAllocateQuotaResponse--; |
114 return o; | 113 return o; |
115 } | 114 } |
116 | 115 |
117 checkAllocateQuotaResponse(api.AllocateQuotaResponse o) { | 116 checkAllocateQuotaResponse(api.AllocateQuotaResponse o) { |
118 buildCounterAllocateQuotaResponse++; | 117 buildCounterAllocateQuotaResponse++; |
119 if (buildCounterAllocateQuotaResponse < 3) { | 118 if (buildCounterAllocateQuotaResponse < 3) { |
120 checkUnnamed1694(o.allocateErrors); | 119 checkUnnamed1690(o.allocateErrors); |
121 unittest.expect(o.operationId, unittest.equals('foo')); | 120 unittest.expect(o.operationId, unittest.equals('foo')); |
122 checkUnnamed1695(o.quotaMetrics); | 121 checkUnnamed1691(o.quotaMetrics); |
123 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 122 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
124 } | 123 } |
125 buildCounterAllocateQuotaResponse--; | 124 buildCounterAllocateQuotaResponse--; |
126 } | 125 } |
127 | 126 |
128 buildUnnamed1696() { | 127 buildUnnamed1692() { |
129 var o = new core.List<api.AuthorizationInfo>(); | 128 var o = new core.List<api.AuthorizationInfo>(); |
130 o.add(buildAuthorizationInfo()); | 129 o.add(buildAuthorizationInfo()); |
131 o.add(buildAuthorizationInfo()); | 130 o.add(buildAuthorizationInfo()); |
132 return o; | 131 return o; |
133 } | 132 } |
134 | 133 |
135 checkUnnamed1696(core.List<api.AuthorizationInfo> o) { | 134 checkUnnamed1692(core.List<api.AuthorizationInfo> o) { |
136 unittest.expect(o, unittest.hasLength(2)); | 135 unittest.expect(o, unittest.hasLength(2)); |
137 checkAuthorizationInfo(o[0]); | 136 checkAuthorizationInfo(o[0]); |
138 checkAuthorizationInfo(o[1]); | 137 checkAuthorizationInfo(o[1]); |
139 } | 138 } |
140 | 139 |
141 buildUnnamed1697() { | 140 buildUnnamed1693() { |
142 var o = new core.Map<core.String, core.Object>(); | 141 var o = new core.Map<core.String, core.Object>(); |
143 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 142 o["x"] = { |
144 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 143 'list': [1, 2, 3], |
| 144 'bool': true, |
| 145 'string': 'foo' |
| 146 }; |
| 147 o["y"] = { |
| 148 'list': [1, 2, 3], |
| 149 'bool': true, |
| 150 'string': 'foo' |
| 151 }; |
145 return o; | 152 return o; |
146 } | 153 } |
147 | 154 |
148 checkUnnamed1697(core.Map<core.String, core.Object> o) { | 155 checkUnnamed1693(core.Map<core.String, core.Object> o) { |
149 unittest.expect(o, unittest.hasLength(2)); | 156 unittest.expect(o, unittest.hasLength(2)); |
150 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 157 var casted1 = (o["x"]) as core.Map; |
151 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 158 unittest.expect(casted1, unittest.hasLength(3)); |
| 159 unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
| 160 unittest.expect(casted1["bool"], unittest.equals(true)); |
| 161 unittest.expect(casted1["string"], unittest.equals('foo')); |
| 162 var casted2 = (o["y"]) as core.Map; |
| 163 unittest.expect(casted2, unittest.hasLength(3)); |
| 164 unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
| 165 unittest.expect(casted2["bool"], unittest.equals(true)); |
| 166 unittest.expect(casted2["string"], unittest.equals('foo')); |
152 } | 167 } |
153 | 168 |
154 buildUnnamed1698() { | 169 buildUnnamed1694() { |
155 var o = new core.Map<core.String, core.Object>(); | 170 var o = new core.Map<core.String, core.Object>(); |
156 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 171 o["x"] = { |
157 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 172 'list': [1, 2, 3], |
| 173 'bool': true, |
| 174 'string': 'foo' |
| 175 }; |
| 176 o["y"] = { |
| 177 'list': [1, 2, 3], |
| 178 'bool': true, |
| 179 'string': 'foo' |
| 180 }; |
158 return o; | 181 return o; |
159 } | 182 } |
160 | 183 |
161 checkUnnamed1698(core.Map<core.String, core.Object> o) { | 184 checkUnnamed1694(core.Map<core.String, core.Object> o) { |
162 unittest.expect(o, unittest.hasLength(2)); | 185 unittest.expect(o, unittest.hasLength(2)); |
163 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 186 var casted3 = (o["x"]) as core.Map; |
164 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 187 unittest.expect(casted3, unittest.hasLength(3)); |
| 188 unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); |
| 189 unittest.expect(casted3["bool"], unittest.equals(true)); |
| 190 unittest.expect(casted3["string"], unittest.equals('foo')); |
| 191 var casted4 = (o["y"]) as core.Map; |
| 192 unittest.expect(casted4, unittest.hasLength(3)); |
| 193 unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); |
| 194 unittest.expect(casted4["bool"], unittest.equals(true)); |
| 195 unittest.expect(casted4["string"], unittest.equals('foo')); |
165 } | 196 } |
166 | 197 |
167 buildUnnamed1699() { | 198 buildUnnamed1695() { |
168 var o = new core.Map<core.String, core.Object>(); | 199 var o = new core.Map<core.String, core.Object>(); |
169 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 200 o["x"] = { |
170 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 201 'list': [1, 2, 3], |
| 202 'bool': true, |
| 203 'string': 'foo' |
| 204 }; |
| 205 o["y"] = { |
| 206 'list': [1, 2, 3], |
| 207 'bool': true, |
| 208 'string': 'foo' |
| 209 }; |
171 return o; | 210 return o; |
172 } | 211 } |
173 | 212 |
174 checkUnnamed1699(core.Map<core.String, core.Object> o) { | 213 checkUnnamed1695(core.Map<core.String, core.Object> o) { |
175 unittest.expect(o, unittest.hasLength(2)); | 214 unittest.expect(o, unittest.hasLength(2)); |
176 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 215 var casted5 = (o["x"]) as core.Map; |
177 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 216 unittest.expect(casted5, unittest.hasLength(3)); |
| 217 unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); |
| 218 unittest.expect(casted5["bool"], unittest.equals(true)); |
| 219 unittest.expect(casted5["string"], unittest.equals('foo')); |
| 220 var casted6 = (o["y"]) as core.Map; |
| 221 unittest.expect(casted6, unittest.hasLength(3)); |
| 222 unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); |
| 223 unittest.expect(casted6["bool"], unittest.equals(true)); |
| 224 unittest.expect(casted6["string"], unittest.equals('foo')); |
178 } | 225 } |
179 | 226 |
180 core.int buildCounterAuditLog = 0; | 227 core.int buildCounterAuditLog = 0; |
181 buildAuditLog() { | 228 buildAuditLog() { |
182 var o = new api.AuditLog(); | 229 var o = new api.AuditLog(); |
183 buildCounterAuditLog++; | 230 buildCounterAuditLog++; |
184 if (buildCounterAuditLog < 3) { | 231 if (buildCounterAuditLog < 3) { |
185 o.authenticationInfo = buildAuthenticationInfo(); | 232 o.authenticationInfo = buildAuthenticationInfo(); |
186 o.authorizationInfo = buildUnnamed1696(); | 233 o.authorizationInfo = buildUnnamed1692(); |
187 o.methodName = "foo"; | 234 o.methodName = "foo"; |
188 o.numResponseItems = "foo"; | 235 o.numResponseItems = "foo"; |
189 o.request = buildUnnamed1697(); | 236 o.request = buildUnnamed1693(); |
190 o.requestMetadata = buildRequestMetadata(); | 237 o.requestMetadata = buildRequestMetadata(); |
191 o.resourceName = "foo"; | 238 o.resourceName = "foo"; |
192 o.response = buildUnnamed1698(); | 239 o.response = buildUnnamed1694(); |
193 o.serviceData = buildUnnamed1699(); | 240 o.serviceData = buildUnnamed1695(); |
194 o.serviceName = "foo"; | 241 o.serviceName = "foo"; |
195 o.status = buildStatus(); | 242 o.status = buildStatus(); |
196 } | 243 } |
197 buildCounterAuditLog--; | 244 buildCounterAuditLog--; |
198 return o; | 245 return o; |
199 } | 246 } |
200 | 247 |
201 checkAuditLog(api.AuditLog o) { | 248 checkAuditLog(api.AuditLog o) { |
202 buildCounterAuditLog++; | 249 buildCounterAuditLog++; |
203 if (buildCounterAuditLog < 3) { | 250 if (buildCounterAuditLog < 3) { |
204 checkAuthenticationInfo(o.authenticationInfo); | 251 checkAuthenticationInfo(o.authenticationInfo); |
205 checkUnnamed1696(o.authorizationInfo); | 252 checkUnnamed1692(o.authorizationInfo); |
206 unittest.expect(o.methodName, unittest.equals('foo')); | 253 unittest.expect(o.methodName, unittest.equals('foo')); |
207 unittest.expect(o.numResponseItems, unittest.equals('foo')); | 254 unittest.expect(o.numResponseItems, unittest.equals('foo')); |
208 checkUnnamed1697(o.request); | 255 checkUnnamed1693(o.request); |
209 checkRequestMetadata(o.requestMetadata); | 256 checkRequestMetadata(o.requestMetadata); |
210 unittest.expect(o.resourceName, unittest.equals('foo')); | 257 unittest.expect(o.resourceName, unittest.equals('foo')); |
211 checkUnnamed1698(o.response); | 258 checkUnnamed1694(o.response); |
212 checkUnnamed1699(o.serviceData); | 259 checkUnnamed1695(o.serviceData); |
213 unittest.expect(o.serviceName, unittest.equals('foo')); | 260 unittest.expect(o.serviceName, unittest.equals('foo')); |
214 checkStatus(o.status); | 261 checkStatus(o.status); |
215 } | 262 } |
216 buildCounterAuditLog--; | 263 buildCounterAuditLog--; |
217 } | 264 } |
218 | 265 |
| 266 buildUnnamed1696() { |
| 267 var o = new core.Map<core.String, core.Object>(); |
| 268 o["x"] = { |
| 269 'list': [1, 2, 3], |
| 270 'bool': true, |
| 271 'string': 'foo' |
| 272 }; |
| 273 o["y"] = { |
| 274 'list': [1, 2, 3], |
| 275 'bool': true, |
| 276 'string': 'foo' |
| 277 }; |
| 278 return o; |
| 279 } |
| 280 |
| 281 checkUnnamed1696(core.Map<core.String, core.Object> o) { |
| 282 unittest.expect(o, unittest.hasLength(2)); |
| 283 var casted7 = (o["x"]) as core.Map; |
| 284 unittest.expect(casted7, unittest.hasLength(3)); |
| 285 unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); |
| 286 unittest.expect(casted7["bool"], unittest.equals(true)); |
| 287 unittest.expect(casted7["string"], unittest.equals('foo')); |
| 288 var casted8 = (o["y"]) as core.Map; |
| 289 unittest.expect(casted8, unittest.hasLength(3)); |
| 290 unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); |
| 291 unittest.expect(casted8["bool"], unittest.equals(true)); |
| 292 unittest.expect(casted8["string"], unittest.equals('foo')); |
| 293 } |
| 294 |
219 core.int buildCounterAuthenticationInfo = 0; | 295 core.int buildCounterAuthenticationInfo = 0; |
220 buildAuthenticationInfo() { | 296 buildAuthenticationInfo() { |
221 var o = new api.AuthenticationInfo(); | 297 var o = new api.AuthenticationInfo(); |
222 buildCounterAuthenticationInfo++; | 298 buildCounterAuthenticationInfo++; |
223 if (buildCounterAuthenticationInfo < 3) { | 299 if (buildCounterAuthenticationInfo < 3) { |
224 o.authoritySelector = "foo"; | 300 o.authoritySelector = "foo"; |
225 o.principalEmail = "foo"; | 301 o.principalEmail = "foo"; |
| 302 o.thirdPartyPrincipal = buildUnnamed1696(); |
226 } | 303 } |
227 buildCounterAuthenticationInfo--; | 304 buildCounterAuthenticationInfo--; |
228 return o; | 305 return o; |
229 } | 306 } |
230 | 307 |
231 checkAuthenticationInfo(api.AuthenticationInfo o) { | 308 checkAuthenticationInfo(api.AuthenticationInfo o) { |
232 buildCounterAuthenticationInfo++; | 309 buildCounterAuthenticationInfo++; |
233 if (buildCounterAuthenticationInfo < 3) { | 310 if (buildCounterAuthenticationInfo < 3) { |
234 unittest.expect(o.authoritySelector, unittest.equals('foo')); | 311 unittest.expect(o.authoritySelector, unittest.equals('foo')); |
235 unittest.expect(o.principalEmail, unittest.equals('foo')); | 312 unittest.expect(o.principalEmail, unittest.equals('foo')); |
| 313 checkUnnamed1696(o.thirdPartyPrincipal); |
236 } | 314 } |
237 buildCounterAuthenticationInfo--; | 315 buildCounterAuthenticationInfo--; |
238 } | 316 } |
239 | 317 |
240 core.int buildCounterAuthorizationInfo = 0; | 318 core.int buildCounterAuthorizationInfo = 0; |
241 buildAuthorizationInfo() { | 319 buildAuthorizationInfo() { |
242 var o = new api.AuthorizationInfo(); | 320 var o = new api.AuthorizationInfo(); |
243 buildCounterAuthorizationInfo++; | 321 buildCounterAuthorizationInfo++; |
244 if (buildCounterAuthorizationInfo < 3) { | 322 if (buildCounterAuthorizationInfo < 3) { |
245 o.granted = true; | 323 o.granted = true; |
(...skipping 28 matching lines...) Expand all Loading... |
274 | 352 |
275 checkCheckError(api.CheckError o) { | 353 checkCheckError(api.CheckError o) { |
276 buildCounterCheckError++; | 354 buildCounterCheckError++; |
277 if (buildCounterCheckError < 3) { | 355 if (buildCounterCheckError < 3) { |
278 unittest.expect(o.code, unittest.equals('foo')); | 356 unittest.expect(o.code, unittest.equals('foo')); |
279 unittest.expect(o.detail, unittest.equals('foo')); | 357 unittest.expect(o.detail, unittest.equals('foo')); |
280 } | 358 } |
281 buildCounterCheckError--; | 359 buildCounterCheckError--; |
282 } | 360 } |
283 | 361 |
284 buildUnnamed1700() { | 362 buildUnnamed1697() { |
285 var o = new core.List<core.String>(); | 363 var o = new core.List<core.String>(); |
286 o.add("foo"); | 364 o.add("foo"); |
287 o.add("foo"); | 365 o.add("foo"); |
288 return o; | 366 return o; |
289 } | 367 } |
290 | 368 |
291 checkUnnamed1700(core.List<core.String> o) { | 369 checkUnnamed1697(core.List<core.String> o) { |
292 unittest.expect(o, unittest.hasLength(2)); | 370 unittest.expect(o, unittest.hasLength(2)); |
293 unittest.expect(o[0], unittest.equals('foo')); | 371 unittest.expect(o[0], unittest.equals('foo')); |
294 unittest.expect(o[1], unittest.equals('foo')); | 372 unittest.expect(o[1], unittest.equals('foo')); |
295 } | 373 } |
296 | 374 |
297 core.int buildCounterCheckInfo = 0; | 375 core.int buildCounterCheckInfo = 0; |
298 buildCheckInfo() { | 376 buildCheckInfo() { |
299 var o = new api.CheckInfo(); | 377 var o = new api.CheckInfo(); |
300 buildCounterCheckInfo++; | 378 buildCounterCheckInfo++; |
301 if (buildCounterCheckInfo < 3) { | 379 if (buildCounterCheckInfo < 3) { |
302 o.consumerInfo = buildConsumerInfo(); | 380 o.consumerInfo = buildConsumerInfo(); |
303 o.unusedArguments = buildUnnamed1700(); | 381 o.unusedArguments = buildUnnamed1697(); |
304 } | 382 } |
305 buildCounterCheckInfo--; | 383 buildCounterCheckInfo--; |
306 return o; | 384 return o; |
307 } | 385 } |
308 | 386 |
309 checkCheckInfo(api.CheckInfo o) { | 387 checkCheckInfo(api.CheckInfo o) { |
310 buildCounterCheckInfo++; | 388 buildCounterCheckInfo++; |
311 if (buildCounterCheckInfo < 3) { | 389 if (buildCounterCheckInfo < 3) { |
312 checkConsumerInfo(o.consumerInfo); | 390 checkConsumerInfo(o.consumerInfo); |
313 checkUnnamed1700(o.unusedArguments); | 391 checkUnnamed1697(o.unusedArguments); |
314 } | 392 } |
315 buildCounterCheckInfo--; | 393 buildCounterCheckInfo--; |
316 } | 394 } |
317 | 395 |
318 core.int buildCounterCheckRequest = 0; | 396 core.int buildCounterCheckRequest = 0; |
319 buildCheckRequest() { | 397 buildCheckRequest() { |
320 var o = new api.CheckRequest(); | 398 var o = new api.CheckRequest(); |
321 buildCounterCheckRequest++; | 399 buildCounterCheckRequest++; |
322 if (buildCounterCheckRequest < 3) { | 400 if (buildCounterCheckRequest < 3) { |
323 o.operation = buildOperation(); | 401 o.operation = buildOperation(); |
324 o.requestProjectSettings = true; | 402 o.requestProjectSettings = true; |
325 o.serviceConfigId = "foo"; | 403 o.serviceConfigId = "foo"; |
326 o.skipActivationCheck = true; | 404 o.skipActivationCheck = true; |
327 } | 405 } |
328 buildCounterCheckRequest--; | 406 buildCounterCheckRequest--; |
329 return o; | 407 return o; |
330 } | 408 } |
331 | 409 |
332 checkCheckRequest(api.CheckRequest o) { | 410 checkCheckRequest(api.CheckRequest o) { |
333 buildCounterCheckRequest++; | 411 buildCounterCheckRequest++; |
334 if (buildCounterCheckRequest < 3) { | 412 if (buildCounterCheckRequest < 3) { |
335 checkOperation(o.operation); | 413 checkOperation(o.operation); |
336 unittest.expect(o.requestProjectSettings, unittest.isTrue); | 414 unittest.expect(o.requestProjectSettings, unittest.isTrue); |
337 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 415 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
338 unittest.expect(o.skipActivationCheck, unittest.isTrue); | 416 unittest.expect(o.skipActivationCheck, unittest.isTrue); |
339 } | 417 } |
340 buildCounterCheckRequest--; | 418 buildCounterCheckRequest--; |
341 } | 419 } |
342 | 420 |
343 buildUnnamed1701() { | 421 buildUnnamed1698() { |
344 var o = new core.List<api.CheckError>(); | 422 var o = new core.List<api.CheckError>(); |
345 o.add(buildCheckError()); | 423 o.add(buildCheckError()); |
346 o.add(buildCheckError()); | 424 o.add(buildCheckError()); |
347 return o; | 425 return o; |
348 } | 426 } |
349 | 427 |
350 checkUnnamed1701(core.List<api.CheckError> o) { | 428 checkUnnamed1698(core.List<api.CheckError> o) { |
351 unittest.expect(o, unittest.hasLength(2)); | 429 unittest.expect(o, unittest.hasLength(2)); |
352 checkCheckError(o[0]); | 430 checkCheckError(o[0]); |
353 checkCheckError(o[1]); | 431 checkCheckError(o[1]); |
354 } | 432 } |
355 | 433 |
356 core.int buildCounterCheckResponse = 0; | 434 core.int buildCounterCheckResponse = 0; |
357 buildCheckResponse() { | 435 buildCheckResponse() { |
358 var o = new api.CheckResponse(); | 436 var o = new api.CheckResponse(); |
359 buildCounterCheckResponse++; | 437 buildCounterCheckResponse++; |
360 if (buildCounterCheckResponse < 3) { | 438 if (buildCounterCheckResponse < 3) { |
361 o.checkErrors = buildUnnamed1701(); | 439 o.checkErrors = buildUnnamed1698(); |
362 o.checkInfo = buildCheckInfo(); | 440 o.checkInfo = buildCheckInfo(); |
363 o.operationId = "foo"; | 441 o.operationId = "foo"; |
364 o.quotaInfo = buildQuotaInfo(); | 442 o.quotaInfo = buildQuotaInfo(); |
365 o.serviceConfigId = "foo"; | 443 o.serviceConfigId = "foo"; |
366 } | 444 } |
367 buildCounterCheckResponse--; | 445 buildCounterCheckResponse--; |
368 return o; | 446 return o; |
369 } | 447 } |
370 | 448 |
371 checkCheckResponse(api.CheckResponse o) { | 449 checkCheckResponse(api.CheckResponse o) { |
372 buildCounterCheckResponse++; | 450 buildCounterCheckResponse++; |
373 if (buildCounterCheckResponse < 3) { | 451 if (buildCounterCheckResponse < 3) { |
374 checkUnnamed1701(o.checkErrors); | 452 checkUnnamed1698(o.checkErrors); |
375 checkCheckInfo(o.checkInfo); | 453 checkCheckInfo(o.checkInfo); |
376 unittest.expect(o.operationId, unittest.equals('foo')); | 454 unittest.expect(o.operationId, unittest.equals('foo')); |
377 checkQuotaInfo(o.quotaInfo); | 455 checkQuotaInfo(o.quotaInfo); |
378 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 456 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
379 } | 457 } |
380 buildCounterCheckResponse--; | 458 buildCounterCheckResponse--; |
381 } | 459 } |
382 | 460 |
383 core.int buildCounterConsumerInfo = 0; | 461 core.int buildCounterConsumerInfo = 0; |
384 buildConsumerInfo() { | 462 buildConsumerInfo() { |
385 var o = new api.ConsumerInfo(); | 463 var o = new api.ConsumerInfo(); |
386 buildCounterConsumerInfo++; | 464 buildCounterConsumerInfo++; |
387 if (buildCounterConsumerInfo < 3) { | 465 if (buildCounterConsumerInfo < 3) { |
388 o.projectNumber = "foo"; | 466 o.projectNumber = "foo"; |
389 } | 467 } |
390 buildCounterConsumerInfo--; | 468 buildCounterConsumerInfo--; |
391 return o; | 469 return o; |
392 } | 470 } |
393 | 471 |
394 checkConsumerInfo(api.ConsumerInfo o) { | 472 checkConsumerInfo(api.ConsumerInfo o) { |
395 buildCounterConsumerInfo++; | 473 buildCounterConsumerInfo++; |
396 if (buildCounterConsumerInfo < 3) { | 474 if (buildCounterConsumerInfo < 3) { |
397 unittest.expect(o.projectNumber, unittest.equals('foo')); | 475 unittest.expect(o.projectNumber, unittest.equals('foo')); |
398 } | 476 } |
399 buildCounterConsumerInfo--; | 477 buildCounterConsumerInfo--; |
400 } | 478 } |
401 | 479 |
402 buildUnnamed1702() { | 480 buildUnnamed1699() { |
403 var o = new core.List<core.String>(); | 481 var o = new core.List<core.String>(); |
404 o.add("foo"); | 482 o.add("foo"); |
405 o.add("foo"); | 483 o.add("foo"); |
406 return o; | 484 return o; |
407 } | 485 } |
408 | 486 |
409 checkUnnamed1702(core.List<core.String> o) { | 487 checkUnnamed1699(core.List<core.String> o) { |
410 unittest.expect(o, unittest.hasLength(2)); | 488 unittest.expect(o, unittest.hasLength(2)); |
411 unittest.expect(o[0], unittest.equals('foo')); | 489 unittest.expect(o[0], unittest.equals('foo')); |
412 unittest.expect(o[1], unittest.equals('foo')); | 490 unittest.expect(o[1], unittest.equals('foo')); |
413 } | 491 } |
414 | 492 |
415 core.int buildCounterDistribution = 0; | 493 core.int buildCounterDistribution = 0; |
416 buildDistribution() { | 494 buildDistribution() { |
417 var o = new api.Distribution(); | 495 var o = new api.Distribution(); |
418 buildCounterDistribution++; | 496 buildCounterDistribution++; |
419 if (buildCounterDistribution < 3) { | 497 if (buildCounterDistribution < 3) { |
420 o.bucketCounts = buildUnnamed1702(); | 498 o.bucketCounts = buildUnnamed1699(); |
421 o.count = "foo"; | 499 o.count = "foo"; |
422 o.explicitBuckets = buildExplicitBuckets(); | 500 o.explicitBuckets = buildExplicitBuckets(); |
423 o.exponentialBuckets = buildExponentialBuckets(); | 501 o.exponentialBuckets = buildExponentialBuckets(); |
424 o.linearBuckets = buildLinearBuckets(); | 502 o.linearBuckets = buildLinearBuckets(); |
425 o.maximum = 42.0; | 503 o.maximum = 42.0; |
426 o.mean = 42.0; | 504 o.mean = 42.0; |
427 o.minimum = 42.0; | 505 o.minimum = 42.0; |
428 o.sumOfSquaredDeviation = 42.0; | 506 o.sumOfSquaredDeviation = 42.0; |
429 } | 507 } |
430 buildCounterDistribution--; | 508 buildCounterDistribution--; |
431 return o; | 509 return o; |
432 } | 510 } |
433 | 511 |
434 checkDistribution(api.Distribution o) { | 512 checkDistribution(api.Distribution o) { |
435 buildCounterDistribution++; | 513 buildCounterDistribution++; |
436 if (buildCounterDistribution < 3) { | 514 if (buildCounterDistribution < 3) { |
437 checkUnnamed1702(o.bucketCounts); | 515 checkUnnamed1699(o.bucketCounts); |
438 unittest.expect(o.count, unittest.equals('foo')); | 516 unittest.expect(o.count, unittest.equals('foo')); |
439 checkExplicitBuckets(o.explicitBuckets); | 517 checkExplicitBuckets(o.explicitBuckets); |
440 checkExponentialBuckets(o.exponentialBuckets); | 518 checkExponentialBuckets(o.exponentialBuckets); |
441 checkLinearBuckets(o.linearBuckets); | 519 checkLinearBuckets(o.linearBuckets); |
442 unittest.expect(o.maximum, unittest.equals(42.0)); | 520 unittest.expect(o.maximum, unittest.equals(42.0)); |
443 unittest.expect(o.mean, unittest.equals(42.0)); | 521 unittest.expect(o.mean, unittest.equals(42.0)); |
444 unittest.expect(o.minimum, unittest.equals(42.0)); | 522 unittest.expect(o.minimum, unittest.equals(42.0)); |
445 unittest.expect(o.sumOfSquaredDeviation, unittest.equals(42.0)); | 523 unittest.expect(o.sumOfSquaredDeviation, unittest.equals(42.0)); |
446 } | 524 } |
447 buildCounterDistribution--; | 525 buildCounterDistribution--; |
(...skipping 13 matching lines...) Expand all Loading... |
461 | 539 |
462 checkEndReconciliationRequest(api.EndReconciliationRequest o) { | 540 checkEndReconciliationRequest(api.EndReconciliationRequest o) { |
463 buildCounterEndReconciliationRequest++; | 541 buildCounterEndReconciliationRequest++; |
464 if (buildCounterEndReconciliationRequest < 3) { | 542 if (buildCounterEndReconciliationRequest < 3) { |
465 checkQuotaOperation(o.reconciliationOperation); | 543 checkQuotaOperation(o.reconciliationOperation); |
466 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 544 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
467 } | 545 } |
468 buildCounterEndReconciliationRequest--; | 546 buildCounterEndReconciliationRequest--; |
469 } | 547 } |
470 | 548 |
471 buildUnnamed1703() { | 549 buildUnnamed1700() { |
472 var o = new core.List<api.MetricValueSet>(); | 550 var o = new core.List<api.MetricValueSet>(); |
473 o.add(buildMetricValueSet()); | 551 o.add(buildMetricValueSet()); |
474 o.add(buildMetricValueSet()); | 552 o.add(buildMetricValueSet()); |
475 return o; | 553 return o; |
476 } | 554 } |
477 | 555 |
478 checkUnnamed1703(core.List<api.MetricValueSet> o) { | 556 checkUnnamed1700(core.List<api.MetricValueSet> o) { |
479 unittest.expect(o, unittest.hasLength(2)); | 557 unittest.expect(o, unittest.hasLength(2)); |
480 checkMetricValueSet(o[0]); | 558 checkMetricValueSet(o[0]); |
481 checkMetricValueSet(o[1]); | 559 checkMetricValueSet(o[1]); |
482 } | 560 } |
483 | 561 |
484 buildUnnamed1704() { | 562 buildUnnamed1701() { |
485 var o = new core.List<api.QuotaError>(); | 563 var o = new core.List<api.QuotaError>(); |
486 o.add(buildQuotaError()); | 564 o.add(buildQuotaError()); |
487 o.add(buildQuotaError()); | 565 o.add(buildQuotaError()); |
488 return o; | 566 return o; |
489 } | 567 } |
490 | 568 |
491 checkUnnamed1704(core.List<api.QuotaError> o) { | 569 checkUnnamed1701(core.List<api.QuotaError> o) { |
492 unittest.expect(o, unittest.hasLength(2)); | 570 unittest.expect(o, unittest.hasLength(2)); |
493 checkQuotaError(o[0]); | 571 checkQuotaError(o[0]); |
494 checkQuotaError(o[1]); | 572 checkQuotaError(o[1]); |
495 } | 573 } |
496 | 574 |
497 core.int buildCounterEndReconciliationResponse = 0; | 575 core.int buildCounterEndReconciliationResponse = 0; |
498 buildEndReconciliationResponse() { | 576 buildEndReconciliationResponse() { |
499 var o = new api.EndReconciliationResponse(); | 577 var o = new api.EndReconciliationResponse(); |
500 buildCounterEndReconciliationResponse++; | 578 buildCounterEndReconciliationResponse++; |
501 if (buildCounterEndReconciliationResponse < 3) { | 579 if (buildCounterEndReconciliationResponse < 3) { |
502 o.operationId = "foo"; | 580 o.operationId = "foo"; |
503 o.quotaMetrics = buildUnnamed1703(); | 581 o.quotaMetrics = buildUnnamed1700(); |
504 o.reconciliationErrors = buildUnnamed1704(); | 582 o.reconciliationErrors = buildUnnamed1701(); |
505 o.serviceConfigId = "foo"; | 583 o.serviceConfigId = "foo"; |
506 } | 584 } |
507 buildCounterEndReconciliationResponse--; | 585 buildCounterEndReconciliationResponse--; |
508 return o; | 586 return o; |
509 } | 587 } |
510 | 588 |
511 checkEndReconciliationResponse(api.EndReconciliationResponse o) { | 589 checkEndReconciliationResponse(api.EndReconciliationResponse o) { |
512 buildCounterEndReconciliationResponse++; | 590 buildCounterEndReconciliationResponse++; |
513 if (buildCounterEndReconciliationResponse < 3) { | 591 if (buildCounterEndReconciliationResponse < 3) { |
514 unittest.expect(o.operationId, unittest.equals('foo')); | 592 unittest.expect(o.operationId, unittest.equals('foo')); |
515 checkUnnamed1703(o.quotaMetrics); | 593 checkUnnamed1700(o.quotaMetrics); |
516 checkUnnamed1704(o.reconciliationErrors); | 594 checkUnnamed1701(o.reconciliationErrors); |
517 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 595 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
518 } | 596 } |
519 buildCounterEndReconciliationResponse--; | 597 buildCounterEndReconciliationResponse--; |
520 } | 598 } |
521 | 599 |
522 buildUnnamed1705() { | 600 buildUnnamed1702() { |
523 var o = new core.List<core.double>(); | 601 var o = new core.List<core.double>(); |
524 o.add(42.0); | 602 o.add(42.0); |
525 o.add(42.0); | 603 o.add(42.0); |
526 return o; | 604 return o; |
527 } | 605 } |
528 | 606 |
529 checkUnnamed1705(core.List<core.double> o) { | 607 checkUnnamed1702(core.List<core.double> o) { |
530 unittest.expect(o, unittest.hasLength(2)); | 608 unittest.expect(o, unittest.hasLength(2)); |
531 unittest.expect(o[0], unittest.equals(42.0)); | 609 unittest.expect(o[0], unittest.equals(42.0)); |
532 unittest.expect(o[1], unittest.equals(42.0)); | 610 unittest.expect(o[1], unittest.equals(42.0)); |
533 } | 611 } |
534 | 612 |
535 core.int buildCounterExplicitBuckets = 0; | 613 core.int buildCounterExplicitBuckets = 0; |
536 buildExplicitBuckets() { | 614 buildExplicitBuckets() { |
537 var o = new api.ExplicitBuckets(); | 615 var o = new api.ExplicitBuckets(); |
538 buildCounterExplicitBuckets++; | 616 buildCounterExplicitBuckets++; |
539 if (buildCounterExplicitBuckets < 3) { | 617 if (buildCounterExplicitBuckets < 3) { |
540 o.bounds = buildUnnamed1705(); | 618 o.bounds = buildUnnamed1702(); |
541 } | 619 } |
542 buildCounterExplicitBuckets--; | 620 buildCounterExplicitBuckets--; |
543 return o; | 621 return o; |
544 } | 622 } |
545 | 623 |
546 checkExplicitBuckets(api.ExplicitBuckets o) { | 624 checkExplicitBuckets(api.ExplicitBuckets o) { |
547 buildCounterExplicitBuckets++; | 625 buildCounterExplicitBuckets++; |
548 if (buildCounterExplicitBuckets < 3) { | 626 if (buildCounterExplicitBuckets < 3) { |
549 checkUnnamed1705(o.bounds); | 627 checkUnnamed1702(o.bounds); |
550 } | 628 } |
551 buildCounterExplicitBuckets--; | 629 buildCounterExplicitBuckets--; |
552 } | 630 } |
553 | 631 |
554 core.int buildCounterExponentialBuckets = 0; | 632 core.int buildCounterExponentialBuckets = 0; |
555 buildExponentialBuckets() { | 633 buildExponentialBuckets() { |
556 var o = new api.ExponentialBuckets(); | 634 var o = new api.ExponentialBuckets(); |
557 buildCounterExponentialBuckets++; | 635 buildCounterExponentialBuckets++; |
558 if (buildCounterExponentialBuckets < 3) { | 636 if (buildCounterExponentialBuckets < 3) { |
559 o.growthFactor = 42.0; | 637 o.growthFactor = 42.0; |
(...skipping 30 matching lines...) Expand all Loading... |
590 checkLinearBuckets(api.LinearBuckets o) { | 668 checkLinearBuckets(api.LinearBuckets o) { |
591 buildCounterLinearBuckets++; | 669 buildCounterLinearBuckets++; |
592 if (buildCounterLinearBuckets < 3) { | 670 if (buildCounterLinearBuckets < 3) { |
593 unittest.expect(o.numFiniteBuckets, unittest.equals(42)); | 671 unittest.expect(o.numFiniteBuckets, unittest.equals(42)); |
594 unittest.expect(o.offset, unittest.equals(42.0)); | 672 unittest.expect(o.offset, unittest.equals(42.0)); |
595 unittest.expect(o.width, unittest.equals(42.0)); | 673 unittest.expect(o.width, unittest.equals(42.0)); |
596 } | 674 } |
597 buildCounterLinearBuckets--; | 675 buildCounterLinearBuckets--; |
598 } | 676 } |
599 | 677 |
600 buildUnnamed1706() { | 678 buildUnnamed1703() { |
601 var o = new core.Map<core.String, core.String>(); | 679 var o = new core.Map<core.String, core.String>(); |
602 o["x"] = "foo"; | 680 o["x"] = "foo"; |
603 o["y"] = "foo"; | 681 o["y"] = "foo"; |
604 return o; | 682 return o; |
605 } | 683 } |
606 | 684 |
607 checkUnnamed1706(core.Map<core.String, core.String> o) { | 685 checkUnnamed1703(core.Map<core.String, core.String> o) { |
608 unittest.expect(o, unittest.hasLength(2)); | 686 unittest.expect(o, unittest.hasLength(2)); |
609 unittest.expect(o["x"], unittest.equals('foo')); | 687 unittest.expect(o["x"], unittest.equals('foo')); |
610 unittest.expect(o["y"], unittest.equals('foo')); | 688 unittest.expect(o["y"], unittest.equals('foo')); |
611 } | 689 } |
612 | 690 |
613 buildUnnamed1707() { | 691 buildUnnamed1704() { |
614 var o = new core.Map<core.String, core.Object>(); | 692 var o = new core.Map<core.String, core.Object>(); |
615 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 693 o["x"] = { |
616 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 694 'list': [1, 2, 3], |
| 695 'bool': true, |
| 696 'string': 'foo' |
| 697 }; |
| 698 o["y"] = { |
| 699 'list': [1, 2, 3], |
| 700 'bool': true, |
| 701 'string': 'foo' |
| 702 }; |
617 return o; | 703 return o; |
618 } | 704 } |
619 | 705 |
620 checkUnnamed1707(core.Map<core.String, core.Object> o) { | 706 checkUnnamed1704(core.Map<core.String, core.Object> o) { |
621 unittest.expect(o, unittest.hasLength(2)); | 707 unittest.expect(o, unittest.hasLength(2)); |
622 var casted7 = (o["x"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); | 708 var casted9 = (o["x"]) as core.Map; |
623 var casted8 = (o["y"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); | 709 unittest.expect(casted9, unittest.hasLength(3)); |
| 710 unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); |
| 711 unittest.expect(casted9["bool"], unittest.equals(true)); |
| 712 unittest.expect(casted9["string"], unittest.equals('foo')); |
| 713 var casted10 = (o["y"]) as core.Map; |
| 714 unittest.expect(casted10, unittest.hasLength(3)); |
| 715 unittest.expect(casted10["list"], unittest.equals([1, 2, 3])); |
| 716 unittest.expect(casted10["bool"], unittest.equals(true)); |
| 717 unittest.expect(casted10["string"], unittest.equals('foo')); |
624 } | 718 } |
625 | 719 |
626 buildUnnamed1708() { | 720 buildUnnamed1705() { |
627 var o = new core.Map<core.String, core.Object>(); | 721 var o = new core.Map<core.String, core.Object>(); |
628 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 722 o["x"] = { |
629 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 723 'list': [1, 2, 3], |
| 724 'bool': true, |
| 725 'string': 'foo' |
| 726 }; |
| 727 o["y"] = { |
| 728 'list': [1, 2, 3], |
| 729 'bool': true, |
| 730 'string': 'foo' |
| 731 }; |
630 return o; | 732 return o; |
631 } | 733 } |
632 | 734 |
633 checkUnnamed1708(core.Map<core.String, core.Object> o) { | 735 checkUnnamed1705(core.Map<core.String, core.Object> o) { |
634 unittest.expect(o, unittest.hasLength(2)); | 736 unittest.expect(o, unittest.hasLength(2)); |
635 var casted9 = (o["x"]) as core.Map; unittest.expect(casted9, unittest.hasLengt
h(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"],
unittest.equals('foo')); | 737 var casted11 = (o["x"]) as core.Map; |
636 var casted10 = (o["y"]) as core.Map; unittest.expect(casted10, unittest.hasLen
gth(3)); unittest.expect(casted10["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted10["bool"], unittest.equals(true)); unittest.expect(casted10["stri
ng"], unittest.equals('foo')); | 738 unittest.expect(casted11, unittest.hasLength(3)); |
| 739 unittest.expect(casted11["list"], unittest.equals([1, 2, 3])); |
| 740 unittest.expect(casted11["bool"], unittest.equals(true)); |
| 741 unittest.expect(casted11["string"], unittest.equals('foo')); |
| 742 var casted12 = (o["y"]) as core.Map; |
| 743 unittest.expect(casted12, unittest.hasLength(3)); |
| 744 unittest.expect(casted12["list"], unittest.equals([1, 2, 3])); |
| 745 unittest.expect(casted12["bool"], unittest.equals(true)); |
| 746 unittest.expect(casted12["string"], unittest.equals('foo')); |
637 } | 747 } |
638 | 748 |
639 core.int buildCounterLogEntry = 0; | 749 core.int buildCounterLogEntry = 0; |
640 buildLogEntry() { | 750 buildLogEntry() { |
641 var o = new api.LogEntry(); | 751 var o = new api.LogEntry(); |
642 buildCounterLogEntry++; | 752 buildCounterLogEntry++; |
643 if (buildCounterLogEntry < 3) { | 753 if (buildCounterLogEntry < 3) { |
644 o.insertId = "foo"; | 754 o.insertId = "foo"; |
645 o.labels = buildUnnamed1706(); | 755 o.labels = buildUnnamed1703(); |
646 o.name = "foo"; | 756 o.name = "foo"; |
647 o.protoPayload = buildUnnamed1707(); | 757 o.protoPayload = buildUnnamed1704(); |
648 o.severity = "foo"; | 758 o.severity = "foo"; |
649 o.structPayload = buildUnnamed1708(); | 759 o.structPayload = buildUnnamed1705(); |
650 o.textPayload = "foo"; | 760 o.textPayload = "foo"; |
651 o.timestamp = "foo"; | 761 o.timestamp = "foo"; |
652 } | 762 } |
653 buildCounterLogEntry--; | 763 buildCounterLogEntry--; |
654 return o; | 764 return o; |
655 } | 765 } |
656 | 766 |
657 checkLogEntry(api.LogEntry o) { | 767 checkLogEntry(api.LogEntry o) { |
658 buildCounterLogEntry++; | 768 buildCounterLogEntry++; |
659 if (buildCounterLogEntry < 3) { | 769 if (buildCounterLogEntry < 3) { |
660 unittest.expect(o.insertId, unittest.equals('foo')); | 770 unittest.expect(o.insertId, unittest.equals('foo')); |
661 checkUnnamed1706(o.labels); | 771 checkUnnamed1703(o.labels); |
662 unittest.expect(o.name, unittest.equals('foo')); | 772 unittest.expect(o.name, unittest.equals('foo')); |
663 checkUnnamed1707(o.protoPayload); | 773 checkUnnamed1704(o.protoPayload); |
664 unittest.expect(o.severity, unittest.equals('foo')); | 774 unittest.expect(o.severity, unittest.equals('foo')); |
665 checkUnnamed1708(o.structPayload); | 775 checkUnnamed1705(o.structPayload); |
666 unittest.expect(o.textPayload, unittest.equals('foo')); | 776 unittest.expect(o.textPayload, unittest.equals('foo')); |
667 unittest.expect(o.timestamp, unittest.equals('foo')); | 777 unittest.expect(o.timestamp, unittest.equals('foo')); |
668 } | 778 } |
669 buildCounterLogEntry--; | 779 buildCounterLogEntry--; |
670 } | 780 } |
671 | 781 |
672 buildUnnamed1709() { | 782 buildUnnamed1706() { |
673 var o = new core.Map<core.String, core.String>(); | 783 var o = new core.Map<core.String, core.String>(); |
674 o["x"] = "foo"; | 784 o["x"] = "foo"; |
675 o["y"] = "foo"; | 785 o["y"] = "foo"; |
676 return o; | 786 return o; |
677 } | 787 } |
678 | 788 |
679 checkUnnamed1709(core.Map<core.String, core.String> o) { | 789 checkUnnamed1706(core.Map<core.String, core.String> o) { |
680 unittest.expect(o, unittest.hasLength(2)); | 790 unittest.expect(o, unittest.hasLength(2)); |
681 unittest.expect(o["x"], unittest.equals('foo')); | 791 unittest.expect(o["x"], unittest.equals('foo')); |
682 unittest.expect(o["y"], unittest.equals('foo')); | 792 unittest.expect(o["y"], unittest.equals('foo')); |
683 } | 793 } |
684 | 794 |
685 core.int buildCounterMetricValue = 0; | 795 core.int buildCounterMetricValue = 0; |
686 buildMetricValue() { | 796 buildMetricValue() { |
687 var o = new api.MetricValue(); | 797 var o = new api.MetricValue(); |
688 buildCounterMetricValue++; | 798 buildCounterMetricValue++; |
689 if (buildCounterMetricValue < 3) { | 799 if (buildCounterMetricValue < 3) { |
690 o.boolValue = true; | 800 o.boolValue = true; |
691 o.distributionValue = buildDistribution(); | 801 o.distributionValue = buildDistribution(); |
692 o.doubleValue = 42.0; | 802 o.doubleValue = 42.0; |
693 o.endTime = "foo"; | 803 o.endTime = "foo"; |
694 o.int64Value = "foo"; | 804 o.int64Value = "foo"; |
695 o.labels = buildUnnamed1709(); | 805 o.labels = buildUnnamed1706(); |
696 o.moneyValue = buildMoney(); | 806 o.moneyValue = buildMoney(); |
697 o.startTime = "foo"; | 807 o.startTime = "foo"; |
698 o.stringValue = "foo"; | 808 o.stringValue = "foo"; |
699 } | 809 } |
700 buildCounterMetricValue--; | 810 buildCounterMetricValue--; |
701 return o; | 811 return o; |
702 } | 812 } |
703 | 813 |
704 checkMetricValue(api.MetricValue o) { | 814 checkMetricValue(api.MetricValue o) { |
705 buildCounterMetricValue++; | 815 buildCounterMetricValue++; |
706 if (buildCounterMetricValue < 3) { | 816 if (buildCounterMetricValue < 3) { |
707 unittest.expect(o.boolValue, unittest.isTrue); | 817 unittest.expect(o.boolValue, unittest.isTrue); |
708 checkDistribution(o.distributionValue); | 818 checkDistribution(o.distributionValue); |
709 unittest.expect(o.doubleValue, unittest.equals(42.0)); | 819 unittest.expect(o.doubleValue, unittest.equals(42.0)); |
710 unittest.expect(o.endTime, unittest.equals('foo')); | 820 unittest.expect(o.endTime, unittest.equals('foo')); |
711 unittest.expect(o.int64Value, unittest.equals('foo')); | 821 unittest.expect(o.int64Value, unittest.equals('foo')); |
712 checkUnnamed1709(o.labels); | 822 checkUnnamed1706(o.labels); |
713 checkMoney(o.moneyValue); | 823 checkMoney(o.moneyValue); |
714 unittest.expect(o.startTime, unittest.equals('foo')); | 824 unittest.expect(o.startTime, unittest.equals('foo')); |
715 unittest.expect(o.stringValue, unittest.equals('foo')); | 825 unittest.expect(o.stringValue, unittest.equals('foo')); |
716 } | 826 } |
717 buildCounterMetricValue--; | 827 buildCounterMetricValue--; |
718 } | 828 } |
719 | 829 |
720 buildUnnamed1710() { | 830 buildUnnamed1707() { |
721 var o = new core.List<api.MetricValue>(); | 831 var o = new core.List<api.MetricValue>(); |
722 o.add(buildMetricValue()); | 832 o.add(buildMetricValue()); |
723 o.add(buildMetricValue()); | 833 o.add(buildMetricValue()); |
724 return o; | 834 return o; |
725 } | 835 } |
726 | 836 |
727 checkUnnamed1710(core.List<api.MetricValue> o) { | 837 checkUnnamed1707(core.List<api.MetricValue> o) { |
728 unittest.expect(o, unittest.hasLength(2)); | 838 unittest.expect(o, unittest.hasLength(2)); |
729 checkMetricValue(o[0]); | 839 checkMetricValue(o[0]); |
730 checkMetricValue(o[1]); | 840 checkMetricValue(o[1]); |
731 } | 841 } |
732 | 842 |
733 core.int buildCounterMetricValueSet = 0; | 843 core.int buildCounterMetricValueSet = 0; |
734 buildMetricValueSet() { | 844 buildMetricValueSet() { |
735 var o = new api.MetricValueSet(); | 845 var o = new api.MetricValueSet(); |
736 buildCounterMetricValueSet++; | 846 buildCounterMetricValueSet++; |
737 if (buildCounterMetricValueSet < 3) { | 847 if (buildCounterMetricValueSet < 3) { |
738 o.metricName = "foo"; | 848 o.metricName = "foo"; |
739 o.metricValues = buildUnnamed1710(); | 849 o.metricValues = buildUnnamed1707(); |
740 } | 850 } |
741 buildCounterMetricValueSet--; | 851 buildCounterMetricValueSet--; |
742 return o; | 852 return o; |
743 } | 853 } |
744 | 854 |
745 checkMetricValueSet(api.MetricValueSet o) { | 855 checkMetricValueSet(api.MetricValueSet o) { |
746 buildCounterMetricValueSet++; | 856 buildCounterMetricValueSet++; |
747 if (buildCounterMetricValueSet < 3) { | 857 if (buildCounterMetricValueSet < 3) { |
748 unittest.expect(o.metricName, unittest.equals('foo')); | 858 unittest.expect(o.metricName, unittest.equals('foo')); |
749 checkUnnamed1710(o.metricValues); | 859 checkUnnamed1707(o.metricValues); |
750 } | 860 } |
751 buildCounterMetricValueSet--; | 861 buildCounterMetricValueSet--; |
752 } | 862 } |
753 | 863 |
754 core.int buildCounterMoney = 0; | 864 core.int buildCounterMoney = 0; |
755 buildMoney() { | 865 buildMoney() { |
756 var o = new api.Money(); | 866 var o = new api.Money(); |
757 buildCounterMoney++; | 867 buildCounterMoney++; |
758 if (buildCounterMoney < 3) { | 868 if (buildCounterMoney < 3) { |
759 o.currencyCode = "foo"; | 869 o.currencyCode = "foo"; |
760 o.nanos = 42; | 870 o.nanos = 42; |
761 o.units = "foo"; | 871 o.units = "foo"; |
762 } | 872 } |
763 buildCounterMoney--; | 873 buildCounterMoney--; |
764 return o; | 874 return o; |
765 } | 875 } |
766 | 876 |
767 checkMoney(api.Money o) { | 877 checkMoney(api.Money o) { |
768 buildCounterMoney++; | 878 buildCounterMoney++; |
769 if (buildCounterMoney < 3) { | 879 if (buildCounterMoney < 3) { |
770 unittest.expect(o.currencyCode, unittest.equals('foo')); | 880 unittest.expect(o.currencyCode, unittest.equals('foo')); |
771 unittest.expect(o.nanos, unittest.equals(42)); | 881 unittest.expect(o.nanos, unittest.equals(42)); |
772 unittest.expect(o.units, unittest.equals('foo')); | 882 unittest.expect(o.units, unittest.equals('foo')); |
773 } | 883 } |
774 buildCounterMoney--; | 884 buildCounterMoney--; |
775 } | 885 } |
776 | 886 |
777 buildUnnamed1711() { | 887 buildUnnamed1708() { |
778 var o = new core.Map<core.String, core.String>(); | 888 var o = new core.Map<core.String, core.String>(); |
779 o["x"] = "foo"; | 889 o["x"] = "foo"; |
780 o["y"] = "foo"; | 890 o["y"] = "foo"; |
781 return o; | 891 return o; |
782 } | 892 } |
783 | 893 |
784 checkUnnamed1711(core.Map<core.String, core.String> o) { | 894 checkUnnamed1708(core.Map<core.String, core.String> o) { |
785 unittest.expect(o, unittest.hasLength(2)); | 895 unittest.expect(o, unittest.hasLength(2)); |
786 unittest.expect(o["x"], unittest.equals('foo')); | 896 unittest.expect(o["x"], unittest.equals('foo')); |
787 unittest.expect(o["y"], unittest.equals('foo')); | 897 unittest.expect(o["y"], unittest.equals('foo')); |
788 } | 898 } |
789 | 899 |
790 buildUnnamed1712() { | 900 buildUnnamed1709() { |
791 var o = new core.List<api.LogEntry>(); | 901 var o = new core.List<api.LogEntry>(); |
792 o.add(buildLogEntry()); | 902 o.add(buildLogEntry()); |
793 o.add(buildLogEntry()); | 903 o.add(buildLogEntry()); |
794 return o; | 904 return o; |
795 } | 905 } |
796 | 906 |
797 checkUnnamed1712(core.List<api.LogEntry> o) { | 907 checkUnnamed1709(core.List<api.LogEntry> o) { |
798 unittest.expect(o, unittest.hasLength(2)); | 908 unittest.expect(o, unittest.hasLength(2)); |
799 checkLogEntry(o[0]); | 909 checkLogEntry(o[0]); |
800 checkLogEntry(o[1]); | 910 checkLogEntry(o[1]); |
801 } | 911 } |
802 | 912 |
803 buildUnnamed1713() { | 913 buildUnnamed1710() { |
804 var o = new core.List<api.MetricValueSet>(); | 914 var o = new core.List<api.MetricValueSet>(); |
805 o.add(buildMetricValueSet()); | 915 o.add(buildMetricValueSet()); |
806 o.add(buildMetricValueSet()); | 916 o.add(buildMetricValueSet()); |
807 return o; | 917 return o; |
808 } | 918 } |
809 | 919 |
810 checkUnnamed1713(core.List<api.MetricValueSet> o) { | 920 checkUnnamed1710(core.List<api.MetricValueSet> o) { |
811 unittest.expect(o, unittest.hasLength(2)); | 921 unittest.expect(o, unittest.hasLength(2)); |
812 checkMetricValueSet(o[0]); | 922 checkMetricValueSet(o[0]); |
813 checkMetricValueSet(o[1]); | 923 checkMetricValueSet(o[1]); |
814 } | 924 } |
815 | 925 |
816 buildUnnamed1714() { | 926 buildUnnamed1711() { |
| 927 var o = new core.List<core.String>(); |
| 928 o.add("foo"); |
| 929 o.add("foo"); |
| 930 return o; |
| 931 } |
| 932 |
| 933 checkUnnamed1711(core.List<core.String> o) { |
| 934 unittest.expect(o, unittest.hasLength(2)); |
| 935 unittest.expect(o[0], unittest.equals('foo')); |
| 936 unittest.expect(o[1], unittest.equals('foo')); |
| 937 } |
| 938 |
| 939 buildUnnamed1712() { |
817 var o = new core.Map<core.String, core.String>(); | 940 var o = new core.Map<core.String, core.String>(); |
818 o["x"] = "foo"; | 941 o["x"] = "foo"; |
819 o["y"] = "foo"; | 942 o["y"] = "foo"; |
820 return o; | 943 return o; |
821 } | 944 } |
822 | 945 |
823 checkUnnamed1714(core.Map<core.String, core.String> o) { | 946 checkUnnamed1712(core.Map<core.String, core.String> o) { |
824 unittest.expect(o, unittest.hasLength(2)); | 947 unittest.expect(o, unittest.hasLength(2)); |
825 unittest.expect(o["x"], unittest.equals('foo')); | 948 unittest.expect(o["x"], unittest.equals('foo')); |
826 unittest.expect(o["y"], unittest.equals('foo')); | 949 unittest.expect(o["y"], unittest.equals('foo')); |
827 } | 950 } |
828 | 951 |
829 core.int buildCounterOperation = 0; | 952 core.int buildCounterOperation = 0; |
830 buildOperation() { | 953 buildOperation() { |
831 var o = new api.Operation(); | 954 var o = new api.Operation(); |
832 buildCounterOperation++; | 955 buildCounterOperation++; |
833 if (buildCounterOperation < 3) { | 956 if (buildCounterOperation < 3) { |
834 o.consumerId = "foo"; | 957 o.consumerId = "foo"; |
835 o.endTime = "foo"; | 958 o.endTime = "foo"; |
836 o.importance = "foo"; | 959 o.importance = "foo"; |
837 o.labels = buildUnnamed1711(); | 960 o.labels = buildUnnamed1708(); |
838 o.logEntries = buildUnnamed1712(); | 961 o.logEntries = buildUnnamed1709(); |
839 o.metricValueSets = buildUnnamed1713(); | 962 o.metricValueSets = buildUnnamed1710(); |
840 o.operationId = "foo"; | 963 o.operationId = "foo"; |
841 o.operationName = "foo"; | 964 o.operationName = "foo"; |
842 o.quotaProperties = buildQuotaProperties(); | 965 o.quotaProperties = buildQuotaProperties(); |
843 o.resourceContainer = "foo"; | 966 o.resourceContainer = "foo"; |
| 967 o.resourceContainers = buildUnnamed1711(); |
844 o.startTime = "foo"; | 968 o.startTime = "foo"; |
845 o.userLabels = buildUnnamed1714(); | 969 o.userLabels = buildUnnamed1712(); |
846 } | 970 } |
847 buildCounterOperation--; | 971 buildCounterOperation--; |
848 return o; | 972 return o; |
849 } | 973 } |
850 | 974 |
851 checkOperation(api.Operation o) { | 975 checkOperation(api.Operation o) { |
852 buildCounterOperation++; | 976 buildCounterOperation++; |
853 if (buildCounterOperation < 3) { | 977 if (buildCounterOperation < 3) { |
854 unittest.expect(o.consumerId, unittest.equals('foo')); | 978 unittest.expect(o.consumerId, unittest.equals('foo')); |
855 unittest.expect(o.endTime, unittest.equals('foo')); | 979 unittest.expect(o.endTime, unittest.equals('foo')); |
856 unittest.expect(o.importance, unittest.equals('foo')); | 980 unittest.expect(o.importance, unittest.equals('foo')); |
857 checkUnnamed1711(o.labels); | 981 checkUnnamed1708(o.labels); |
858 checkUnnamed1712(o.logEntries); | 982 checkUnnamed1709(o.logEntries); |
859 checkUnnamed1713(o.metricValueSets); | 983 checkUnnamed1710(o.metricValueSets); |
860 unittest.expect(o.operationId, unittest.equals('foo')); | 984 unittest.expect(o.operationId, unittest.equals('foo')); |
861 unittest.expect(o.operationName, unittest.equals('foo')); | 985 unittest.expect(o.operationName, unittest.equals('foo')); |
862 checkQuotaProperties(o.quotaProperties); | 986 checkQuotaProperties(o.quotaProperties); |
863 unittest.expect(o.resourceContainer, unittest.equals('foo')); | 987 unittest.expect(o.resourceContainer, unittest.equals('foo')); |
| 988 checkUnnamed1711(o.resourceContainers); |
864 unittest.expect(o.startTime, unittest.equals('foo')); | 989 unittest.expect(o.startTime, unittest.equals('foo')); |
865 checkUnnamed1714(o.userLabels); | 990 checkUnnamed1712(o.userLabels); |
866 } | 991 } |
867 buildCounterOperation--; | 992 buildCounterOperation--; |
868 } | 993 } |
869 | 994 |
870 core.int buildCounterQuotaError = 0; | 995 core.int buildCounterQuotaError = 0; |
871 buildQuotaError() { | 996 buildQuotaError() { |
872 var o = new api.QuotaError(); | 997 var o = new api.QuotaError(); |
873 buildCounterQuotaError++; | 998 buildCounterQuotaError++; |
874 if (buildCounterQuotaError < 3) { | 999 if (buildCounterQuotaError < 3) { |
875 o.code = "foo"; | 1000 o.code = "foo"; |
876 o.description = "foo"; | 1001 o.description = "foo"; |
877 o.subject = "foo"; | 1002 o.subject = "foo"; |
878 } | 1003 } |
879 buildCounterQuotaError--; | 1004 buildCounterQuotaError--; |
880 return o; | 1005 return o; |
881 } | 1006 } |
882 | 1007 |
883 checkQuotaError(api.QuotaError o) { | 1008 checkQuotaError(api.QuotaError o) { |
884 buildCounterQuotaError++; | 1009 buildCounterQuotaError++; |
885 if (buildCounterQuotaError < 3) { | 1010 if (buildCounterQuotaError < 3) { |
886 unittest.expect(o.code, unittest.equals('foo')); | 1011 unittest.expect(o.code, unittest.equals('foo')); |
887 unittest.expect(o.description, unittest.equals('foo')); | 1012 unittest.expect(o.description, unittest.equals('foo')); |
888 unittest.expect(o.subject, unittest.equals('foo')); | 1013 unittest.expect(o.subject, unittest.equals('foo')); |
889 } | 1014 } |
890 buildCounterQuotaError--; | 1015 buildCounterQuotaError--; |
891 } | 1016 } |
892 | 1017 |
893 buildUnnamed1715() { | 1018 buildUnnamed1713() { |
894 var o = new core.List<core.String>(); | 1019 var o = new core.List<core.String>(); |
895 o.add("foo"); | 1020 o.add("foo"); |
896 o.add("foo"); | 1021 o.add("foo"); |
897 return o; | 1022 return o; |
898 } | 1023 } |
899 | 1024 |
900 checkUnnamed1715(core.List<core.String> o) { | 1025 checkUnnamed1713(core.List<core.String> o) { |
901 unittest.expect(o, unittest.hasLength(2)); | 1026 unittest.expect(o, unittest.hasLength(2)); |
902 unittest.expect(o[0], unittest.equals('foo')); | 1027 unittest.expect(o[0], unittest.equals('foo')); |
903 unittest.expect(o[1], unittest.equals('foo')); | 1028 unittest.expect(o[1], unittest.equals('foo')); |
904 } | 1029 } |
905 | 1030 |
906 buildUnnamed1716() { | 1031 buildUnnamed1714() { |
907 var o = new core.Map<core.String, core.int>(); | 1032 var o = new core.Map<core.String, core.int>(); |
908 o["x"] = 42; | 1033 o["x"] = 42; |
909 o["y"] = 42; | 1034 o["y"] = 42; |
910 return o; | 1035 return o; |
911 } | 1036 } |
912 | 1037 |
913 checkUnnamed1716(core.Map<core.String, core.int> o) { | 1038 checkUnnamed1714(core.Map<core.String, core.int> o) { |
914 unittest.expect(o, unittest.hasLength(2)); | 1039 unittest.expect(o, unittest.hasLength(2)); |
915 unittest.expect(o["x"], unittest.equals(42)); | 1040 unittest.expect(o["x"], unittest.equals(42)); |
916 unittest.expect(o["y"], unittest.equals(42)); | 1041 unittest.expect(o["y"], unittest.equals(42)); |
917 } | 1042 } |
918 | 1043 |
919 buildUnnamed1717() { | 1044 buildUnnamed1715() { |
920 var o = new core.List<api.MetricValueSet>(); | 1045 var o = new core.List<api.MetricValueSet>(); |
921 o.add(buildMetricValueSet()); | 1046 o.add(buildMetricValueSet()); |
922 o.add(buildMetricValueSet()); | 1047 o.add(buildMetricValueSet()); |
923 return o; | 1048 return o; |
924 } | 1049 } |
925 | 1050 |
926 checkUnnamed1717(core.List<api.MetricValueSet> o) { | 1051 checkUnnamed1715(core.List<api.MetricValueSet> o) { |
927 unittest.expect(o, unittest.hasLength(2)); | 1052 unittest.expect(o, unittest.hasLength(2)); |
928 checkMetricValueSet(o[0]); | 1053 checkMetricValueSet(o[0]); |
929 checkMetricValueSet(o[1]); | 1054 checkMetricValueSet(o[1]); |
930 } | 1055 } |
931 | 1056 |
932 core.int buildCounterQuotaInfo = 0; | 1057 core.int buildCounterQuotaInfo = 0; |
933 buildQuotaInfo() { | 1058 buildQuotaInfo() { |
934 var o = new api.QuotaInfo(); | 1059 var o = new api.QuotaInfo(); |
935 buildCounterQuotaInfo++; | 1060 buildCounterQuotaInfo++; |
936 if (buildCounterQuotaInfo < 3) { | 1061 if (buildCounterQuotaInfo < 3) { |
937 o.limitExceeded = buildUnnamed1715(); | 1062 o.limitExceeded = buildUnnamed1713(); |
938 o.quotaConsumed = buildUnnamed1716(); | 1063 o.quotaConsumed = buildUnnamed1714(); |
939 o.quotaMetrics = buildUnnamed1717(); | 1064 o.quotaMetrics = buildUnnamed1715(); |
940 } | 1065 } |
941 buildCounterQuotaInfo--; | 1066 buildCounterQuotaInfo--; |
942 return o; | 1067 return o; |
943 } | 1068 } |
944 | 1069 |
945 checkQuotaInfo(api.QuotaInfo o) { | 1070 checkQuotaInfo(api.QuotaInfo o) { |
946 buildCounterQuotaInfo++; | 1071 buildCounterQuotaInfo++; |
947 if (buildCounterQuotaInfo < 3) { | 1072 if (buildCounterQuotaInfo < 3) { |
948 checkUnnamed1715(o.limitExceeded); | 1073 checkUnnamed1713(o.limitExceeded); |
949 checkUnnamed1716(o.quotaConsumed); | 1074 checkUnnamed1714(o.quotaConsumed); |
950 checkUnnamed1717(o.quotaMetrics); | 1075 checkUnnamed1715(o.quotaMetrics); |
951 } | 1076 } |
952 buildCounterQuotaInfo--; | 1077 buildCounterQuotaInfo--; |
953 } | 1078 } |
954 | 1079 |
955 buildUnnamed1718() { | 1080 buildUnnamed1716() { |
956 var o = new core.Map<core.String, core.String>(); | 1081 var o = new core.Map<core.String, core.String>(); |
957 o["x"] = "foo"; | 1082 o["x"] = "foo"; |
958 o["y"] = "foo"; | 1083 o["y"] = "foo"; |
959 return o; | 1084 return o; |
960 } | 1085 } |
961 | 1086 |
962 checkUnnamed1718(core.Map<core.String, core.String> o) { | 1087 checkUnnamed1716(core.Map<core.String, core.String> o) { |
963 unittest.expect(o, unittest.hasLength(2)); | 1088 unittest.expect(o, unittest.hasLength(2)); |
964 unittest.expect(o["x"], unittest.equals('foo')); | 1089 unittest.expect(o["x"], unittest.equals('foo')); |
965 unittest.expect(o["y"], unittest.equals('foo')); | 1090 unittest.expect(o["y"], unittest.equals('foo')); |
966 } | 1091 } |
967 | 1092 |
968 buildUnnamed1719() { | 1093 buildUnnamed1717() { |
969 var o = new core.List<api.MetricValueSet>(); | 1094 var o = new core.List<api.MetricValueSet>(); |
970 o.add(buildMetricValueSet()); | 1095 o.add(buildMetricValueSet()); |
971 o.add(buildMetricValueSet()); | 1096 o.add(buildMetricValueSet()); |
972 return o; | 1097 return o; |
973 } | 1098 } |
974 | 1099 |
975 checkUnnamed1719(core.List<api.MetricValueSet> o) { | 1100 checkUnnamed1717(core.List<api.MetricValueSet> o) { |
976 unittest.expect(o, unittest.hasLength(2)); | 1101 unittest.expect(o, unittest.hasLength(2)); |
977 checkMetricValueSet(o[0]); | 1102 checkMetricValueSet(o[0]); |
978 checkMetricValueSet(o[1]); | 1103 checkMetricValueSet(o[1]); |
979 } | 1104 } |
980 | 1105 |
981 core.int buildCounterQuotaOperation = 0; | 1106 core.int buildCounterQuotaOperation = 0; |
982 buildQuotaOperation() { | 1107 buildQuotaOperation() { |
983 var o = new api.QuotaOperation(); | 1108 var o = new api.QuotaOperation(); |
984 buildCounterQuotaOperation++; | 1109 buildCounterQuotaOperation++; |
985 if (buildCounterQuotaOperation < 3) { | 1110 if (buildCounterQuotaOperation < 3) { |
986 o.consumerId = "foo"; | 1111 o.consumerId = "foo"; |
987 o.labels = buildUnnamed1718(); | 1112 o.labels = buildUnnamed1716(); |
988 o.methodName = "foo"; | 1113 o.methodName = "foo"; |
989 o.operationId = "foo"; | 1114 o.operationId = "foo"; |
990 o.quotaMetrics = buildUnnamed1719(); | 1115 o.quotaMetrics = buildUnnamed1717(); |
991 o.quotaMode = "foo"; | 1116 o.quotaMode = "foo"; |
992 } | 1117 } |
993 buildCounterQuotaOperation--; | 1118 buildCounterQuotaOperation--; |
994 return o; | 1119 return o; |
995 } | 1120 } |
996 | 1121 |
997 checkQuotaOperation(api.QuotaOperation o) { | 1122 checkQuotaOperation(api.QuotaOperation o) { |
998 buildCounterQuotaOperation++; | 1123 buildCounterQuotaOperation++; |
999 if (buildCounterQuotaOperation < 3) { | 1124 if (buildCounterQuotaOperation < 3) { |
1000 unittest.expect(o.consumerId, unittest.equals('foo')); | 1125 unittest.expect(o.consumerId, unittest.equals('foo')); |
1001 checkUnnamed1718(o.labels); | 1126 checkUnnamed1716(o.labels); |
1002 unittest.expect(o.methodName, unittest.equals('foo')); | 1127 unittest.expect(o.methodName, unittest.equals('foo')); |
1003 unittest.expect(o.operationId, unittest.equals('foo')); | 1128 unittest.expect(o.operationId, unittest.equals('foo')); |
1004 checkUnnamed1719(o.quotaMetrics); | 1129 checkUnnamed1717(o.quotaMetrics); |
1005 unittest.expect(o.quotaMode, unittest.equals('foo')); | 1130 unittest.expect(o.quotaMode, unittest.equals('foo')); |
1006 } | 1131 } |
1007 buildCounterQuotaOperation--; | 1132 buildCounterQuotaOperation--; |
1008 } | 1133 } |
1009 | 1134 |
1010 buildUnnamed1720() { | 1135 buildUnnamed1718() { |
1011 var o = new core.Map<core.String, core.String>(); | 1136 var o = new core.Map<core.String, core.String>(); |
1012 o["x"] = "foo"; | 1137 o["x"] = "foo"; |
1013 o["y"] = "foo"; | 1138 o["y"] = "foo"; |
1014 return o; | 1139 return o; |
1015 } | 1140 } |
1016 | 1141 |
1017 checkUnnamed1720(core.Map<core.String, core.String> o) { | 1142 checkUnnamed1718(core.Map<core.String, core.String> o) { |
1018 unittest.expect(o, unittest.hasLength(2)); | 1143 unittest.expect(o, unittest.hasLength(2)); |
1019 unittest.expect(o["x"], unittest.equals('foo')); | 1144 unittest.expect(o["x"], unittest.equals('foo')); |
1020 unittest.expect(o["y"], unittest.equals('foo')); | 1145 unittest.expect(o["y"], unittest.equals('foo')); |
1021 } | 1146 } |
1022 | 1147 |
1023 core.int buildCounterQuotaProperties = 0; | 1148 core.int buildCounterQuotaProperties = 0; |
1024 buildQuotaProperties() { | 1149 buildQuotaProperties() { |
1025 var o = new api.QuotaProperties(); | 1150 var o = new api.QuotaProperties(); |
1026 buildCounterQuotaProperties++; | 1151 buildCounterQuotaProperties++; |
1027 if (buildCounterQuotaProperties < 3) { | 1152 if (buildCounterQuotaProperties < 3) { |
1028 o.limitByIds = buildUnnamed1720(); | 1153 o.limitByIds = buildUnnamed1718(); |
1029 o.quotaMode = "foo"; | 1154 o.quotaMode = "foo"; |
1030 } | 1155 } |
1031 buildCounterQuotaProperties--; | 1156 buildCounterQuotaProperties--; |
1032 return o; | 1157 return o; |
1033 } | 1158 } |
1034 | 1159 |
1035 checkQuotaProperties(api.QuotaProperties o) { | 1160 checkQuotaProperties(api.QuotaProperties o) { |
1036 buildCounterQuotaProperties++; | 1161 buildCounterQuotaProperties++; |
1037 if (buildCounterQuotaProperties < 3) { | 1162 if (buildCounterQuotaProperties < 3) { |
1038 checkUnnamed1720(o.limitByIds); | 1163 checkUnnamed1718(o.limitByIds); |
1039 unittest.expect(o.quotaMode, unittest.equals('foo')); | 1164 unittest.expect(o.quotaMode, unittest.equals('foo')); |
1040 } | 1165 } |
1041 buildCounterQuotaProperties--; | 1166 buildCounterQuotaProperties--; |
1042 } | 1167 } |
1043 | 1168 |
1044 core.int buildCounterReleaseQuotaRequest = 0; | 1169 core.int buildCounterReleaseQuotaRequest = 0; |
1045 buildReleaseQuotaRequest() { | 1170 buildReleaseQuotaRequest() { |
1046 var o = new api.ReleaseQuotaRequest(); | 1171 var o = new api.ReleaseQuotaRequest(); |
1047 buildCounterReleaseQuotaRequest++; | 1172 buildCounterReleaseQuotaRequest++; |
1048 if (buildCounterReleaseQuotaRequest < 3) { | 1173 if (buildCounterReleaseQuotaRequest < 3) { |
1049 o.releaseOperation = buildQuotaOperation(); | 1174 o.releaseOperation = buildQuotaOperation(); |
1050 o.serviceConfigId = "foo"; | 1175 o.serviceConfigId = "foo"; |
1051 } | 1176 } |
1052 buildCounterReleaseQuotaRequest--; | 1177 buildCounterReleaseQuotaRequest--; |
1053 return o; | 1178 return o; |
1054 } | 1179 } |
1055 | 1180 |
1056 checkReleaseQuotaRequest(api.ReleaseQuotaRequest o) { | 1181 checkReleaseQuotaRequest(api.ReleaseQuotaRequest o) { |
1057 buildCounterReleaseQuotaRequest++; | 1182 buildCounterReleaseQuotaRequest++; |
1058 if (buildCounterReleaseQuotaRequest < 3) { | 1183 if (buildCounterReleaseQuotaRequest < 3) { |
1059 checkQuotaOperation(o.releaseOperation); | 1184 checkQuotaOperation(o.releaseOperation); |
1060 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1185 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1061 } | 1186 } |
1062 buildCounterReleaseQuotaRequest--; | 1187 buildCounterReleaseQuotaRequest--; |
1063 } | 1188 } |
1064 | 1189 |
1065 buildUnnamed1721() { | 1190 buildUnnamed1719() { |
1066 var o = new core.List<api.MetricValueSet>(); | 1191 var o = new core.List<api.MetricValueSet>(); |
1067 o.add(buildMetricValueSet()); | 1192 o.add(buildMetricValueSet()); |
1068 o.add(buildMetricValueSet()); | 1193 o.add(buildMetricValueSet()); |
1069 return o; | 1194 return o; |
1070 } | 1195 } |
1071 | 1196 |
1072 checkUnnamed1721(core.List<api.MetricValueSet> o) { | 1197 checkUnnamed1719(core.List<api.MetricValueSet> o) { |
1073 unittest.expect(o, unittest.hasLength(2)); | 1198 unittest.expect(o, unittest.hasLength(2)); |
1074 checkMetricValueSet(o[0]); | 1199 checkMetricValueSet(o[0]); |
1075 checkMetricValueSet(o[1]); | 1200 checkMetricValueSet(o[1]); |
1076 } | 1201 } |
1077 | 1202 |
1078 buildUnnamed1722() { | 1203 buildUnnamed1720() { |
1079 var o = new core.List<api.QuotaError>(); | 1204 var o = new core.List<api.QuotaError>(); |
1080 o.add(buildQuotaError()); | 1205 o.add(buildQuotaError()); |
1081 o.add(buildQuotaError()); | 1206 o.add(buildQuotaError()); |
1082 return o; | 1207 return o; |
1083 } | 1208 } |
1084 | 1209 |
1085 checkUnnamed1722(core.List<api.QuotaError> o) { | 1210 checkUnnamed1720(core.List<api.QuotaError> o) { |
1086 unittest.expect(o, unittest.hasLength(2)); | 1211 unittest.expect(o, unittest.hasLength(2)); |
1087 checkQuotaError(o[0]); | 1212 checkQuotaError(o[0]); |
1088 checkQuotaError(o[1]); | 1213 checkQuotaError(o[1]); |
1089 } | 1214 } |
1090 | 1215 |
1091 core.int buildCounterReleaseQuotaResponse = 0; | 1216 core.int buildCounterReleaseQuotaResponse = 0; |
1092 buildReleaseQuotaResponse() { | 1217 buildReleaseQuotaResponse() { |
1093 var o = new api.ReleaseQuotaResponse(); | 1218 var o = new api.ReleaseQuotaResponse(); |
1094 buildCounterReleaseQuotaResponse++; | 1219 buildCounterReleaseQuotaResponse++; |
1095 if (buildCounterReleaseQuotaResponse < 3) { | 1220 if (buildCounterReleaseQuotaResponse < 3) { |
1096 o.operationId = "foo"; | 1221 o.operationId = "foo"; |
1097 o.quotaMetrics = buildUnnamed1721(); | 1222 o.quotaMetrics = buildUnnamed1719(); |
1098 o.releaseErrors = buildUnnamed1722(); | 1223 o.releaseErrors = buildUnnamed1720(); |
1099 o.serviceConfigId = "foo"; | 1224 o.serviceConfigId = "foo"; |
1100 } | 1225 } |
1101 buildCounterReleaseQuotaResponse--; | 1226 buildCounterReleaseQuotaResponse--; |
1102 return o; | 1227 return o; |
1103 } | 1228 } |
1104 | 1229 |
1105 checkReleaseQuotaResponse(api.ReleaseQuotaResponse o) { | 1230 checkReleaseQuotaResponse(api.ReleaseQuotaResponse o) { |
1106 buildCounterReleaseQuotaResponse++; | 1231 buildCounterReleaseQuotaResponse++; |
1107 if (buildCounterReleaseQuotaResponse < 3) { | 1232 if (buildCounterReleaseQuotaResponse < 3) { |
1108 unittest.expect(o.operationId, unittest.equals('foo')); | 1233 unittest.expect(o.operationId, unittest.equals('foo')); |
1109 checkUnnamed1721(o.quotaMetrics); | 1234 checkUnnamed1719(o.quotaMetrics); |
1110 checkUnnamed1722(o.releaseErrors); | 1235 checkUnnamed1720(o.releaseErrors); |
1111 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1236 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1112 } | 1237 } |
1113 buildCounterReleaseQuotaResponse--; | 1238 buildCounterReleaseQuotaResponse--; |
1114 } | 1239 } |
1115 | 1240 |
1116 core.int buildCounterReportError = 0; | 1241 core.int buildCounterReportError = 0; |
1117 buildReportError() { | 1242 buildReportError() { |
1118 var o = new api.ReportError(); | 1243 var o = new api.ReportError(); |
1119 buildCounterReportError++; | 1244 buildCounterReportError++; |
1120 if (buildCounterReportError < 3) { | 1245 if (buildCounterReportError < 3) { |
(...skipping 27 matching lines...) Expand all Loading... |
1148 | 1273 |
1149 checkReportInfo(api.ReportInfo o) { | 1274 checkReportInfo(api.ReportInfo o) { |
1150 buildCounterReportInfo++; | 1275 buildCounterReportInfo++; |
1151 if (buildCounterReportInfo < 3) { | 1276 if (buildCounterReportInfo < 3) { |
1152 unittest.expect(o.operationId, unittest.equals('foo')); | 1277 unittest.expect(o.operationId, unittest.equals('foo')); |
1153 checkQuotaInfo(o.quotaInfo); | 1278 checkQuotaInfo(o.quotaInfo); |
1154 } | 1279 } |
1155 buildCounterReportInfo--; | 1280 buildCounterReportInfo--; |
1156 } | 1281 } |
1157 | 1282 |
1158 buildUnnamed1723() { | 1283 buildUnnamed1721() { |
1159 var o = new core.List<api.Operation>(); | 1284 var o = new core.List<api.Operation>(); |
1160 o.add(buildOperation()); | 1285 o.add(buildOperation()); |
1161 o.add(buildOperation()); | 1286 o.add(buildOperation()); |
1162 return o; | 1287 return o; |
1163 } | 1288 } |
1164 | 1289 |
1165 checkUnnamed1723(core.List<api.Operation> o) { | 1290 checkUnnamed1721(core.List<api.Operation> o) { |
1166 unittest.expect(o, unittest.hasLength(2)); | 1291 unittest.expect(o, unittest.hasLength(2)); |
1167 checkOperation(o[0]); | 1292 checkOperation(o[0]); |
1168 checkOperation(o[1]); | 1293 checkOperation(o[1]); |
1169 } | 1294 } |
1170 | 1295 |
1171 core.int buildCounterReportRequest = 0; | 1296 core.int buildCounterReportRequest = 0; |
1172 buildReportRequest() { | 1297 buildReportRequest() { |
1173 var o = new api.ReportRequest(); | 1298 var o = new api.ReportRequest(); |
1174 buildCounterReportRequest++; | 1299 buildCounterReportRequest++; |
1175 if (buildCounterReportRequest < 3) { | 1300 if (buildCounterReportRequest < 3) { |
1176 o.operations = buildUnnamed1723(); | 1301 o.operations = buildUnnamed1721(); |
1177 o.serviceConfigId = "foo"; | 1302 o.serviceConfigId = "foo"; |
1178 } | 1303 } |
1179 buildCounterReportRequest--; | 1304 buildCounterReportRequest--; |
1180 return o; | 1305 return o; |
1181 } | 1306 } |
1182 | 1307 |
1183 checkReportRequest(api.ReportRequest o) { | 1308 checkReportRequest(api.ReportRequest o) { |
1184 buildCounterReportRequest++; | 1309 buildCounterReportRequest++; |
1185 if (buildCounterReportRequest < 3) { | 1310 if (buildCounterReportRequest < 3) { |
1186 checkUnnamed1723(o.operations); | 1311 checkUnnamed1721(o.operations); |
1187 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1312 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1188 } | 1313 } |
1189 buildCounterReportRequest--; | 1314 buildCounterReportRequest--; |
1190 } | 1315 } |
1191 | 1316 |
1192 buildUnnamed1724() { | 1317 buildUnnamed1722() { |
1193 var o = new core.List<api.ReportError>(); | 1318 var o = new core.List<api.ReportError>(); |
1194 o.add(buildReportError()); | 1319 o.add(buildReportError()); |
1195 o.add(buildReportError()); | 1320 o.add(buildReportError()); |
1196 return o; | 1321 return o; |
1197 } | 1322 } |
1198 | 1323 |
1199 checkUnnamed1724(core.List<api.ReportError> o) { | 1324 checkUnnamed1722(core.List<api.ReportError> o) { |
1200 unittest.expect(o, unittest.hasLength(2)); | 1325 unittest.expect(o, unittest.hasLength(2)); |
1201 checkReportError(o[0]); | 1326 checkReportError(o[0]); |
1202 checkReportError(o[1]); | 1327 checkReportError(o[1]); |
1203 } | 1328 } |
1204 | 1329 |
1205 buildUnnamed1725() { | 1330 buildUnnamed1723() { |
1206 var o = new core.List<api.ReportInfo>(); | 1331 var o = new core.List<api.ReportInfo>(); |
1207 o.add(buildReportInfo()); | 1332 o.add(buildReportInfo()); |
1208 o.add(buildReportInfo()); | 1333 o.add(buildReportInfo()); |
1209 return o; | 1334 return o; |
1210 } | 1335 } |
1211 | 1336 |
1212 checkUnnamed1725(core.List<api.ReportInfo> o) { | 1337 checkUnnamed1723(core.List<api.ReportInfo> o) { |
1213 unittest.expect(o, unittest.hasLength(2)); | 1338 unittest.expect(o, unittest.hasLength(2)); |
1214 checkReportInfo(o[0]); | 1339 checkReportInfo(o[0]); |
1215 checkReportInfo(o[1]); | 1340 checkReportInfo(o[1]); |
1216 } | 1341 } |
1217 | 1342 |
1218 core.int buildCounterReportResponse = 0; | 1343 core.int buildCounterReportResponse = 0; |
1219 buildReportResponse() { | 1344 buildReportResponse() { |
1220 var o = new api.ReportResponse(); | 1345 var o = new api.ReportResponse(); |
1221 buildCounterReportResponse++; | 1346 buildCounterReportResponse++; |
1222 if (buildCounterReportResponse < 3) { | 1347 if (buildCounterReportResponse < 3) { |
1223 o.reportErrors = buildUnnamed1724(); | 1348 o.reportErrors = buildUnnamed1722(); |
1224 o.reportInfos = buildUnnamed1725(); | 1349 o.reportInfos = buildUnnamed1723(); |
1225 o.serviceConfigId = "foo"; | 1350 o.serviceConfigId = "foo"; |
1226 } | 1351 } |
1227 buildCounterReportResponse--; | 1352 buildCounterReportResponse--; |
1228 return o; | 1353 return o; |
1229 } | 1354 } |
1230 | 1355 |
1231 checkReportResponse(api.ReportResponse o) { | 1356 checkReportResponse(api.ReportResponse o) { |
1232 buildCounterReportResponse++; | 1357 buildCounterReportResponse++; |
1233 if (buildCounterReportResponse < 3) { | 1358 if (buildCounterReportResponse < 3) { |
1234 checkUnnamed1724(o.reportErrors); | 1359 checkUnnamed1722(o.reportErrors); |
1235 checkUnnamed1725(o.reportInfos); | 1360 checkUnnamed1723(o.reportInfos); |
1236 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1361 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1237 } | 1362 } |
1238 buildCounterReportResponse--; | 1363 buildCounterReportResponse--; |
1239 } | 1364 } |
1240 | 1365 |
1241 core.int buildCounterRequestMetadata = 0; | 1366 core.int buildCounterRequestMetadata = 0; |
1242 buildRequestMetadata() { | 1367 buildRequestMetadata() { |
1243 var o = new api.RequestMetadata(); | 1368 var o = new api.RequestMetadata(); |
1244 buildCounterRequestMetadata++; | 1369 buildCounterRequestMetadata++; |
1245 if (buildCounterRequestMetadata < 3) { | 1370 if (buildCounterRequestMetadata < 3) { |
(...skipping 27 matching lines...) Expand all Loading... |
1273 | 1398 |
1274 checkStartReconciliationRequest(api.StartReconciliationRequest o) { | 1399 checkStartReconciliationRequest(api.StartReconciliationRequest o) { |
1275 buildCounterStartReconciliationRequest++; | 1400 buildCounterStartReconciliationRequest++; |
1276 if (buildCounterStartReconciliationRequest < 3) { | 1401 if (buildCounterStartReconciliationRequest < 3) { |
1277 checkQuotaOperation(o.reconciliationOperation); | 1402 checkQuotaOperation(o.reconciliationOperation); |
1278 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1403 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1279 } | 1404 } |
1280 buildCounterStartReconciliationRequest--; | 1405 buildCounterStartReconciliationRequest--; |
1281 } | 1406 } |
1282 | 1407 |
1283 buildUnnamed1726() { | 1408 buildUnnamed1724() { |
1284 var o = new core.List<api.MetricValueSet>(); | 1409 var o = new core.List<api.MetricValueSet>(); |
1285 o.add(buildMetricValueSet()); | 1410 o.add(buildMetricValueSet()); |
1286 o.add(buildMetricValueSet()); | 1411 o.add(buildMetricValueSet()); |
1287 return o; | 1412 return o; |
1288 } | 1413 } |
1289 | 1414 |
1290 checkUnnamed1726(core.List<api.MetricValueSet> o) { | 1415 checkUnnamed1724(core.List<api.MetricValueSet> o) { |
1291 unittest.expect(o, unittest.hasLength(2)); | 1416 unittest.expect(o, unittest.hasLength(2)); |
1292 checkMetricValueSet(o[0]); | 1417 checkMetricValueSet(o[0]); |
1293 checkMetricValueSet(o[1]); | 1418 checkMetricValueSet(o[1]); |
1294 } | 1419 } |
1295 | 1420 |
1296 buildUnnamed1727() { | 1421 buildUnnamed1725() { |
1297 var o = new core.List<api.QuotaError>(); | 1422 var o = new core.List<api.QuotaError>(); |
1298 o.add(buildQuotaError()); | 1423 o.add(buildQuotaError()); |
1299 o.add(buildQuotaError()); | 1424 o.add(buildQuotaError()); |
1300 return o; | 1425 return o; |
1301 } | 1426 } |
1302 | 1427 |
1303 checkUnnamed1727(core.List<api.QuotaError> o) { | 1428 checkUnnamed1725(core.List<api.QuotaError> o) { |
1304 unittest.expect(o, unittest.hasLength(2)); | 1429 unittest.expect(o, unittest.hasLength(2)); |
1305 checkQuotaError(o[0]); | 1430 checkQuotaError(o[0]); |
1306 checkQuotaError(o[1]); | 1431 checkQuotaError(o[1]); |
1307 } | 1432 } |
1308 | 1433 |
1309 core.int buildCounterStartReconciliationResponse = 0; | 1434 core.int buildCounterStartReconciliationResponse = 0; |
1310 buildStartReconciliationResponse() { | 1435 buildStartReconciliationResponse() { |
1311 var o = new api.StartReconciliationResponse(); | 1436 var o = new api.StartReconciliationResponse(); |
1312 buildCounterStartReconciliationResponse++; | 1437 buildCounterStartReconciliationResponse++; |
1313 if (buildCounterStartReconciliationResponse < 3) { | 1438 if (buildCounterStartReconciliationResponse < 3) { |
1314 o.operationId = "foo"; | 1439 o.operationId = "foo"; |
1315 o.quotaMetrics = buildUnnamed1726(); | 1440 o.quotaMetrics = buildUnnamed1724(); |
1316 o.reconciliationErrors = buildUnnamed1727(); | 1441 o.reconciliationErrors = buildUnnamed1725(); |
1317 o.serviceConfigId = "foo"; | 1442 o.serviceConfigId = "foo"; |
1318 } | 1443 } |
1319 buildCounterStartReconciliationResponse--; | 1444 buildCounterStartReconciliationResponse--; |
1320 return o; | 1445 return o; |
1321 } | 1446 } |
1322 | 1447 |
1323 checkStartReconciliationResponse(api.StartReconciliationResponse o) { | 1448 checkStartReconciliationResponse(api.StartReconciliationResponse o) { |
1324 buildCounterStartReconciliationResponse++; | 1449 buildCounterStartReconciliationResponse++; |
1325 if (buildCounterStartReconciliationResponse < 3) { | 1450 if (buildCounterStartReconciliationResponse < 3) { |
1326 unittest.expect(o.operationId, unittest.equals('foo')); | 1451 unittest.expect(o.operationId, unittest.equals('foo')); |
1327 checkUnnamed1726(o.quotaMetrics); | 1452 checkUnnamed1724(o.quotaMetrics); |
1328 checkUnnamed1727(o.reconciliationErrors); | 1453 checkUnnamed1725(o.reconciliationErrors); |
1329 unittest.expect(o.serviceConfigId, unittest.equals('foo')); | 1454 unittest.expect(o.serviceConfigId, unittest.equals('foo')); |
1330 } | 1455 } |
1331 buildCounterStartReconciliationResponse--; | 1456 buildCounterStartReconciliationResponse--; |
1332 } | 1457 } |
1333 | 1458 |
1334 buildUnnamed1728() { | 1459 buildUnnamed1726() { |
1335 var o = new core.Map<core.String, core.Object>(); | 1460 var o = new core.Map<core.String, core.Object>(); |
1336 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1461 o["x"] = { |
1337 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1462 'list': [1, 2, 3], |
| 1463 'bool': true, |
| 1464 'string': 'foo' |
| 1465 }; |
| 1466 o["y"] = { |
| 1467 'list': [1, 2, 3], |
| 1468 'bool': true, |
| 1469 'string': 'foo' |
| 1470 }; |
1338 return o; | 1471 return o; |
1339 } | 1472 } |
1340 | 1473 |
1341 checkUnnamed1728(core.Map<core.String, core.Object> o) { | 1474 checkUnnamed1726(core.Map<core.String, core.Object> o) { |
1342 unittest.expect(o, unittest.hasLength(2)); | 1475 unittest.expect(o, unittest.hasLength(2)); |
1343 var casted11 = (o["x"]) as core.Map; unittest.expect(casted11, unittest.hasLen
gth(3)); unittest.expect(casted11["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted11["bool"], unittest.equals(true)); unittest.expect(casted11["stri
ng"], unittest.equals('foo')); | 1476 var casted13 = (o["x"]) as core.Map; |
1344 var casted12 = (o["y"]) as core.Map; unittest.expect(casted12, unittest.hasLen
gth(3)); unittest.expect(casted12["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted12["bool"], unittest.equals(true)); unittest.expect(casted12["stri
ng"], unittest.equals('foo')); | 1477 unittest.expect(casted13, unittest.hasLength(3)); |
| 1478 unittest.expect(casted13["list"], unittest.equals([1, 2, 3])); |
| 1479 unittest.expect(casted13["bool"], unittest.equals(true)); |
| 1480 unittest.expect(casted13["string"], unittest.equals('foo')); |
| 1481 var casted14 = (o["y"]) as core.Map; |
| 1482 unittest.expect(casted14, unittest.hasLength(3)); |
| 1483 unittest.expect(casted14["list"], unittest.equals([1, 2, 3])); |
| 1484 unittest.expect(casted14["bool"], unittest.equals(true)); |
| 1485 unittest.expect(casted14["string"], unittest.equals('foo')); |
1345 } | 1486 } |
1346 | 1487 |
1347 buildUnnamed1729() { | 1488 buildUnnamed1727() { |
1348 var o = new core.List<core.Map<core.String, core.Object>>(); | 1489 var o = new core.List<core.Map<core.String, core.Object>>(); |
1349 o.add(buildUnnamed1728()); | 1490 o.add(buildUnnamed1726()); |
1350 o.add(buildUnnamed1728()); | 1491 o.add(buildUnnamed1726()); |
1351 return o; | 1492 return o; |
1352 } | 1493 } |
1353 | 1494 |
1354 checkUnnamed1729(core.List<core.Map<core.String, core.Object>> o) { | 1495 checkUnnamed1727(core.List<core.Map<core.String, core.Object>> o) { |
1355 unittest.expect(o, unittest.hasLength(2)); | 1496 unittest.expect(o, unittest.hasLength(2)); |
1356 checkUnnamed1728(o[0]); | 1497 checkUnnamed1726(o[0]); |
1357 checkUnnamed1728(o[1]); | 1498 checkUnnamed1726(o[1]); |
1358 } | 1499 } |
1359 | 1500 |
1360 core.int buildCounterStatus = 0; | 1501 core.int buildCounterStatus = 0; |
1361 buildStatus() { | 1502 buildStatus() { |
1362 var o = new api.Status(); | 1503 var o = new api.Status(); |
1363 buildCounterStatus++; | 1504 buildCounterStatus++; |
1364 if (buildCounterStatus < 3) { | 1505 if (buildCounterStatus < 3) { |
1365 o.code = 42; | 1506 o.code = 42; |
1366 o.details = buildUnnamed1729(); | 1507 o.details = buildUnnamed1727(); |
1367 o.message = "foo"; | 1508 o.message = "foo"; |
1368 } | 1509 } |
1369 buildCounterStatus--; | 1510 buildCounterStatus--; |
1370 return o; | 1511 return o; |
1371 } | 1512 } |
1372 | 1513 |
1373 checkStatus(api.Status o) { | 1514 checkStatus(api.Status o) { |
1374 buildCounterStatus++; | 1515 buildCounterStatus++; |
1375 if (buildCounterStatus < 3) { | 1516 if (buildCounterStatus < 3) { |
1376 unittest.expect(o.code, unittest.equals(42)); | 1517 unittest.expect(o.code, unittest.equals(42)); |
1377 checkUnnamed1729(o.details); | 1518 checkUnnamed1727(o.details); |
1378 unittest.expect(o.message, unittest.equals('foo')); | 1519 unittest.expect(o.message, unittest.equals('foo')); |
1379 } | 1520 } |
1380 buildCounterStatus--; | 1521 buildCounterStatus--; |
1381 } | 1522 } |
1382 | 1523 |
1383 | |
1384 main() { | 1524 main() { |
1385 unittest.group("obj-schema-AllocateQuotaRequest", () { | 1525 unittest.group("obj-schema-AllocateQuotaRequest", () { |
1386 unittest.test("to-json--from-json", () { | 1526 unittest.test("to-json--from-json", () { |
1387 var o = buildAllocateQuotaRequest(); | 1527 var o = buildAllocateQuotaRequest(); |
1388 var od = new api.AllocateQuotaRequest.fromJson(o.toJson()); | 1528 var od = new api.AllocateQuotaRequest.fromJson(o.toJson()); |
1389 checkAllocateQuotaRequest(od); | 1529 checkAllocateQuotaRequest(od); |
1390 }); | 1530 }); |
1391 }); | 1531 }); |
1392 | 1532 |
1393 | |
1394 unittest.group("obj-schema-AllocateQuotaResponse", () { | 1533 unittest.group("obj-schema-AllocateQuotaResponse", () { |
1395 unittest.test("to-json--from-json", () { | 1534 unittest.test("to-json--from-json", () { |
1396 var o = buildAllocateQuotaResponse(); | 1535 var o = buildAllocateQuotaResponse(); |
1397 var od = new api.AllocateQuotaResponse.fromJson(o.toJson()); | 1536 var od = new api.AllocateQuotaResponse.fromJson(o.toJson()); |
1398 checkAllocateQuotaResponse(od); | 1537 checkAllocateQuotaResponse(od); |
1399 }); | 1538 }); |
1400 }); | 1539 }); |
1401 | 1540 |
1402 | |
1403 unittest.group("obj-schema-AuditLog", () { | 1541 unittest.group("obj-schema-AuditLog", () { |
1404 unittest.test("to-json--from-json", () { | 1542 unittest.test("to-json--from-json", () { |
1405 var o = buildAuditLog(); | 1543 var o = buildAuditLog(); |
1406 var od = new api.AuditLog.fromJson(o.toJson()); | 1544 var od = new api.AuditLog.fromJson(o.toJson()); |
1407 checkAuditLog(od); | 1545 checkAuditLog(od); |
1408 }); | 1546 }); |
1409 }); | 1547 }); |
1410 | 1548 |
1411 | |
1412 unittest.group("obj-schema-AuthenticationInfo", () { | 1549 unittest.group("obj-schema-AuthenticationInfo", () { |
1413 unittest.test("to-json--from-json", () { | 1550 unittest.test("to-json--from-json", () { |
1414 var o = buildAuthenticationInfo(); | 1551 var o = buildAuthenticationInfo(); |
1415 var od = new api.AuthenticationInfo.fromJson(o.toJson()); | 1552 var od = new api.AuthenticationInfo.fromJson(o.toJson()); |
1416 checkAuthenticationInfo(od); | 1553 checkAuthenticationInfo(od); |
1417 }); | 1554 }); |
1418 }); | 1555 }); |
1419 | 1556 |
1420 | |
1421 unittest.group("obj-schema-AuthorizationInfo", () { | 1557 unittest.group("obj-schema-AuthorizationInfo", () { |
1422 unittest.test("to-json--from-json", () { | 1558 unittest.test("to-json--from-json", () { |
1423 var o = buildAuthorizationInfo(); | 1559 var o = buildAuthorizationInfo(); |
1424 var od = new api.AuthorizationInfo.fromJson(o.toJson()); | 1560 var od = new api.AuthorizationInfo.fromJson(o.toJson()); |
1425 checkAuthorizationInfo(od); | 1561 checkAuthorizationInfo(od); |
1426 }); | 1562 }); |
1427 }); | 1563 }); |
1428 | 1564 |
1429 | |
1430 unittest.group("obj-schema-CheckError", () { | 1565 unittest.group("obj-schema-CheckError", () { |
1431 unittest.test("to-json--from-json", () { | 1566 unittest.test("to-json--from-json", () { |
1432 var o = buildCheckError(); | 1567 var o = buildCheckError(); |
1433 var od = new api.CheckError.fromJson(o.toJson()); | 1568 var od = new api.CheckError.fromJson(o.toJson()); |
1434 checkCheckError(od); | 1569 checkCheckError(od); |
1435 }); | 1570 }); |
1436 }); | 1571 }); |
1437 | 1572 |
1438 | |
1439 unittest.group("obj-schema-CheckInfo", () { | 1573 unittest.group("obj-schema-CheckInfo", () { |
1440 unittest.test("to-json--from-json", () { | 1574 unittest.test("to-json--from-json", () { |
1441 var o = buildCheckInfo(); | 1575 var o = buildCheckInfo(); |
1442 var od = new api.CheckInfo.fromJson(o.toJson()); | 1576 var od = new api.CheckInfo.fromJson(o.toJson()); |
1443 checkCheckInfo(od); | 1577 checkCheckInfo(od); |
1444 }); | 1578 }); |
1445 }); | 1579 }); |
1446 | 1580 |
1447 | |
1448 unittest.group("obj-schema-CheckRequest", () { | 1581 unittest.group("obj-schema-CheckRequest", () { |
1449 unittest.test("to-json--from-json", () { | 1582 unittest.test("to-json--from-json", () { |
1450 var o = buildCheckRequest(); | 1583 var o = buildCheckRequest(); |
1451 var od = new api.CheckRequest.fromJson(o.toJson()); | 1584 var od = new api.CheckRequest.fromJson(o.toJson()); |
1452 checkCheckRequest(od); | 1585 checkCheckRequest(od); |
1453 }); | 1586 }); |
1454 }); | 1587 }); |
1455 | 1588 |
1456 | |
1457 unittest.group("obj-schema-CheckResponse", () { | 1589 unittest.group("obj-schema-CheckResponse", () { |
1458 unittest.test("to-json--from-json", () { | 1590 unittest.test("to-json--from-json", () { |
1459 var o = buildCheckResponse(); | 1591 var o = buildCheckResponse(); |
1460 var od = new api.CheckResponse.fromJson(o.toJson()); | 1592 var od = new api.CheckResponse.fromJson(o.toJson()); |
1461 checkCheckResponse(od); | 1593 checkCheckResponse(od); |
1462 }); | 1594 }); |
1463 }); | 1595 }); |
1464 | 1596 |
1465 | |
1466 unittest.group("obj-schema-ConsumerInfo", () { | 1597 unittest.group("obj-schema-ConsumerInfo", () { |
1467 unittest.test("to-json--from-json", () { | 1598 unittest.test("to-json--from-json", () { |
1468 var o = buildConsumerInfo(); | 1599 var o = buildConsumerInfo(); |
1469 var od = new api.ConsumerInfo.fromJson(o.toJson()); | 1600 var od = new api.ConsumerInfo.fromJson(o.toJson()); |
1470 checkConsumerInfo(od); | 1601 checkConsumerInfo(od); |
1471 }); | 1602 }); |
1472 }); | 1603 }); |
1473 | 1604 |
1474 | |
1475 unittest.group("obj-schema-Distribution", () { | 1605 unittest.group("obj-schema-Distribution", () { |
1476 unittest.test("to-json--from-json", () { | 1606 unittest.test("to-json--from-json", () { |
1477 var o = buildDistribution(); | 1607 var o = buildDistribution(); |
1478 var od = new api.Distribution.fromJson(o.toJson()); | 1608 var od = new api.Distribution.fromJson(o.toJson()); |
1479 checkDistribution(od); | 1609 checkDistribution(od); |
1480 }); | 1610 }); |
1481 }); | 1611 }); |
1482 | 1612 |
1483 | |
1484 unittest.group("obj-schema-EndReconciliationRequest", () { | 1613 unittest.group("obj-schema-EndReconciliationRequest", () { |
1485 unittest.test("to-json--from-json", () { | 1614 unittest.test("to-json--from-json", () { |
1486 var o = buildEndReconciliationRequest(); | 1615 var o = buildEndReconciliationRequest(); |
1487 var od = new api.EndReconciliationRequest.fromJson(o.toJson()); | 1616 var od = new api.EndReconciliationRequest.fromJson(o.toJson()); |
1488 checkEndReconciliationRequest(od); | 1617 checkEndReconciliationRequest(od); |
1489 }); | 1618 }); |
1490 }); | 1619 }); |
1491 | 1620 |
1492 | |
1493 unittest.group("obj-schema-EndReconciliationResponse", () { | 1621 unittest.group("obj-schema-EndReconciliationResponse", () { |
1494 unittest.test("to-json--from-json", () { | 1622 unittest.test("to-json--from-json", () { |
1495 var o = buildEndReconciliationResponse(); | 1623 var o = buildEndReconciliationResponse(); |
1496 var od = new api.EndReconciliationResponse.fromJson(o.toJson()); | 1624 var od = new api.EndReconciliationResponse.fromJson(o.toJson()); |
1497 checkEndReconciliationResponse(od); | 1625 checkEndReconciliationResponse(od); |
1498 }); | 1626 }); |
1499 }); | 1627 }); |
1500 | 1628 |
1501 | |
1502 unittest.group("obj-schema-ExplicitBuckets", () { | 1629 unittest.group("obj-schema-ExplicitBuckets", () { |
1503 unittest.test("to-json--from-json", () { | 1630 unittest.test("to-json--from-json", () { |
1504 var o = buildExplicitBuckets(); | 1631 var o = buildExplicitBuckets(); |
1505 var od = new api.ExplicitBuckets.fromJson(o.toJson()); | 1632 var od = new api.ExplicitBuckets.fromJson(o.toJson()); |
1506 checkExplicitBuckets(od); | 1633 checkExplicitBuckets(od); |
1507 }); | 1634 }); |
1508 }); | 1635 }); |
1509 | 1636 |
1510 | |
1511 unittest.group("obj-schema-ExponentialBuckets", () { | 1637 unittest.group("obj-schema-ExponentialBuckets", () { |
1512 unittest.test("to-json--from-json", () { | 1638 unittest.test("to-json--from-json", () { |
1513 var o = buildExponentialBuckets(); | 1639 var o = buildExponentialBuckets(); |
1514 var od = new api.ExponentialBuckets.fromJson(o.toJson()); | 1640 var od = new api.ExponentialBuckets.fromJson(o.toJson()); |
1515 checkExponentialBuckets(od); | 1641 checkExponentialBuckets(od); |
1516 }); | 1642 }); |
1517 }); | 1643 }); |
1518 | 1644 |
1519 | |
1520 unittest.group("obj-schema-LinearBuckets", () { | 1645 unittest.group("obj-schema-LinearBuckets", () { |
1521 unittest.test("to-json--from-json", () { | 1646 unittest.test("to-json--from-json", () { |
1522 var o = buildLinearBuckets(); | 1647 var o = buildLinearBuckets(); |
1523 var od = new api.LinearBuckets.fromJson(o.toJson()); | 1648 var od = new api.LinearBuckets.fromJson(o.toJson()); |
1524 checkLinearBuckets(od); | 1649 checkLinearBuckets(od); |
1525 }); | 1650 }); |
1526 }); | 1651 }); |
1527 | 1652 |
1528 | |
1529 unittest.group("obj-schema-LogEntry", () { | 1653 unittest.group("obj-schema-LogEntry", () { |
1530 unittest.test("to-json--from-json", () { | 1654 unittest.test("to-json--from-json", () { |
1531 var o = buildLogEntry(); | 1655 var o = buildLogEntry(); |
1532 var od = new api.LogEntry.fromJson(o.toJson()); | 1656 var od = new api.LogEntry.fromJson(o.toJson()); |
1533 checkLogEntry(od); | 1657 checkLogEntry(od); |
1534 }); | 1658 }); |
1535 }); | 1659 }); |
1536 | 1660 |
1537 | |
1538 unittest.group("obj-schema-MetricValue", () { | 1661 unittest.group("obj-schema-MetricValue", () { |
1539 unittest.test("to-json--from-json", () { | 1662 unittest.test("to-json--from-json", () { |
1540 var o = buildMetricValue(); | 1663 var o = buildMetricValue(); |
1541 var od = new api.MetricValue.fromJson(o.toJson()); | 1664 var od = new api.MetricValue.fromJson(o.toJson()); |
1542 checkMetricValue(od); | 1665 checkMetricValue(od); |
1543 }); | 1666 }); |
1544 }); | 1667 }); |
1545 | 1668 |
1546 | |
1547 unittest.group("obj-schema-MetricValueSet", () { | 1669 unittest.group("obj-schema-MetricValueSet", () { |
1548 unittest.test("to-json--from-json", () { | 1670 unittest.test("to-json--from-json", () { |
1549 var o = buildMetricValueSet(); | 1671 var o = buildMetricValueSet(); |
1550 var od = new api.MetricValueSet.fromJson(o.toJson()); | 1672 var od = new api.MetricValueSet.fromJson(o.toJson()); |
1551 checkMetricValueSet(od); | 1673 checkMetricValueSet(od); |
1552 }); | 1674 }); |
1553 }); | 1675 }); |
1554 | 1676 |
1555 | |
1556 unittest.group("obj-schema-Money", () { | 1677 unittest.group("obj-schema-Money", () { |
1557 unittest.test("to-json--from-json", () { | 1678 unittest.test("to-json--from-json", () { |
1558 var o = buildMoney(); | 1679 var o = buildMoney(); |
1559 var od = new api.Money.fromJson(o.toJson()); | 1680 var od = new api.Money.fromJson(o.toJson()); |
1560 checkMoney(od); | 1681 checkMoney(od); |
1561 }); | 1682 }); |
1562 }); | 1683 }); |
1563 | 1684 |
1564 | |
1565 unittest.group("obj-schema-Operation", () { | 1685 unittest.group("obj-schema-Operation", () { |
1566 unittest.test("to-json--from-json", () { | 1686 unittest.test("to-json--from-json", () { |
1567 var o = buildOperation(); | 1687 var o = buildOperation(); |
1568 var od = new api.Operation.fromJson(o.toJson()); | 1688 var od = new api.Operation.fromJson(o.toJson()); |
1569 checkOperation(od); | 1689 checkOperation(od); |
1570 }); | 1690 }); |
1571 }); | 1691 }); |
1572 | 1692 |
1573 | |
1574 unittest.group("obj-schema-QuotaError", () { | 1693 unittest.group("obj-schema-QuotaError", () { |
1575 unittest.test("to-json--from-json", () { | 1694 unittest.test("to-json--from-json", () { |
1576 var o = buildQuotaError(); | 1695 var o = buildQuotaError(); |
1577 var od = new api.QuotaError.fromJson(o.toJson()); | 1696 var od = new api.QuotaError.fromJson(o.toJson()); |
1578 checkQuotaError(od); | 1697 checkQuotaError(od); |
1579 }); | 1698 }); |
1580 }); | 1699 }); |
1581 | 1700 |
1582 | |
1583 unittest.group("obj-schema-QuotaInfo", () { | 1701 unittest.group("obj-schema-QuotaInfo", () { |
1584 unittest.test("to-json--from-json", () { | 1702 unittest.test("to-json--from-json", () { |
1585 var o = buildQuotaInfo(); | 1703 var o = buildQuotaInfo(); |
1586 var od = new api.QuotaInfo.fromJson(o.toJson()); | 1704 var od = new api.QuotaInfo.fromJson(o.toJson()); |
1587 checkQuotaInfo(od); | 1705 checkQuotaInfo(od); |
1588 }); | 1706 }); |
1589 }); | 1707 }); |
1590 | 1708 |
1591 | |
1592 unittest.group("obj-schema-QuotaOperation", () { | 1709 unittest.group("obj-schema-QuotaOperation", () { |
1593 unittest.test("to-json--from-json", () { | 1710 unittest.test("to-json--from-json", () { |
1594 var o = buildQuotaOperation(); | 1711 var o = buildQuotaOperation(); |
1595 var od = new api.QuotaOperation.fromJson(o.toJson()); | 1712 var od = new api.QuotaOperation.fromJson(o.toJson()); |
1596 checkQuotaOperation(od); | 1713 checkQuotaOperation(od); |
1597 }); | 1714 }); |
1598 }); | 1715 }); |
1599 | 1716 |
1600 | |
1601 unittest.group("obj-schema-QuotaProperties", () { | 1717 unittest.group("obj-schema-QuotaProperties", () { |
1602 unittest.test("to-json--from-json", () { | 1718 unittest.test("to-json--from-json", () { |
1603 var o = buildQuotaProperties(); | 1719 var o = buildQuotaProperties(); |
1604 var od = new api.QuotaProperties.fromJson(o.toJson()); | 1720 var od = new api.QuotaProperties.fromJson(o.toJson()); |
1605 checkQuotaProperties(od); | 1721 checkQuotaProperties(od); |
1606 }); | 1722 }); |
1607 }); | 1723 }); |
1608 | 1724 |
1609 | |
1610 unittest.group("obj-schema-ReleaseQuotaRequest", () { | 1725 unittest.group("obj-schema-ReleaseQuotaRequest", () { |
1611 unittest.test("to-json--from-json", () { | 1726 unittest.test("to-json--from-json", () { |
1612 var o = buildReleaseQuotaRequest(); | 1727 var o = buildReleaseQuotaRequest(); |
1613 var od = new api.ReleaseQuotaRequest.fromJson(o.toJson()); | 1728 var od = new api.ReleaseQuotaRequest.fromJson(o.toJson()); |
1614 checkReleaseQuotaRequest(od); | 1729 checkReleaseQuotaRequest(od); |
1615 }); | 1730 }); |
1616 }); | 1731 }); |
1617 | 1732 |
1618 | |
1619 unittest.group("obj-schema-ReleaseQuotaResponse", () { | 1733 unittest.group("obj-schema-ReleaseQuotaResponse", () { |
1620 unittest.test("to-json--from-json", () { | 1734 unittest.test("to-json--from-json", () { |
1621 var o = buildReleaseQuotaResponse(); | 1735 var o = buildReleaseQuotaResponse(); |
1622 var od = new api.ReleaseQuotaResponse.fromJson(o.toJson()); | 1736 var od = new api.ReleaseQuotaResponse.fromJson(o.toJson()); |
1623 checkReleaseQuotaResponse(od); | 1737 checkReleaseQuotaResponse(od); |
1624 }); | 1738 }); |
1625 }); | 1739 }); |
1626 | 1740 |
1627 | |
1628 unittest.group("obj-schema-ReportError", () { | 1741 unittest.group("obj-schema-ReportError", () { |
1629 unittest.test("to-json--from-json", () { | 1742 unittest.test("to-json--from-json", () { |
1630 var o = buildReportError(); | 1743 var o = buildReportError(); |
1631 var od = new api.ReportError.fromJson(o.toJson()); | 1744 var od = new api.ReportError.fromJson(o.toJson()); |
1632 checkReportError(od); | 1745 checkReportError(od); |
1633 }); | 1746 }); |
1634 }); | 1747 }); |
1635 | 1748 |
1636 | |
1637 unittest.group("obj-schema-ReportInfo", () { | 1749 unittest.group("obj-schema-ReportInfo", () { |
1638 unittest.test("to-json--from-json", () { | 1750 unittest.test("to-json--from-json", () { |
1639 var o = buildReportInfo(); | 1751 var o = buildReportInfo(); |
1640 var od = new api.ReportInfo.fromJson(o.toJson()); | 1752 var od = new api.ReportInfo.fromJson(o.toJson()); |
1641 checkReportInfo(od); | 1753 checkReportInfo(od); |
1642 }); | 1754 }); |
1643 }); | 1755 }); |
1644 | 1756 |
1645 | |
1646 unittest.group("obj-schema-ReportRequest", () { | 1757 unittest.group("obj-schema-ReportRequest", () { |
1647 unittest.test("to-json--from-json", () { | 1758 unittest.test("to-json--from-json", () { |
1648 var o = buildReportRequest(); | 1759 var o = buildReportRequest(); |
1649 var od = new api.ReportRequest.fromJson(o.toJson()); | 1760 var od = new api.ReportRequest.fromJson(o.toJson()); |
1650 checkReportRequest(od); | 1761 checkReportRequest(od); |
1651 }); | 1762 }); |
1652 }); | 1763 }); |
1653 | 1764 |
1654 | |
1655 unittest.group("obj-schema-ReportResponse", () { | 1765 unittest.group("obj-schema-ReportResponse", () { |
1656 unittest.test("to-json--from-json", () { | 1766 unittest.test("to-json--from-json", () { |
1657 var o = buildReportResponse(); | 1767 var o = buildReportResponse(); |
1658 var od = new api.ReportResponse.fromJson(o.toJson()); | 1768 var od = new api.ReportResponse.fromJson(o.toJson()); |
1659 checkReportResponse(od); | 1769 checkReportResponse(od); |
1660 }); | 1770 }); |
1661 }); | 1771 }); |
1662 | 1772 |
1663 | |
1664 unittest.group("obj-schema-RequestMetadata", () { | 1773 unittest.group("obj-schema-RequestMetadata", () { |
1665 unittest.test("to-json--from-json", () { | 1774 unittest.test("to-json--from-json", () { |
1666 var o = buildRequestMetadata(); | 1775 var o = buildRequestMetadata(); |
1667 var od = new api.RequestMetadata.fromJson(o.toJson()); | 1776 var od = new api.RequestMetadata.fromJson(o.toJson()); |
1668 checkRequestMetadata(od); | 1777 checkRequestMetadata(od); |
1669 }); | 1778 }); |
1670 }); | 1779 }); |
1671 | 1780 |
1672 | |
1673 unittest.group("obj-schema-StartReconciliationRequest", () { | 1781 unittest.group("obj-schema-StartReconciliationRequest", () { |
1674 unittest.test("to-json--from-json", () { | 1782 unittest.test("to-json--from-json", () { |
1675 var o = buildStartReconciliationRequest(); | 1783 var o = buildStartReconciliationRequest(); |
1676 var od = new api.StartReconciliationRequest.fromJson(o.toJson()); | 1784 var od = new api.StartReconciliationRequest.fromJson(o.toJson()); |
1677 checkStartReconciliationRequest(od); | 1785 checkStartReconciliationRequest(od); |
1678 }); | 1786 }); |
1679 }); | 1787 }); |
1680 | 1788 |
1681 | |
1682 unittest.group("obj-schema-StartReconciliationResponse", () { | 1789 unittest.group("obj-schema-StartReconciliationResponse", () { |
1683 unittest.test("to-json--from-json", () { | 1790 unittest.test("to-json--from-json", () { |
1684 var o = buildStartReconciliationResponse(); | 1791 var o = buildStartReconciliationResponse(); |
1685 var od = new api.StartReconciliationResponse.fromJson(o.toJson()); | 1792 var od = new api.StartReconciliationResponse.fromJson(o.toJson()); |
1686 checkStartReconciliationResponse(od); | 1793 checkStartReconciliationResponse(od); |
1687 }); | 1794 }); |
1688 }); | 1795 }); |
1689 | 1796 |
1690 | |
1691 unittest.group("obj-schema-Status", () { | 1797 unittest.group("obj-schema-Status", () { |
1692 unittest.test("to-json--from-json", () { | 1798 unittest.test("to-json--from-json", () { |
1693 var o = buildStatus(); | 1799 var o = buildStatus(); |
1694 var od = new api.Status.fromJson(o.toJson()); | 1800 var od = new api.Status.fromJson(o.toJson()); |
1695 checkStatus(od); | 1801 checkStatus(od); |
1696 }); | 1802 }); |
1697 }); | 1803 }); |
1698 | 1804 |
1699 | |
1700 unittest.group("resource-ServicesResourceApi", () { | 1805 unittest.group("resource-ServicesResourceApi", () { |
1701 unittest.test("method--allocateQuota", () { | 1806 unittest.test("method--allocateQuota", () { |
1702 | |
1703 var mock = new HttpServerMock(); | 1807 var mock = new HttpServerMock(); |
1704 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 1808 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1705 var arg_request = buildAllocateQuotaRequest(); | 1809 var arg_request = buildAllocateQuotaRequest(); |
1706 var arg_serviceName = "foo"; | 1810 var arg_serviceName = "foo"; |
1707 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1811 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1708 var obj = new api.AllocateQuotaRequest.fromJson(json); | 1812 var obj = new api.AllocateQuotaRequest.fromJson(json); |
1709 checkAllocateQuotaRequest(obj); | 1813 checkAllocateQuotaRequest(obj); |
1710 | 1814 |
1711 var path = (req.url).path; | 1815 var path = (req.url).path; |
1712 var pathOffset = 0; | 1816 var pathOffset = 0; |
1713 var index; | 1817 var index; |
1714 var subPart; | 1818 var subPart; |
1715 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1819 unittest.expect( |
| 1820 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1716 pathOffset += 1; | 1821 pathOffset += 1; |
1717 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 1822 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1823 unittest.equals("v1/services/")); |
1718 pathOffset += 12; | 1824 pathOffset += 12; |
1719 index = path.indexOf(":allocateQuota", pathOffset); | 1825 index = path.indexOf(":allocateQuota", pathOffset); |
1720 unittest.expect(index >= 0, unittest.isTrue); | 1826 unittest.expect(index >= 0, unittest.isTrue); |
1721 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1827 subPart = |
| 1828 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1722 pathOffset = index; | 1829 pathOffset = index; |
1723 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 1830 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1724 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals(":allocateQuota")); | 1831 unittest.expect(path.substring(pathOffset, pathOffset + 14), |
| 1832 unittest.equals(":allocateQuota")); |
1725 pathOffset += 14; | 1833 pathOffset += 14; |
1726 | 1834 |
1727 var query = (req.url).query; | 1835 var query = (req.url).query; |
1728 var queryOffset = 0; | 1836 var queryOffset = 0; |
1729 var queryMap = {}; | 1837 var queryMap = {}; |
1730 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1838 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1731 parseBool(n) { | 1839 parseBool(n) { |
1732 if (n == "true") return true; | 1840 if (n == "true") return true; |
1733 if (n == "false") return false; | 1841 if (n == "false") return false; |
1734 if (n == null) return null; | 1842 if (n == null) return null; |
1735 throw new core.ArgumentError("Invalid boolean: $n"); | 1843 throw new core.ArgumentError("Invalid boolean: $n"); |
1736 } | 1844 } |
| 1845 |
1737 if (query.length > 0) { | 1846 if (query.length > 0) { |
1738 for (var part in query.split("&")) { | 1847 for (var part in query.split("&")) { |
1739 var keyvalue = part.split("="); | 1848 var keyvalue = part.split("="); |
1740 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1849 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1850 core.Uri.decodeQueryComponent(keyvalue[1])); |
1741 } | 1851 } |
1742 } | 1852 } |
1743 | 1853 |
1744 | |
1745 var h = { | 1854 var h = { |
1746 "content-type" : "application/json; charset=utf-8", | 1855 "content-type": "application/json; charset=utf-8", |
1747 }; | 1856 }; |
1748 var resp = convert.JSON.encode(buildAllocateQuotaResponse()); | 1857 var resp = convert.JSON.encode(buildAllocateQuotaResponse()); |
1749 return new async.Future.value(stringResponse(200, h, resp)); | 1858 return new async.Future.value(stringResponse(200, h, resp)); |
1750 }), true); | 1859 }), true); |
1751 res.allocateQuota(arg_request, arg_serviceName).then(unittest.expectAsync1
(((api.AllocateQuotaResponse response) { | 1860 res |
| 1861 .allocateQuota(arg_request, arg_serviceName) |
| 1862 .then(unittest.expectAsync1(((api.AllocateQuotaResponse response) { |
1752 checkAllocateQuotaResponse(response); | 1863 checkAllocateQuotaResponse(response); |
1753 }))); | 1864 }))); |
1754 }); | 1865 }); |
1755 | 1866 |
1756 unittest.test("method--check", () { | 1867 unittest.test("method--check", () { |
1757 | |
1758 var mock = new HttpServerMock(); | 1868 var mock = new HttpServerMock(); |
1759 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 1869 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1760 var arg_request = buildCheckRequest(); | 1870 var arg_request = buildCheckRequest(); |
1761 var arg_serviceName = "foo"; | 1871 var arg_serviceName = "foo"; |
1762 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1872 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1763 var obj = new api.CheckRequest.fromJson(json); | 1873 var obj = new api.CheckRequest.fromJson(json); |
1764 checkCheckRequest(obj); | 1874 checkCheckRequest(obj); |
1765 | 1875 |
1766 var path = (req.url).path; | 1876 var path = (req.url).path; |
1767 var pathOffset = 0; | 1877 var pathOffset = 0; |
1768 var index; | 1878 var index; |
1769 var subPart; | 1879 var subPart; |
1770 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1880 unittest.expect( |
| 1881 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1771 pathOffset += 1; | 1882 pathOffset += 1; |
1772 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 1883 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1884 unittest.equals("v1/services/")); |
1773 pathOffset += 12; | 1885 pathOffset += 12; |
1774 index = path.indexOf(":check", pathOffset); | 1886 index = path.indexOf(":check", pathOffset); |
1775 unittest.expect(index >= 0, unittest.isTrue); | 1887 unittest.expect(index >= 0, unittest.isTrue); |
1776 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1888 subPart = |
| 1889 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1777 pathOffset = index; | 1890 pathOffset = index; |
1778 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 1891 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1779 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als(":check")); | 1892 unittest.expect(path.substring(pathOffset, pathOffset + 6), |
| 1893 unittest.equals(":check")); |
1780 pathOffset += 6; | 1894 pathOffset += 6; |
1781 | 1895 |
1782 var query = (req.url).query; | 1896 var query = (req.url).query; |
1783 var queryOffset = 0; | 1897 var queryOffset = 0; |
1784 var queryMap = {}; | 1898 var queryMap = {}; |
1785 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1899 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1786 parseBool(n) { | 1900 parseBool(n) { |
1787 if (n == "true") return true; | 1901 if (n == "true") return true; |
1788 if (n == "false") return false; | 1902 if (n == "false") return false; |
1789 if (n == null) return null; | 1903 if (n == null) return null; |
1790 throw new core.ArgumentError("Invalid boolean: $n"); | 1904 throw new core.ArgumentError("Invalid boolean: $n"); |
1791 } | 1905 } |
| 1906 |
1792 if (query.length > 0) { | 1907 if (query.length > 0) { |
1793 for (var part in query.split("&")) { | 1908 for (var part in query.split("&")) { |
1794 var keyvalue = part.split("="); | 1909 var keyvalue = part.split("="); |
1795 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1910 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1911 core.Uri.decodeQueryComponent(keyvalue[1])); |
1796 } | 1912 } |
1797 } | 1913 } |
1798 | 1914 |
1799 | |
1800 var h = { | 1915 var h = { |
1801 "content-type" : "application/json; charset=utf-8", | 1916 "content-type": "application/json; charset=utf-8", |
1802 }; | 1917 }; |
1803 var resp = convert.JSON.encode(buildCheckResponse()); | 1918 var resp = convert.JSON.encode(buildCheckResponse()); |
1804 return new async.Future.value(stringResponse(200, h, resp)); | 1919 return new async.Future.value(stringResponse(200, h, resp)); |
1805 }), true); | 1920 }), true); |
1806 res.check(arg_request, arg_serviceName).then(unittest.expectAsync1(((api.C
heckResponse response) { | 1921 res |
| 1922 .check(arg_request, arg_serviceName) |
| 1923 .then(unittest.expectAsync1(((api.CheckResponse response) { |
1807 checkCheckResponse(response); | 1924 checkCheckResponse(response); |
1808 }))); | 1925 }))); |
1809 }); | 1926 }); |
1810 | 1927 |
1811 unittest.test("method--endReconciliation", () { | 1928 unittest.test("method--endReconciliation", () { |
1812 | |
1813 var mock = new HttpServerMock(); | 1929 var mock = new HttpServerMock(); |
1814 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 1930 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1815 var arg_request = buildEndReconciliationRequest(); | 1931 var arg_request = buildEndReconciliationRequest(); |
1816 var arg_serviceName = "foo"; | 1932 var arg_serviceName = "foo"; |
1817 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1933 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1818 var obj = new api.EndReconciliationRequest.fromJson(json); | 1934 var obj = new api.EndReconciliationRequest.fromJson(json); |
1819 checkEndReconciliationRequest(obj); | 1935 checkEndReconciliationRequest(obj); |
1820 | 1936 |
1821 var path = (req.url).path; | 1937 var path = (req.url).path; |
1822 var pathOffset = 0; | 1938 var pathOffset = 0; |
1823 var index; | 1939 var index; |
1824 var subPart; | 1940 var subPart; |
1825 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1941 unittest.expect( |
| 1942 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1826 pathOffset += 1; | 1943 pathOffset += 1; |
1827 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 1944 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 1945 unittest.equals("v1/services/")); |
1828 pathOffset += 12; | 1946 pathOffset += 12; |
1829 index = path.indexOf(":endReconciliation", pathOffset); | 1947 index = path.indexOf(":endReconciliation", pathOffset); |
1830 unittest.expect(index >= 0, unittest.isTrue); | 1948 unittest.expect(index >= 0, unittest.isTrue); |
1831 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1949 subPart = |
| 1950 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1832 pathOffset = index; | 1951 pathOffset = index; |
1833 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 1952 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1834 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals(":endReconciliation")); | 1953 unittest.expect(path.substring(pathOffset, pathOffset + 18), |
| 1954 unittest.equals(":endReconciliation")); |
1835 pathOffset += 18; | 1955 pathOffset += 18; |
1836 | 1956 |
1837 var query = (req.url).query; | 1957 var query = (req.url).query; |
1838 var queryOffset = 0; | 1958 var queryOffset = 0; |
1839 var queryMap = {}; | 1959 var queryMap = {}; |
1840 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1960 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1841 parseBool(n) { | 1961 parseBool(n) { |
1842 if (n == "true") return true; | 1962 if (n == "true") return true; |
1843 if (n == "false") return false; | 1963 if (n == "false") return false; |
1844 if (n == null) return null; | 1964 if (n == null) return null; |
1845 throw new core.ArgumentError("Invalid boolean: $n"); | 1965 throw new core.ArgumentError("Invalid boolean: $n"); |
1846 } | 1966 } |
| 1967 |
1847 if (query.length > 0) { | 1968 if (query.length > 0) { |
1848 for (var part in query.split("&")) { | 1969 for (var part in query.split("&")) { |
1849 var keyvalue = part.split("="); | 1970 var keyvalue = part.split("="); |
1850 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1971 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1972 core.Uri.decodeQueryComponent(keyvalue[1])); |
1851 } | 1973 } |
1852 } | 1974 } |
1853 | 1975 |
1854 | |
1855 var h = { | 1976 var h = { |
1856 "content-type" : "application/json; charset=utf-8", | 1977 "content-type": "application/json; charset=utf-8", |
1857 }; | 1978 }; |
1858 var resp = convert.JSON.encode(buildEndReconciliationResponse()); | 1979 var resp = convert.JSON.encode(buildEndReconciliationResponse()); |
1859 return new async.Future.value(stringResponse(200, h, resp)); | 1980 return new async.Future.value(stringResponse(200, h, resp)); |
1860 }), true); | 1981 }), true); |
1861 res.endReconciliation(arg_request, arg_serviceName).then(unittest.expectAs
ync1(((api.EndReconciliationResponse response) { | 1982 res.endReconciliation(arg_request, arg_serviceName).then( |
| 1983 unittest.expectAsync1(((api.EndReconciliationResponse response) { |
1862 checkEndReconciliationResponse(response); | 1984 checkEndReconciliationResponse(response); |
1863 }))); | 1985 }))); |
1864 }); | 1986 }); |
1865 | 1987 |
1866 unittest.test("method--releaseQuota", () { | 1988 unittest.test("method--releaseQuota", () { |
1867 | |
1868 var mock = new HttpServerMock(); | 1989 var mock = new HttpServerMock(); |
1869 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 1990 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1870 var arg_request = buildReleaseQuotaRequest(); | 1991 var arg_request = buildReleaseQuotaRequest(); |
1871 var arg_serviceName = "foo"; | 1992 var arg_serviceName = "foo"; |
1872 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1993 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1873 var obj = new api.ReleaseQuotaRequest.fromJson(json); | 1994 var obj = new api.ReleaseQuotaRequest.fromJson(json); |
1874 checkReleaseQuotaRequest(obj); | 1995 checkReleaseQuotaRequest(obj); |
1875 | 1996 |
1876 var path = (req.url).path; | 1997 var path = (req.url).path; |
1877 var pathOffset = 0; | 1998 var pathOffset = 0; |
1878 var index; | 1999 var index; |
1879 var subPart; | 2000 var subPart; |
1880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2001 unittest.expect( |
| 2002 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1881 pathOffset += 1; | 2003 pathOffset += 1; |
1882 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 2004 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2005 unittest.equals("v1/services/")); |
1883 pathOffset += 12; | 2006 pathOffset += 12; |
1884 index = path.indexOf(":releaseQuota", pathOffset); | 2007 index = path.indexOf(":releaseQuota", pathOffset); |
1885 unittest.expect(index >= 0, unittest.isTrue); | 2008 unittest.expect(index >= 0, unittest.isTrue); |
1886 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2009 subPart = |
| 2010 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1887 pathOffset = index; | 2011 pathOffset = index; |
1888 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 2012 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1889 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":releaseQuota")); | 2013 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 2014 unittest.equals(":releaseQuota")); |
1890 pathOffset += 13; | 2015 pathOffset += 13; |
1891 | 2016 |
1892 var query = (req.url).query; | 2017 var query = (req.url).query; |
1893 var queryOffset = 0; | 2018 var queryOffset = 0; |
1894 var queryMap = {}; | 2019 var queryMap = {}; |
1895 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2020 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1896 parseBool(n) { | 2021 parseBool(n) { |
1897 if (n == "true") return true; | 2022 if (n == "true") return true; |
1898 if (n == "false") return false; | 2023 if (n == "false") return false; |
1899 if (n == null) return null; | 2024 if (n == null) return null; |
1900 throw new core.ArgumentError("Invalid boolean: $n"); | 2025 throw new core.ArgumentError("Invalid boolean: $n"); |
1901 } | 2026 } |
| 2027 |
1902 if (query.length > 0) { | 2028 if (query.length > 0) { |
1903 for (var part in query.split("&")) { | 2029 for (var part in query.split("&")) { |
1904 var keyvalue = part.split("="); | 2030 var keyvalue = part.split("="); |
1905 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2031 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2032 core.Uri.decodeQueryComponent(keyvalue[1])); |
1906 } | 2033 } |
1907 } | 2034 } |
1908 | 2035 |
1909 | |
1910 var h = { | 2036 var h = { |
1911 "content-type" : "application/json; charset=utf-8", | 2037 "content-type": "application/json; charset=utf-8", |
1912 }; | 2038 }; |
1913 var resp = convert.JSON.encode(buildReleaseQuotaResponse()); | 2039 var resp = convert.JSON.encode(buildReleaseQuotaResponse()); |
1914 return new async.Future.value(stringResponse(200, h, resp)); | 2040 return new async.Future.value(stringResponse(200, h, resp)); |
1915 }), true); | 2041 }), true); |
1916 res.releaseQuota(arg_request, arg_serviceName).then(unittest.expectAsync1(
((api.ReleaseQuotaResponse response) { | 2042 res |
| 2043 .releaseQuota(arg_request, arg_serviceName) |
| 2044 .then(unittest.expectAsync1(((api.ReleaseQuotaResponse response) { |
1917 checkReleaseQuotaResponse(response); | 2045 checkReleaseQuotaResponse(response); |
1918 }))); | 2046 }))); |
1919 }); | 2047 }); |
1920 | 2048 |
1921 unittest.test("method--report", () { | 2049 unittest.test("method--report", () { |
1922 | |
1923 var mock = new HttpServerMock(); | 2050 var mock = new HttpServerMock(); |
1924 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 2051 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1925 var arg_request = buildReportRequest(); | 2052 var arg_request = buildReportRequest(); |
1926 var arg_serviceName = "foo"; | 2053 var arg_serviceName = "foo"; |
1927 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2054 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1928 var obj = new api.ReportRequest.fromJson(json); | 2055 var obj = new api.ReportRequest.fromJson(json); |
1929 checkReportRequest(obj); | 2056 checkReportRequest(obj); |
1930 | 2057 |
1931 var path = (req.url).path; | 2058 var path = (req.url).path; |
1932 var pathOffset = 0; | 2059 var pathOffset = 0; |
1933 var index; | 2060 var index; |
1934 var subPart; | 2061 var subPart; |
1935 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2062 unittest.expect( |
| 2063 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1936 pathOffset += 1; | 2064 pathOffset += 1; |
1937 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 2065 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2066 unittest.equals("v1/services/")); |
1938 pathOffset += 12; | 2067 pathOffset += 12; |
1939 index = path.indexOf(":report", pathOffset); | 2068 index = path.indexOf(":report", pathOffset); |
1940 unittest.expect(index >= 0, unittest.isTrue); | 2069 unittest.expect(index >= 0, unittest.isTrue); |
1941 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2070 subPart = |
| 2071 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1942 pathOffset = index; | 2072 pathOffset = index; |
1943 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 2073 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1944 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als(":report")); | 2074 unittest.expect(path.substring(pathOffset, pathOffset + 7), |
| 2075 unittest.equals(":report")); |
1945 pathOffset += 7; | 2076 pathOffset += 7; |
1946 | 2077 |
1947 var query = (req.url).query; | 2078 var query = (req.url).query; |
1948 var queryOffset = 0; | 2079 var queryOffset = 0; |
1949 var queryMap = {}; | 2080 var queryMap = {}; |
1950 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2081 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1951 parseBool(n) { | 2082 parseBool(n) { |
1952 if (n == "true") return true; | 2083 if (n == "true") return true; |
1953 if (n == "false") return false; | 2084 if (n == "false") return false; |
1954 if (n == null) return null; | 2085 if (n == null) return null; |
1955 throw new core.ArgumentError("Invalid boolean: $n"); | 2086 throw new core.ArgumentError("Invalid boolean: $n"); |
1956 } | 2087 } |
| 2088 |
1957 if (query.length > 0) { | 2089 if (query.length > 0) { |
1958 for (var part in query.split("&")) { | 2090 for (var part in query.split("&")) { |
1959 var keyvalue = part.split("="); | 2091 var keyvalue = part.split("="); |
1960 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2092 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2093 core.Uri.decodeQueryComponent(keyvalue[1])); |
1961 } | 2094 } |
1962 } | 2095 } |
1963 | 2096 |
1964 | |
1965 var h = { | 2097 var h = { |
1966 "content-type" : "application/json; charset=utf-8", | 2098 "content-type": "application/json; charset=utf-8", |
1967 }; | 2099 }; |
1968 var resp = convert.JSON.encode(buildReportResponse()); | 2100 var resp = convert.JSON.encode(buildReportResponse()); |
1969 return new async.Future.value(stringResponse(200, h, resp)); | 2101 return new async.Future.value(stringResponse(200, h, resp)); |
1970 }), true); | 2102 }), true); |
1971 res.report(arg_request, arg_serviceName).then(unittest.expectAsync1(((api.
ReportResponse response) { | 2103 res |
| 2104 .report(arg_request, arg_serviceName) |
| 2105 .then(unittest.expectAsync1(((api.ReportResponse response) { |
1972 checkReportResponse(response); | 2106 checkReportResponse(response); |
1973 }))); | 2107 }))); |
1974 }); | 2108 }); |
1975 | 2109 |
1976 unittest.test("method--startReconciliation", () { | 2110 unittest.test("method--startReconciliation", () { |
1977 | |
1978 var mock = new HttpServerMock(); | 2111 var mock = new HttpServerMock(); |
1979 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; | 2112 api.ServicesResourceApi res = new api.ServicecontrolApi(mock).services; |
1980 var arg_request = buildStartReconciliationRequest(); | 2113 var arg_request = buildStartReconciliationRequest(); |
1981 var arg_serviceName = "foo"; | 2114 var arg_serviceName = "foo"; |
1982 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2115 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1983 var obj = new api.StartReconciliationRequest.fromJson(json); | 2116 var obj = new api.StartReconciliationRequest.fromJson(json); |
1984 checkStartReconciliationRequest(obj); | 2117 checkStartReconciliationRequest(obj); |
1985 | 2118 |
1986 var path = (req.url).path; | 2119 var path = (req.url).path; |
1987 var pathOffset = 0; | 2120 var pathOffset = 0; |
1988 var index; | 2121 var index; |
1989 var subPart; | 2122 var subPart; |
1990 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2123 unittest.expect( |
| 2124 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1991 pathOffset += 1; | 2125 pathOffset += 1; |
1992 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/services/")); | 2126 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2127 unittest.equals("v1/services/")); |
1993 pathOffset += 12; | 2128 pathOffset += 12; |
1994 index = path.indexOf(":startReconciliation", pathOffset); | 2129 index = path.indexOf(":startReconciliation", pathOffset); |
1995 unittest.expect(index >= 0, unittest.isTrue); | 2130 unittest.expect(index >= 0, unittest.isTrue); |
1996 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2131 subPart = |
| 2132 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1997 pathOffset = index; | 2133 pathOffset = index; |
1998 unittest.expect(subPart, unittest.equals("$arg_serviceName")); | 2134 unittest.expect(subPart, unittest.equals("$arg_serviceName")); |
1999 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals(":startReconciliation")); | 2135 unittest.expect(path.substring(pathOffset, pathOffset + 20), |
| 2136 unittest.equals(":startReconciliation")); |
2000 pathOffset += 20; | 2137 pathOffset += 20; |
2001 | 2138 |
2002 var query = (req.url).query; | 2139 var query = (req.url).query; |
2003 var queryOffset = 0; | 2140 var queryOffset = 0; |
2004 var queryMap = {}; | 2141 var queryMap = {}; |
2005 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2006 parseBool(n) { | 2143 parseBool(n) { |
2007 if (n == "true") return true; | 2144 if (n == "true") return true; |
2008 if (n == "false") return false; | 2145 if (n == "false") return false; |
2009 if (n == null) return null; | 2146 if (n == null) return null; |
2010 throw new core.ArgumentError("Invalid boolean: $n"); | 2147 throw new core.ArgumentError("Invalid boolean: $n"); |
2011 } | 2148 } |
| 2149 |
2012 if (query.length > 0) { | 2150 if (query.length > 0) { |
2013 for (var part in query.split("&")) { | 2151 for (var part in query.split("&")) { |
2014 var keyvalue = part.split("="); | 2152 var keyvalue = part.split("="); |
2015 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2153 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2154 core.Uri.decodeQueryComponent(keyvalue[1])); |
2016 } | 2155 } |
2017 } | 2156 } |
2018 | 2157 |
2019 | |
2020 var h = { | 2158 var h = { |
2021 "content-type" : "application/json; charset=utf-8", | 2159 "content-type": "application/json; charset=utf-8", |
2022 }; | 2160 }; |
2023 var resp = convert.JSON.encode(buildStartReconciliationResponse()); | 2161 var resp = convert.JSON.encode(buildStartReconciliationResponse()); |
2024 return new async.Future.value(stringResponse(200, h, resp)); | 2162 return new async.Future.value(stringResponse(200, h, resp)); |
2025 }), true); | 2163 }), true); |
2026 res.startReconciliation(arg_request, arg_serviceName).then(unittest.expect
Async1(((api.StartReconciliationResponse response) { | 2164 res.startReconciliation(arg_request, arg_serviceName).then( |
| 2165 unittest.expectAsync1(((api.StartReconciliationResponse response) { |
2027 checkStartReconciliationResponse(response); | 2166 checkStartReconciliationResponse(response); |
2028 }))); | 2167 }))); |
2029 }); | 2168 }); |
2030 | |
2031 }); | 2169 }); |
2032 | |
2033 | |
2034 } | 2170 } |
2035 | |
OLD | NEW |