OLD | NEW |
1 library googleapis.discovery.v1.test; | 1 library googleapis.discovery.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/discovery/v1.dart' as api; | 10 import 'package:googleapis/discovery/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 buildCounterDirectoryListItemsIcons = 0; | 53 core.int buildCounterDirectoryListItemsIcons = 0; |
55 buildDirectoryListItemsIcons() { | 54 buildDirectoryListItemsIcons() { |
56 var o = new api.DirectoryListItemsIcons(); | 55 var o = new api.DirectoryListItemsIcons(); |
57 buildCounterDirectoryListItemsIcons++; | 56 buildCounterDirectoryListItemsIcons++; |
58 if (buildCounterDirectoryListItemsIcons < 3) { | 57 if (buildCounterDirectoryListItemsIcons < 3) { |
59 o.x16 = "foo"; | 58 o.x16 = "foo"; |
60 o.x32 = "foo"; | 59 o.x32 = "foo"; |
61 } | 60 } |
62 buildCounterDirectoryListItemsIcons--; | 61 buildCounterDirectoryListItemsIcons--; |
63 return o; | 62 return o; |
64 } | 63 } |
65 | 64 |
66 checkDirectoryListItemsIcons(api.DirectoryListItemsIcons o) { | 65 checkDirectoryListItemsIcons(api.DirectoryListItemsIcons o) { |
67 buildCounterDirectoryListItemsIcons++; | 66 buildCounterDirectoryListItemsIcons++; |
68 if (buildCounterDirectoryListItemsIcons < 3) { | 67 if (buildCounterDirectoryListItemsIcons < 3) { |
69 unittest.expect(o.x16, unittest.equals('foo')); | 68 unittest.expect(o.x16, unittest.equals('foo')); |
70 unittest.expect(o.x32, unittest.equals('foo')); | 69 unittest.expect(o.x32, unittest.equals('foo')); |
71 } | 70 } |
72 buildCounterDirectoryListItemsIcons--; | 71 buildCounterDirectoryListItemsIcons--; |
73 } | 72 } |
74 | 73 |
75 buildUnnamed310() { | 74 buildUnnamed309() { |
76 var o = new core.List<core.String>(); | 75 var o = new core.List<core.String>(); |
77 o.add("foo"); | 76 o.add("foo"); |
78 o.add("foo"); | 77 o.add("foo"); |
79 return o; | 78 return o; |
80 } | 79 } |
81 | 80 |
82 checkUnnamed310(core.List<core.String> o) { | 81 checkUnnamed309(core.List<core.String> o) { |
83 unittest.expect(o, unittest.hasLength(2)); | 82 unittest.expect(o, unittest.hasLength(2)); |
84 unittest.expect(o[0], unittest.equals('foo')); | 83 unittest.expect(o[0], unittest.equals('foo')); |
85 unittest.expect(o[1], unittest.equals('foo')); | 84 unittest.expect(o[1], unittest.equals('foo')); |
86 } | 85 } |
87 | 86 |
88 core.int buildCounterDirectoryListItems = 0; | 87 core.int buildCounterDirectoryListItems = 0; |
89 buildDirectoryListItems() { | 88 buildDirectoryListItems() { |
90 var o = new api.DirectoryListItems(); | 89 var o = new api.DirectoryListItems(); |
91 buildCounterDirectoryListItems++; | 90 buildCounterDirectoryListItems++; |
92 if (buildCounterDirectoryListItems < 3) { | 91 if (buildCounterDirectoryListItems < 3) { |
93 o.description = "foo"; | 92 o.description = "foo"; |
94 o.discoveryLink = "foo"; | 93 o.discoveryLink = "foo"; |
95 o.discoveryRestUrl = "foo"; | 94 o.discoveryRestUrl = "foo"; |
96 o.documentationLink = "foo"; | 95 o.documentationLink = "foo"; |
97 o.icons = buildDirectoryListItemsIcons(); | 96 o.icons = buildDirectoryListItemsIcons(); |
98 o.id = "foo"; | 97 o.id = "foo"; |
99 o.kind = "foo"; | 98 o.kind = "foo"; |
100 o.labels = buildUnnamed310(); | 99 o.labels = buildUnnamed309(); |
101 o.name = "foo"; | 100 o.name = "foo"; |
102 o.preferred = true; | 101 o.preferred = true; |
103 o.title = "foo"; | 102 o.title = "foo"; |
104 o.version = "foo"; | 103 o.version = "foo"; |
105 } | 104 } |
106 buildCounterDirectoryListItems--; | 105 buildCounterDirectoryListItems--; |
107 return o; | 106 return o; |
108 } | 107 } |
109 | 108 |
110 checkDirectoryListItems(api.DirectoryListItems o) { | 109 checkDirectoryListItems(api.DirectoryListItems o) { |
111 buildCounterDirectoryListItems++; | 110 buildCounterDirectoryListItems++; |
112 if (buildCounterDirectoryListItems < 3) { | 111 if (buildCounterDirectoryListItems < 3) { |
113 unittest.expect(o.description, unittest.equals('foo')); | 112 unittest.expect(o.description, unittest.equals('foo')); |
114 unittest.expect(o.discoveryLink, unittest.equals('foo')); | 113 unittest.expect(o.discoveryLink, unittest.equals('foo')); |
115 unittest.expect(o.discoveryRestUrl, unittest.equals('foo')); | 114 unittest.expect(o.discoveryRestUrl, unittest.equals('foo')); |
116 unittest.expect(o.documentationLink, unittest.equals('foo')); | 115 unittest.expect(o.documentationLink, unittest.equals('foo')); |
117 checkDirectoryListItemsIcons(o.icons); | 116 checkDirectoryListItemsIcons(o.icons); |
118 unittest.expect(o.id, unittest.equals('foo')); | 117 unittest.expect(o.id, unittest.equals('foo')); |
119 unittest.expect(o.kind, unittest.equals('foo')); | 118 unittest.expect(o.kind, unittest.equals('foo')); |
120 checkUnnamed310(o.labels); | 119 checkUnnamed309(o.labels); |
121 unittest.expect(o.name, unittest.equals('foo')); | 120 unittest.expect(o.name, unittest.equals('foo')); |
122 unittest.expect(o.preferred, unittest.isTrue); | 121 unittest.expect(o.preferred, unittest.isTrue); |
123 unittest.expect(o.title, unittest.equals('foo')); | 122 unittest.expect(o.title, unittest.equals('foo')); |
124 unittest.expect(o.version, unittest.equals('foo')); | 123 unittest.expect(o.version, unittest.equals('foo')); |
125 } | 124 } |
126 buildCounterDirectoryListItems--; | 125 buildCounterDirectoryListItems--; |
127 } | 126 } |
128 | 127 |
129 buildUnnamed311() { | 128 buildUnnamed310() { |
130 var o = new core.List<api.DirectoryListItems>(); | 129 var o = new core.List<api.DirectoryListItems>(); |
131 o.add(buildDirectoryListItems()); | 130 o.add(buildDirectoryListItems()); |
132 o.add(buildDirectoryListItems()); | 131 o.add(buildDirectoryListItems()); |
133 return o; | 132 return o; |
134 } | 133 } |
135 | 134 |
136 checkUnnamed311(core.List<api.DirectoryListItems> o) { | 135 checkUnnamed310(core.List<api.DirectoryListItems> o) { |
137 unittest.expect(o, unittest.hasLength(2)); | 136 unittest.expect(o, unittest.hasLength(2)); |
138 checkDirectoryListItems(o[0]); | 137 checkDirectoryListItems(o[0]); |
139 checkDirectoryListItems(o[1]); | 138 checkDirectoryListItems(o[1]); |
140 } | 139 } |
141 | 140 |
142 core.int buildCounterDirectoryList = 0; | 141 core.int buildCounterDirectoryList = 0; |
143 buildDirectoryList() { | 142 buildDirectoryList() { |
144 var o = new api.DirectoryList(); | 143 var o = new api.DirectoryList(); |
145 buildCounterDirectoryList++; | 144 buildCounterDirectoryList++; |
146 if (buildCounterDirectoryList < 3) { | 145 if (buildCounterDirectoryList < 3) { |
147 o.discoveryVersion = "foo"; | 146 o.discoveryVersion = "foo"; |
148 o.items = buildUnnamed311(); | 147 o.items = buildUnnamed310(); |
149 o.kind = "foo"; | 148 o.kind = "foo"; |
150 } | 149 } |
151 buildCounterDirectoryList--; | 150 buildCounterDirectoryList--; |
152 return o; | 151 return o; |
153 } | 152 } |
154 | 153 |
155 checkDirectoryList(api.DirectoryList o) { | 154 checkDirectoryList(api.DirectoryList o) { |
156 buildCounterDirectoryList++; | 155 buildCounterDirectoryList++; |
157 if (buildCounterDirectoryList < 3) { | 156 if (buildCounterDirectoryList < 3) { |
158 unittest.expect(o.discoveryVersion, unittest.equals('foo')); | 157 unittest.expect(o.discoveryVersion, unittest.equals('foo')); |
159 checkUnnamed311(o.items); | 158 checkUnnamed310(o.items); |
160 unittest.expect(o.kind, unittest.equals('foo')); | 159 unittest.expect(o.kind, unittest.equals('foo')); |
161 } | 160 } |
162 buildCounterDirectoryList--; | 161 buildCounterDirectoryList--; |
163 } | 162 } |
164 | 163 |
165 buildUnnamed312() { | 164 buildUnnamed311() { |
166 var o = new core.List<core.String>(); | 165 var o = new core.List<core.String>(); |
167 o.add("foo"); | 166 o.add("foo"); |
168 o.add("foo"); | 167 o.add("foo"); |
169 return o; | 168 return o; |
170 } | 169 } |
171 | 170 |
172 checkUnnamed312(core.List<core.String> o) { | 171 checkUnnamed311(core.List<core.String> o) { |
173 unittest.expect(o, unittest.hasLength(2)); | 172 unittest.expect(o, unittest.hasLength(2)); |
174 unittest.expect(o[0], unittest.equals('foo')); | 173 unittest.expect(o[0], unittest.equals('foo')); |
175 unittest.expect(o[1], unittest.equals('foo')); | 174 unittest.expect(o[1], unittest.equals('foo')); |
176 } | 175 } |
177 | 176 |
178 core.int buildCounterJsonSchemaAnnotations = 0; | 177 core.int buildCounterJsonSchemaAnnotations = 0; |
179 buildJsonSchemaAnnotations() { | 178 buildJsonSchemaAnnotations() { |
180 var o = new api.JsonSchemaAnnotations(); | 179 var o = new api.JsonSchemaAnnotations(); |
181 buildCounterJsonSchemaAnnotations++; | 180 buildCounterJsonSchemaAnnotations++; |
182 if (buildCounterJsonSchemaAnnotations < 3) { | 181 if (buildCounterJsonSchemaAnnotations < 3) { |
183 o.required = buildUnnamed312(); | 182 o.required = buildUnnamed311(); |
184 } | 183 } |
185 buildCounterJsonSchemaAnnotations--; | 184 buildCounterJsonSchemaAnnotations--; |
186 return o; | 185 return o; |
187 } | 186 } |
188 | 187 |
189 checkJsonSchemaAnnotations(api.JsonSchemaAnnotations o) { | 188 checkJsonSchemaAnnotations(api.JsonSchemaAnnotations o) { |
190 buildCounterJsonSchemaAnnotations++; | 189 buildCounterJsonSchemaAnnotations++; |
191 if (buildCounterJsonSchemaAnnotations < 3) { | 190 if (buildCounterJsonSchemaAnnotations < 3) { |
192 checkUnnamed312(o.required); | 191 checkUnnamed311(o.required); |
193 } | 192 } |
194 buildCounterJsonSchemaAnnotations--; | 193 buildCounterJsonSchemaAnnotations--; |
195 } | 194 } |
196 | 195 |
| 196 buildUnnamed312() { |
| 197 var o = new core.List<core.String>(); |
| 198 o.add("foo"); |
| 199 o.add("foo"); |
| 200 return o; |
| 201 } |
| 202 |
| 203 checkUnnamed312(core.List<core.String> o) { |
| 204 unittest.expect(o, unittest.hasLength(2)); |
| 205 unittest.expect(o[0], unittest.equals('foo')); |
| 206 unittest.expect(o[1], unittest.equals('foo')); |
| 207 } |
| 208 |
197 buildUnnamed313() { | 209 buildUnnamed313() { |
198 var o = new core.List<core.String>(); | 210 var o = new core.List<core.String>(); |
199 o.add("foo"); | 211 o.add("foo"); |
200 o.add("foo"); | 212 o.add("foo"); |
201 return o; | 213 return o; |
202 } | 214 } |
203 | 215 |
204 checkUnnamed313(core.List<core.String> o) { | 216 checkUnnamed313(core.List<core.String> o) { |
205 unittest.expect(o, unittest.hasLength(2)); | 217 unittest.expect(o, unittest.hasLength(2)); |
206 unittest.expect(o[0], unittest.equals('foo')); | 218 unittest.expect(o[0], unittest.equals('foo')); |
207 unittest.expect(o[1], unittest.equals('foo')); | 219 unittest.expect(o[1], unittest.equals('foo')); |
208 } | 220 } |
209 | 221 |
210 buildUnnamed314() { | 222 buildUnnamed314() { |
211 var o = new core.List<core.String>(); | |
212 o.add("foo"); | |
213 o.add("foo"); | |
214 return o; | |
215 } | |
216 | |
217 checkUnnamed314(core.List<core.String> o) { | |
218 unittest.expect(o, unittest.hasLength(2)); | |
219 unittest.expect(o[0], unittest.equals('foo')); | |
220 unittest.expect(o[1], unittest.equals('foo')); | |
221 } | |
222 | |
223 buildUnnamed315() { | |
224 var o = new core.Map<core.String, api.JsonSchema>(); | 223 var o = new core.Map<core.String, api.JsonSchema>(); |
225 o["x"] = buildJsonSchema(); | 224 o["x"] = buildJsonSchema(); |
226 o["y"] = buildJsonSchema(); | 225 o["y"] = buildJsonSchema(); |
227 return o; | 226 return o; |
228 } | 227 } |
229 | 228 |
230 checkUnnamed315(core.Map<core.String, api.JsonSchema> o) { | 229 checkUnnamed314(core.Map<core.String, api.JsonSchema> o) { |
231 unittest.expect(o, unittest.hasLength(2)); | 230 unittest.expect(o, unittest.hasLength(2)); |
232 checkJsonSchema(o["x"]); | 231 checkJsonSchema(o["x"]); |
233 checkJsonSchema(o["y"]); | 232 checkJsonSchema(o["y"]); |
234 } | 233 } |
235 | 234 |
236 core.int buildCounterJsonSchemaVariantMap = 0; | 235 core.int buildCounterJsonSchemaVariantMap = 0; |
237 buildJsonSchemaVariantMap() { | 236 buildJsonSchemaVariantMap() { |
238 var o = new api.JsonSchemaVariantMap(); | 237 var o = new api.JsonSchemaVariantMap(); |
239 buildCounterJsonSchemaVariantMap++; | 238 buildCounterJsonSchemaVariantMap++; |
240 if (buildCounterJsonSchemaVariantMap < 3) { | 239 if (buildCounterJsonSchemaVariantMap < 3) { |
241 o.P_ref = "foo"; | 240 o.P_ref = "foo"; |
242 o.typeValue = "foo"; | 241 o.typeValue = "foo"; |
243 } | 242 } |
244 buildCounterJsonSchemaVariantMap--; | 243 buildCounterJsonSchemaVariantMap--; |
245 return o; | 244 return o; |
246 } | 245 } |
247 | 246 |
248 checkJsonSchemaVariantMap(api.JsonSchemaVariantMap o) { | 247 checkJsonSchemaVariantMap(api.JsonSchemaVariantMap o) { |
249 buildCounterJsonSchemaVariantMap++; | 248 buildCounterJsonSchemaVariantMap++; |
250 if (buildCounterJsonSchemaVariantMap < 3) { | 249 if (buildCounterJsonSchemaVariantMap < 3) { |
251 unittest.expect(o.P_ref, unittest.equals('foo')); | 250 unittest.expect(o.P_ref, unittest.equals('foo')); |
252 unittest.expect(o.typeValue, unittest.equals('foo')); | 251 unittest.expect(o.typeValue, unittest.equals('foo')); |
253 } | 252 } |
254 buildCounterJsonSchemaVariantMap--; | 253 buildCounterJsonSchemaVariantMap--; |
255 } | 254 } |
256 | 255 |
257 buildUnnamed316() { | 256 buildUnnamed315() { |
258 var o = new core.List<api.JsonSchemaVariantMap>(); | 257 var o = new core.List<api.JsonSchemaVariantMap>(); |
259 o.add(buildJsonSchemaVariantMap()); | 258 o.add(buildJsonSchemaVariantMap()); |
260 o.add(buildJsonSchemaVariantMap()); | 259 o.add(buildJsonSchemaVariantMap()); |
261 return o; | 260 return o; |
262 } | 261 } |
263 | 262 |
264 checkUnnamed316(core.List<api.JsonSchemaVariantMap> o) { | 263 checkUnnamed315(core.List<api.JsonSchemaVariantMap> o) { |
265 unittest.expect(o, unittest.hasLength(2)); | 264 unittest.expect(o, unittest.hasLength(2)); |
266 checkJsonSchemaVariantMap(o[0]); | 265 checkJsonSchemaVariantMap(o[0]); |
267 checkJsonSchemaVariantMap(o[1]); | 266 checkJsonSchemaVariantMap(o[1]); |
268 } | 267 } |
269 | 268 |
270 core.int buildCounterJsonSchemaVariant = 0; | 269 core.int buildCounterJsonSchemaVariant = 0; |
271 buildJsonSchemaVariant() { | 270 buildJsonSchemaVariant() { |
272 var o = new api.JsonSchemaVariant(); | 271 var o = new api.JsonSchemaVariant(); |
273 buildCounterJsonSchemaVariant++; | 272 buildCounterJsonSchemaVariant++; |
274 if (buildCounterJsonSchemaVariant < 3) { | 273 if (buildCounterJsonSchemaVariant < 3) { |
275 o.discriminant = "foo"; | 274 o.discriminant = "foo"; |
276 o.map = buildUnnamed316(); | 275 o.map = buildUnnamed315(); |
277 } | 276 } |
278 buildCounterJsonSchemaVariant--; | 277 buildCounterJsonSchemaVariant--; |
279 return o; | 278 return o; |
280 } | 279 } |
281 | 280 |
282 checkJsonSchemaVariant(api.JsonSchemaVariant o) { | 281 checkJsonSchemaVariant(api.JsonSchemaVariant o) { |
283 buildCounterJsonSchemaVariant++; | 282 buildCounterJsonSchemaVariant++; |
284 if (buildCounterJsonSchemaVariant < 3) { | 283 if (buildCounterJsonSchemaVariant < 3) { |
285 unittest.expect(o.discriminant, unittest.equals('foo')); | 284 unittest.expect(o.discriminant, unittest.equals('foo')); |
286 checkUnnamed316(o.map); | 285 checkUnnamed315(o.map); |
287 } | 286 } |
288 buildCounterJsonSchemaVariant--; | 287 buildCounterJsonSchemaVariant--; |
289 } | 288 } |
290 | 289 |
291 core.int buildCounterJsonSchema = 0; | 290 core.int buildCounterJsonSchema = 0; |
292 buildJsonSchema() { | 291 buildJsonSchema() { |
293 var o = new api.JsonSchema(); | 292 var o = new api.JsonSchema(); |
294 buildCounterJsonSchema++; | 293 buildCounterJsonSchema++; |
295 if (buildCounterJsonSchema < 3) { | 294 if (buildCounterJsonSchema < 3) { |
296 o.P_ref = "foo"; | 295 o.P_ref = "foo"; |
297 o.additionalProperties = buildJsonSchema(); | 296 o.additionalProperties = buildJsonSchema(); |
298 o.annotations = buildJsonSchemaAnnotations(); | 297 o.annotations = buildJsonSchemaAnnotations(); |
299 o.default_ = "foo"; | 298 o.default_ = "foo"; |
300 o.description = "foo"; | 299 o.description = "foo"; |
301 o.enum_ = buildUnnamed313(); | 300 o.enum_ = buildUnnamed312(); |
302 o.enumDescriptions = buildUnnamed314(); | 301 o.enumDescriptions = buildUnnamed313(); |
303 o.format = "foo"; | 302 o.format = "foo"; |
304 o.id = "foo"; | 303 o.id = "foo"; |
305 o.items = buildJsonSchema(); | 304 o.items = buildJsonSchema(); |
306 o.location = "foo"; | 305 o.location = "foo"; |
307 o.maximum = "foo"; | 306 o.maximum = "foo"; |
308 o.minimum = "foo"; | 307 o.minimum = "foo"; |
309 o.pattern = "foo"; | 308 o.pattern = "foo"; |
310 o.properties = buildUnnamed315(); | 309 o.properties = buildUnnamed314(); |
311 o.readOnly = true; | 310 o.readOnly = true; |
312 o.repeated = true; | 311 o.repeated = true; |
313 o.required = true; | 312 o.required = true; |
314 o.type = "foo"; | 313 o.type = "foo"; |
315 o.variant = buildJsonSchemaVariant(); | 314 o.variant = buildJsonSchemaVariant(); |
316 } | 315 } |
317 buildCounterJsonSchema--; | 316 buildCounterJsonSchema--; |
318 return o; | 317 return o; |
319 } | 318 } |
320 | 319 |
321 checkJsonSchema(api.JsonSchema o) { | 320 checkJsonSchema(api.JsonSchema o) { |
322 buildCounterJsonSchema++; | 321 buildCounterJsonSchema++; |
323 if (buildCounterJsonSchema < 3) { | 322 if (buildCounterJsonSchema < 3) { |
324 unittest.expect(o.P_ref, unittest.equals('foo')); | 323 unittest.expect(o.P_ref, unittest.equals('foo')); |
325 checkJsonSchema(o.additionalProperties); | 324 checkJsonSchema(o.additionalProperties); |
326 checkJsonSchemaAnnotations(o.annotations); | 325 checkJsonSchemaAnnotations(o.annotations); |
327 unittest.expect(o.default_, unittest.equals('foo')); | 326 unittest.expect(o.default_, unittest.equals('foo')); |
328 unittest.expect(o.description, unittest.equals('foo')); | 327 unittest.expect(o.description, unittest.equals('foo')); |
329 checkUnnamed313(o.enum_); | 328 checkUnnamed312(o.enum_); |
330 checkUnnamed314(o.enumDescriptions); | 329 checkUnnamed313(o.enumDescriptions); |
331 unittest.expect(o.format, unittest.equals('foo')); | 330 unittest.expect(o.format, unittest.equals('foo')); |
332 unittest.expect(o.id, unittest.equals('foo')); | 331 unittest.expect(o.id, unittest.equals('foo')); |
333 checkJsonSchema(o.items); | 332 checkJsonSchema(o.items); |
334 unittest.expect(o.location, unittest.equals('foo')); | 333 unittest.expect(o.location, unittest.equals('foo')); |
335 unittest.expect(o.maximum, unittest.equals('foo')); | 334 unittest.expect(o.maximum, unittest.equals('foo')); |
336 unittest.expect(o.minimum, unittest.equals('foo')); | 335 unittest.expect(o.minimum, unittest.equals('foo')); |
337 unittest.expect(o.pattern, unittest.equals('foo')); | 336 unittest.expect(o.pattern, unittest.equals('foo')); |
338 checkUnnamed315(o.properties); | 337 checkUnnamed314(o.properties); |
339 unittest.expect(o.readOnly, unittest.isTrue); | 338 unittest.expect(o.readOnly, unittest.isTrue); |
340 unittest.expect(o.repeated, unittest.isTrue); | 339 unittest.expect(o.repeated, unittest.isTrue); |
341 unittest.expect(o.required, unittest.isTrue); | 340 unittest.expect(o.required, unittest.isTrue); |
342 unittest.expect(o.type, unittest.equals('foo')); | 341 unittest.expect(o.type, unittest.equals('foo')); |
343 checkJsonSchemaVariant(o.variant); | 342 checkJsonSchemaVariant(o.variant); |
344 } | 343 } |
345 buildCounterJsonSchema--; | 344 buildCounterJsonSchema--; |
346 } | 345 } |
347 | 346 |
348 core.int buildCounterRestDescriptionAuthOauth2ScopesValue = 0; | 347 core.int buildCounterRestDescriptionAuthOauth2ScopesValue = 0; |
349 buildRestDescriptionAuthOauth2ScopesValue() { | 348 buildRestDescriptionAuthOauth2ScopesValue() { |
350 var o = new api.RestDescriptionAuthOauth2ScopesValue(); | 349 var o = new api.RestDescriptionAuthOauth2ScopesValue(); |
351 buildCounterRestDescriptionAuthOauth2ScopesValue++; | 350 buildCounterRestDescriptionAuthOauth2ScopesValue++; |
352 if (buildCounterRestDescriptionAuthOauth2ScopesValue < 3) { | 351 if (buildCounterRestDescriptionAuthOauth2ScopesValue < 3) { |
353 o.description = "foo"; | 352 o.description = "foo"; |
354 } | 353 } |
355 buildCounterRestDescriptionAuthOauth2ScopesValue--; | 354 buildCounterRestDescriptionAuthOauth2ScopesValue--; |
356 return o; | 355 return o; |
357 } | 356 } |
358 | 357 |
359 checkRestDescriptionAuthOauth2ScopesValue(api.RestDescriptionAuthOauth2ScopesVal
ue o) { | 358 checkRestDescriptionAuthOauth2ScopesValue( |
| 359 api.RestDescriptionAuthOauth2ScopesValue o) { |
360 buildCounterRestDescriptionAuthOauth2ScopesValue++; | 360 buildCounterRestDescriptionAuthOauth2ScopesValue++; |
361 if (buildCounterRestDescriptionAuthOauth2ScopesValue < 3) { | 361 if (buildCounterRestDescriptionAuthOauth2ScopesValue < 3) { |
362 unittest.expect(o.description, unittest.equals('foo')); | 362 unittest.expect(o.description, unittest.equals('foo')); |
363 } | 363 } |
364 buildCounterRestDescriptionAuthOauth2ScopesValue--; | 364 buildCounterRestDescriptionAuthOauth2ScopesValue--; |
365 } | 365 } |
366 | 366 |
367 buildUnnamed317() { | 367 buildUnnamed316() { |
368 var o = new core.Map<core.String, api.RestDescriptionAuthOauth2ScopesValue>(); | 368 var o = new core.Map<core.String, api.RestDescriptionAuthOauth2ScopesValue>(); |
369 o["x"] = buildRestDescriptionAuthOauth2ScopesValue(); | 369 o["x"] = buildRestDescriptionAuthOauth2ScopesValue(); |
370 o["y"] = buildRestDescriptionAuthOauth2ScopesValue(); | 370 o["y"] = buildRestDescriptionAuthOauth2ScopesValue(); |
371 return o; | 371 return o; |
372 } | 372 } |
373 | 373 |
374 checkUnnamed317(core.Map<core.String, api.RestDescriptionAuthOauth2ScopesValue>
o) { | 374 checkUnnamed316( |
| 375 core.Map<core.String, api.RestDescriptionAuthOauth2ScopesValue> o) { |
375 unittest.expect(o, unittest.hasLength(2)); | 376 unittest.expect(o, unittest.hasLength(2)); |
376 checkRestDescriptionAuthOauth2ScopesValue(o["x"]); | 377 checkRestDescriptionAuthOauth2ScopesValue(o["x"]); |
377 checkRestDescriptionAuthOauth2ScopesValue(o["y"]); | 378 checkRestDescriptionAuthOauth2ScopesValue(o["y"]); |
378 } | 379 } |
379 | 380 |
380 core.int buildCounterRestDescriptionAuthOauth2 = 0; | 381 core.int buildCounterRestDescriptionAuthOauth2 = 0; |
381 buildRestDescriptionAuthOauth2() { | 382 buildRestDescriptionAuthOauth2() { |
382 var o = new api.RestDescriptionAuthOauth2(); | 383 var o = new api.RestDescriptionAuthOauth2(); |
383 buildCounterRestDescriptionAuthOauth2++; | 384 buildCounterRestDescriptionAuthOauth2++; |
384 if (buildCounterRestDescriptionAuthOauth2 < 3) { | 385 if (buildCounterRestDescriptionAuthOauth2 < 3) { |
385 o.scopes = buildUnnamed317(); | 386 o.scopes = buildUnnamed316(); |
386 } | 387 } |
387 buildCounterRestDescriptionAuthOauth2--; | 388 buildCounterRestDescriptionAuthOauth2--; |
388 return o; | 389 return o; |
389 } | 390 } |
390 | 391 |
391 checkRestDescriptionAuthOauth2(api.RestDescriptionAuthOauth2 o) { | 392 checkRestDescriptionAuthOauth2(api.RestDescriptionAuthOauth2 o) { |
392 buildCounterRestDescriptionAuthOauth2++; | 393 buildCounterRestDescriptionAuthOauth2++; |
393 if (buildCounterRestDescriptionAuthOauth2 < 3) { | 394 if (buildCounterRestDescriptionAuthOauth2 < 3) { |
394 checkUnnamed317(o.scopes); | 395 checkUnnamed316(o.scopes); |
395 } | 396 } |
396 buildCounterRestDescriptionAuthOauth2--; | 397 buildCounterRestDescriptionAuthOauth2--; |
397 } | 398 } |
398 | 399 |
399 core.int buildCounterRestDescriptionAuth = 0; | 400 core.int buildCounterRestDescriptionAuth = 0; |
400 buildRestDescriptionAuth() { | 401 buildRestDescriptionAuth() { |
401 var o = new api.RestDescriptionAuth(); | 402 var o = new api.RestDescriptionAuth(); |
402 buildCounterRestDescriptionAuth++; | 403 buildCounterRestDescriptionAuth++; |
403 if (buildCounterRestDescriptionAuth < 3) { | 404 if (buildCounterRestDescriptionAuth < 3) { |
404 o.oauth2 = buildRestDescriptionAuthOauth2(); | 405 o.oauth2 = buildRestDescriptionAuthOauth2(); |
405 } | 406 } |
406 buildCounterRestDescriptionAuth--; | 407 buildCounterRestDescriptionAuth--; |
407 return o; | 408 return o; |
408 } | 409 } |
409 | 410 |
410 checkRestDescriptionAuth(api.RestDescriptionAuth o) { | 411 checkRestDescriptionAuth(api.RestDescriptionAuth o) { |
411 buildCounterRestDescriptionAuth++; | 412 buildCounterRestDescriptionAuth++; |
412 if (buildCounterRestDescriptionAuth < 3) { | 413 if (buildCounterRestDescriptionAuth < 3) { |
413 checkRestDescriptionAuthOauth2(o.oauth2); | 414 checkRestDescriptionAuthOauth2(o.oauth2); |
414 } | 415 } |
415 buildCounterRestDescriptionAuth--; | 416 buildCounterRestDescriptionAuth--; |
416 } | 417 } |
417 | 418 |
418 buildUnnamed318() { | 419 buildUnnamed317() { |
419 var o = new core.List<core.String>(); | 420 var o = new core.List<core.String>(); |
420 o.add("foo"); | 421 o.add("foo"); |
421 o.add("foo"); | 422 o.add("foo"); |
422 return o; | 423 return o; |
423 } | 424 } |
424 | 425 |
425 checkUnnamed318(core.List<core.String> o) { | 426 checkUnnamed317(core.List<core.String> o) { |
426 unittest.expect(o, unittest.hasLength(2)); | 427 unittest.expect(o, unittest.hasLength(2)); |
427 unittest.expect(o[0], unittest.equals('foo')); | 428 unittest.expect(o[0], unittest.equals('foo')); |
428 unittest.expect(o[1], unittest.equals('foo')); | 429 unittest.expect(o[1], unittest.equals('foo')); |
429 } | 430 } |
430 | 431 |
431 core.int buildCounterRestDescriptionIcons = 0; | 432 core.int buildCounterRestDescriptionIcons = 0; |
432 buildRestDescriptionIcons() { | 433 buildRestDescriptionIcons() { |
433 var o = new api.RestDescriptionIcons(); | 434 var o = new api.RestDescriptionIcons(); |
434 buildCounterRestDescriptionIcons++; | 435 buildCounterRestDescriptionIcons++; |
435 if (buildCounterRestDescriptionIcons < 3) { | 436 if (buildCounterRestDescriptionIcons < 3) { |
436 o.x16 = "foo"; | 437 o.x16 = "foo"; |
437 o.x32 = "foo"; | 438 o.x32 = "foo"; |
438 } | 439 } |
439 buildCounterRestDescriptionIcons--; | 440 buildCounterRestDescriptionIcons--; |
440 return o; | 441 return o; |
441 } | 442 } |
442 | 443 |
443 checkRestDescriptionIcons(api.RestDescriptionIcons o) { | 444 checkRestDescriptionIcons(api.RestDescriptionIcons o) { |
444 buildCounterRestDescriptionIcons++; | 445 buildCounterRestDescriptionIcons++; |
445 if (buildCounterRestDescriptionIcons < 3) { | 446 if (buildCounterRestDescriptionIcons < 3) { |
446 unittest.expect(o.x16, unittest.equals('foo')); | 447 unittest.expect(o.x16, unittest.equals('foo')); |
447 unittest.expect(o.x32, unittest.equals('foo')); | 448 unittest.expect(o.x32, unittest.equals('foo')); |
448 } | 449 } |
449 buildCounterRestDescriptionIcons--; | 450 buildCounterRestDescriptionIcons--; |
450 } | 451 } |
451 | 452 |
452 buildUnnamed319() { | 453 buildUnnamed318() { |
453 var o = new core.List<core.String>(); | 454 var o = new core.List<core.String>(); |
454 o.add("foo"); | 455 o.add("foo"); |
455 o.add("foo"); | 456 o.add("foo"); |
456 return o; | 457 return o; |
457 } | 458 } |
458 | 459 |
459 checkUnnamed319(core.List<core.String> o) { | 460 checkUnnamed318(core.List<core.String> o) { |
460 unittest.expect(o, unittest.hasLength(2)); | 461 unittest.expect(o, unittest.hasLength(2)); |
461 unittest.expect(o[0], unittest.equals('foo')); | 462 unittest.expect(o[0], unittest.equals('foo')); |
462 unittest.expect(o[1], unittest.equals('foo')); | 463 unittest.expect(o[1], unittest.equals('foo')); |
463 } | 464 } |
464 | 465 |
465 buildUnnamed320() { | 466 buildUnnamed319() { |
466 var o = new core.Map<core.String, api.RestMethod>(); | 467 var o = new core.Map<core.String, api.RestMethod>(); |
467 o["x"] = buildRestMethod(); | 468 o["x"] = buildRestMethod(); |
468 o["y"] = buildRestMethod(); | 469 o["y"] = buildRestMethod(); |
469 return o; | 470 return o; |
470 } | 471 } |
471 | 472 |
472 checkUnnamed320(core.Map<core.String, api.RestMethod> o) { | 473 checkUnnamed319(core.Map<core.String, api.RestMethod> o) { |
473 unittest.expect(o, unittest.hasLength(2)); | 474 unittest.expect(o, unittest.hasLength(2)); |
474 checkRestMethod(o["x"]); | 475 checkRestMethod(o["x"]); |
475 checkRestMethod(o["y"]); | 476 checkRestMethod(o["y"]); |
476 } | 477 } |
477 | 478 |
478 buildUnnamed321() { | 479 buildUnnamed320() { |
479 var o = new core.Map<core.String, api.JsonSchema>(); | 480 var o = new core.Map<core.String, api.JsonSchema>(); |
480 o["x"] = buildJsonSchema(); | 481 o["x"] = buildJsonSchema(); |
481 o["y"] = buildJsonSchema(); | 482 o["y"] = buildJsonSchema(); |
482 return o; | 483 return o; |
483 } | 484 } |
484 | 485 |
485 checkUnnamed321(core.Map<core.String, api.JsonSchema> o) { | 486 checkUnnamed320(core.Map<core.String, api.JsonSchema> o) { |
486 unittest.expect(o, unittest.hasLength(2)); | 487 unittest.expect(o, unittest.hasLength(2)); |
487 checkJsonSchema(o["x"]); | 488 checkJsonSchema(o["x"]); |
488 checkJsonSchema(o["y"]); | 489 checkJsonSchema(o["y"]); |
489 } | 490 } |
490 | 491 |
491 buildUnnamed322() { | 492 buildUnnamed321() { |
492 var o = new core.Map<core.String, api.RestResource>(); | 493 var o = new core.Map<core.String, api.RestResource>(); |
493 o["x"] = buildRestResource(); | 494 o["x"] = buildRestResource(); |
494 o["y"] = buildRestResource(); | 495 o["y"] = buildRestResource(); |
495 return o; | 496 return o; |
496 } | 497 } |
497 | 498 |
498 checkUnnamed322(core.Map<core.String, api.RestResource> o) { | 499 checkUnnamed321(core.Map<core.String, api.RestResource> o) { |
499 unittest.expect(o, unittest.hasLength(2)); | 500 unittest.expect(o, unittest.hasLength(2)); |
500 checkRestResource(o["x"]); | 501 checkRestResource(o["x"]); |
501 checkRestResource(o["y"]); | 502 checkRestResource(o["y"]); |
502 } | 503 } |
503 | 504 |
504 buildUnnamed323() { | 505 buildUnnamed322() { |
505 var o = new core.Map<core.String, api.JsonSchema>(); | 506 var o = new core.Map<core.String, api.JsonSchema>(); |
506 o["x"] = buildJsonSchema(); | 507 o["x"] = buildJsonSchema(); |
507 o["y"] = buildJsonSchema(); | 508 o["y"] = buildJsonSchema(); |
508 return o; | 509 return o; |
509 } | 510 } |
510 | 511 |
511 checkUnnamed323(core.Map<core.String, api.JsonSchema> o) { | 512 checkUnnamed322(core.Map<core.String, api.JsonSchema> o) { |
512 unittest.expect(o, unittest.hasLength(2)); | 513 unittest.expect(o, unittest.hasLength(2)); |
513 checkJsonSchema(o["x"]); | 514 checkJsonSchema(o["x"]); |
514 checkJsonSchema(o["y"]); | 515 checkJsonSchema(o["y"]); |
515 } | 516 } |
516 | 517 |
517 core.int buildCounterRestDescription = 0; | 518 core.int buildCounterRestDescription = 0; |
518 buildRestDescription() { | 519 buildRestDescription() { |
519 var o = new api.RestDescription(); | 520 var o = new api.RestDescription(); |
520 buildCounterRestDescription++; | 521 buildCounterRestDescription++; |
521 if (buildCounterRestDescription < 3) { | 522 if (buildCounterRestDescription < 3) { |
522 o.auth = buildRestDescriptionAuth(); | 523 o.auth = buildRestDescriptionAuth(); |
523 o.basePath = "foo"; | 524 o.basePath = "foo"; |
524 o.baseUrl = "foo"; | 525 o.baseUrl = "foo"; |
525 o.batchPath = "foo"; | 526 o.batchPath = "foo"; |
526 o.canonicalName = "foo"; | 527 o.canonicalName = "foo"; |
527 o.description = "foo"; | 528 o.description = "foo"; |
528 o.discoveryVersion = "foo"; | 529 o.discoveryVersion = "foo"; |
529 o.documentationLink = "foo"; | 530 o.documentationLink = "foo"; |
530 o.etag = "foo"; | 531 o.etag = "foo"; |
531 o.exponentialBackoffDefault = true; | 532 o.exponentialBackoffDefault = true; |
532 o.features = buildUnnamed318(); | 533 o.features = buildUnnamed317(); |
533 o.icons = buildRestDescriptionIcons(); | 534 o.icons = buildRestDescriptionIcons(); |
534 o.id = "foo"; | 535 o.id = "foo"; |
535 o.kind = "foo"; | 536 o.kind = "foo"; |
536 o.labels = buildUnnamed319(); | 537 o.labels = buildUnnamed318(); |
537 o.methods = buildUnnamed320(); | 538 o.methods = buildUnnamed319(); |
538 o.name = "foo"; | 539 o.name = "foo"; |
539 o.ownerDomain = "foo"; | 540 o.ownerDomain = "foo"; |
540 o.ownerName = "foo"; | 541 o.ownerName = "foo"; |
541 o.packagePath = "foo"; | 542 o.packagePath = "foo"; |
542 o.parameters = buildUnnamed321(); | 543 o.parameters = buildUnnamed320(); |
543 o.protocol = "foo"; | 544 o.protocol = "foo"; |
544 o.resources = buildUnnamed322(); | 545 o.resources = buildUnnamed321(); |
545 o.revision = "foo"; | 546 o.revision = "foo"; |
546 o.rootUrl = "foo"; | 547 o.rootUrl = "foo"; |
547 o.schemas = buildUnnamed323(); | 548 o.schemas = buildUnnamed322(); |
548 o.servicePath = "foo"; | 549 o.servicePath = "foo"; |
549 o.title = "foo"; | 550 o.title = "foo"; |
550 o.version = "foo"; | 551 o.version = "foo"; |
551 o.versionModule = true; | 552 o.versionModule = true; |
552 } | 553 } |
553 buildCounterRestDescription--; | 554 buildCounterRestDescription--; |
554 return o; | 555 return o; |
555 } | 556 } |
556 | 557 |
557 checkRestDescription(api.RestDescription o) { | 558 checkRestDescription(api.RestDescription o) { |
558 buildCounterRestDescription++; | 559 buildCounterRestDescription++; |
559 if (buildCounterRestDescription < 3) { | 560 if (buildCounterRestDescription < 3) { |
560 checkRestDescriptionAuth(o.auth); | 561 checkRestDescriptionAuth(o.auth); |
561 unittest.expect(o.basePath, unittest.equals('foo')); | 562 unittest.expect(o.basePath, unittest.equals('foo')); |
562 unittest.expect(o.baseUrl, unittest.equals('foo')); | 563 unittest.expect(o.baseUrl, unittest.equals('foo')); |
563 unittest.expect(o.batchPath, unittest.equals('foo')); | 564 unittest.expect(o.batchPath, unittest.equals('foo')); |
564 unittest.expect(o.canonicalName, unittest.equals('foo')); | 565 unittest.expect(o.canonicalName, unittest.equals('foo')); |
565 unittest.expect(o.description, unittest.equals('foo')); | 566 unittest.expect(o.description, unittest.equals('foo')); |
566 unittest.expect(o.discoveryVersion, unittest.equals('foo')); | 567 unittest.expect(o.discoveryVersion, unittest.equals('foo')); |
567 unittest.expect(o.documentationLink, unittest.equals('foo')); | 568 unittest.expect(o.documentationLink, unittest.equals('foo')); |
568 unittest.expect(o.etag, unittest.equals('foo')); | 569 unittest.expect(o.etag, unittest.equals('foo')); |
569 unittest.expect(o.exponentialBackoffDefault, unittest.isTrue); | 570 unittest.expect(o.exponentialBackoffDefault, unittest.isTrue); |
570 checkUnnamed318(o.features); | 571 checkUnnamed317(o.features); |
571 checkRestDescriptionIcons(o.icons); | 572 checkRestDescriptionIcons(o.icons); |
572 unittest.expect(o.id, unittest.equals('foo')); | 573 unittest.expect(o.id, unittest.equals('foo')); |
573 unittest.expect(o.kind, unittest.equals('foo')); | 574 unittest.expect(o.kind, unittest.equals('foo')); |
574 checkUnnamed319(o.labels); | 575 checkUnnamed318(o.labels); |
575 checkUnnamed320(o.methods); | 576 checkUnnamed319(o.methods); |
576 unittest.expect(o.name, unittest.equals('foo')); | 577 unittest.expect(o.name, unittest.equals('foo')); |
577 unittest.expect(o.ownerDomain, unittest.equals('foo')); | 578 unittest.expect(o.ownerDomain, unittest.equals('foo')); |
578 unittest.expect(o.ownerName, unittest.equals('foo')); | 579 unittest.expect(o.ownerName, unittest.equals('foo')); |
579 unittest.expect(o.packagePath, unittest.equals('foo')); | 580 unittest.expect(o.packagePath, unittest.equals('foo')); |
580 checkUnnamed321(o.parameters); | 581 checkUnnamed320(o.parameters); |
581 unittest.expect(o.protocol, unittest.equals('foo')); | 582 unittest.expect(o.protocol, unittest.equals('foo')); |
582 checkUnnamed322(o.resources); | 583 checkUnnamed321(o.resources); |
583 unittest.expect(o.revision, unittest.equals('foo')); | 584 unittest.expect(o.revision, unittest.equals('foo')); |
584 unittest.expect(o.rootUrl, unittest.equals('foo')); | 585 unittest.expect(o.rootUrl, unittest.equals('foo')); |
585 checkUnnamed323(o.schemas); | 586 checkUnnamed322(o.schemas); |
586 unittest.expect(o.servicePath, unittest.equals('foo')); | 587 unittest.expect(o.servicePath, unittest.equals('foo')); |
587 unittest.expect(o.title, unittest.equals('foo')); | 588 unittest.expect(o.title, unittest.equals('foo')); |
588 unittest.expect(o.version, unittest.equals('foo')); | 589 unittest.expect(o.version, unittest.equals('foo')); |
589 unittest.expect(o.versionModule, unittest.isTrue); | 590 unittest.expect(o.versionModule, unittest.isTrue); |
590 } | 591 } |
591 buildCounterRestDescription--; | 592 buildCounterRestDescription--; |
592 } | 593 } |
593 | 594 |
594 buildUnnamed324() { | 595 buildUnnamed323() { |
595 var o = new core.List<core.String>(); | 596 var o = new core.List<core.String>(); |
596 o.add("foo"); | 597 o.add("foo"); |
597 o.add("foo"); | 598 o.add("foo"); |
598 return o; | 599 return o; |
599 } | 600 } |
600 | 601 |
601 checkUnnamed324(core.List<core.String> o) { | 602 checkUnnamed323(core.List<core.String> o) { |
602 unittest.expect(o, unittest.hasLength(2)); | 603 unittest.expect(o, unittest.hasLength(2)); |
603 unittest.expect(o[0], unittest.equals('foo')); | 604 unittest.expect(o[0], unittest.equals('foo')); |
604 unittest.expect(o[1], unittest.equals('foo')); | 605 unittest.expect(o[1], unittest.equals('foo')); |
605 } | 606 } |
606 | 607 |
607 core.int buildCounterRestMethodMediaUploadProtocolsResumable = 0; | 608 core.int buildCounterRestMethodMediaUploadProtocolsResumable = 0; |
608 buildRestMethodMediaUploadProtocolsResumable() { | 609 buildRestMethodMediaUploadProtocolsResumable() { |
609 var o = new api.RestMethodMediaUploadProtocolsResumable(); | 610 var o = new api.RestMethodMediaUploadProtocolsResumable(); |
610 buildCounterRestMethodMediaUploadProtocolsResumable++; | 611 buildCounterRestMethodMediaUploadProtocolsResumable++; |
611 if (buildCounterRestMethodMediaUploadProtocolsResumable < 3) { | 612 if (buildCounterRestMethodMediaUploadProtocolsResumable < 3) { |
612 o.multipart = true; | 613 o.multipart = true; |
613 o.path = "foo"; | 614 o.path = "foo"; |
614 } | 615 } |
615 buildCounterRestMethodMediaUploadProtocolsResumable--; | 616 buildCounterRestMethodMediaUploadProtocolsResumable--; |
616 return o; | 617 return o; |
617 } | 618 } |
618 | 619 |
619 checkRestMethodMediaUploadProtocolsResumable(api.RestMethodMediaUploadProtocolsR
esumable o) { | 620 checkRestMethodMediaUploadProtocolsResumable( |
| 621 api.RestMethodMediaUploadProtocolsResumable o) { |
620 buildCounterRestMethodMediaUploadProtocolsResumable++; | 622 buildCounterRestMethodMediaUploadProtocolsResumable++; |
621 if (buildCounterRestMethodMediaUploadProtocolsResumable < 3) { | 623 if (buildCounterRestMethodMediaUploadProtocolsResumable < 3) { |
622 unittest.expect(o.multipart, unittest.isTrue); | 624 unittest.expect(o.multipart, unittest.isTrue); |
623 unittest.expect(o.path, unittest.equals('foo')); | 625 unittest.expect(o.path, unittest.equals('foo')); |
624 } | 626 } |
625 buildCounterRestMethodMediaUploadProtocolsResumable--; | 627 buildCounterRestMethodMediaUploadProtocolsResumable--; |
626 } | 628 } |
627 | 629 |
628 core.int buildCounterRestMethodMediaUploadProtocolsSimple = 0; | 630 core.int buildCounterRestMethodMediaUploadProtocolsSimple = 0; |
629 buildRestMethodMediaUploadProtocolsSimple() { | 631 buildRestMethodMediaUploadProtocolsSimple() { |
630 var o = new api.RestMethodMediaUploadProtocolsSimple(); | 632 var o = new api.RestMethodMediaUploadProtocolsSimple(); |
631 buildCounterRestMethodMediaUploadProtocolsSimple++; | 633 buildCounterRestMethodMediaUploadProtocolsSimple++; |
632 if (buildCounterRestMethodMediaUploadProtocolsSimple < 3) { | 634 if (buildCounterRestMethodMediaUploadProtocolsSimple < 3) { |
633 o.multipart = true; | 635 o.multipart = true; |
634 o.path = "foo"; | 636 o.path = "foo"; |
635 } | 637 } |
636 buildCounterRestMethodMediaUploadProtocolsSimple--; | 638 buildCounterRestMethodMediaUploadProtocolsSimple--; |
637 return o; | 639 return o; |
638 } | 640 } |
639 | 641 |
640 checkRestMethodMediaUploadProtocolsSimple(api.RestMethodMediaUploadProtocolsSimp
le o) { | 642 checkRestMethodMediaUploadProtocolsSimple( |
| 643 api.RestMethodMediaUploadProtocolsSimple o) { |
641 buildCounterRestMethodMediaUploadProtocolsSimple++; | 644 buildCounterRestMethodMediaUploadProtocolsSimple++; |
642 if (buildCounterRestMethodMediaUploadProtocolsSimple < 3) { | 645 if (buildCounterRestMethodMediaUploadProtocolsSimple < 3) { |
643 unittest.expect(o.multipart, unittest.isTrue); | 646 unittest.expect(o.multipart, unittest.isTrue); |
644 unittest.expect(o.path, unittest.equals('foo')); | 647 unittest.expect(o.path, unittest.equals('foo')); |
645 } | 648 } |
646 buildCounterRestMethodMediaUploadProtocolsSimple--; | 649 buildCounterRestMethodMediaUploadProtocolsSimple--; |
647 } | 650 } |
648 | 651 |
649 core.int buildCounterRestMethodMediaUploadProtocols = 0; | 652 core.int buildCounterRestMethodMediaUploadProtocols = 0; |
650 buildRestMethodMediaUploadProtocols() { | 653 buildRestMethodMediaUploadProtocols() { |
(...skipping 14 matching lines...) Expand all Loading... |
665 checkRestMethodMediaUploadProtocolsSimple(o.simple); | 668 checkRestMethodMediaUploadProtocolsSimple(o.simple); |
666 } | 669 } |
667 buildCounterRestMethodMediaUploadProtocols--; | 670 buildCounterRestMethodMediaUploadProtocols--; |
668 } | 671 } |
669 | 672 |
670 core.int buildCounterRestMethodMediaUpload = 0; | 673 core.int buildCounterRestMethodMediaUpload = 0; |
671 buildRestMethodMediaUpload() { | 674 buildRestMethodMediaUpload() { |
672 var o = new api.RestMethodMediaUpload(); | 675 var o = new api.RestMethodMediaUpload(); |
673 buildCounterRestMethodMediaUpload++; | 676 buildCounterRestMethodMediaUpload++; |
674 if (buildCounterRestMethodMediaUpload < 3) { | 677 if (buildCounterRestMethodMediaUpload < 3) { |
675 o.accept = buildUnnamed324(); | 678 o.accept = buildUnnamed323(); |
676 o.maxSize = "foo"; | 679 o.maxSize = "foo"; |
677 o.protocols = buildRestMethodMediaUploadProtocols(); | 680 o.protocols = buildRestMethodMediaUploadProtocols(); |
678 } | 681 } |
679 buildCounterRestMethodMediaUpload--; | 682 buildCounterRestMethodMediaUpload--; |
680 return o; | 683 return o; |
681 } | 684 } |
682 | 685 |
683 checkRestMethodMediaUpload(api.RestMethodMediaUpload o) { | 686 checkRestMethodMediaUpload(api.RestMethodMediaUpload o) { |
684 buildCounterRestMethodMediaUpload++; | 687 buildCounterRestMethodMediaUpload++; |
685 if (buildCounterRestMethodMediaUpload < 3) { | 688 if (buildCounterRestMethodMediaUpload < 3) { |
686 checkUnnamed324(o.accept); | 689 checkUnnamed323(o.accept); |
687 unittest.expect(o.maxSize, unittest.equals('foo')); | 690 unittest.expect(o.maxSize, unittest.equals('foo')); |
688 checkRestMethodMediaUploadProtocols(o.protocols); | 691 checkRestMethodMediaUploadProtocols(o.protocols); |
689 } | 692 } |
690 buildCounterRestMethodMediaUpload--; | 693 buildCounterRestMethodMediaUpload--; |
691 } | 694 } |
692 | 695 |
693 buildUnnamed325() { | 696 buildUnnamed324() { |
694 var o = new core.List<core.String>(); | 697 var o = new core.List<core.String>(); |
695 o.add("foo"); | 698 o.add("foo"); |
696 o.add("foo"); | 699 o.add("foo"); |
697 return o; | 700 return o; |
698 } | 701 } |
699 | 702 |
700 checkUnnamed325(core.List<core.String> o) { | 703 checkUnnamed324(core.List<core.String> o) { |
701 unittest.expect(o, unittest.hasLength(2)); | 704 unittest.expect(o, unittest.hasLength(2)); |
702 unittest.expect(o[0], unittest.equals('foo')); | 705 unittest.expect(o[0], unittest.equals('foo')); |
703 unittest.expect(o[1], unittest.equals('foo')); | 706 unittest.expect(o[1], unittest.equals('foo')); |
704 } | 707 } |
705 | 708 |
706 buildUnnamed326() { | 709 buildUnnamed325() { |
707 var o = new core.Map<core.String, api.JsonSchema>(); | 710 var o = new core.Map<core.String, api.JsonSchema>(); |
708 o["x"] = buildJsonSchema(); | 711 o["x"] = buildJsonSchema(); |
709 o["y"] = buildJsonSchema(); | 712 o["y"] = buildJsonSchema(); |
710 return o; | 713 return o; |
711 } | 714 } |
712 | 715 |
713 checkUnnamed326(core.Map<core.String, api.JsonSchema> o) { | 716 checkUnnamed325(core.Map<core.String, api.JsonSchema> o) { |
714 unittest.expect(o, unittest.hasLength(2)); | 717 unittest.expect(o, unittest.hasLength(2)); |
715 checkJsonSchema(o["x"]); | 718 checkJsonSchema(o["x"]); |
716 checkJsonSchema(o["y"]); | 719 checkJsonSchema(o["y"]); |
717 } | 720 } |
718 | 721 |
719 core.int buildCounterRestMethodRequest = 0; | 722 core.int buildCounterRestMethodRequest = 0; |
720 buildRestMethodRequest() { | 723 buildRestMethodRequest() { |
721 var o = new api.RestMethodRequest(); | 724 var o = new api.RestMethodRequest(); |
722 buildCounterRestMethodRequest++; | 725 buildCounterRestMethodRequest++; |
723 if (buildCounterRestMethodRequest < 3) { | 726 if (buildCounterRestMethodRequest < 3) { |
(...skipping 25 matching lines...) Expand all Loading... |
749 } | 752 } |
750 | 753 |
751 checkRestMethodResponse(api.RestMethodResponse o) { | 754 checkRestMethodResponse(api.RestMethodResponse o) { |
752 buildCounterRestMethodResponse++; | 755 buildCounterRestMethodResponse++; |
753 if (buildCounterRestMethodResponse < 3) { | 756 if (buildCounterRestMethodResponse < 3) { |
754 unittest.expect(o.P_ref, unittest.equals('foo')); | 757 unittest.expect(o.P_ref, unittest.equals('foo')); |
755 } | 758 } |
756 buildCounterRestMethodResponse--; | 759 buildCounterRestMethodResponse--; |
757 } | 760 } |
758 | 761 |
759 buildUnnamed327() { | 762 buildUnnamed326() { |
760 var o = new core.List<core.String>(); | 763 var o = new core.List<core.String>(); |
761 o.add("foo"); | 764 o.add("foo"); |
762 o.add("foo"); | 765 o.add("foo"); |
763 return o; | 766 return o; |
764 } | 767 } |
765 | 768 |
766 checkUnnamed327(core.List<core.String> o) { | 769 checkUnnamed326(core.List<core.String> o) { |
767 unittest.expect(o, unittest.hasLength(2)); | 770 unittest.expect(o, unittest.hasLength(2)); |
768 unittest.expect(o[0], unittest.equals('foo')); | 771 unittest.expect(o[0], unittest.equals('foo')); |
769 unittest.expect(o[1], unittest.equals('foo')); | 772 unittest.expect(o[1], unittest.equals('foo')); |
770 } | 773 } |
771 | 774 |
772 core.int buildCounterRestMethod = 0; | 775 core.int buildCounterRestMethod = 0; |
773 buildRestMethod() { | 776 buildRestMethod() { |
774 var o = new api.RestMethod(); | 777 var o = new api.RestMethod(); |
775 buildCounterRestMethod++; | 778 buildCounterRestMethod++; |
776 if (buildCounterRestMethod < 3) { | 779 if (buildCounterRestMethod < 3) { |
777 o.description = "foo"; | 780 o.description = "foo"; |
778 o.etagRequired = true; | 781 o.etagRequired = true; |
779 o.httpMethod = "foo"; | 782 o.httpMethod = "foo"; |
780 o.id = "foo"; | 783 o.id = "foo"; |
781 o.mediaUpload = buildRestMethodMediaUpload(); | 784 o.mediaUpload = buildRestMethodMediaUpload(); |
782 o.parameterOrder = buildUnnamed325(); | 785 o.parameterOrder = buildUnnamed324(); |
783 o.parameters = buildUnnamed326(); | 786 o.parameters = buildUnnamed325(); |
784 o.path = "foo"; | 787 o.path = "foo"; |
785 o.request = buildRestMethodRequest(); | 788 o.request = buildRestMethodRequest(); |
786 o.response = buildRestMethodResponse(); | 789 o.response = buildRestMethodResponse(); |
787 o.scopes = buildUnnamed327(); | 790 o.scopes = buildUnnamed326(); |
788 o.supportsMediaDownload = true; | 791 o.supportsMediaDownload = true; |
789 o.supportsMediaUpload = true; | 792 o.supportsMediaUpload = true; |
790 o.supportsSubscription = true; | 793 o.supportsSubscription = true; |
791 o.useMediaDownloadService = true; | 794 o.useMediaDownloadService = true; |
792 } | 795 } |
793 buildCounterRestMethod--; | 796 buildCounterRestMethod--; |
794 return o; | 797 return o; |
795 } | 798 } |
796 | 799 |
797 checkRestMethod(api.RestMethod o) { | 800 checkRestMethod(api.RestMethod o) { |
798 buildCounterRestMethod++; | 801 buildCounterRestMethod++; |
799 if (buildCounterRestMethod < 3) { | 802 if (buildCounterRestMethod < 3) { |
800 unittest.expect(o.description, unittest.equals('foo')); | 803 unittest.expect(o.description, unittest.equals('foo')); |
801 unittest.expect(o.etagRequired, unittest.isTrue); | 804 unittest.expect(o.etagRequired, unittest.isTrue); |
802 unittest.expect(o.httpMethod, unittest.equals('foo')); | 805 unittest.expect(o.httpMethod, unittest.equals('foo')); |
803 unittest.expect(o.id, unittest.equals('foo')); | 806 unittest.expect(o.id, unittest.equals('foo')); |
804 checkRestMethodMediaUpload(o.mediaUpload); | 807 checkRestMethodMediaUpload(o.mediaUpload); |
805 checkUnnamed325(o.parameterOrder); | 808 checkUnnamed324(o.parameterOrder); |
806 checkUnnamed326(o.parameters); | 809 checkUnnamed325(o.parameters); |
807 unittest.expect(o.path, unittest.equals('foo')); | 810 unittest.expect(o.path, unittest.equals('foo')); |
808 checkRestMethodRequest(o.request); | 811 checkRestMethodRequest(o.request); |
809 checkRestMethodResponse(o.response); | 812 checkRestMethodResponse(o.response); |
810 checkUnnamed327(o.scopes); | 813 checkUnnamed326(o.scopes); |
811 unittest.expect(o.supportsMediaDownload, unittest.isTrue); | 814 unittest.expect(o.supportsMediaDownload, unittest.isTrue); |
812 unittest.expect(o.supportsMediaUpload, unittest.isTrue); | 815 unittest.expect(o.supportsMediaUpload, unittest.isTrue); |
813 unittest.expect(o.supportsSubscription, unittest.isTrue); | 816 unittest.expect(o.supportsSubscription, unittest.isTrue); |
814 unittest.expect(o.useMediaDownloadService, unittest.isTrue); | 817 unittest.expect(o.useMediaDownloadService, unittest.isTrue); |
815 } | 818 } |
816 buildCounterRestMethod--; | 819 buildCounterRestMethod--; |
817 } | 820 } |
818 | 821 |
819 buildUnnamed328() { | 822 buildUnnamed327() { |
820 var o = new core.Map<core.String, api.RestMethod>(); | 823 var o = new core.Map<core.String, api.RestMethod>(); |
821 o["x"] = buildRestMethod(); | 824 o["x"] = buildRestMethod(); |
822 o["y"] = buildRestMethod(); | 825 o["y"] = buildRestMethod(); |
823 return o; | 826 return o; |
824 } | 827 } |
825 | 828 |
826 checkUnnamed328(core.Map<core.String, api.RestMethod> o) { | 829 checkUnnamed327(core.Map<core.String, api.RestMethod> o) { |
827 unittest.expect(o, unittest.hasLength(2)); | 830 unittest.expect(o, unittest.hasLength(2)); |
828 checkRestMethod(o["x"]); | 831 checkRestMethod(o["x"]); |
829 checkRestMethod(o["y"]); | 832 checkRestMethod(o["y"]); |
830 } | 833 } |
831 | 834 |
832 buildUnnamed329() { | 835 buildUnnamed328() { |
833 var o = new core.Map<core.String, api.RestResource>(); | 836 var o = new core.Map<core.String, api.RestResource>(); |
834 o["x"] = buildRestResource(); | 837 o["x"] = buildRestResource(); |
835 o["y"] = buildRestResource(); | 838 o["y"] = buildRestResource(); |
836 return o; | 839 return o; |
837 } | 840 } |
838 | 841 |
839 checkUnnamed329(core.Map<core.String, api.RestResource> o) { | 842 checkUnnamed328(core.Map<core.String, api.RestResource> o) { |
840 unittest.expect(o, unittest.hasLength(2)); | 843 unittest.expect(o, unittest.hasLength(2)); |
841 checkRestResource(o["x"]); | 844 checkRestResource(o["x"]); |
842 checkRestResource(o["y"]); | 845 checkRestResource(o["y"]); |
843 } | 846 } |
844 | 847 |
845 core.int buildCounterRestResource = 0; | 848 core.int buildCounterRestResource = 0; |
846 buildRestResource() { | 849 buildRestResource() { |
847 var o = new api.RestResource(); | 850 var o = new api.RestResource(); |
848 buildCounterRestResource++; | 851 buildCounterRestResource++; |
849 if (buildCounterRestResource < 3) { | 852 if (buildCounterRestResource < 3) { |
850 o.methods = buildUnnamed328(); | 853 o.methods = buildUnnamed327(); |
851 o.resources = buildUnnamed329(); | 854 o.resources = buildUnnamed328(); |
852 } | 855 } |
853 buildCounterRestResource--; | 856 buildCounterRestResource--; |
854 return o; | 857 return o; |
855 } | 858 } |
856 | 859 |
857 checkRestResource(api.RestResource o) { | 860 checkRestResource(api.RestResource o) { |
858 buildCounterRestResource++; | 861 buildCounterRestResource++; |
859 if (buildCounterRestResource < 3) { | 862 if (buildCounterRestResource < 3) { |
860 checkUnnamed328(o.methods); | 863 checkUnnamed327(o.methods); |
861 checkUnnamed329(o.resources); | 864 checkUnnamed328(o.resources); |
862 } | 865 } |
863 buildCounterRestResource--; | 866 buildCounterRestResource--; |
864 } | 867 } |
865 | 868 |
866 | |
867 main() { | 869 main() { |
868 unittest.group("obj-schema-DirectoryListItemsIcons", () { | 870 unittest.group("obj-schema-DirectoryListItemsIcons", () { |
869 unittest.test("to-json--from-json", () { | 871 unittest.test("to-json--from-json", () { |
870 var o = buildDirectoryListItemsIcons(); | 872 var o = buildDirectoryListItemsIcons(); |
871 var od = new api.DirectoryListItemsIcons.fromJson(o.toJson()); | 873 var od = new api.DirectoryListItemsIcons.fromJson(o.toJson()); |
872 checkDirectoryListItemsIcons(od); | 874 checkDirectoryListItemsIcons(od); |
873 }); | 875 }); |
874 }); | 876 }); |
875 | 877 |
876 | |
877 unittest.group("obj-schema-DirectoryListItems", () { | 878 unittest.group("obj-schema-DirectoryListItems", () { |
878 unittest.test("to-json--from-json", () { | 879 unittest.test("to-json--from-json", () { |
879 var o = buildDirectoryListItems(); | 880 var o = buildDirectoryListItems(); |
880 var od = new api.DirectoryListItems.fromJson(o.toJson()); | 881 var od = new api.DirectoryListItems.fromJson(o.toJson()); |
881 checkDirectoryListItems(od); | 882 checkDirectoryListItems(od); |
882 }); | 883 }); |
883 }); | 884 }); |
884 | 885 |
885 | |
886 unittest.group("obj-schema-DirectoryList", () { | 886 unittest.group("obj-schema-DirectoryList", () { |
887 unittest.test("to-json--from-json", () { | 887 unittest.test("to-json--from-json", () { |
888 var o = buildDirectoryList(); | 888 var o = buildDirectoryList(); |
889 var od = new api.DirectoryList.fromJson(o.toJson()); | 889 var od = new api.DirectoryList.fromJson(o.toJson()); |
890 checkDirectoryList(od); | 890 checkDirectoryList(od); |
891 }); | 891 }); |
892 }); | 892 }); |
893 | 893 |
894 | |
895 unittest.group("obj-schema-JsonSchemaAnnotations", () { | 894 unittest.group("obj-schema-JsonSchemaAnnotations", () { |
896 unittest.test("to-json--from-json", () { | 895 unittest.test("to-json--from-json", () { |
897 var o = buildJsonSchemaAnnotations(); | 896 var o = buildJsonSchemaAnnotations(); |
898 var od = new api.JsonSchemaAnnotations.fromJson(o.toJson()); | 897 var od = new api.JsonSchemaAnnotations.fromJson(o.toJson()); |
899 checkJsonSchemaAnnotations(od); | 898 checkJsonSchemaAnnotations(od); |
900 }); | 899 }); |
901 }); | 900 }); |
902 | 901 |
903 | |
904 unittest.group("obj-schema-JsonSchemaVariantMap", () { | 902 unittest.group("obj-schema-JsonSchemaVariantMap", () { |
905 unittest.test("to-json--from-json", () { | 903 unittest.test("to-json--from-json", () { |
906 var o = buildJsonSchemaVariantMap(); | 904 var o = buildJsonSchemaVariantMap(); |
907 var od = new api.JsonSchemaVariantMap.fromJson(o.toJson()); | 905 var od = new api.JsonSchemaVariantMap.fromJson(o.toJson()); |
908 checkJsonSchemaVariantMap(od); | 906 checkJsonSchemaVariantMap(od); |
909 }); | 907 }); |
910 }); | 908 }); |
911 | 909 |
912 | |
913 unittest.group("obj-schema-JsonSchemaVariant", () { | 910 unittest.group("obj-schema-JsonSchemaVariant", () { |
914 unittest.test("to-json--from-json", () { | 911 unittest.test("to-json--from-json", () { |
915 var o = buildJsonSchemaVariant(); | 912 var o = buildJsonSchemaVariant(); |
916 var od = new api.JsonSchemaVariant.fromJson(o.toJson()); | 913 var od = new api.JsonSchemaVariant.fromJson(o.toJson()); |
917 checkJsonSchemaVariant(od); | 914 checkJsonSchemaVariant(od); |
918 }); | 915 }); |
919 }); | 916 }); |
920 | 917 |
921 | |
922 unittest.group("obj-schema-JsonSchema", () { | 918 unittest.group("obj-schema-JsonSchema", () { |
923 unittest.test("to-json--from-json", () { | 919 unittest.test("to-json--from-json", () { |
924 var o = buildJsonSchema(); | 920 var o = buildJsonSchema(); |
925 var od = new api.JsonSchema.fromJson(o.toJson()); | 921 var od = new api.JsonSchema.fromJson(o.toJson()); |
926 checkJsonSchema(od); | 922 checkJsonSchema(od); |
927 }); | 923 }); |
928 }); | 924 }); |
929 | 925 |
930 | |
931 unittest.group("obj-schema-RestDescriptionAuthOauth2ScopesValue", () { | 926 unittest.group("obj-schema-RestDescriptionAuthOauth2ScopesValue", () { |
932 unittest.test("to-json--from-json", () { | 927 unittest.test("to-json--from-json", () { |
933 var o = buildRestDescriptionAuthOauth2ScopesValue(); | 928 var o = buildRestDescriptionAuthOauth2ScopesValue(); |
934 var od = new api.RestDescriptionAuthOauth2ScopesValue.fromJson(o.toJson())
; | 929 var od = |
| 930 new api.RestDescriptionAuthOauth2ScopesValue.fromJson(o.toJson()); |
935 checkRestDescriptionAuthOauth2ScopesValue(od); | 931 checkRestDescriptionAuthOauth2ScopesValue(od); |
936 }); | 932 }); |
937 }); | 933 }); |
938 | 934 |
939 | |
940 unittest.group("obj-schema-RestDescriptionAuthOauth2", () { | 935 unittest.group("obj-schema-RestDescriptionAuthOauth2", () { |
941 unittest.test("to-json--from-json", () { | 936 unittest.test("to-json--from-json", () { |
942 var o = buildRestDescriptionAuthOauth2(); | 937 var o = buildRestDescriptionAuthOauth2(); |
943 var od = new api.RestDescriptionAuthOauth2.fromJson(o.toJson()); | 938 var od = new api.RestDescriptionAuthOauth2.fromJson(o.toJson()); |
944 checkRestDescriptionAuthOauth2(od); | 939 checkRestDescriptionAuthOauth2(od); |
945 }); | 940 }); |
946 }); | 941 }); |
947 | 942 |
948 | |
949 unittest.group("obj-schema-RestDescriptionAuth", () { | 943 unittest.group("obj-schema-RestDescriptionAuth", () { |
950 unittest.test("to-json--from-json", () { | 944 unittest.test("to-json--from-json", () { |
951 var o = buildRestDescriptionAuth(); | 945 var o = buildRestDescriptionAuth(); |
952 var od = new api.RestDescriptionAuth.fromJson(o.toJson()); | 946 var od = new api.RestDescriptionAuth.fromJson(o.toJson()); |
953 checkRestDescriptionAuth(od); | 947 checkRestDescriptionAuth(od); |
954 }); | 948 }); |
955 }); | 949 }); |
956 | 950 |
957 | |
958 unittest.group("obj-schema-RestDescriptionIcons", () { | 951 unittest.group("obj-schema-RestDescriptionIcons", () { |
959 unittest.test("to-json--from-json", () { | 952 unittest.test("to-json--from-json", () { |
960 var o = buildRestDescriptionIcons(); | 953 var o = buildRestDescriptionIcons(); |
961 var od = new api.RestDescriptionIcons.fromJson(o.toJson()); | 954 var od = new api.RestDescriptionIcons.fromJson(o.toJson()); |
962 checkRestDescriptionIcons(od); | 955 checkRestDescriptionIcons(od); |
963 }); | 956 }); |
964 }); | 957 }); |
965 | 958 |
966 | |
967 unittest.group("obj-schema-RestDescription", () { | 959 unittest.group("obj-schema-RestDescription", () { |
968 unittest.test("to-json--from-json", () { | 960 unittest.test("to-json--from-json", () { |
969 var o = buildRestDescription(); | 961 var o = buildRestDescription(); |
970 var od = new api.RestDescription.fromJson(o.toJson()); | 962 var od = new api.RestDescription.fromJson(o.toJson()); |
971 checkRestDescription(od); | 963 checkRestDescription(od); |
972 }); | 964 }); |
973 }); | 965 }); |
974 | 966 |
975 | |
976 unittest.group("obj-schema-RestMethodMediaUploadProtocolsResumable", () { | 967 unittest.group("obj-schema-RestMethodMediaUploadProtocolsResumable", () { |
977 unittest.test("to-json--from-json", () { | 968 unittest.test("to-json--from-json", () { |
978 var o = buildRestMethodMediaUploadProtocolsResumable(); | 969 var o = buildRestMethodMediaUploadProtocolsResumable(); |
979 var od = new api.RestMethodMediaUploadProtocolsResumable.fromJson(o.toJson
()); | 970 var od = |
| 971 new api.RestMethodMediaUploadProtocolsResumable.fromJson(o.toJson()); |
980 checkRestMethodMediaUploadProtocolsResumable(od); | 972 checkRestMethodMediaUploadProtocolsResumable(od); |
981 }); | 973 }); |
982 }); | 974 }); |
983 | 975 |
984 | |
985 unittest.group("obj-schema-RestMethodMediaUploadProtocolsSimple", () { | 976 unittest.group("obj-schema-RestMethodMediaUploadProtocolsSimple", () { |
986 unittest.test("to-json--from-json", () { | 977 unittest.test("to-json--from-json", () { |
987 var o = buildRestMethodMediaUploadProtocolsSimple(); | 978 var o = buildRestMethodMediaUploadProtocolsSimple(); |
988 var od = new api.RestMethodMediaUploadProtocolsSimple.fromJson(o.toJson())
; | 979 var od = |
| 980 new api.RestMethodMediaUploadProtocolsSimple.fromJson(o.toJson()); |
989 checkRestMethodMediaUploadProtocolsSimple(od); | 981 checkRestMethodMediaUploadProtocolsSimple(od); |
990 }); | 982 }); |
991 }); | 983 }); |
992 | 984 |
993 | |
994 unittest.group("obj-schema-RestMethodMediaUploadProtocols", () { | 985 unittest.group("obj-schema-RestMethodMediaUploadProtocols", () { |
995 unittest.test("to-json--from-json", () { | 986 unittest.test("to-json--from-json", () { |
996 var o = buildRestMethodMediaUploadProtocols(); | 987 var o = buildRestMethodMediaUploadProtocols(); |
997 var od = new api.RestMethodMediaUploadProtocols.fromJson(o.toJson()); | 988 var od = new api.RestMethodMediaUploadProtocols.fromJson(o.toJson()); |
998 checkRestMethodMediaUploadProtocols(od); | 989 checkRestMethodMediaUploadProtocols(od); |
999 }); | 990 }); |
1000 }); | 991 }); |
1001 | 992 |
1002 | |
1003 unittest.group("obj-schema-RestMethodMediaUpload", () { | 993 unittest.group("obj-schema-RestMethodMediaUpload", () { |
1004 unittest.test("to-json--from-json", () { | 994 unittest.test("to-json--from-json", () { |
1005 var o = buildRestMethodMediaUpload(); | 995 var o = buildRestMethodMediaUpload(); |
1006 var od = new api.RestMethodMediaUpload.fromJson(o.toJson()); | 996 var od = new api.RestMethodMediaUpload.fromJson(o.toJson()); |
1007 checkRestMethodMediaUpload(od); | 997 checkRestMethodMediaUpload(od); |
1008 }); | 998 }); |
1009 }); | 999 }); |
1010 | 1000 |
1011 | |
1012 unittest.group("obj-schema-RestMethodRequest", () { | 1001 unittest.group("obj-schema-RestMethodRequest", () { |
1013 unittest.test("to-json--from-json", () { | 1002 unittest.test("to-json--from-json", () { |
1014 var o = buildRestMethodRequest(); | 1003 var o = buildRestMethodRequest(); |
1015 var od = new api.RestMethodRequest.fromJson(o.toJson()); | 1004 var od = new api.RestMethodRequest.fromJson(o.toJson()); |
1016 checkRestMethodRequest(od); | 1005 checkRestMethodRequest(od); |
1017 }); | 1006 }); |
1018 }); | 1007 }); |
1019 | 1008 |
1020 | |
1021 unittest.group("obj-schema-RestMethodResponse", () { | 1009 unittest.group("obj-schema-RestMethodResponse", () { |
1022 unittest.test("to-json--from-json", () { | 1010 unittest.test("to-json--from-json", () { |
1023 var o = buildRestMethodResponse(); | 1011 var o = buildRestMethodResponse(); |
1024 var od = new api.RestMethodResponse.fromJson(o.toJson()); | 1012 var od = new api.RestMethodResponse.fromJson(o.toJson()); |
1025 checkRestMethodResponse(od); | 1013 checkRestMethodResponse(od); |
1026 }); | 1014 }); |
1027 }); | 1015 }); |
1028 | 1016 |
1029 | |
1030 unittest.group("obj-schema-RestMethod", () { | 1017 unittest.group("obj-schema-RestMethod", () { |
1031 unittest.test("to-json--from-json", () { | 1018 unittest.test("to-json--from-json", () { |
1032 var o = buildRestMethod(); | 1019 var o = buildRestMethod(); |
1033 var od = new api.RestMethod.fromJson(o.toJson()); | 1020 var od = new api.RestMethod.fromJson(o.toJson()); |
1034 checkRestMethod(od); | 1021 checkRestMethod(od); |
1035 }); | 1022 }); |
1036 }); | 1023 }); |
1037 | 1024 |
1038 | |
1039 unittest.group("obj-schema-RestResource", () { | 1025 unittest.group("obj-schema-RestResource", () { |
1040 unittest.test("to-json--from-json", () { | 1026 unittest.test("to-json--from-json", () { |
1041 var o = buildRestResource(); | 1027 var o = buildRestResource(); |
1042 var od = new api.RestResource.fromJson(o.toJson()); | 1028 var od = new api.RestResource.fromJson(o.toJson()); |
1043 checkRestResource(od); | 1029 checkRestResource(od); |
1044 }); | 1030 }); |
1045 }); | 1031 }); |
1046 | 1032 |
1047 | |
1048 unittest.group("resource-ApisResourceApi", () { | 1033 unittest.group("resource-ApisResourceApi", () { |
1049 unittest.test("method--getRest", () { | 1034 unittest.test("method--getRest", () { |
1050 | |
1051 var mock = new HttpServerMock(); | 1035 var mock = new HttpServerMock(); |
1052 api.ApisResourceApi res = new api.DiscoveryApi(mock).apis; | 1036 api.ApisResourceApi res = new api.DiscoveryApi(mock).apis; |
1053 var arg_api = "foo"; | 1037 var arg_api = "foo"; |
1054 var arg_version = "foo"; | 1038 var arg_version = "foo"; |
1055 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1039 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1056 var path = (req.url).path; | 1040 var path = (req.url).path; |
1057 var pathOffset = 0; | 1041 var pathOffset = 0; |
1058 var index; | 1042 var index; |
1059 var subPart; | 1043 var subPart; |
1060 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1044 unittest.expect( |
| 1045 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1061 pathOffset += 1; | 1046 pathOffset += 1; |
1062 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("discovery/v1/")); | 1047 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 1048 unittest.equals("discovery/v1/")); |
1063 pathOffset += 13; | 1049 pathOffset += 13; |
1064 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("apis/")); | 1050 unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| 1051 unittest.equals("apis/")); |
1065 pathOffset += 5; | 1052 pathOffset += 5; |
1066 index = path.indexOf("/", pathOffset); | 1053 index = path.indexOf("/", pathOffset); |
1067 unittest.expect(index >= 0, unittest.isTrue); | 1054 unittest.expect(index >= 0, unittest.isTrue); |
1068 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1055 subPart = |
| 1056 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1069 pathOffset = index; | 1057 pathOffset = index; |
1070 unittest.expect(subPart, unittest.equals("$arg_api")); | 1058 unittest.expect(subPart, unittest.equals("$arg_api")); |
1071 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1059 unittest.expect( |
| 1060 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1072 pathOffset += 1; | 1061 pathOffset += 1; |
1073 index = path.indexOf("/rest", pathOffset); | 1062 index = path.indexOf("/rest", pathOffset); |
1074 unittest.expect(index >= 0, unittest.isTrue); | 1063 unittest.expect(index >= 0, unittest.isTrue); |
1075 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1064 subPart = |
| 1065 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
1076 pathOffset = index; | 1066 pathOffset = index; |
1077 unittest.expect(subPart, unittest.equals("$arg_version")); | 1067 unittest.expect(subPart, unittest.equals("$arg_version")); |
1078 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/rest")); | 1068 unittest.expect(path.substring(pathOffset, pathOffset + 5), |
| 1069 unittest.equals("/rest")); |
1079 pathOffset += 5; | 1070 pathOffset += 5; |
1080 | 1071 |
1081 var query = (req.url).query; | 1072 var query = (req.url).query; |
1082 var queryOffset = 0; | 1073 var queryOffset = 0; |
1083 var queryMap = {}; | 1074 var queryMap = {}; |
1084 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1075 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1085 parseBool(n) { | 1076 parseBool(n) { |
1086 if (n == "true") return true; | 1077 if (n == "true") return true; |
1087 if (n == "false") return false; | 1078 if (n == "false") return false; |
1088 if (n == null) return null; | 1079 if (n == null) return null; |
1089 throw new core.ArgumentError("Invalid boolean: $n"); | 1080 throw new core.ArgumentError("Invalid boolean: $n"); |
1090 } | 1081 } |
| 1082 |
1091 if (query.length > 0) { | 1083 if (query.length > 0) { |
1092 for (var part in query.split("&")) { | 1084 for (var part in query.split("&")) { |
1093 var keyvalue = part.split("="); | 1085 var keyvalue = part.split("="); |
1094 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1086 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1087 core.Uri.decodeQueryComponent(keyvalue[1])); |
1095 } | 1088 } |
1096 } | 1089 } |
1097 | 1090 |
1098 | |
1099 var h = { | 1091 var h = { |
1100 "content-type" : "application/json; charset=utf-8", | 1092 "content-type": "application/json; charset=utf-8", |
1101 }; | 1093 }; |
1102 var resp = convert.JSON.encode(buildRestDescription()); | 1094 var resp = convert.JSON.encode(buildRestDescription()); |
1103 return new async.Future.value(stringResponse(200, h, resp)); | 1095 return new async.Future.value(stringResponse(200, h, resp)); |
1104 }), true); | 1096 }), true); |
1105 res.getRest(arg_api, arg_version).then(unittest.expectAsync1(((api.RestDes
cription response) { | 1097 res |
| 1098 .getRest(arg_api, arg_version) |
| 1099 .then(unittest.expectAsync1(((api.RestDescription response) { |
1106 checkRestDescription(response); | 1100 checkRestDescription(response); |
1107 }))); | 1101 }))); |
1108 }); | 1102 }); |
1109 | 1103 |
1110 unittest.test("method--list", () { | 1104 unittest.test("method--list", () { |
1111 | |
1112 var mock = new HttpServerMock(); | 1105 var mock = new HttpServerMock(); |
1113 api.ApisResourceApi res = new api.DiscoveryApi(mock).apis; | 1106 api.ApisResourceApi res = new api.DiscoveryApi(mock).apis; |
1114 var arg_name = "foo"; | 1107 var arg_name = "foo"; |
1115 var arg_preferred = true; | 1108 var arg_preferred = true; |
1116 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1109 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
1117 var path = (req.url).path; | 1110 var path = (req.url).path; |
1118 var pathOffset = 0; | 1111 var pathOffset = 0; |
1119 var index; | 1112 var index; |
1120 var subPart; | 1113 var subPart; |
1121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1114 unittest.expect( |
| 1115 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
1122 pathOffset += 1; | 1116 pathOffset += 1; |
1123 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("discovery/v1/")); | 1117 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 1118 unittest.equals("discovery/v1/")); |
1124 pathOffset += 13; | 1119 pathOffset += 13; |
1125 unittest.expect(path.substring(pathOffset, pathOffset + 4), unittest.equ
als("apis")); | 1120 unittest.expect(path.substring(pathOffset, pathOffset + 4), |
| 1121 unittest.equals("apis")); |
1126 pathOffset += 4; | 1122 pathOffset += 4; |
1127 | 1123 |
1128 var query = (req.url).query; | 1124 var query = (req.url).query; |
1129 var queryOffset = 0; | 1125 var queryOffset = 0; |
1130 var queryMap = {}; | 1126 var queryMap = {}; |
1131 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1127 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1132 parseBool(n) { | 1128 parseBool(n) { |
1133 if (n == "true") return true; | 1129 if (n == "true") return true; |
1134 if (n == "false") return false; | 1130 if (n == "false") return false; |
1135 if (n == null) return null; | 1131 if (n == null) return null; |
1136 throw new core.ArgumentError("Invalid boolean: $n"); | 1132 throw new core.ArgumentError("Invalid boolean: $n"); |
1137 } | 1133 } |
| 1134 |
1138 if (query.length > 0) { | 1135 if (query.length > 0) { |
1139 for (var part in query.split("&")) { | 1136 for (var part in query.split("&")) { |
1140 var keyvalue = part.split("="); | 1137 var keyvalue = part.split("="); |
1141 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1138 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1139 core.Uri.decodeQueryComponent(keyvalue[1])); |
1142 } | 1140 } |
1143 } | 1141 } |
1144 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); | 1142 unittest.expect(queryMap["name"].first, unittest.equals(arg_name)); |
1145 unittest.expect(queryMap["preferred"].first, unittest.equals("$arg_prefe
rred")); | 1143 unittest.expect( |
1146 | 1144 queryMap["preferred"].first, unittest.equals("$arg_preferred")); |
1147 | 1145 |
1148 var h = { | 1146 var h = { |
1149 "content-type" : "application/json; charset=utf-8", | 1147 "content-type": "application/json; charset=utf-8", |
1150 }; | 1148 }; |
1151 var resp = convert.JSON.encode(buildDirectoryList()); | 1149 var resp = convert.JSON.encode(buildDirectoryList()); |
1152 return new async.Future.value(stringResponse(200, h, resp)); | 1150 return new async.Future.value(stringResponse(200, h, resp)); |
1153 }), true); | 1151 }), true); |
1154 res.list(name: arg_name, preferred: arg_preferred).then(unittest.expectAsy
nc1(((api.DirectoryList response) { | 1152 res |
| 1153 .list(name: arg_name, preferred: arg_preferred) |
| 1154 .then(unittest.expectAsync1(((api.DirectoryList response) { |
1155 checkDirectoryList(response); | 1155 checkDirectoryList(response); |
1156 }))); | 1156 }))); |
1157 }); | 1157 }); |
1158 | |
1159 }); | 1158 }); |
1160 | |
1161 | |
1162 } | 1159 } |
1163 | |
OLD | NEW |