Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: generated/googleapis_beta/test/runtimeconfig/v1beta1_test.dart

Issue 3006323002: Api-Roll 54: 2017-09-11 (Closed)
Patch Set: use 2.0.0-dev.infinity sdk constraint in pubspecs Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 library googleapis_beta.runtimeconfig.v1beta1.test; 1 library googleapis_beta.runtimeconfig.v1beta1.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_beta/runtimeconfig/v1beta1.dart' as api; 10 import 'package:googleapis_beta/runtimeconfig/v1beta1.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 buildUnnamed3553() { 53 buildUnnamed3561() {
55 var o = new core.List<core.String>(); 54 var o = new core.List<core.String>();
56 o.add("foo"); 55 o.add("foo");
57 o.add("foo"); 56 o.add("foo");
58 return o; 57 return o;
59 } 58 }
60 59
61 checkUnnamed3553(core.List<core.String> o) { 60 checkUnnamed3561(core.List<core.String> o) {
62 unittest.expect(o, unittest.hasLength(2)); 61 unittest.expect(o, unittest.hasLength(2));
63 unittest.expect(o[0], unittest.equals('foo')); 62 unittest.expect(o[0], unittest.equals('foo'));
64 unittest.expect(o[1], unittest.equals('foo')); 63 unittest.expect(o[1], unittest.equals('foo'));
65 } 64 }
66 65
67 core.int buildCounterBinding = 0; 66 core.int buildCounterBinding = 0;
68 buildBinding() { 67 buildBinding() {
69 var o = new api.Binding(); 68 var o = new api.Binding();
70 buildCounterBinding++; 69 buildCounterBinding++;
71 if (buildCounterBinding < 3) { 70 if (buildCounterBinding < 3) {
72 o.members = buildUnnamed3553(); 71 o.members = buildUnnamed3561();
73 o.role = "foo"; 72 o.role = "foo";
74 } 73 }
75 buildCounterBinding--; 74 buildCounterBinding--;
76 return o; 75 return o;
77 } 76 }
78 77
79 checkBinding(api.Binding o) { 78 checkBinding(api.Binding o) {
80 buildCounterBinding++; 79 buildCounterBinding++;
81 if (buildCounterBinding < 3) { 80 if (buildCounterBinding < 3) {
82 checkUnnamed3553(o.members); 81 checkUnnamed3561(o.members);
83 unittest.expect(o.role, unittest.equals('foo')); 82 unittest.expect(o.role, unittest.equals('foo'));
84 } 83 }
85 buildCounterBinding--; 84 buildCounterBinding--;
86 } 85 }
87 86
88 core.int buildCounterCardinality = 0; 87 core.int buildCounterCardinality = 0;
89 buildCardinality() { 88 buildCardinality() {
90 var o = new api.Cardinality(); 89 var o = new api.Cardinality();
91 buildCounterCardinality++; 90 buildCounterCardinality++;
92 if (buildCounterCardinality < 3) { 91 if (buildCounterCardinality < 3) {
(...skipping 10 matching lines...) Expand all
103 unittest.expect(o.number, unittest.equals(42)); 102 unittest.expect(o.number, unittest.equals(42));
104 unittest.expect(o.path, unittest.equals('foo')); 103 unittest.expect(o.path, unittest.equals('foo'));
105 } 104 }
106 buildCounterCardinality--; 105 buildCounterCardinality--;
107 } 106 }
108 107
109 core.int buildCounterEmpty = 0; 108 core.int buildCounterEmpty = 0;
110 buildEmpty() { 109 buildEmpty() {
111 var o = new api.Empty(); 110 var o = new api.Empty();
112 buildCounterEmpty++; 111 buildCounterEmpty++;
113 if (buildCounterEmpty < 3) { 112 if (buildCounterEmpty < 3) {}
114 }
115 buildCounterEmpty--; 113 buildCounterEmpty--;
116 return o; 114 return o;
117 } 115 }
118 116
119 checkEmpty(api.Empty o) { 117 checkEmpty(api.Empty o) {
120 buildCounterEmpty++; 118 buildCounterEmpty++;
121 if (buildCounterEmpty < 3) { 119 if (buildCounterEmpty < 3) {}
122 }
123 buildCounterEmpty--; 120 buildCounterEmpty--;
124 } 121 }
125 122
126 core.int buildCounterEndCondition = 0; 123 core.int buildCounterEndCondition = 0;
127 buildEndCondition() { 124 buildEndCondition() {
128 var o = new api.EndCondition(); 125 var o = new api.EndCondition();
129 buildCounterEndCondition++; 126 buildCounterEndCondition++;
130 if (buildCounterEndCondition < 3) { 127 if (buildCounterEndCondition < 3) {
131 o.cardinality = buildCardinality(); 128 o.cardinality = buildCardinality();
132 } 129 }
133 buildCounterEndCondition--; 130 buildCounterEndCondition--;
134 return o; 131 return o;
135 } 132 }
136 133
137 checkEndCondition(api.EndCondition o) { 134 checkEndCondition(api.EndCondition o) {
138 buildCounterEndCondition++; 135 buildCounterEndCondition++;
139 if (buildCounterEndCondition < 3) { 136 if (buildCounterEndCondition < 3) {
140 checkCardinality(o.cardinality); 137 checkCardinality(o.cardinality);
141 } 138 }
142 buildCounterEndCondition--; 139 buildCounterEndCondition--;
143 } 140 }
144 141
145 buildUnnamed3554() { 142 buildUnnamed3562() {
146 var o = new core.List<api.RuntimeConfig>(); 143 var o = new core.List<api.RuntimeConfig>();
147 o.add(buildRuntimeConfig()); 144 o.add(buildRuntimeConfig());
148 o.add(buildRuntimeConfig()); 145 o.add(buildRuntimeConfig());
149 return o; 146 return o;
150 } 147 }
151 148
152 checkUnnamed3554(core.List<api.RuntimeConfig> o) { 149 checkUnnamed3562(core.List<api.RuntimeConfig> o) {
153 unittest.expect(o, unittest.hasLength(2)); 150 unittest.expect(o, unittest.hasLength(2));
154 checkRuntimeConfig(o[0]); 151 checkRuntimeConfig(o[0]);
155 checkRuntimeConfig(o[1]); 152 checkRuntimeConfig(o[1]);
156 } 153 }
157 154
158 core.int buildCounterListConfigsResponse = 0; 155 core.int buildCounterListConfigsResponse = 0;
159 buildListConfigsResponse() { 156 buildListConfigsResponse() {
160 var o = new api.ListConfigsResponse(); 157 var o = new api.ListConfigsResponse();
161 buildCounterListConfigsResponse++; 158 buildCounterListConfigsResponse++;
162 if (buildCounterListConfigsResponse < 3) { 159 if (buildCounterListConfigsResponse < 3) {
163 o.configs = buildUnnamed3554(); 160 o.configs = buildUnnamed3562();
164 o.nextPageToken = "foo"; 161 o.nextPageToken = "foo";
165 } 162 }
166 buildCounterListConfigsResponse--; 163 buildCounterListConfigsResponse--;
167 return o; 164 return o;
168 } 165 }
169 166
170 checkListConfigsResponse(api.ListConfigsResponse o) { 167 checkListConfigsResponse(api.ListConfigsResponse o) {
171 buildCounterListConfigsResponse++; 168 buildCounterListConfigsResponse++;
172 if (buildCounterListConfigsResponse < 3) { 169 if (buildCounterListConfigsResponse < 3) {
173 checkUnnamed3554(o.configs); 170 checkUnnamed3562(o.configs);
174 unittest.expect(o.nextPageToken, unittest.equals('foo')); 171 unittest.expect(o.nextPageToken, unittest.equals('foo'));
175 } 172 }
176 buildCounterListConfigsResponse--; 173 buildCounterListConfigsResponse--;
177 } 174 }
178 175
179 buildUnnamed3555() { 176 buildUnnamed3563() {
180 var o = new core.List<api.Variable>(); 177 var o = new core.List<api.Variable>();
181 o.add(buildVariable()); 178 o.add(buildVariable());
182 o.add(buildVariable()); 179 o.add(buildVariable());
183 return o; 180 return o;
184 } 181 }
185 182
186 checkUnnamed3555(core.List<api.Variable> o) { 183 checkUnnamed3563(core.List<api.Variable> o) {
187 unittest.expect(o, unittest.hasLength(2)); 184 unittest.expect(o, unittest.hasLength(2));
188 checkVariable(o[0]); 185 checkVariable(o[0]);
189 checkVariable(o[1]); 186 checkVariable(o[1]);
190 } 187 }
191 188
192 core.int buildCounterListVariablesResponse = 0; 189 core.int buildCounterListVariablesResponse = 0;
193 buildListVariablesResponse() { 190 buildListVariablesResponse() {
194 var o = new api.ListVariablesResponse(); 191 var o = new api.ListVariablesResponse();
195 buildCounterListVariablesResponse++; 192 buildCounterListVariablesResponse++;
196 if (buildCounterListVariablesResponse < 3) { 193 if (buildCounterListVariablesResponse < 3) {
197 o.nextPageToken = "foo"; 194 o.nextPageToken = "foo";
198 o.variables = buildUnnamed3555(); 195 o.variables = buildUnnamed3563();
199 } 196 }
200 buildCounterListVariablesResponse--; 197 buildCounterListVariablesResponse--;
201 return o; 198 return o;
202 } 199 }
203 200
204 checkListVariablesResponse(api.ListVariablesResponse o) { 201 checkListVariablesResponse(api.ListVariablesResponse o) {
205 buildCounterListVariablesResponse++; 202 buildCounterListVariablesResponse++;
206 if (buildCounterListVariablesResponse < 3) { 203 if (buildCounterListVariablesResponse < 3) {
207 unittest.expect(o.nextPageToken, unittest.equals('foo')); 204 unittest.expect(o.nextPageToken, unittest.equals('foo'));
208 checkUnnamed3555(o.variables); 205 checkUnnamed3563(o.variables);
209 } 206 }
210 buildCounterListVariablesResponse--; 207 buildCounterListVariablesResponse--;
211 } 208 }
212 209
213 buildUnnamed3556() { 210 buildUnnamed3564() {
214 var o = new core.List<api.Waiter>(); 211 var o = new core.List<api.Waiter>();
215 o.add(buildWaiter()); 212 o.add(buildWaiter());
216 o.add(buildWaiter()); 213 o.add(buildWaiter());
217 return o; 214 return o;
218 } 215 }
219 216
220 checkUnnamed3556(core.List<api.Waiter> o) { 217 checkUnnamed3564(core.List<api.Waiter> o) {
221 unittest.expect(o, unittest.hasLength(2)); 218 unittest.expect(o, unittest.hasLength(2));
222 checkWaiter(o[0]); 219 checkWaiter(o[0]);
223 checkWaiter(o[1]); 220 checkWaiter(o[1]);
224 } 221 }
225 222
226 core.int buildCounterListWaitersResponse = 0; 223 core.int buildCounterListWaitersResponse = 0;
227 buildListWaitersResponse() { 224 buildListWaitersResponse() {
228 var o = new api.ListWaitersResponse(); 225 var o = new api.ListWaitersResponse();
229 buildCounterListWaitersResponse++; 226 buildCounterListWaitersResponse++;
230 if (buildCounterListWaitersResponse < 3) { 227 if (buildCounterListWaitersResponse < 3) {
231 o.nextPageToken = "foo"; 228 o.nextPageToken = "foo";
232 o.waiters = buildUnnamed3556(); 229 o.waiters = buildUnnamed3564();
233 } 230 }
234 buildCounterListWaitersResponse--; 231 buildCounterListWaitersResponse--;
235 return o; 232 return o;
236 } 233 }
237 234
238 checkListWaitersResponse(api.ListWaitersResponse o) { 235 checkListWaitersResponse(api.ListWaitersResponse o) {
239 buildCounterListWaitersResponse++; 236 buildCounterListWaitersResponse++;
240 if (buildCounterListWaitersResponse < 3) { 237 if (buildCounterListWaitersResponse < 3) {
241 unittest.expect(o.nextPageToken, unittest.equals('foo')); 238 unittest.expect(o.nextPageToken, unittest.equals('foo'));
242 checkUnnamed3556(o.waiters); 239 checkUnnamed3564(o.waiters);
243 } 240 }
244 buildCounterListWaitersResponse--; 241 buildCounterListWaitersResponse--;
245 } 242 }
246 243
247 buildUnnamed3557() { 244 buildUnnamed3565() {
248 var o = new core.Map<core.String, core.Object>(); 245 var o = new core.Map<core.String, core.Object>();
249 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 246 o["x"] = {
250 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 247 'list': [1, 2, 3],
248 'bool': true,
249 'string': 'foo'
250 };
251 o["y"] = {
252 'list': [1, 2, 3],
253 'bool': true,
254 'string': 'foo'
255 };
251 return o; 256 return o;
252 } 257 }
253 258
254 checkUnnamed3557(core.Map<core.String, core.Object> o) { 259 checkUnnamed3565(core.Map<core.String, core.Object> o) {
255 unittest.expect(o, unittest.hasLength(2)); 260 unittest.expect(o, unittest.hasLength(2));
256 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')); 261 var casted1 = (o["x"]) as core.Map;
257 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')); 262 unittest.expect(casted1, unittest.hasLength(3));
263 unittest.expect(casted1["list"], unittest.equals([1, 2, 3]));
264 unittest.expect(casted1["bool"], unittest.equals(true));
265 unittest.expect(casted1["string"], unittest.equals('foo'));
266 var casted2 = (o["y"]) as core.Map;
267 unittest.expect(casted2, unittest.hasLength(3));
268 unittest.expect(casted2["list"], unittest.equals([1, 2, 3]));
269 unittest.expect(casted2["bool"], unittest.equals(true));
270 unittest.expect(casted2["string"], unittest.equals('foo'));
258 } 271 }
259 272
260 buildUnnamed3558() { 273 buildUnnamed3566() {
261 var o = new core.Map<core.String, core.Object>(); 274 var o = new core.Map<core.String, core.Object>();
262 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 275 o["x"] = {
263 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 276 'list': [1, 2, 3],
277 'bool': true,
278 'string': 'foo'
279 };
280 o["y"] = {
281 'list': [1, 2, 3],
282 'bool': true,
283 'string': 'foo'
284 };
264 return o; 285 return o;
265 } 286 }
266 287
267 checkUnnamed3558(core.Map<core.String, core.Object> o) { 288 checkUnnamed3566(core.Map<core.String, core.Object> o) {
268 unittest.expect(o, unittest.hasLength(2)); 289 unittest.expect(o, unittest.hasLength(2));
269 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')); 290 var casted3 = (o["x"]) as core.Map;
270 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')); 291 unittest.expect(casted3, unittest.hasLength(3));
292 unittest.expect(casted3["list"], unittest.equals([1, 2, 3]));
293 unittest.expect(casted3["bool"], unittest.equals(true));
294 unittest.expect(casted3["string"], unittest.equals('foo'));
295 var casted4 = (o["y"]) as core.Map;
296 unittest.expect(casted4, unittest.hasLength(3));
297 unittest.expect(casted4["list"], unittest.equals([1, 2, 3]));
298 unittest.expect(casted4["bool"], unittest.equals(true));
299 unittest.expect(casted4["string"], unittest.equals('foo'));
271 } 300 }
272 301
273 core.int buildCounterOperation = 0; 302 core.int buildCounterOperation = 0;
274 buildOperation() { 303 buildOperation() {
275 var o = new api.Operation(); 304 var o = new api.Operation();
276 buildCounterOperation++; 305 buildCounterOperation++;
277 if (buildCounterOperation < 3) { 306 if (buildCounterOperation < 3) {
278 o.done = true; 307 o.done = true;
279 o.error = buildStatus(); 308 o.error = buildStatus();
280 o.metadata = buildUnnamed3557(); 309 o.metadata = buildUnnamed3565();
281 o.name = "foo"; 310 o.name = "foo";
282 o.response = buildUnnamed3558(); 311 o.response = buildUnnamed3566();
283 } 312 }
284 buildCounterOperation--; 313 buildCounterOperation--;
285 return o; 314 return o;
286 } 315 }
287 316
288 checkOperation(api.Operation o) { 317 checkOperation(api.Operation o) {
289 buildCounterOperation++; 318 buildCounterOperation++;
290 if (buildCounterOperation < 3) { 319 if (buildCounterOperation < 3) {
291 unittest.expect(o.done, unittest.isTrue); 320 unittest.expect(o.done, unittest.isTrue);
292 checkStatus(o.error); 321 checkStatus(o.error);
293 checkUnnamed3557(o.metadata); 322 checkUnnamed3565(o.metadata);
294 unittest.expect(o.name, unittest.equals('foo')); 323 unittest.expect(o.name, unittest.equals('foo'));
295 checkUnnamed3558(o.response); 324 checkUnnamed3566(o.response);
296 } 325 }
297 buildCounterOperation--; 326 buildCounterOperation--;
298 } 327 }
299 328
300 buildUnnamed3559() { 329 buildUnnamed3567() {
301 var o = new core.List<api.Binding>(); 330 var o = new core.List<api.Binding>();
302 o.add(buildBinding()); 331 o.add(buildBinding());
303 o.add(buildBinding()); 332 o.add(buildBinding());
304 return o; 333 return o;
305 } 334 }
306 335
307 checkUnnamed3559(core.List<api.Binding> o) { 336 checkUnnamed3567(core.List<api.Binding> o) {
308 unittest.expect(o, unittest.hasLength(2)); 337 unittest.expect(o, unittest.hasLength(2));
309 checkBinding(o[0]); 338 checkBinding(o[0]);
310 checkBinding(o[1]); 339 checkBinding(o[1]);
311 } 340 }
312 341
313 core.int buildCounterPolicy = 0; 342 core.int buildCounterPolicy = 0;
314 buildPolicy() { 343 buildPolicy() {
315 var o = new api.Policy(); 344 var o = new api.Policy();
316 buildCounterPolicy++; 345 buildCounterPolicy++;
317 if (buildCounterPolicy < 3) { 346 if (buildCounterPolicy < 3) {
318 o.bindings = buildUnnamed3559(); 347 o.bindings = buildUnnamed3567();
319 o.etag = "foo"; 348 o.etag = "foo";
320 o.version = 42; 349 o.version = 42;
321 } 350 }
322 buildCounterPolicy--; 351 buildCounterPolicy--;
323 return o; 352 return o;
324 } 353 }
325 354
326 checkPolicy(api.Policy o) { 355 checkPolicy(api.Policy o) {
327 buildCounterPolicy++; 356 buildCounterPolicy++;
328 if (buildCounterPolicy < 3) { 357 if (buildCounterPolicy < 3) {
329 checkUnnamed3559(o.bindings); 358 checkUnnamed3567(o.bindings);
330 unittest.expect(o.etag, unittest.equals('foo')); 359 unittest.expect(o.etag, unittest.equals('foo'));
331 unittest.expect(o.version, unittest.equals(42)); 360 unittest.expect(o.version, unittest.equals(42));
332 } 361 }
333 buildCounterPolicy--; 362 buildCounterPolicy--;
334 } 363 }
335 364
336 core.int buildCounterRuntimeConfig = 0; 365 core.int buildCounterRuntimeConfig = 0;
337 buildRuntimeConfig() { 366 buildRuntimeConfig() {
338 var o = new api.RuntimeConfig(); 367 var o = new api.RuntimeConfig();
339 buildCounterRuntimeConfig++; 368 buildCounterRuntimeConfig++;
(...skipping 26 matching lines...) Expand all
366 } 395 }
367 396
368 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { 397 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) {
369 buildCounterSetIamPolicyRequest++; 398 buildCounterSetIamPolicyRequest++;
370 if (buildCounterSetIamPolicyRequest < 3) { 399 if (buildCounterSetIamPolicyRequest < 3) {
371 checkPolicy(o.policy); 400 checkPolicy(o.policy);
372 } 401 }
373 buildCounterSetIamPolicyRequest--; 402 buildCounterSetIamPolicyRequest--;
374 } 403 }
375 404
376 buildUnnamed3560() { 405 buildUnnamed3568() {
377 var o = new core.Map<core.String, core.Object>(); 406 var o = new core.Map<core.String, core.Object>();
378 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 407 o["x"] = {
379 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 408 'list': [1, 2, 3],
409 'bool': true,
410 'string': 'foo'
411 };
412 o["y"] = {
413 'list': [1, 2, 3],
414 'bool': true,
415 'string': 'foo'
416 };
380 return o; 417 return o;
381 } 418 }
382 419
383 checkUnnamed3560(core.Map<core.String, core.Object> o) { 420 checkUnnamed3568(core.Map<core.String, core.Object> o) {
384 unittest.expect(o, unittest.hasLength(2)); 421 unittest.expect(o, unittest.hasLength(2));
385 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')); 422 var casted5 = (o["x"]) as core.Map;
386 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')); 423 unittest.expect(casted5, unittest.hasLength(3));
424 unittest.expect(casted5["list"], unittest.equals([1, 2, 3]));
425 unittest.expect(casted5["bool"], unittest.equals(true));
426 unittest.expect(casted5["string"], unittest.equals('foo'));
427 var casted6 = (o["y"]) as core.Map;
428 unittest.expect(casted6, unittest.hasLength(3));
429 unittest.expect(casted6["list"], unittest.equals([1, 2, 3]));
430 unittest.expect(casted6["bool"], unittest.equals(true));
431 unittest.expect(casted6["string"], unittest.equals('foo'));
387 } 432 }
388 433
389 buildUnnamed3561() { 434 buildUnnamed3569() {
390 var o = new core.List<core.Map<core.String, core.Object>>(); 435 var o = new core.List<core.Map<core.String, core.Object>>();
391 o.add(buildUnnamed3560()); 436 o.add(buildUnnamed3568());
392 o.add(buildUnnamed3560()); 437 o.add(buildUnnamed3568());
393 return o; 438 return o;
394 } 439 }
395 440
396 checkUnnamed3561(core.List<core.Map<core.String, core.Object>> o) { 441 checkUnnamed3569(core.List<core.Map<core.String, core.Object>> o) {
397 unittest.expect(o, unittest.hasLength(2)); 442 unittest.expect(o, unittest.hasLength(2));
398 checkUnnamed3560(o[0]); 443 checkUnnamed3568(o[0]);
399 checkUnnamed3560(o[1]); 444 checkUnnamed3568(o[1]);
400 } 445 }
401 446
402 core.int buildCounterStatus = 0; 447 core.int buildCounterStatus = 0;
403 buildStatus() { 448 buildStatus() {
404 var o = new api.Status(); 449 var o = new api.Status();
405 buildCounterStatus++; 450 buildCounterStatus++;
406 if (buildCounterStatus < 3) { 451 if (buildCounterStatus < 3) {
407 o.code = 42; 452 o.code = 42;
408 o.details = buildUnnamed3561(); 453 o.details = buildUnnamed3569();
409 o.message = "foo"; 454 o.message = "foo";
410 } 455 }
411 buildCounterStatus--; 456 buildCounterStatus--;
412 return o; 457 return o;
413 } 458 }
414 459
415 checkStatus(api.Status o) { 460 checkStatus(api.Status o) {
416 buildCounterStatus++; 461 buildCounterStatus++;
417 if (buildCounterStatus < 3) { 462 if (buildCounterStatus < 3) {
418 unittest.expect(o.code, unittest.equals(42)); 463 unittest.expect(o.code, unittest.equals(42));
419 checkUnnamed3561(o.details); 464 checkUnnamed3569(o.details);
420 unittest.expect(o.message, unittest.equals('foo')); 465 unittest.expect(o.message, unittest.equals('foo'));
421 } 466 }
422 buildCounterStatus--; 467 buildCounterStatus--;
423 } 468 }
424 469
425 buildUnnamed3562() { 470 buildUnnamed3570() {
426 var o = new core.List<core.String>(); 471 var o = new core.List<core.String>();
427 o.add("foo"); 472 o.add("foo");
428 o.add("foo"); 473 o.add("foo");
429 return o; 474 return o;
430 } 475 }
431 476
432 checkUnnamed3562(core.List<core.String> o) { 477 checkUnnamed3570(core.List<core.String> o) {
433 unittest.expect(o, unittest.hasLength(2)); 478 unittest.expect(o, unittest.hasLength(2));
434 unittest.expect(o[0], unittest.equals('foo')); 479 unittest.expect(o[0], unittest.equals('foo'));
435 unittest.expect(o[1], unittest.equals('foo')); 480 unittest.expect(o[1], unittest.equals('foo'));
436 } 481 }
437 482
438 core.int buildCounterTestIamPermissionsRequest = 0; 483 core.int buildCounterTestIamPermissionsRequest = 0;
439 buildTestIamPermissionsRequest() { 484 buildTestIamPermissionsRequest() {
440 var o = new api.TestIamPermissionsRequest(); 485 var o = new api.TestIamPermissionsRequest();
441 buildCounterTestIamPermissionsRequest++; 486 buildCounterTestIamPermissionsRequest++;
442 if (buildCounterTestIamPermissionsRequest < 3) { 487 if (buildCounterTestIamPermissionsRequest < 3) {
443 o.permissions = buildUnnamed3562(); 488 o.permissions = buildUnnamed3570();
444 } 489 }
445 buildCounterTestIamPermissionsRequest--; 490 buildCounterTestIamPermissionsRequest--;
446 return o; 491 return o;
447 } 492 }
448 493
449 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { 494 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
450 buildCounterTestIamPermissionsRequest++; 495 buildCounterTestIamPermissionsRequest++;
451 if (buildCounterTestIamPermissionsRequest < 3) { 496 if (buildCounterTestIamPermissionsRequest < 3) {
452 checkUnnamed3562(o.permissions); 497 checkUnnamed3570(o.permissions);
453 } 498 }
454 buildCounterTestIamPermissionsRequest--; 499 buildCounterTestIamPermissionsRequest--;
455 } 500 }
456 501
457 buildUnnamed3563() { 502 buildUnnamed3571() {
458 var o = new core.List<core.String>(); 503 var o = new core.List<core.String>();
459 o.add("foo"); 504 o.add("foo");
460 o.add("foo"); 505 o.add("foo");
461 return o; 506 return o;
462 } 507 }
463 508
464 checkUnnamed3563(core.List<core.String> o) { 509 checkUnnamed3571(core.List<core.String> o) {
465 unittest.expect(o, unittest.hasLength(2)); 510 unittest.expect(o, unittest.hasLength(2));
466 unittest.expect(o[0], unittest.equals('foo')); 511 unittest.expect(o[0], unittest.equals('foo'));
467 unittest.expect(o[1], unittest.equals('foo')); 512 unittest.expect(o[1], unittest.equals('foo'));
468 } 513 }
469 514
470 core.int buildCounterTestIamPermissionsResponse = 0; 515 core.int buildCounterTestIamPermissionsResponse = 0;
471 buildTestIamPermissionsResponse() { 516 buildTestIamPermissionsResponse() {
472 var o = new api.TestIamPermissionsResponse(); 517 var o = new api.TestIamPermissionsResponse();
473 buildCounterTestIamPermissionsResponse++; 518 buildCounterTestIamPermissionsResponse++;
474 if (buildCounterTestIamPermissionsResponse < 3) { 519 if (buildCounterTestIamPermissionsResponse < 3) {
475 o.permissions = buildUnnamed3563(); 520 o.permissions = buildUnnamed3571();
476 } 521 }
477 buildCounterTestIamPermissionsResponse--; 522 buildCounterTestIamPermissionsResponse--;
478 return o; 523 return o;
479 } 524 }
480 525
481 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { 526 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
482 buildCounterTestIamPermissionsResponse++; 527 buildCounterTestIamPermissionsResponse++;
483 if (buildCounterTestIamPermissionsResponse < 3) { 528 if (buildCounterTestIamPermissionsResponse < 3) {
484 checkUnnamed3563(o.permissions); 529 checkUnnamed3571(o.permissions);
485 } 530 }
486 buildCounterTestIamPermissionsResponse--; 531 buildCounterTestIamPermissionsResponse--;
487 } 532 }
488 533
489 core.int buildCounterVariable = 0; 534 core.int buildCounterVariable = 0;
490 buildVariable() { 535 buildVariable() {
491 var o = new api.Variable(); 536 var o = new api.Variable();
492 buildCounterVariable++; 537 buildCounterVariable++;
493 if (buildCounterVariable < 3) { 538 if (buildCounterVariable < 3) {
494 o.name = "foo"; 539 o.name = "foo";
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 601 }
557 602
558 checkWatchVariableRequest(api.WatchVariableRequest o) { 603 checkWatchVariableRequest(api.WatchVariableRequest o) {
559 buildCounterWatchVariableRequest++; 604 buildCounterWatchVariableRequest++;
560 if (buildCounterWatchVariableRequest < 3) { 605 if (buildCounterWatchVariableRequest < 3) {
561 unittest.expect(o.newerThan, unittest.equals('foo')); 606 unittest.expect(o.newerThan, unittest.equals('foo'));
562 } 607 }
563 buildCounterWatchVariableRequest--; 608 buildCounterWatchVariableRequest--;
564 } 609 }
565 610
566
567 main() { 611 main() {
568 unittest.group("obj-schema-Binding", () { 612 unittest.group("obj-schema-Binding", () {
569 unittest.test("to-json--from-json", () { 613 unittest.test("to-json--from-json", () {
570 var o = buildBinding(); 614 var o = buildBinding();
571 var od = new api.Binding.fromJson(o.toJson()); 615 var od = new api.Binding.fromJson(o.toJson());
572 checkBinding(od); 616 checkBinding(od);
573 }); 617 });
574 }); 618 });
575 619
576
577 unittest.group("obj-schema-Cardinality", () { 620 unittest.group("obj-schema-Cardinality", () {
578 unittest.test("to-json--from-json", () { 621 unittest.test("to-json--from-json", () {
579 var o = buildCardinality(); 622 var o = buildCardinality();
580 var od = new api.Cardinality.fromJson(o.toJson()); 623 var od = new api.Cardinality.fromJson(o.toJson());
581 checkCardinality(od); 624 checkCardinality(od);
582 }); 625 });
583 }); 626 });
584 627
585
586 unittest.group("obj-schema-Empty", () { 628 unittest.group("obj-schema-Empty", () {
587 unittest.test("to-json--from-json", () { 629 unittest.test("to-json--from-json", () {
588 var o = buildEmpty(); 630 var o = buildEmpty();
589 var od = new api.Empty.fromJson(o.toJson()); 631 var od = new api.Empty.fromJson(o.toJson());
590 checkEmpty(od); 632 checkEmpty(od);
591 }); 633 });
592 }); 634 });
593 635
594
595 unittest.group("obj-schema-EndCondition", () { 636 unittest.group("obj-schema-EndCondition", () {
596 unittest.test("to-json--from-json", () { 637 unittest.test("to-json--from-json", () {
597 var o = buildEndCondition(); 638 var o = buildEndCondition();
598 var od = new api.EndCondition.fromJson(o.toJson()); 639 var od = new api.EndCondition.fromJson(o.toJson());
599 checkEndCondition(od); 640 checkEndCondition(od);
600 }); 641 });
601 }); 642 });
602 643
603
604 unittest.group("obj-schema-ListConfigsResponse", () { 644 unittest.group("obj-schema-ListConfigsResponse", () {
605 unittest.test("to-json--from-json", () { 645 unittest.test("to-json--from-json", () {
606 var o = buildListConfigsResponse(); 646 var o = buildListConfigsResponse();
607 var od = new api.ListConfigsResponse.fromJson(o.toJson()); 647 var od = new api.ListConfigsResponse.fromJson(o.toJson());
608 checkListConfigsResponse(od); 648 checkListConfigsResponse(od);
609 }); 649 });
610 }); 650 });
611 651
612
613 unittest.group("obj-schema-ListVariablesResponse", () { 652 unittest.group("obj-schema-ListVariablesResponse", () {
614 unittest.test("to-json--from-json", () { 653 unittest.test("to-json--from-json", () {
615 var o = buildListVariablesResponse(); 654 var o = buildListVariablesResponse();
616 var od = new api.ListVariablesResponse.fromJson(o.toJson()); 655 var od = new api.ListVariablesResponse.fromJson(o.toJson());
617 checkListVariablesResponse(od); 656 checkListVariablesResponse(od);
618 }); 657 });
619 }); 658 });
620 659
621
622 unittest.group("obj-schema-ListWaitersResponse", () { 660 unittest.group("obj-schema-ListWaitersResponse", () {
623 unittest.test("to-json--from-json", () { 661 unittest.test("to-json--from-json", () {
624 var o = buildListWaitersResponse(); 662 var o = buildListWaitersResponse();
625 var od = new api.ListWaitersResponse.fromJson(o.toJson()); 663 var od = new api.ListWaitersResponse.fromJson(o.toJson());
626 checkListWaitersResponse(od); 664 checkListWaitersResponse(od);
627 }); 665 });
628 }); 666 });
629 667
630
631 unittest.group("obj-schema-Operation", () { 668 unittest.group("obj-schema-Operation", () {
632 unittest.test("to-json--from-json", () { 669 unittest.test("to-json--from-json", () {
633 var o = buildOperation(); 670 var o = buildOperation();
634 var od = new api.Operation.fromJson(o.toJson()); 671 var od = new api.Operation.fromJson(o.toJson());
635 checkOperation(od); 672 checkOperation(od);
636 }); 673 });
637 }); 674 });
638 675
639
640 unittest.group("obj-schema-Policy", () { 676 unittest.group("obj-schema-Policy", () {
641 unittest.test("to-json--from-json", () { 677 unittest.test("to-json--from-json", () {
642 var o = buildPolicy(); 678 var o = buildPolicy();
643 var od = new api.Policy.fromJson(o.toJson()); 679 var od = new api.Policy.fromJson(o.toJson());
644 checkPolicy(od); 680 checkPolicy(od);
645 }); 681 });
646 }); 682 });
647 683
648
649 unittest.group("obj-schema-RuntimeConfig", () { 684 unittest.group("obj-schema-RuntimeConfig", () {
650 unittest.test("to-json--from-json", () { 685 unittest.test("to-json--from-json", () {
651 var o = buildRuntimeConfig(); 686 var o = buildRuntimeConfig();
652 var od = new api.RuntimeConfig.fromJson(o.toJson()); 687 var od = new api.RuntimeConfig.fromJson(o.toJson());
653 checkRuntimeConfig(od); 688 checkRuntimeConfig(od);
654 }); 689 });
655 }); 690 });
656 691
657
658 unittest.group("obj-schema-SetIamPolicyRequest", () { 692 unittest.group("obj-schema-SetIamPolicyRequest", () {
659 unittest.test("to-json--from-json", () { 693 unittest.test("to-json--from-json", () {
660 var o = buildSetIamPolicyRequest(); 694 var o = buildSetIamPolicyRequest();
661 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); 695 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
662 checkSetIamPolicyRequest(od); 696 checkSetIamPolicyRequest(od);
663 }); 697 });
664 }); 698 });
665 699
666
667 unittest.group("obj-schema-Status", () { 700 unittest.group("obj-schema-Status", () {
668 unittest.test("to-json--from-json", () { 701 unittest.test("to-json--from-json", () {
669 var o = buildStatus(); 702 var o = buildStatus();
670 var od = new api.Status.fromJson(o.toJson()); 703 var od = new api.Status.fromJson(o.toJson());
671 checkStatus(od); 704 checkStatus(od);
672 }); 705 });
673 }); 706 });
674 707
675
676 unittest.group("obj-schema-TestIamPermissionsRequest", () { 708 unittest.group("obj-schema-TestIamPermissionsRequest", () {
677 unittest.test("to-json--from-json", () { 709 unittest.test("to-json--from-json", () {
678 var o = buildTestIamPermissionsRequest(); 710 var o = buildTestIamPermissionsRequest();
679 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); 711 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson());
680 checkTestIamPermissionsRequest(od); 712 checkTestIamPermissionsRequest(od);
681 }); 713 });
682 }); 714 });
683 715
684
685 unittest.group("obj-schema-TestIamPermissionsResponse", () { 716 unittest.group("obj-schema-TestIamPermissionsResponse", () {
686 unittest.test("to-json--from-json", () { 717 unittest.test("to-json--from-json", () {
687 var o = buildTestIamPermissionsResponse(); 718 var o = buildTestIamPermissionsResponse();
688 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); 719 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson());
689 checkTestIamPermissionsResponse(od); 720 checkTestIamPermissionsResponse(od);
690 }); 721 });
691 }); 722 });
692 723
693
694 unittest.group("obj-schema-Variable", () { 724 unittest.group("obj-schema-Variable", () {
695 unittest.test("to-json--from-json", () { 725 unittest.test("to-json--from-json", () {
696 var o = buildVariable(); 726 var o = buildVariable();
697 var od = new api.Variable.fromJson(o.toJson()); 727 var od = new api.Variable.fromJson(o.toJson());
698 checkVariable(od); 728 checkVariable(od);
699 }); 729 });
700 }); 730 });
701 731
702
703 unittest.group("obj-schema-Waiter", () { 732 unittest.group("obj-schema-Waiter", () {
704 unittest.test("to-json--from-json", () { 733 unittest.test("to-json--from-json", () {
705 var o = buildWaiter(); 734 var o = buildWaiter();
706 var od = new api.Waiter.fromJson(o.toJson()); 735 var od = new api.Waiter.fromJson(o.toJson());
707 checkWaiter(od); 736 checkWaiter(od);
708 }); 737 });
709 }); 738 });
710 739
711
712 unittest.group("obj-schema-WatchVariableRequest", () { 740 unittest.group("obj-schema-WatchVariableRequest", () {
713 unittest.test("to-json--from-json", () { 741 unittest.test("to-json--from-json", () {
714 var o = buildWatchVariableRequest(); 742 var o = buildWatchVariableRequest();
715 var od = new api.WatchVariableRequest.fromJson(o.toJson()); 743 var od = new api.WatchVariableRequest.fromJson(o.toJson());
716 checkWatchVariableRequest(od); 744 checkWatchVariableRequest(od);
717 }); 745 });
718 }); 746 });
719 747
720
721 unittest.group("resource-ProjectsConfigsResourceApi", () { 748 unittest.group("resource-ProjectsConfigsResourceApi", () {
722 unittest.test("method--create", () { 749 unittest.test("method--create", () {
723
724 var mock = new HttpServerMock(); 750 var mock = new HttpServerMock();
725 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 751 api.ProjectsConfigsResourceApi res =
752 new api.RuntimeconfigApi(mock).projects.configs;
726 var arg_request = buildRuntimeConfig(); 753 var arg_request = buildRuntimeConfig();
727 var arg_parent = "foo"; 754 var arg_parent = "foo";
728 var arg_requestId = "foo"; 755 var arg_requestId = "foo";
729 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 756 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
730 var obj = new api.RuntimeConfig.fromJson(json); 757 var obj = new api.RuntimeConfig.fromJson(json);
731 checkRuntimeConfig(obj); 758 checkRuntimeConfig(obj);
732 759
733 var path = (req.url).path; 760 var path = (req.url).path;
734 var pathOffset = 0; 761 var pathOffset = 0;
735 var index; 762 var index;
736 var subPart; 763 var subPart;
737 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 764 unittest.expect(
765 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
738 pathOffset += 1; 766 pathOffset += 1;
739 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 767 unittest.expect(path.substring(pathOffset, pathOffset + 8),
768 unittest.equals("v1beta1/"));
740 pathOffset += 8; 769 pathOffset += 8;
741 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 770 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
742 771
743 var query = (req.url).query; 772 var query = (req.url).query;
744 var queryOffset = 0; 773 var queryOffset = 0;
745 var queryMap = {}; 774 var queryMap = {};
746 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 775 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
747 parseBool(n) { 776 parseBool(n) {
748 if (n == "true") return true; 777 if (n == "true") return true;
749 if (n == "false") return false; 778 if (n == "false") return false;
750 if (n == null) return null; 779 if (n == null) return null;
751 throw new core.ArgumentError("Invalid boolean: $n"); 780 throw new core.ArgumentError("Invalid boolean: $n");
752 } 781 }
782
753 if (query.length > 0) { 783 if (query.length > 0) {
754 for (var part in query.split("&")) { 784 for (var part in query.split("&")) {
755 var keyvalue = part.split("="); 785 var keyvalue = part.split("=");
756 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 786 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
787 core.Uri.decodeQueryComponent(keyvalue[1]));
757 } 788 }
758 } 789 }
759 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id)); 790 unittest.expect(
760 791 queryMap["requestId"].first, unittest.equals(arg_requestId));
761 792
762 var h = { 793 var h = {
763 "content-type" : "application/json; charset=utf-8", 794 "content-type": "application/json; charset=utf-8",
764 }; 795 };
765 var resp = convert.JSON.encode(buildRuntimeConfig()); 796 var resp = convert.JSON.encode(buildRuntimeConfig());
766 return new async.Future.value(stringResponse(200, h, resp)); 797 return new async.Future.value(stringResponse(200, h, resp));
767 }), true); 798 }), true);
768 res.create(arg_request, arg_parent, requestId: arg_requestId).then(unittes t.expectAsync1(((api.RuntimeConfig response) { 799 res
800 .create(arg_request, arg_parent, requestId: arg_requestId)
801 .then(unittest.expectAsync1(((api.RuntimeConfig response) {
769 checkRuntimeConfig(response); 802 checkRuntimeConfig(response);
770 }))); 803 })));
771 }); 804 });
772 805
773 unittest.test("method--delete", () { 806 unittest.test("method--delete", () {
774
775 var mock = new HttpServerMock(); 807 var mock = new HttpServerMock();
776 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 808 api.ProjectsConfigsResourceApi res =
809 new api.RuntimeconfigApi(mock).projects.configs;
777 var arg_name = "foo"; 810 var arg_name = "foo";
778 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 811 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
779 var path = (req.url).path; 812 var path = (req.url).path;
780 var pathOffset = 0; 813 var pathOffset = 0;
781 var index; 814 var index;
782 var subPart; 815 var subPart;
783 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 816 unittest.expect(
817 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
784 pathOffset += 1; 818 pathOffset += 1;
785 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 819 unittest.expect(path.substring(pathOffset, pathOffset + 8),
820 unittest.equals("v1beta1/"));
786 pathOffset += 8; 821 pathOffset += 8;
787 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 822 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
788 823
789 var query = (req.url).query; 824 var query = (req.url).query;
790 var queryOffset = 0; 825 var queryOffset = 0;
791 var queryMap = {}; 826 var queryMap = {};
792 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 827 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
793 parseBool(n) { 828 parseBool(n) {
794 if (n == "true") return true; 829 if (n == "true") return true;
795 if (n == "false") return false; 830 if (n == "false") return false;
796 if (n == null) return null; 831 if (n == null) return null;
797 throw new core.ArgumentError("Invalid boolean: $n"); 832 throw new core.ArgumentError("Invalid boolean: $n");
798 } 833 }
834
799 if (query.length > 0) { 835 if (query.length > 0) {
800 for (var part in query.split("&")) { 836 for (var part in query.split("&")) {
801 var keyvalue = part.split("="); 837 var keyvalue = part.split("=");
802 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 838 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
839 core.Uri.decodeQueryComponent(keyvalue[1]));
803 } 840 }
804 } 841 }
805 842
806
807 var h = { 843 var h = {
808 "content-type" : "application/json; charset=utf-8", 844 "content-type": "application/json; charset=utf-8",
809 }; 845 };
810 var resp = convert.JSON.encode(buildEmpty()); 846 var resp = convert.JSON.encode(buildEmpty());
811 return new async.Future.value(stringResponse(200, h, resp)); 847 return new async.Future.value(stringResponse(200, h, resp));
812 }), true); 848 }), true);
813 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 849 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
814 checkEmpty(response); 850 checkEmpty(response);
815 }))); 851 })));
816 }); 852 });
817 853
818 unittest.test("method--get", () { 854 unittest.test("method--get", () {
819
820 var mock = new HttpServerMock(); 855 var mock = new HttpServerMock();
821 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 856 api.ProjectsConfigsResourceApi res =
857 new api.RuntimeconfigApi(mock).projects.configs;
822 var arg_name = "foo"; 858 var arg_name = "foo";
823 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 859 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
824 var path = (req.url).path; 860 var path = (req.url).path;
825 var pathOffset = 0; 861 var pathOffset = 0;
826 var index; 862 var index;
827 var subPart; 863 var subPart;
828 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 864 unittest.expect(
865 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
829 pathOffset += 1; 866 pathOffset += 1;
830 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 867 unittest.expect(path.substring(pathOffset, pathOffset + 8),
868 unittest.equals("v1beta1/"));
831 pathOffset += 8; 869 pathOffset += 8;
832 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 870 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
833 871
834 var query = (req.url).query; 872 var query = (req.url).query;
835 var queryOffset = 0; 873 var queryOffset = 0;
836 var queryMap = {}; 874 var queryMap = {};
837 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 875 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
838 parseBool(n) { 876 parseBool(n) {
839 if (n == "true") return true; 877 if (n == "true") return true;
840 if (n == "false") return false; 878 if (n == "false") return false;
841 if (n == null) return null; 879 if (n == null) return null;
842 throw new core.ArgumentError("Invalid boolean: $n"); 880 throw new core.ArgumentError("Invalid boolean: $n");
843 } 881 }
882
844 if (query.length > 0) { 883 if (query.length > 0) {
845 for (var part in query.split("&")) { 884 for (var part in query.split("&")) {
846 var keyvalue = part.split("="); 885 var keyvalue = part.split("=");
847 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
887 core.Uri.decodeQueryComponent(keyvalue[1]));
848 } 888 }
849 } 889 }
850 890
851
852 var h = { 891 var h = {
853 "content-type" : "application/json; charset=utf-8", 892 "content-type": "application/json; charset=utf-8",
854 }; 893 };
855 var resp = convert.JSON.encode(buildRuntimeConfig()); 894 var resp = convert.JSON.encode(buildRuntimeConfig());
856 return new async.Future.value(stringResponse(200, h, resp)); 895 return new async.Future.value(stringResponse(200, h, resp));
857 }), true); 896 }), true);
858 res.get(arg_name).then(unittest.expectAsync1(((api.RuntimeConfig response) { 897 res
898 .get(arg_name)
899 .then(unittest.expectAsync1(((api.RuntimeConfig response) {
859 checkRuntimeConfig(response); 900 checkRuntimeConfig(response);
860 }))); 901 })));
861 }); 902 });
862 903
863 unittest.test("method--getIamPolicy", () { 904 unittest.test("method--getIamPolicy", () {
864
865 var mock = new HttpServerMock(); 905 var mock = new HttpServerMock();
866 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 906 api.ProjectsConfigsResourceApi res =
907 new api.RuntimeconfigApi(mock).projects.configs;
867 var arg_resource = "foo"; 908 var arg_resource = "foo";
868 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 909 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
869 var path = (req.url).path; 910 var path = (req.url).path;
870 var pathOffset = 0; 911 var pathOffset = 0;
871 var index; 912 var index;
872 var subPart; 913 var subPart;
873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 914 unittest.expect(
915 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
874 pathOffset += 1; 916 pathOffset += 1;
875 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 917 unittest.expect(path.substring(pathOffset, pathOffset + 8),
918 unittest.equals("v1beta1/"));
876 pathOffset += 8; 919 pathOffset += 8;
877 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 920 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
878 921
879 var query = (req.url).query; 922 var query = (req.url).query;
880 var queryOffset = 0; 923 var queryOffset = 0;
881 var queryMap = {}; 924 var queryMap = {};
882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 925 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
883 parseBool(n) { 926 parseBool(n) {
884 if (n == "true") return true; 927 if (n == "true") return true;
885 if (n == "false") return false; 928 if (n == "false") return false;
886 if (n == null) return null; 929 if (n == null) return null;
887 throw new core.ArgumentError("Invalid boolean: $n"); 930 throw new core.ArgumentError("Invalid boolean: $n");
888 } 931 }
932
889 if (query.length > 0) { 933 if (query.length > 0) {
890 for (var part in query.split("&")) { 934 for (var part in query.split("&")) {
891 var keyvalue = part.split("="); 935 var keyvalue = part.split("=");
892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 936 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
937 core.Uri.decodeQueryComponent(keyvalue[1]));
893 } 938 }
894 } 939 }
895 940
896
897 var h = { 941 var h = {
898 "content-type" : "application/json; charset=utf-8", 942 "content-type": "application/json; charset=utf-8",
899 }; 943 };
900 var resp = convert.JSON.encode(buildPolicy()); 944 var resp = convert.JSON.encode(buildPolicy());
901 return new async.Future.value(stringResponse(200, h, resp)); 945 return new async.Future.value(stringResponse(200, h, resp));
902 }), true); 946 }), true);
903 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res ponse) { 947 res
948 .getIamPolicy(arg_resource)
949 .then(unittest.expectAsync1(((api.Policy response) {
904 checkPolicy(response); 950 checkPolicy(response);
905 }))); 951 })));
906 }); 952 });
907 953
908 unittest.test("method--list", () { 954 unittest.test("method--list", () {
909
910 var mock = new HttpServerMock(); 955 var mock = new HttpServerMock();
911 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 956 api.ProjectsConfigsResourceApi res =
957 new api.RuntimeconfigApi(mock).projects.configs;
912 var arg_parent = "foo"; 958 var arg_parent = "foo";
913 var arg_pageSize = 42; 959 var arg_pageSize = 42;
914 var arg_pageToken = "foo"; 960 var arg_pageToken = "foo";
915 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 961 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
916 var path = (req.url).path; 962 var path = (req.url).path;
917 var pathOffset = 0; 963 var pathOffset = 0;
918 var index; 964 var index;
919 var subPart; 965 var subPart;
920 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 966 unittest.expect(
967 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
921 pathOffset += 1; 968 pathOffset += 1;
922 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 969 unittest.expect(path.substring(pathOffset, pathOffset + 8),
970 unittest.equals("v1beta1/"));
923 pathOffset += 8; 971 pathOffset += 8;
924 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 972 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
925 973
926 var query = (req.url).query; 974 var query = (req.url).query;
927 var queryOffset = 0; 975 var queryOffset = 0;
928 var queryMap = {}; 976 var queryMap = {};
929 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 977 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
930 parseBool(n) { 978 parseBool(n) {
931 if (n == "true") return true; 979 if (n == "true") return true;
932 if (n == "false") return false; 980 if (n == "false") return false;
933 if (n == null) return null; 981 if (n == null) return null;
934 throw new core.ArgumentError("Invalid boolean: $n"); 982 throw new core.ArgumentError("Invalid boolean: $n");
935 } 983 }
984
936 if (query.length > 0) { 985 if (query.length > 0) {
937 for (var part in query.split("&")) { 986 for (var part in query.split("&")) {
938 var keyvalue = part.split("="); 987 var keyvalue = part.split("=");
939 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 988 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
989 core.Uri.decodeQueryComponent(keyvalue[1]));
940 } 990 }
941 } 991 }
942 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 992 unittest.expect(core.int.parse(queryMap["pageSize"].first),
943 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 993 unittest.equals(arg_pageSize));
944 994 unittest.expect(
995 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
945 996
946 var h = { 997 var h = {
947 "content-type" : "application/json; charset=utf-8", 998 "content-type": "application/json; charset=utf-8",
948 }; 999 };
949 var resp = convert.JSON.encode(buildListConfigsResponse()); 1000 var resp = convert.JSON.encode(buildListConfigsResponse());
950 return new async.Future.value(stringResponse(200, h, resp)); 1001 return new async.Future.value(stringResponse(200, h, resp));
951 }), true); 1002 }), true);
952 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync1(((api.ListConfigsResponse response) { 1003 res
1004 .list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken)
1005 .then(unittest.expectAsync1(((api.ListConfigsResponse response) {
953 checkListConfigsResponse(response); 1006 checkListConfigsResponse(response);
954 }))); 1007 })));
955 }); 1008 });
956 1009
957 unittest.test("method--setIamPolicy", () { 1010 unittest.test("method--setIamPolicy", () {
958
959 var mock = new HttpServerMock(); 1011 var mock = new HttpServerMock();
960 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 1012 api.ProjectsConfigsResourceApi res =
1013 new api.RuntimeconfigApi(mock).projects.configs;
961 var arg_request = buildSetIamPolicyRequest(); 1014 var arg_request = buildSetIamPolicyRequest();
962 var arg_resource = "foo"; 1015 var arg_resource = "foo";
963 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1016 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
964 var obj = new api.SetIamPolicyRequest.fromJson(json); 1017 var obj = new api.SetIamPolicyRequest.fromJson(json);
965 checkSetIamPolicyRequest(obj); 1018 checkSetIamPolicyRequest(obj);
966 1019
967 var path = (req.url).path; 1020 var path = (req.url).path;
968 var pathOffset = 0; 1021 var pathOffset = 0;
969 var index; 1022 var index;
970 var subPart; 1023 var subPart;
971 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1024 unittest.expect(
1025 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
972 pathOffset += 1; 1026 pathOffset += 1;
973 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1027 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1028 unittest.equals("v1beta1/"));
974 pathOffset += 8; 1029 pathOffset += 8;
975 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1030 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
976 1031
977 var query = (req.url).query; 1032 var query = (req.url).query;
978 var queryOffset = 0; 1033 var queryOffset = 0;
979 var queryMap = {}; 1034 var queryMap = {};
980 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1035 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
981 parseBool(n) { 1036 parseBool(n) {
982 if (n == "true") return true; 1037 if (n == "true") return true;
983 if (n == "false") return false; 1038 if (n == "false") return false;
984 if (n == null) return null; 1039 if (n == null) return null;
985 throw new core.ArgumentError("Invalid boolean: $n"); 1040 throw new core.ArgumentError("Invalid boolean: $n");
986 } 1041 }
1042
987 if (query.length > 0) { 1043 if (query.length > 0) {
988 for (var part in query.split("&")) { 1044 for (var part in query.split("&")) {
989 var keyvalue = part.split("="); 1045 var keyvalue = part.split("=");
990 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1046 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1047 core.Uri.decodeQueryComponent(keyvalue[1]));
991 } 1048 }
992 } 1049 }
993 1050
994
995 var h = { 1051 var h = {
996 "content-type" : "application/json; charset=utf-8", 1052 "content-type": "application/json; charset=utf-8",
997 }; 1053 };
998 var resp = convert.JSON.encode(buildPolicy()); 1054 var resp = convert.JSON.encode(buildPolicy());
999 return new async.Future.value(stringResponse(200, h, resp)); 1055 return new async.Future.value(stringResponse(200, h, resp));
1000 }), true); 1056 }), true);
1001 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a pi.Policy response) { 1057 res
1058 .setIamPolicy(arg_request, arg_resource)
1059 .then(unittest.expectAsync1(((api.Policy response) {
1002 checkPolicy(response); 1060 checkPolicy(response);
1003 }))); 1061 })));
1004 }); 1062 });
1005 1063
1006 unittest.test("method--testIamPermissions", () { 1064 unittest.test("method--testIamPermissions", () {
1007
1008 var mock = new HttpServerMock(); 1065 var mock = new HttpServerMock();
1009 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 1066 api.ProjectsConfigsResourceApi res =
1067 new api.RuntimeconfigApi(mock).projects.configs;
1010 var arg_request = buildTestIamPermissionsRequest(); 1068 var arg_request = buildTestIamPermissionsRequest();
1011 var arg_resource = "foo"; 1069 var arg_resource = "foo";
1012 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1070 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1013 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1071 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1014 checkTestIamPermissionsRequest(obj); 1072 checkTestIamPermissionsRequest(obj);
1015 1073
1016 var path = (req.url).path; 1074 var path = (req.url).path;
1017 var pathOffset = 0; 1075 var pathOffset = 0;
1018 var index; 1076 var index;
1019 var subPart; 1077 var subPart;
1020 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1078 unittest.expect(
1079 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1021 pathOffset += 1; 1080 pathOffset += 1;
1022 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1081 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1082 unittest.equals("v1beta1/"));
1023 pathOffset += 8; 1083 pathOffset += 8;
1024 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1084 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1025 1085
1026 var query = (req.url).query; 1086 var query = (req.url).query;
1027 var queryOffset = 0; 1087 var queryOffset = 0;
1028 var queryMap = {}; 1088 var queryMap = {};
1029 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1089 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1030 parseBool(n) { 1090 parseBool(n) {
1031 if (n == "true") return true; 1091 if (n == "true") return true;
1032 if (n == "false") return false; 1092 if (n == "false") return false;
1033 if (n == null) return null; 1093 if (n == null) return null;
1034 throw new core.ArgumentError("Invalid boolean: $n"); 1094 throw new core.ArgumentError("Invalid boolean: $n");
1035 } 1095 }
1096
1036 if (query.length > 0) { 1097 if (query.length > 0) {
1037 for (var part in query.split("&")) { 1098 for (var part in query.split("&")) {
1038 var keyvalue = part.split("="); 1099 var keyvalue = part.split("=");
1039 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1100 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1101 core.Uri.decodeQueryComponent(keyvalue[1]));
1040 } 1102 }
1041 } 1103 }
1042 1104
1043
1044 var h = { 1105 var h = {
1045 "content-type" : "application/json; charset=utf-8", 1106 "content-type": "application/json; charset=utf-8",
1046 }; 1107 };
1047 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1108 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1048 return new async.Future.value(stringResponse(200, h, resp)); 1109 return new async.Future.value(stringResponse(200, h, resp));
1049 }), true); 1110 }), true);
1050 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1111 res.testIamPermissions(arg_request, arg_resource).then(
1112 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1051 checkTestIamPermissionsResponse(response); 1113 checkTestIamPermissionsResponse(response);
1052 }))); 1114 })));
1053 }); 1115 });
1054 1116
1055 unittest.test("method--update", () { 1117 unittest.test("method--update", () {
1056
1057 var mock = new HttpServerMock(); 1118 var mock = new HttpServerMock();
1058 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 1119 api.ProjectsConfigsResourceApi res =
1120 new api.RuntimeconfigApi(mock).projects.configs;
1059 var arg_request = buildRuntimeConfig(); 1121 var arg_request = buildRuntimeConfig();
1060 var arg_name = "foo"; 1122 var arg_name = "foo";
1061 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1123 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1062 var obj = new api.RuntimeConfig.fromJson(json); 1124 var obj = new api.RuntimeConfig.fromJson(json);
1063 checkRuntimeConfig(obj); 1125 checkRuntimeConfig(obj);
1064 1126
1065 var path = (req.url).path; 1127 var path = (req.url).path;
1066 var pathOffset = 0; 1128 var pathOffset = 0;
1067 var index; 1129 var index;
1068 var subPart; 1130 var subPart;
1069 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1131 unittest.expect(
1132 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1070 pathOffset += 1; 1133 pathOffset += 1;
1071 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1134 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1135 unittest.equals("v1beta1/"));
1072 pathOffset += 8; 1136 pathOffset += 8;
1073 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1137 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1074 1138
1075 var query = (req.url).query; 1139 var query = (req.url).query;
1076 var queryOffset = 0; 1140 var queryOffset = 0;
1077 var queryMap = {}; 1141 var queryMap = {};
1078 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1079 parseBool(n) { 1143 parseBool(n) {
1080 if (n == "true") return true; 1144 if (n == "true") return true;
1081 if (n == "false") return false; 1145 if (n == "false") return false;
1082 if (n == null) return null; 1146 if (n == null) return null;
1083 throw new core.ArgumentError("Invalid boolean: $n"); 1147 throw new core.ArgumentError("Invalid boolean: $n");
1084 } 1148 }
1149
1085 if (query.length > 0) { 1150 if (query.length > 0) {
1086 for (var part in query.split("&")) { 1151 for (var part in query.split("&")) {
1087 var keyvalue = part.split("="); 1152 var keyvalue = part.split("=");
1088 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1153 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1154 core.Uri.decodeQueryComponent(keyvalue[1]));
1089 } 1155 }
1090 } 1156 }
1091 1157
1092
1093 var h = { 1158 var h = {
1094 "content-type" : "application/json; charset=utf-8", 1159 "content-type": "application/json; charset=utf-8",
1095 }; 1160 };
1096 var resp = convert.JSON.encode(buildRuntimeConfig()); 1161 var resp = convert.JSON.encode(buildRuntimeConfig());
1097 return new async.Future.value(stringResponse(200, h, resp)); 1162 return new async.Future.value(stringResponse(200, h, resp));
1098 }), true); 1163 }), true);
1099 res.update(arg_request, arg_name).then(unittest.expectAsync1(((api.Runtime Config response) { 1164 res
1165 .update(arg_request, arg_name)
1166 .then(unittest.expectAsync1(((api.RuntimeConfig response) {
1100 checkRuntimeConfig(response); 1167 checkRuntimeConfig(response);
1101 }))); 1168 })));
1102 }); 1169 });
1103
1104 }); 1170 });
1105 1171
1106
1107 unittest.group("resource-ProjectsConfigsOperationsResourceApi", () { 1172 unittest.group("resource-ProjectsConfigsOperationsResourceApi", () {
1108 unittest.test("method--get", () { 1173 unittest.test("method--get", () {
1109
1110 var mock = new HttpServerMock(); 1174 var mock = new HttpServerMock();
1111 api.ProjectsConfigsOperationsResourceApi res = new api.RuntimeconfigApi(mo ck).projects.configs.operations; 1175 api.ProjectsConfigsOperationsResourceApi res =
1176 new api.RuntimeconfigApi(mock).projects.configs.operations;
1112 var arg_name = "foo"; 1177 var arg_name = "foo";
1113 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1178 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1114 var path = (req.url).path; 1179 var path = (req.url).path;
1115 var pathOffset = 0; 1180 var pathOffset = 0;
1116 var index; 1181 var index;
1117 var subPart; 1182 var subPart;
1118 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1183 unittest.expect(
1184 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1119 pathOffset += 1; 1185 pathOffset += 1;
1120 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1186 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1187 unittest.equals("v1beta1/"));
1121 pathOffset += 8; 1188 pathOffset += 8;
1122 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1189 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1123 1190
1124 var query = (req.url).query; 1191 var query = (req.url).query;
1125 var queryOffset = 0; 1192 var queryOffset = 0;
1126 var queryMap = {}; 1193 var queryMap = {};
1127 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1194 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1128 parseBool(n) { 1195 parseBool(n) {
1129 if (n == "true") return true; 1196 if (n == "true") return true;
1130 if (n == "false") return false; 1197 if (n == "false") return false;
1131 if (n == null) return null; 1198 if (n == null) return null;
1132 throw new core.ArgumentError("Invalid boolean: $n"); 1199 throw new core.ArgumentError("Invalid boolean: $n");
1133 } 1200 }
1201
1134 if (query.length > 0) { 1202 if (query.length > 0) {
1135 for (var part in query.split("&")) { 1203 for (var part in query.split("&")) {
1136 var keyvalue = part.split("="); 1204 var keyvalue = part.split("=");
1137 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1205 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1206 core.Uri.decodeQueryComponent(keyvalue[1]));
1138 } 1207 }
1139 } 1208 }
1140 1209
1141
1142 var h = { 1210 var h = {
1143 "content-type" : "application/json; charset=utf-8", 1211 "content-type": "application/json; charset=utf-8",
1144 }; 1212 };
1145 var resp = convert.JSON.encode(buildOperation()); 1213 var resp = convert.JSON.encode(buildOperation());
1146 return new async.Future.value(stringResponse(200, h, resp)); 1214 return new async.Future.value(stringResponse(200, h, resp));
1147 }), true); 1215 }), true);
1148 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { 1216 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) {
1149 checkOperation(response); 1217 checkOperation(response);
1150 }))); 1218 })));
1151 }); 1219 });
1152 1220
1153 unittest.test("method--testIamPermissions", () { 1221 unittest.test("method--testIamPermissions", () {
1154
1155 var mock = new HttpServerMock(); 1222 var mock = new HttpServerMock();
1156 api.ProjectsConfigsOperationsResourceApi res = new api.RuntimeconfigApi(mo ck).projects.configs.operations; 1223 api.ProjectsConfigsOperationsResourceApi res =
1224 new api.RuntimeconfigApi(mock).projects.configs.operations;
1157 var arg_request = buildTestIamPermissionsRequest(); 1225 var arg_request = buildTestIamPermissionsRequest();
1158 var arg_resource = "foo"; 1226 var arg_resource = "foo";
1159 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1227 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1160 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1228 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1161 checkTestIamPermissionsRequest(obj); 1229 checkTestIamPermissionsRequest(obj);
1162 1230
1163 var path = (req.url).path; 1231 var path = (req.url).path;
1164 var pathOffset = 0; 1232 var pathOffset = 0;
1165 var index; 1233 var index;
1166 var subPart; 1234 var subPart;
1167 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1235 unittest.expect(
1236 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1168 pathOffset += 1; 1237 pathOffset += 1;
1169 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1238 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1239 unittest.equals("v1beta1/"));
1170 pathOffset += 8; 1240 pathOffset += 8;
1171 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1241 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1172 1242
1173 var query = (req.url).query; 1243 var query = (req.url).query;
1174 var queryOffset = 0; 1244 var queryOffset = 0;
1175 var queryMap = {}; 1245 var queryMap = {};
1176 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1246 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1177 parseBool(n) { 1247 parseBool(n) {
1178 if (n == "true") return true; 1248 if (n == "true") return true;
1179 if (n == "false") return false; 1249 if (n == "false") return false;
1180 if (n == null) return null; 1250 if (n == null) return null;
1181 throw new core.ArgumentError("Invalid boolean: $n"); 1251 throw new core.ArgumentError("Invalid boolean: $n");
1182 } 1252 }
1253
1183 if (query.length > 0) { 1254 if (query.length > 0) {
1184 for (var part in query.split("&")) { 1255 for (var part in query.split("&")) {
1185 var keyvalue = part.split("="); 1256 var keyvalue = part.split("=");
1186 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1257 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1258 core.Uri.decodeQueryComponent(keyvalue[1]));
1187 } 1259 }
1188 } 1260 }
1189 1261
1190
1191 var h = { 1262 var h = {
1192 "content-type" : "application/json; charset=utf-8", 1263 "content-type": "application/json; charset=utf-8",
1193 }; 1264 };
1194 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1265 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1195 return new async.Future.value(stringResponse(200, h, resp)); 1266 return new async.Future.value(stringResponse(200, h, resp));
1196 }), true); 1267 }), true);
1197 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1268 res.testIamPermissions(arg_request, arg_resource).then(
1269 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1198 checkTestIamPermissionsResponse(response); 1270 checkTestIamPermissionsResponse(response);
1199 }))); 1271 })));
1200 }); 1272 });
1201
1202 }); 1273 });
1203 1274
1204
1205 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () { 1275 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () {
1206 unittest.test("method--create", () { 1276 unittest.test("method--create", () {
1207
1208 var mock = new HttpServerMock(); 1277 var mock = new HttpServerMock();
1209 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1278 api.ProjectsConfigsVariablesResourceApi res =
1279 new api.RuntimeconfigApi(mock).projects.configs.variables;
1210 var arg_request = buildVariable(); 1280 var arg_request = buildVariable();
1211 var arg_parent = "foo"; 1281 var arg_parent = "foo";
1212 var arg_requestId = "foo"; 1282 var arg_requestId = "foo";
1213 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1283 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1214 var obj = new api.Variable.fromJson(json); 1284 var obj = new api.Variable.fromJson(json);
1215 checkVariable(obj); 1285 checkVariable(obj);
1216 1286
1217 var path = (req.url).path; 1287 var path = (req.url).path;
1218 var pathOffset = 0; 1288 var pathOffset = 0;
1219 var index; 1289 var index;
1220 var subPart; 1290 var subPart;
1221 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1291 unittest.expect(
1292 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1222 pathOffset += 1; 1293 pathOffset += 1;
1223 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1294 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1295 unittest.equals("v1beta1/"));
1224 pathOffset += 8; 1296 pathOffset += 8;
1225 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1297 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1226 1298
1227 var query = (req.url).query; 1299 var query = (req.url).query;
1228 var queryOffset = 0; 1300 var queryOffset = 0;
1229 var queryMap = {}; 1301 var queryMap = {};
1230 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1302 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1231 parseBool(n) { 1303 parseBool(n) {
1232 if (n == "true") return true; 1304 if (n == "true") return true;
1233 if (n == "false") return false; 1305 if (n == "false") return false;
1234 if (n == null) return null; 1306 if (n == null) return null;
1235 throw new core.ArgumentError("Invalid boolean: $n"); 1307 throw new core.ArgumentError("Invalid boolean: $n");
1236 } 1308 }
1309
1237 if (query.length > 0) { 1310 if (query.length > 0) {
1238 for (var part in query.split("&")) { 1311 for (var part in query.split("&")) {
1239 var keyvalue = part.split("="); 1312 var keyvalue = part.split("=");
1240 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1313 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1314 core.Uri.decodeQueryComponent(keyvalue[1]));
1241 } 1315 }
1242 } 1316 }
1243 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id)); 1317 unittest.expect(
1244 1318 queryMap["requestId"].first, unittest.equals(arg_requestId));
1245 1319
1246 var h = { 1320 var h = {
1247 "content-type" : "application/json; charset=utf-8", 1321 "content-type": "application/json; charset=utf-8",
1248 }; 1322 };
1249 var resp = convert.JSON.encode(buildVariable()); 1323 var resp = convert.JSON.encode(buildVariable());
1250 return new async.Future.value(stringResponse(200, h, resp)); 1324 return new async.Future.value(stringResponse(200, h, resp));
1251 }), true); 1325 }), true);
1252 res.create(arg_request, arg_parent, requestId: arg_requestId).then(unittes t.expectAsync1(((api.Variable response) { 1326 res
1327 .create(arg_request, arg_parent, requestId: arg_requestId)
1328 .then(unittest.expectAsync1(((api.Variable response) {
1253 checkVariable(response); 1329 checkVariable(response);
1254 }))); 1330 })));
1255 }); 1331 });
1256 1332
1257 unittest.test("method--delete", () { 1333 unittest.test("method--delete", () {
1258
1259 var mock = new HttpServerMock(); 1334 var mock = new HttpServerMock();
1260 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1335 api.ProjectsConfigsVariablesResourceApi res =
1336 new api.RuntimeconfigApi(mock).projects.configs.variables;
1261 var arg_name = "foo"; 1337 var arg_name = "foo";
1262 var arg_recursive = true; 1338 var arg_recursive = true;
1263 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1339 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1264 var path = (req.url).path; 1340 var path = (req.url).path;
1265 var pathOffset = 0; 1341 var pathOffset = 0;
1266 var index; 1342 var index;
1267 var subPart; 1343 var subPart;
1268 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1344 unittest.expect(
1345 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1269 pathOffset += 1; 1346 pathOffset += 1;
1270 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1347 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1348 unittest.equals("v1beta1/"));
1271 pathOffset += 8; 1349 pathOffset += 8;
1272 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1350 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1273 1351
1274 var query = (req.url).query; 1352 var query = (req.url).query;
1275 var queryOffset = 0; 1353 var queryOffset = 0;
1276 var queryMap = {}; 1354 var queryMap = {};
1277 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1355 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1278 parseBool(n) { 1356 parseBool(n) {
1279 if (n == "true") return true; 1357 if (n == "true") return true;
1280 if (n == "false") return false; 1358 if (n == "false") return false;
1281 if (n == null) return null; 1359 if (n == null) return null;
1282 throw new core.ArgumentError("Invalid boolean: $n"); 1360 throw new core.ArgumentError("Invalid boolean: $n");
1283 } 1361 }
1362
1284 if (query.length > 0) { 1363 if (query.length > 0) {
1285 for (var part in query.split("&")) { 1364 for (var part in query.split("&")) {
1286 var keyvalue = part.split("="); 1365 var keyvalue = part.split("=");
1287 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1366 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1367 core.Uri.decodeQueryComponent(keyvalue[1]));
1288 } 1368 }
1289 } 1369 }
1290 unittest.expect(queryMap["recursive"].first, unittest.equals("$arg_recur sive")); 1370 unittest.expect(
1291 1371 queryMap["recursive"].first, unittest.equals("$arg_recursive"));
1292 1372
1293 var h = { 1373 var h = {
1294 "content-type" : "application/json; charset=utf-8", 1374 "content-type": "application/json; charset=utf-8",
1295 }; 1375 };
1296 var resp = convert.JSON.encode(buildEmpty()); 1376 var resp = convert.JSON.encode(buildEmpty());
1297 return new async.Future.value(stringResponse(200, h, resp)); 1377 return new async.Future.value(stringResponse(200, h, resp));
1298 }), true); 1378 }), true);
1299 res.delete(arg_name, recursive: arg_recursive).then(unittest.expectAsync1( ((api.Empty response) { 1379 res
1380 .delete(arg_name, recursive: arg_recursive)
1381 .then(unittest.expectAsync1(((api.Empty response) {
1300 checkEmpty(response); 1382 checkEmpty(response);
1301 }))); 1383 })));
1302 }); 1384 });
1303 1385
1304 unittest.test("method--get", () { 1386 unittest.test("method--get", () {
1305
1306 var mock = new HttpServerMock(); 1387 var mock = new HttpServerMock();
1307 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1388 api.ProjectsConfigsVariablesResourceApi res =
1389 new api.RuntimeconfigApi(mock).projects.configs.variables;
1308 var arg_name = "foo"; 1390 var arg_name = "foo";
1309 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1391 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1310 var path = (req.url).path; 1392 var path = (req.url).path;
1311 var pathOffset = 0; 1393 var pathOffset = 0;
1312 var index; 1394 var index;
1313 var subPart; 1395 var subPart;
1314 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1396 unittest.expect(
1397 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1315 pathOffset += 1; 1398 pathOffset += 1;
1316 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1399 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1400 unittest.equals("v1beta1/"));
1317 pathOffset += 8; 1401 pathOffset += 8;
1318 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1402 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1319 1403
1320 var query = (req.url).query; 1404 var query = (req.url).query;
1321 var queryOffset = 0; 1405 var queryOffset = 0;
1322 var queryMap = {}; 1406 var queryMap = {};
1323 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1407 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1324 parseBool(n) { 1408 parseBool(n) {
1325 if (n == "true") return true; 1409 if (n == "true") return true;
1326 if (n == "false") return false; 1410 if (n == "false") return false;
1327 if (n == null) return null; 1411 if (n == null) return null;
1328 throw new core.ArgumentError("Invalid boolean: $n"); 1412 throw new core.ArgumentError("Invalid boolean: $n");
1329 } 1413 }
1414
1330 if (query.length > 0) { 1415 if (query.length > 0) {
1331 for (var part in query.split("&")) { 1416 for (var part in query.split("&")) {
1332 var keyvalue = part.split("="); 1417 var keyvalue = part.split("=");
1333 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1418 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1419 core.Uri.decodeQueryComponent(keyvalue[1]));
1334 } 1420 }
1335 } 1421 }
1336 1422
1337
1338 var h = { 1423 var h = {
1339 "content-type" : "application/json; charset=utf-8", 1424 "content-type": "application/json; charset=utf-8",
1340 }; 1425 };
1341 var resp = convert.JSON.encode(buildVariable()); 1426 var resp = convert.JSON.encode(buildVariable());
1342 return new async.Future.value(stringResponse(200, h, resp)); 1427 return new async.Future.value(stringResponse(200, h, resp));
1343 }), true); 1428 }), true);
1344 res.get(arg_name).then(unittest.expectAsync1(((api.Variable response) { 1429 res.get(arg_name).then(unittest.expectAsync1(((api.Variable response) {
1345 checkVariable(response); 1430 checkVariable(response);
1346 }))); 1431 })));
1347 }); 1432 });
1348 1433
1349 unittest.test("method--list", () { 1434 unittest.test("method--list", () {
1350
1351 var mock = new HttpServerMock(); 1435 var mock = new HttpServerMock();
1352 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1436 api.ProjectsConfigsVariablesResourceApi res =
1437 new api.RuntimeconfigApi(mock).projects.configs.variables;
1353 var arg_parent = "foo"; 1438 var arg_parent = "foo";
1439 var arg_returnValues = true;
1440 var arg_pageToken = "foo";
1354 var arg_pageSize = 42; 1441 var arg_pageSize = 42;
1355 var arg_filter = "foo"; 1442 var arg_filter = "foo";
1356 var arg_returnValues = true;
1357 var arg_pageToken = "foo";
1358 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1443 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1359 var path = (req.url).path; 1444 var path = (req.url).path;
1360 var pathOffset = 0; 1445 var pathOffset = 0;
1361 var index; 1446 var index;
1362 var subPart; 1447 var subPart;
1363 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1448 unittest.expect(
1449 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1364 pathOffset += 1; 1450 pathOffset += 1;
1365 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1451 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1452 unittest.equals("v1beta1/"));
1366 pathOffset += 8; 1453 pathOffset += 8;
1367 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1454 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1368 1455
1369 var query = (req.url).query; 1456 var query = (req.url).query;
1370 var queryOffset = 0; 1457 var queryOffset = 0;
1371 var queryMap = {}; 1458 var queryMap = {};
1372 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1459 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1373 parseBool(n) { 1460 parseBool(n) {
1374 if (n == "true") return true; 1461 if (n == "true") return true;
1375 if (n == "false") return false; 1462 if (n == "false") return false;
1376 if (n == null) return null; 1463 if (n == null) return null;
1377 throw new core.ArgumentError("Invalid boolean: $n"); 1464 throw new core.ArgumentError("Invalid boolean: $n");
1378 } 1465 }
1466
1379 if (query.length > 0) { 1467 if (query.length > 0) {
1380 for (var part in query.split("&")) { 1468 for (var part in query.split("&")) {
1381 var keyvalue = part.split("="); 1469 var keyvalue = part.split("=");
1382 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1471 core.Uri.decodeQueryComponent(keyvalue[1]));
1383 } 1472 }
1384 } 1473 }
1385 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 1474 unittest.expect(queryMap["returnValues"].first,
1475 unittest.equals("$arg_returnValues"));
1476 unittest.expect(
1477 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
1478 unittest.expect(core.int.parse(queryMap["pageSize"].first),
1479 unittest.equals(arg_pageSize));
1386 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); 1480 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter));
1387 unittest.expect(queryMap["returnValues"].first, unittest.equals("$arg_re turnValues"));
1388 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en));
1389
1390 1481
1391 var h = { 1482 var h = {
1392 "content-type" : "application/json; charset=utf-8", 1483 "content-type": "application/json; charset=utf-8",
1393 }; 1484 };
1394 var resp = convert.JSON.encode(buildListVariablesResponse()); 1485 var resp = convert.JSON.encode(buildListVariablesResponse());
1395 return new async.Future.value(stringResponse(200, h, resp)); 1486 return new async.Future.value(stringResponse(200, h, resp));
1396 }), true); 1487 }), true);
1397 res.list(arg_parent, pageSize: arg_pageSize, filter: arg_filter, returnVal ues: arg_returnValues, pageToken: arg_pageToken).then(unittest.expectAsync1(((ap i.ListVariablesResponse response) { 1488 res
1489 .list(arg_parent,
1490 returnValues: arg_returnValues,
1491 pageToken: arg_pageToken,
1492 pageSize: arg_pageSize,
1493 filter: arg_filter)
1494 .then(unittest.expectAsync1(((api.ListVariablesResponse response) {
1398 checkListVariablesResponse(response); 1495 checkListVariablesResponse(response);
1399 }))); 1496 })));
1400 }); 1497 });
1401 1498
1402 unittest.test("method--testIamPermissions", () { 1499 unittest.test("method--testIamPermissions", () {
1403
1404 var mock = new HttpServerMock(); 1500 var mock = new HttpServerMock();
1405 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1501 api.ProjectsConfigsVariablesResourceApi res =
1502 new api.RuntimeconfigApi(mock).projects.configs.variables;
1406 var arg_request = buildTestIamPermissionsRequest(); 1503 var arg_request = buildTestIamPermissionsRequest();
1407 var arg_resource = "foo"; 1504 var arg_resource = "foo";
1408 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1505 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1409 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1506 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1410 checkTestIamPermissionsRequest(obj); 1507 checkTestIamPermissionsRequest(obj);
1411 1508
1412 var path = (req.url).path; 1509 var path = (req.url).path;
1413 var pathOffset = 0; 1510 var pathOffset = 0;
1414 var index; 1511 var index;
1415 var subPart; 1512 var subPart;
1416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1513 unittest.expect(
1514 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1417 pathOffset += 1; 1515 pathOffset += 1;
1418 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1516 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1517 unittest.equals("v1beta1/"));
1419 pathOffset += 8; 1518 pathOffset += 8;
1420 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1519 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1421 1520
1422 var query = (req.url).query; 1521 var query = (req.url).query;
1423 var queryOffset = 0; 1522 var queryOffset = 0;
1424 var queryMap = {}; 1523 var queryMap = {};
1425 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1524 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1426 parseBool(n) { 1525 parseBool(n) {
1427 if (n == "true") return true; 1526 if (n == "true") return true;
1428 if (n == "false") return false; 1527 if (n == "false") return false;
1429 if (n == null) return null; 1528 if (n == null) return null;
1430 throw new core.ArgumentError("Invalid boolean: $n"); 1529 throw new core.ArgumentError("Invalid boolean: $n");
1431 } 1530 }
1531
1432 if (query.length > 0) { 1532 if (query.length > 0) {
1433 for (var part in query.split("&")) { 1533 for (var part in query.split("&")) {
1434 var keyvalue = part.split("="); 1534 var keyvalue = part.split("=");
1435 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1535 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1536 core.Uri.decodeQueryComponent(keyvalue[1]));
1436 } 1537 }
1437 } 1538 }
1438 1539
1439
1440 var h = { 1540 var h = {
1441 "content-type" : "application/json; charset=utf-8", 1541 "content-type": "application/json; charset=utf-8",
1442 }; 1542 };
1443 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1543 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1444 return new async.Future.value(stringResponse(200, h, resp)); 1544 return new async.Future.value(stringResponse(200, h, resp));
1445 }), true); 1545 }), true);
1446 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1546 res.testIamPermissions(arg_request, arg_resource).then(
1547 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1447 checkTestIamPermissionsResponse(response); 1548 checkTestIamPermissionsResponse(response);
1448 }))); 1549 })));
1449 }); 1550 });
1450 1551
1451 unittest.test("method--update", () { 1552 unittest.test("method--update", () {
1452
1453 var mock = new HttpServerMock(); 1553 var mock = new HttpServerMock();
1454 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1554 api.ProjectsConfigsVariablesResourceApi res =
1555 new api.RuntimeconfigApi(mock).projects.configs.variables;
1455 var arg_request = buildVariable(); 1556 var arg_request = buildVariable();
1456 var arg_name = "foo"; 1557 var arg_name = "foo";
1457 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1558 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1458 var obj = new api.Variable.fromJson(json); 1559 var obj = new api.Variable.fromJson(json);
1459 checkVariable(obj); 1560 checkVariable(obj);
1460 1561
1461 var path = (req.url).path; 1562 var path = (req.url).path;
1462 var pathOffset = 0; 1563 var pathOffset = 0;
1463 var index; 1564 var index;
1464 var subPart; 1565 var subPart;
1465 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1566 unittest.expect(
1567 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1466 pathOffset += 1; 1568 pathOffset += 1;
1467 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1569 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1570 unittest.equals("v1beta1/"));
1468 pathOffset += 8; 1571 pathOffset += 8;
1469 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1572 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1470 1573
1471 var query = (req.url).query; 1574 var query = (req.url).query;
1472 var queryOffset = 0; 1575 var queryOffset = 0;
1473 var queryMap = {}; 1576 var queryMap = {};
1474 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1577 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1475 parseBool(n) { 1578 parseBool(n) {
1476 if (n == "true") return true; 1579 if (n == "true") return true;
1477 if (n == "false") return false; 1580 if (n == "false") return false;
1478 if (n == null) return null; 1581 if (n == null) return null;
1479 throw new core.ArgumentError("Invalid boolean: $n"); 1582 throw new core.ArgumentError("Invalid boolean: $n");
1480 } 1583 }
1584
1481 if (query.length > 0) { 1585 if (query.length > 0) {
1482 for (var part in query.split("&")) { 1586 for (var part in query.split("&")) {
1483 var keyvalue = part.split("="); 1587 var keyvalue = part.split("=");
1484 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1588 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1589 core.Uri.decodeQueryComponent(keyvalue[1]));
1485 } 1590 }
1486 } 1591 }
1487 1592
1488
1489 var h = { 1593 var h = {
1490 "content-type" : "application/json; charset=utf-8", 1594 "content-type": "application/json; charset=utf-8",
1491 }; 1595 };
1492 var resp = convert.JSON.encode(buildVariable()); 1596 var resp = convert.JSON.encode(buildVariable());
1493 return new async.Future.value(stringResponse(200, h, resp)); 1597 return new async.Future.value(stringResponse(200, h, resp));
1494 }), true); 1598 }), true);
1495 res.update(arg_request, arg_name).then(unittest.expectAsync1(((api.Variabl e response) { 1599 res
1600 .update(arg_request, arg_name)
1601 .then(unittest.expectAsync1(((api.Variable response) {
1496 checkVariable(response); 1602 checkVariable(response);
1497 }))); 1603 })));
1498 }); 1604 });
1499 1605
1500 unittest.test("method--watch", () { 1606 unittest.test("method--watch", () {
1501
1502 var mock = new HttpServerMock(); 1607 var mock = new HttpServerMock();
1503 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1608 api.ProjectsConfigsVariablesResourceApi res =
1609 new api.RuntimeconfigApi(mock).projects.configs.variables;
1504 var arg_request = buildWatchVariableRequest(); 1610 var arg_request = buildWatchVariableRequest();
1505 var arg_name = "foo"; 1611 var arg_name = "foo";
1506 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1612 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1507 var obj = new api.WatchVariableRequest.fromJson(json); 1613 var obj = new api.WatchVariableRequest.fromJson(json);
1508 checkWatchVariableRequest(obj); 1614 checkWatchVariableRequest(obj);
1509 1615
1510 var path = (req.url).path; 1616 var path = (req.url).path;
1511 var pathOffset = 0; 1617 var pathOffset = 0;
1512 var index; 1618 var index;
1513 var subPart; 1619 var subPart;
1514 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1620 unittest.expect(
1621 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1515 pathOffset += 1; 1622 pathOffset += 1;
1516 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1623 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1624 unittest.equals("v1beta1/"));
1517 pathOffset += 8; 1625 pathOffset += 8;
1518 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1626 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1519 1627
1520 var query = (req.url).query; 1628 var query = (req.url).query;
1521 var queryOffset = 0; 1629 var queryOffset = 0;
1522 var queryMap = {}; 1630 var queryMap = {};
1523 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1631 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1524 parseBool(n) { 1632 parseBool(n) {
1525 if (n == "true") return true; 1633 if (n == "true") return true;
1526 if (n == "false") return false; 1634 if (n == "false") return false;
1527 if (n == null) return null; 1635 if (n == null) return null;
1528 throw new core.ArgumentError("Invalid boolean: $n"); 1636 throw new core.ArgumentError("Invalid boolean: $n");
1529 } 1637 }
1638
1530 if (query.length > 0) { 1639 if (query.length > 0) {
1531 for (var part in query.split("&")) { 1640 for (var part in query.split("&")) {
1532 var keyvalue = part.split("="); 1641 var keyvalue = part.split("=");
1533 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1642 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1643 core.Uri.decodeQueryComponent(keyvalue[1]));
1534 } 1644 }
1535 } 1645 }
1536 1646
1537
1538 var h = { 1647 var h = {
1539 "content-type" : "application/json; charset=utf-8", 1648 "content-type": "application/json; charset=utf-8",
1540 }; 1649 };
1541 var resp = convert.JSON.encode(buildVariable()); 1650 var resp = convert.JSON.encode(buildVariable());
1542 return new async.Future.value(stringResponse(200, h, resp)); 1651 return new async.Future.value(stringResponse(200, h, resp));
1543 }), true); 1652 }), true);
1544 res.watch(arg_request, arg_name).then(unittest.expectAsync1(((api.Variable response) { 1653 res
1654 .watch(arg_request, arg_name)
1655 .then(unittest.expectAsync1(((api.Variable response) {
1545 checkVariable(response); 1656 checkVariable(response);
1546 }))); 1657 })));
1547 }); 1658 });
1548
1549 }); 1659 });
1550 1660
1551
1552 unittest.group("resource-ProjectsConfigsWaitersResourceApi", () { 1661 unittest.group("resource-ProjectsConfigsWaitersResourceApi", () {
1553 unittest.test("method--create", () { 1662 unittest.test("method--create", () {
1554
1555 var mock = new HttpServerMock(); 1663 var mock = new HttpServerMock();
1556 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters; 1664 api.ProjectsConfigsWaitersResourceApi res =
1665 new api.RuntimeconfigApi(mock).projects.configs.waiters;
1557 var arg_request = buildWaiter(); 1666 var arg_request = buildWaiter();
1558 var arg_parent = "foo"; 1667 var arg_parent = "foo";
1559 var arg_requestId = "foo"; 1668 var arg_requestId = "foo";
1560 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1669 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1561 var obj = new api.Waiter.fromJson(json); 1670 var obj = new api.Waiter.fromJson(json);
1562 checkWaiter(obj); 1671 checkWaiter(obj);
1563 1672
1564 var path = (req.url).path; 1673 var path = (req.url).path;
1565 var pathOffset = 0; 1674 var pathOffset = 0;
1566 var index; 1675 var index;
1567 var subPart; 1676 var subPart;
1568 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1677 unittest.expect(
1678 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1569 pathOffset += 1; 1679 pathOffset += 1;
1570 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1680 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1681 unittest.equals("v1beta1/"));
1571 pathOffset += 8; 1682 pathOffset += 8;
1572 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1683 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1573 1684
1574 var query = (req.url).query; 1685 var query = (req.url).query;
1575 var queryOffset = 0; 1686 var queryOffset = 0;
1576 var queryMap = {}; 1687 var queryMap = {};
1577 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1688 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1578 parseBool(n) { 1689 parseBool(n) {
1579 if (n == "true") return true; 1690 if (n == "true") return true;
1580 if (n == "false") return false; 1691 if (n == "false") return false;
1581 if (n == null) return null; 1692 if (n == null) return null;
1582 throw new core.ArgumentError("Invalid boolean: $n"); 1693 throw new core.ArgumentError("Invalid boolean: $n");
1583 } 1694 }
1695
1584 if (query.length > 0) { 1696 if (query.length > 0) {
1585 for (var part in query.split("&")) { 1697 for (var part in query.split("&")) {
1586 var keyvalue = part.split("="); 1698 var keyvalue = part.split("=");
1587 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1699 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1700 core.Uri.decodeQueryComponent(keyvalue[1]));
1588 } 1701 }
1589 } 1702 }
1590 unittest.expect(queryMap["requestId"].first, unittest.equals(arg_request Id)); 1703 unittest.expect(
1591 1704 queryMap["requestId"].first, unittest.equals(arg_requestId));
1592 1705
1593 var h = { 1706 var h = {
1594 "content-type" : "application/json; charset=utf-8", 1707 "content-type": "application/json; charset=utf-8",
1595 }; 1708 };
1596 var resp = convert.JSON.encode(buildOperation()); 1709 var resp = convert.JSON.encode(buildOperation());
1597 return new async.Future.value(stringResponse(200, h, resp)); 1710 return new async.Future.value(stringResponse(200, h, resp));
1598 }), true); 1711 }), true);
1599 res.create(arg_request, arg_parent, requestId: arg_requestId).then(unittes t.expectAsync1(((api.Operation response) { 1712 res
1713 .create(arg_request, arg_parent, requestId: arg_requestId)
1714 .then(unittest.expectAsync1(((api.Operation response) {
1600 checkOperation(response); 1715 checkOperation(response);
1601 }))); 1716 })));
1602 }); 1717 });
1603 1718
1604 unittest.test("method--delete", () { 1719 unittest.test("method--delete", () {
1605
1606 var mock = new HttpServerMock(); 1720 var mock = new HttpServerMock();
1607 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters; 1721 api.ProjectsConfigsWaitersResourceApi res =
1722 new api.RuntimeconfigApi(mock).projects.configs.waiters;
1608 var arg_name = "foo"; 1723 var arg_name = "foo";
1609 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1724 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1610 var path = (req.url).path; 1725 var path = (req.url).path;
1611 var pathOffset = 0; 1726 var pathOffset = 0;
1612 var index; 1727 var index;
1613 var subPart; 1728 var subPart;
1614 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1729 unittest.expect(
1730 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1615 pathOffset += 1; 1731 pathOffset += 1;
1616 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1732 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1733 unittest.equals("v1beta1/"));
1617 pathOffset += 8; 1734 pathOffset += 8;
1618 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1735 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1619 1736
1620 var query = (req.url).query; 1737 var query = (req.url).query;
1621 var queryOffset = 0; 1738 var queryOffset = 0;
1622 var queryMap = {}; 1739 var queryMap = {};
1623 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1740 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1624 parseBool(n) { 1741 parseBool(n) {
1625 if (n == "true") return true; 1742 if (n == "true") return true;
1626 if (n == "false") return false; 1743 if (n == "false") return false;
1627 if (n == null) return null; 1744 if (n == null) return null;
1628 throw new core.ArgumentError("Invalid boolean: $n"); 1745 throw new core.ArgumentError("Invalid boolean: $n");
1629 } 1746 }
1747
1630 if (query.length > 0) { 1748 if (query.length > 0) {
1631 for (var part in query.split("&")) { 1749 for (var part in query.split("&")) {
1632 var keyvalue = part.split("="); 1750 var keyvalue = part.split("=");
1633 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1751 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1752 core.Uri.decodeQueryComponent(keyvalue[1]));
1634 } 1753 }
1635 } 1754 }
1636 1755
1637
1638 var h = { 1756 var h = {
1639 "content-type" : "application/json; charset=utf-8", 1757 "content-type": "application/json; charset=utf-8",
1640 }; 1758 };
1641 var resp = convert.JSON.encode(buildEmpty()); 1759 var resp = convert.JSON.encode(buildEmpty());
1642 return new async.Future.value(stringResponse(200, h, resp)); 1760 return new async.Future.value(stringResponse(200, h, resp));
1643 }), true); 1761 }), true);
1644 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { 1762 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) {
1645 checkEmpty(response); 1763 checkEmpty(response);
1646 }))); 1764 })));
1647 }); 1765 });
1648 1766
1649 unittest.test("method--get", () { 1767 unittest.test("method--get", () {
1650
1651 var mock = new HttpServerMock(); 1768 var mock = new HttpServerMock();
1652 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters; 1769 api.ProjectsConfigsWaitersResourceApi res =
1770 new api.RuntimeconfigApi(mock).projects.configs.waiters;
1653 var arg_name = "foo"; 1771 var arg_name = "foo";
1654 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1772 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1655 var path = (req.url).path; 1773 var path = (req.url).path;
1656 var pathOffset = 0; 1774 var pathOffset = 0;
1657 var index; 1775 var index;
1658 var subPart; 1776 var subPart;
1659 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1777 unittest.expect(
1778 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1660 pathOffset += 1; 1779 pathOffset += 1;
1661 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1780 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1781 unittest.equals("v1beta1/"));
1662 pathOffset += 8; 1782 pathOffset += 8;
1663 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1783 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1664 1784
1665 var query = (req.url).query; 1785 var query = (req.url).query;
1666 var queryOffset = 0; 1786 var queryOffset = 0;
1667 var queryMap = {}; 1787 var queryMap = {};
1668 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1788 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1669 parseBool(n) { 1789 parseBool(n) {
1670 if (n == "true") return true; 1790 if (n == "true") return true;
1671 if (n == "false") return false; 1791 if (n == "false") return false;
1672 if (n == null) return null; 1792 if (n == null) return null;
1673 throw new core.ArgumentError("Invalid boolean: $n"); 1793 throw new core.ArgumentError("Invalid boolean: $n");
1674 } 1794 }
1795
1675 if (query.length > 0) { 1796 if (query.length > 0) {
1676 for (var part in query.split("&")) { 1797 for (var part in query.split("&")) {
1677 var keyvalue = part.split("="); 1798 var keyvalue = part.split("=");
1678 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1799 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1800 core.Uri.decodeQueryComponent(keyvalue[1]));
1679 } 1801 }
1680 } 1802 }
1681 1803
1682
1683 var h = { 1804 var h = {
1684 "content-type" : "application/json; charset=utf-8", 1805 "content-type": "application/json; charset=utf-8",
1685 }; 1806 };
1686 var resp = convert.JSON.encode(buildWaiter()); 1807 var resp = convert.JSON.encode(buildWaiter());
1687 return new async.Future.value(stringResponse(200, h, resp)); 1808 return new async.Future.value(stringResponse(200, h, resp));
1688 }), true); 1809 }), true);
1689 res.get(arg_name).then(unittest.expectAsync1(((api.Waiter response) { 1810 res.get(arg_name).then(unittest.expectAsync1(((api.Waiter response) {
1690 checkWaiter(response); 1811 checkWaiter(response);
1691 }))); 1812 })));
1692 }); 1813 });
1693 1814
1694 unittest.test("method--list", () { 1815 unittest.test("method--list", () {
1695
1696 var mock = new HttpServerMock(); 1816 var mock = new HttpServerMock();
1697 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters; 1817 api.ProjectsConfigsWaitersResourceApi res =
1818 new api.RuntimeconfigApi(mock).projects.configs.waiters;
1698 var arg_parent = "foo"; 1819 var arg_parent = "foo";
1699 var arg_pageToken = "foo"; 1820 var arg_pageToken = "foo";
1700 var arg_pageSize = 42; 1821 var arg_pageSize = 42;
1701 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1822 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1702 var path = (req.url).path; 1823 var path = (req.url).path;
1703 var pathOffset = 0; 1824 var pathOffset = 0;
1704 var index; 1825 var index;
1705 var subPart; 1826 var subPart;
1706 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1827 unittest.expect(
1828 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1707 pathOffset += 1; 1829 pathOffset += 1;
1708 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1830 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1831 unittest.equals("v1beta1/"));
1709 pathOffset += 8; 1832 pathOffset += 8;
1710 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1833 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1711 1834
1712 var query = (req.url).query; 1835 var query = (req.url).query;
1713 var queryOffset = 0; 1836 var queryOffset = 0;
1714 var queryMap = {}; 1837 var queryMap = {};
1715 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1838 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1716 parseBool(n) { 1839 parseBool(n) {
1717 if (n == "true") return true; 1840 if (n == "true") return true;
1718 if (n == "false") return false; 1841 if (n == "false") return false;
1719 if (n == null) return null; 1842 if (n == null) return null;
1720 throw new core.ArgumentError("Invalid boolean: $n"); 1843 throw new core.ArgumentError("Invalid boolean: $n");
1721 } 1844 }
1845
1722 if (query.length > 0) { 1846 if (query.length > 0) {
1723 for (var part in query.split("&")) { 1847 for (var part in query.split("&")) {
1724 var keyvalue = part.split("="); 1848 var keyvalue = part.split("=");
1725 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]));
1726 } 1851 }
1727 } 1852 }
1728 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok en)); 1853 unittest.expect(
1729 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ als(arg_pageSize)); 1854 queryMap["pageToken"].first, unittest.equals(arg_pageToken));
1730 1855 unittest.expect(core.int.parse(queryMap["pageSize"].first),
1856 unittest.equals(arg_pageSize));
1731 1857
1732 var h = { 1858 var h = {
1733 "content-type" : "application/json; charset=utf-8", 1859 "content-type": "application/json; charset=utf-8",
1734 }; 1860 };
1735 var resp = convert.JSON.encode(buildListWaitersResponse()); 1861 var resp = convert.JSON.encode(buildListWaitersResponse());
1736 return new async.Future.value(stringResponse(200, h, resp)); 1862 return new async.Future.value(stringResponse(200, h, resp));
1737 }), true); 1863 }), true);
1738 res.list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize).the n(unittest.expectAsync1(((api.ListWaitersResponse response) { 1864 res
1865 .list(arg_parent, pageToken: arg_pageToken, pageSize: arg_pageSize)
1866 .then(unittest.expectAsync1(((api.ListWaitersResponse response) {
1739 checkListWaitersResponse(response); 1867 checkListWaitersResponse(response);
1740 }))); 1868 })));
1741 }); 1869 });
1742 1870
1743 unittest.test("method--testIamPermissions", () { 1871 unittest.test("method--testIamPermissions", () {
1744
1745 var mock = new HttpServerMock(); 1872 var mock = new HttpServerMock();
1746 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters; 1873 api.ProjectsConfigsWaitersResourceApi res =
1874 new api.RuntimeconfigApi(mock).projects.configs.waiters;
1747 var arg_request = buildTestIamPermissionsRequest(); 1875 var arg_request = buildTestIamPermissionsRequest();
1748 var arg_resource = "foo"; 1876 var arg_resource = "foo";
1749 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { 1877 mock.register(unittest.expectAsync2((http.BaseRequest req, json) {
1750 var obj = new api.TestIamPermissionsRequest.fromJson(json); 1878 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1751 checkTestIamPermissionsRequest(obj); 1879 checkTestIamPermissionsRequest(obj);
1752 1880
1753 var path = (req.url).path; 1881 var path = (req.url).path;
1754 var pathOffset = 0; 1882 var pathOffset = 0;
1755 var index; 1883 var index;
1756 var subPart; 1884 var subPart;
1757 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/")); 1885 unittest.expect(
1886 path.substring(pathOffset, pathOffset + 1), unittest.equals("/"));
1758 pathOffset += 1; 1887 pathOffset += 1;
1759 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/")); 1888 unittest.expect(path.substring(pathOffset, pathOffset + 8),
1889 unittest.equals("v1beta1/"));
1760 pathOffset += 8; 1890 pathOffset += 8;
1761 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation; 1891 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1762 1892
1763 var query = (req.url).query; 1893 var query = (req.url).query;
1764 var queryOffset = 0; 1894 var queryOffset = 0;
1765 var queryMap = {}; 1895 var queryMap = {};
1766 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); 1896 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1767 parseBool(n) { 1897 parseBool(n) {
1768 if (n == "true") return true; 1898 if (n == "true") return true;
1769 if (n == "false") return false; 1899 if (n == "false") return false;
1770 if (n == null) return null; 1900 if (n == null) return null;
1771 throw new core.ArgumentError("Invalid boolean: $n"); 1901 throw new core.ArgumentError("Invalid boolean: $n");
1772 } 1902 }
1903
1773 if (query.length > 0) { 1904 if (query.length > 0) {
1774 for (var part in query.split("&")) { 1905 for (var part in query.split("&")) {
1775 var keyvalue = part.split("="); 1906 var keyvalue = part.split("=");
1776 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1])); 1907 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]),
1908 core.Uri.decodeQueryComponent(keyvalue[1]));
1777 } 1909 }
1778 } 1910 }
1779 1911
1780
1781 var h = { 1912 var h = {
1782 "content-type" : "application/json; charset=utf-8", 1913 "content-type": "application/json; charset=utf-8",
1783 }; 1914 };
1784 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); 1915 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1785 return new async.Future.value(stringResponse(200, h, resp)); 1916 return new async.Future.value(stringResponse(200, h, resp));
1786 }), true); 1917 }), true);
1787 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c1(((api.TestIamPermissionsResponse response) { 1918 res.testIamPermissions(arg_request, arg_resource).then(
1919 unittest.expectAsync1(((api.TestIamPermissionsResponse response) {
1788 checkTestIamPermissionsResponse(response); 1920 checkTestIamPermissionsResponse(response);
1789 }))); 1921 })));
1790 }); 1922 });
1791
1792 }); 1923 });
1793
1794
1795 } 1924 }
1796
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698