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

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

Issue 2571553005: Api-roll 43: 2016-12-13 (Closed)
Patch Set: Created 4 years 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; 4 import "dart:collection" as collection;
5 import "dart:async" as async; 5 import "dart:async" as async;
6 import "dart:convert" as convert; 6 import "dart:convert" as convert;
7 7
8 import 'package:http/http.dart' as http; 8 import 'package:http/http.dart' as http;
9 import 'package:http/testing.dart' as http_testing; 9 import 'package:http/testing.dart' as http_testing;
10 import 'package:unittest/unittest.dart' as unittest; 10 import 'package:unittest/unittest.dart' as unittest;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 http.StreamedResponse stringResponse( 48 http.StreamedResponse stringResponse(
49 core.int status, core.Map headers, core.String body) { 49 core.int status, core.Map headers, core.String body) {
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]);
51 return new http.StreamedResponse(stream, status, headers: headers); 51 return new http.StreamedResponse(stream, status, headers: headers);
52 } 52 }
53 53
54 buildUnnamed3764() {
55 var o = new core.List<core.String>();
56 o.add("foo");
57 o.add("foo");
58 return o;
59 }
60
61 checkUnnamed3764(core.List<core.String> o) {
62 unittest.expect(o, unittest.hasLength(2));
63 unittest.expect(o[0], unittest.equals('foo'));
64 unittest.expect(o[1], unittest.equals('foo'));
65 }
66
67 core.int buildCounterBinding = 0;
68 buildBinding() {
69 var o = new api.Binding();
70 buildCounterBinding++;
71 if (buildCounterBinding < 3) {
72 o.members = buildUnnamed3764();
73 o.role = "foo";
74 }
75 buildCounterBinding--;
76 return o;
77 }
78
79 checkBinding(api.Binding o) {
80 buildCounterBinding++;
81 if (buildCounterBinding < 3) {
82 checkUnnamed3764(o.members);
83 unittest.expect(o.role, unittest.equals('foo'));
84 }
85 buildCounterBinding--;
86 }
87
54 core.int buildCounterCardinality = 0; 88 core.int buildCounterCardinality = 0;
55 buildCardinality() { 89 buildCardinality() {
56 var o = new api.Cardinality(); 90 var o = new api.Cardinality();
57 buildCounterCardinality++; 91 buildCounterCardinality++;
58 if (buildCounterCardinality < 3) { 92 if (buildCounterCardinality < 3) {
59 o.number = 42; 93 o.number = 42;
60 o.path = "foo"; 94 o.path = "foo";
61 } 95 }
62 buildCounterCardinality--; 96 buildCounterCardinality--;
63 return o; 97 return o;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 135 }
102 136
103 checkEndCondition(api.EndCondition o) { 137 checkEndCondition(api.EndCondition o) {
104 buildCounterEndCondition++; 138 buildCounterEndCondition++;
105 if (buildCounterEndCondition < 3) { 139 if (buildCounterEndCondition < 3) {
106 checkCardinality(o.cardinality); 140 checkCardinality(o.cardinality);
107 } 141 }
108 buildCounterEndCondition--; 142 buildCounterEndCondition--;
109 } 143 }
110 144
111 buildUnnamed4048() { 145 buildUnnamed3765() {
112 var o = new core.List<api.RuntimeConfig>(); 146 var o = new core.List<api.RuntimeConfig>();
113 o.add(buildRuntimeConfig()); 147 o.add(buildRuntimeConfig());
114 o.add(buildRuntimeConfig()); 148 o.add(buildRuntimeConfig());
115 return o; 149 return o;
116 } 150 }
117 151
118 checkUnnamed4048(core.List<api.RuntimeConfig> o) { 152 checkUnnamed3765(core.List<api.RuntimeConfig> o) {
119 unittest.expect(o, unittest.hasLength(2)); 153 unittest.expect(o, unittest.hasLength(2));
120 checkRuntimeConfig(o[0]); 154 checkRuntimeConfig(o[0]);
121 checkRuntimeConfig(o[1]); 155 checkRuntimeConfig(o[1]);
122 } 156 }
123 157
124 core.int buildCounterListConfigsResponse = 0; 158 core.int buildCounterListConfigsResponse = 0;
125 buildListConfigsResponse() { 159 buildListConfigsResponse() {
126 var o = new api.ListConfigsResponse(); 160 var o = new api.ListConfigsResponse();
127 buildCounterListConfigsResponse++; 161 buildCounterListConfigsResponse++;
128 if (buildCounterListConfigsResponse < 3) { 162 if (buildCounterListConfigsResponse < 3) {
129 o.configs = buildUnnamed4048(); 163 o.configs = buildUnnamed3765();
130 o.nextPageToken = "foo"; 164 o.nextPageToken = "foo";
131 } 165 }
132 buildCounterListConfigsResponse--; 166 buildCounterListConfigsResponse--;
133 return o; 167 return o;
134 } 168 }
135 169
136 checkListConfigsResponse(api.ListConfigsResponse o) { 170 checkListConfigsResponse(api.ListConfigsResponse o) {
137 buildCounterListConfigsResponse++; 171 buildCounterListConfigsResponse++;
138 if (buildCounterListConfigsResponse < 3) { 172 if (buildCounterListConfigsResponse < 3) {
139 checkUnnamed4048(o.configs); 173 checkUnnamed3765(o.configs);
140 unittest.expect(o.nextPageToken, unittest.equals('foo')); 174 unittest.expect(o.nextPageToken, unittest.equals('foo'));
141 } 175 }
142 buildCounterListConfigsResponse--; 176 buildCounterListConfigsResponse--;
143 } 177 }
144 178
145 buildUnnamed4049() { 179 buildUnnamed3766() {
146 var o = new core.List<api.Variable>(); 180 var o = new core.List<api.Variable>();
147 o.add(buildVariable()); 181 o.add(buildVariable());
148 o.add(buildVariable()); 182 o.add(buildVariable());
149 return o; 183 return o;
150 } 184 }
151 185
152 checkUnnamed4049(core.List<api.Variable> o) { 186 checkUnnamed3766(core.List<api.Variable> o) {
153 unittest.expect(o, unittest.hasLength(2)); 187 unittest.expect(o, unittest.hasLength(2));
154 checkVariable(o[0]); 188 checkVariable(o[0]);
155 checkVariable(o[1]); 189 checkVariable(o[1]);
156 } 190 }
157 191
158 core.int buildCounterListVariablesResponse = 0; 192 core.int buildCounterListVariablesResponse = 0;
159 buildListVariablesResponse() { 193 buildListVariablesResponse() {
160 var o = new api.ListVariablesResponse(); 194 var o = new api.ListVariablesResponse();
161 buildCounterListVariablesResponse++; 195 buildCounterListVariablesResponse++;
162 if (buildCounterListVariablesResponse < 3) { 196 if (buildCounterListVariablesResponse < 3) {
163 o.nextPageToken = "foo"; 197 o.nextPageToken = "foo";
164 o.variables = buildUnnamed4049(); 198 o.variables = buildUnnamed3766();
165 } 199 }
166 buildCounterListVariablesResponse--; 200 buildCounterListVariablesResponse--;
167 return o; 201 return o;
168 } 202 }
169 203
170 checkListVariablesResponse(api.ListVariablesResponse o) { 204 checkListVariablesResponse(api.ListVariablesResponse o) {
171 buildCounterListVariablesResponse++; 205 buildCounterListVariablesResponse++;
172 if (buildCounterListVariablesResponse < 3) { 206 if (buildCounterListVariablesResponse < 3) {
173 unittest.expect(o.nextPageToken, unittest.equals('foo')); 207 unittest.expect(o.nextPageToken, unittest.equals('foo'));
174 checkUnnamed4049(o.variables); 208 checkUnnamed3766(o.variables);
175 } 209 }
176 buildCounterListVariablesResponse--; 210 buildCounterListVariablesResponse--;
177 } 211 }
178 212
179 buildUnnamed4050() { 213 buildUnnamed3767() {
180 var o = new core.List<api.Waiter>(); 214 var o = new core.List<api.Waiter>();
181 o.add(buildWaiter()); 215 o.add(buildWaiter());
182 o.add(buildWaiter()); 216 o.add(buildWaiter());
183 return o; 217 return o;
184 } 218 }
185 219
186 checkUnnamed4050(core.List<api.Waiter> o) { 220 checkUnnamed3767(core.List<api.Waiter> o) {
187 unittest.expect(o, unittest.hasLength(2)); 221 unittest.expect(o, unittest.hasLength(2));
188 checkWaiter(o[0]); 222 checkWaiter(o[0]);
189 checkWaiter(o[1]); 223 checkWaiter(o[1]);
190 } 224 }
191 225
192 core.int buildCounterListWaitersResponse = 0; 226 core.int buildCounterListWaitersResponse = 0;
193 buildListWaitersResponse() { 227 buildListWaitersResponse() {
194 var o = new api.ListWaitersResponse(); 228 var o = new api.ListWaitersResponse();
195 buildCounterListWaitersResponse++; 229 buildCounterListWaitersResponse++;
196 if (buildCounterListWaitersResponse < 3) { 230 if (buildCounterListWaitersResponse < 3) {
197 o.nextPageToken = "foo"; 231 o.nextPageToken = "foo";
198 o.waiters = buildUnnamed4050(); 232 o.waiters = buildUnnamed3767();
199 } 233 }
200 buildCounterListWaitersResponse--; 234 buildCounterListWaitersResponse--;
201 return o; 235 return o;
202 } 236 }
203 237
204 checkListWaitersResponse(api.ListWaitersResponse o) { 238 checkListWaitersResponse(api.ListWaitersResponse o) {
205 buildCounterListWaitersResponse++; 239 buildCounterListWaitersResponse++;
206 if (buildCounterListWaitersResponse < 3) { 240 if (buildCounterListWaitersResponse < 3) {
207 unittest.expect(o.nextPageToken, unittest.equals('foo')); 241 unittest.expect(o.nextPageToken, unittest.equals('foo'));
208 checkUnnamed4050(o.waiters); 242 checkUnnamed3767(o.waiters);
209 } 243 }
210 buildCounterListWaitersResponse--; 244 buildCounterListWaitersResponse--;
211 } 245 }
212 246
213 buildUnnamed4051() { 247 buildUnnamed3768() {
214 var o = new core.Map<core.String, core.Object>(); 248 var o = new core.Map<core.String, core.Object>();
215 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 249 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
216 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 250 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
217 return o; 251 return o;
218 } 252 }
219 253
220 checkUnnamed4051(core.Map<core.String, core.Object> o) { 254 checkUnnamed3768(core.Map<core.String, core.Object> o) {
221 unittest.expect(o, unittest.hasLength(2)); 255 unittest.expect(o, unittest.hasLength(2));
222 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')); 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'));
223 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')); 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'));
224 } 258 }
225 259
226 buildUnnamed4052() { 260 buildUnnamed3769() {
227 var o = new core.Map<core.String, core.Object>(); 261 var o = new core.Map<core.String, core.Object>();
228 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 262 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
229 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 263 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
230 return o; 264 return o;
231 } 265 }
232 266
233 checkUnnamed4052(core.Map<core.String, core.Object> o) { 267 checkUnnamed3769(core.Map<core.String, core.Object> o) {
234 unittest.expect(o, unittest.hasLength(2)); 268 unittest.expect(o, unittest.hasLength(2));
235 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')); 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'));
236 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')); 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'));
237 } 271 }
238 272
239 core.int buildCounterOperation = 0; 273 core.int buildCounterOperation = 0;
240 buildOperation() { 274 buildOperation() {
241 var o = new api.Operation(); 275 var o = new api.Operation();
242 buildCounterOperation++; 276 buildCounterOperation++;
243 if (buildCounterOperation < 3) { 277 if (buildCounterOperation < 3) {
244 o.done = true; 278 o.done = true;
245 o.error = buildStatus(); 279 o.error = buildStatus();
246 o.metadata = buildUnnamed4051(); 280 o.metadata = buildUnnamed3768();
247 o.name = "foo"; 281 o.name = "foo";
248 o.response = buildUnnamed4052(); 282 o.response = buildUnnamed3769();
249 } 283 }
250 buildCounterOperation--; 284 buildCounterOperation--;
251 return o; 285 return o;
252 } 286 }
253 287
254 checkOperation(api.Operation o) { 288 checkOperation(api.Operation o) {
255 buildCounterOperation++; 289 buildCounterOperation++;
256 if (buildCounterOperation < 3) { 290 if (buildCounterOperation < 3) {
257 unittest.expect(o.done, unittest.isTrue); 291 unittest.expect(o.done, unittest.isTrue);
258 checkStatus(o.error); 292 checkStatus(o.error);
259 checkUnnamed4051(o.metadata); 293 checkUnnamed3768(o.metadata);
260 unittest.expect(o.name, unittest.equals('foo')); 294 unittest.expect(o.name, unittest.equals('foo'));
261 checkUnnamed4052(o.response); 295 checkUnnamed3769(o.response);
262 } 296 }
263 buildCounterOperation--; 297 buildCounterOperation--;
264 } 298 }
265 299
300 buildUnnamed3770() {
301 var o = new core.List<api.Binding>();
302 o.add(buildBinding());
303 o.add(buildBinding());
304 return o;
305 }
306
307 checkUnnamed3770(core.List<api.Binding> o) {
308 unittest.expect(o, unittest.hasLength(2));
309 checkBinding(o[0]);
310 checkBinding(o[1]);
311 }
312
313 core.int buildCounterPolicy = 0;
314 buildPolicy() {
315 var o = new api.Policy();
316 buildCounterPolicy++;
317 if (buildCounterPolicy < 3) {
318 o.bindings = buildUnnamed3770();
319 o.etag = "foo";
320 o.version = 42;
321 }
322 buildCounterPolicy--;
323 return o;
324 }
325
326 checkPolicy(api.Policy o) {
327 buildCounterPolicy++;
328 if (buildCounterPolicy < 3) {
329 checkUnnamed3770(o.bindings);
330 unittest.expect(o.etag, unittest.equals('foo'));
331 unittest.expect(o.version, unittest.equals(42));
332 }
333 buildCounterPolicy--;
334 }
335
266 core.int buildCounterRuntimeConfig = 0; 336 core.int buildCounterRuntimeConfig = 0;
267 buildRuntimeConfig() { 337 buildRuntimeConfig() {
268 var o = new api.RuntimeConfig(); 338 var o = new api.RuntimeConfig();
269 buildCounterRuntimeConfig++; 339 buildCounterRuntimeConfig++;
270 if (buildCounterRuntimeConfig < 3) { 340 if (buildCounterRuntimeConfig < 3) {
271 o.description = "foo"; 341 o.description = "foo";
272 o.name = "foo"; 342 o.name = "foo";
273 } 343 }
274 buildCounterRuntimeConfig--; 344 buildCounterRuntimeConfig--;
275 return o; 345 return o;
276 } 346 }
277 347
278 checkRuntimeConfig(api.RuntimeConfig o) { 348 checkRuntimeConfig(api.RuntimeConfig o) {
279 buildCounterRuntimeConfig++; 349 buildCounterRuntimeConfig++;
280 if (buildCounterRuntimeConfig < 3) { 350 if (buildCounterRuntimeConfig < 3) {
281 unittest.expect(o.description, unittest.equals('foo')); 351 unittest.expect(o.description, unittest.equals('foo'));
282 unittest.expect(o.name, unittest.equals('foo')); 352 unittest.expect(o.name, unittest.equals('foo'));
283 } 353 }
284 buildCounterRuntimeConfig--; 354 buildCounterRuntimeConfig--;
285 } 355 }
286 356
287 buildUnnamed4053() { 357 core.int buildCounterSetIamPolicyRequest = 0;
358 buildSetIamPolicyRequest() {
359 var o = new api.SetIamPolicyRequest();
360 buildCounterSetIamPolicyRequest++;
361 if (buildCounterSetIamPolicyRequest < 3) {
362 o.policy = buildPolicy();
363 }
364 buildCounterSetIamPolicyRequest--;
365 return o;
366 }
367
368 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) {
369 buildCounterSetIamPolicyRequest++;
370 if (buildCounterSetIamPolicyRequest < 3) {
371 checkPolicy(o.policy);
372 }
373 buildCounterSetIamPolicyRequest--;
374 }
375
376 buildUnnamed3771() {
288 var o = new core.Map<core.String, core.Object>(); 377 var o = new core.Map<core.String, core.Object>();
289 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 378 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
290 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; 379 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'};
291 return o; 380 return o;
292 } 381 }
293 382
294 checkUnnamed4053(core.Map<core.String, core.Object> o) { 383 checkUnnamed3771(core.Map<core.String, core.Object> o) {
295 unittest.expect(o, unittest.hasLength(2)); 384 unittest.expect(o, unittest.hasLength(2));
296 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')); 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'));
297 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')); 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'));
298 } 387 }
299 388
300 buildUnnamed4054() { 389 buildUnnamed3772() {
301 var o = new core.List<core.Map<core.String, core.Object>>(); 390 var o = new core.List<core.Map<core.String, core.Object>>();
302 o.add(buildUnnamed4053()); 391 o.add(buildUnnamed3771());
303 o.add(buildUnnamed4053()); 392 o.add(buildUnnamed3771());
304 return o; 393 return o;
305 } 394 }
306 395
307 checkUnnamed4054(core.List<core.Map<core.String, core.Object>> o) { 396 checkUnnamed3772(core.List<core.Map<core.String, core.Object>> o) {
308 unittest.expect(o, unittest.hasLength(2)); 397 unittest.expect(o, unittest.hasLength(2));
309 checkUnnamed4053(o[0]); 398 checkUnnamed3771(o[0]);
310 checkUnnamed4053(o[1]); 399 checkUnnamed3771(o[1]);
311 } 400 }
312 401
313 core.int buildCounterStatus = 0; 402 core.int buildCounterStatus = 0;
314 buildStatus() { 403 buildStatus() {
315 var o = new api.Status(); 404 var o = new api.Status();
316 buildCounterStatus++; 405 buildCounterStatus++;
317 if (buildCounterStatus < 3) { 406 if (buildCounterStatus < 3) {
318 o.code = 42; 407 o.code = 42;
319 o.details = buildUnnamed4054(); 408 o.details = buildUnnamed3772();
320 o.message = "foo"; 409 o.message = "foo";
321 } 410 }
322 buildCounterStatus--; 411 buildCounterStatus--;
323 return o; 412 return o;
324 } 413 }
325 414
326 checkStatus(api.Status o) { 415 checkStatus(api.Status o) {
327 buildCounterStatus++; 416 buildCounterStatus++;
328 if (buildCounterStatus < 3) { 417 if (buildCounterStatus < 3) {
329 unittest.expect(o.code, unittest.equals(42)); 418 unittest.expect(o.code, unittest.equals(42));
330 checkUnnamed4054(o.details); 419 checkUnnamed3772(o.details);
331 unittest.expect(o.message, unittest.equals('foo')); 420 unittest.expect(o.message, unittest.equals('foo'));
332 } 421 }
333 buildCounterStatus--; 422 buildCounterStatus--;
334 } 423 }
335 424
425 buildUnnamed3773() {
426 var o = new core.List<core.String>();
427 o.add("foo");
428 o.add("foo");
429 return o;
430 }
431
432 checkUnnamed3773(core.List<core.String> o) {
433 unittest.expect(o, unittest.hasLength(2));
434 unittest.expect(o[0], unittest.equals('foo'));
435 unittest.expect(o[1], unittest.equals('foo'));
436 }
437
438 core.int buildCounterTestIamPermissionsRequest = 0;
439 buildTestIamPermissionsRequest() {
440 var o = new api.TestIamPermissionsRequest();
441 buildCounterTestIamPermissionsRequest++;
442 if (buildCounterTestIamPermissionsRequest < 3) {
443 o.permissions = buildUnnamed3773();
444 }
445 buildCounterTestIamPermissionsRequest--;
446 return o;
447 }
448
449 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) {
450 buildCounterTestIamPermissionsRequest++;
451 if (buildCounterTestIamPermissionsRequest < 3) {
452 checkUnnamed3773(o.permissions);
453 }
454 buildCounterTestIamPermissionsRequest--;
455 }
456
457 buildUnnamed3774() {
458 var o = new core.List<core.String>();
459 o.add("foo");
460 o.add("foo");
461 return o;
462 }
463
464 checkUnnamed3774(core.List<core.String> o) {
465 unittest.expect(o, unittest.hasLength(2));
466 unittest.expect(o[0], unittest.equals('foo'));
467 unittest.expect(o[1], unittest.equals('foo'));
468 }
469
470 core.int buildCounterTestIamPermissionsResponse = 0;
471 buildTestIamPermissionsResponse() {
472 var o = new api.TestIamPermissionsResponse();
473 buildCounterTestIamPermissionsResponse++;
474 if (buildCounterTestIamPermissionsResponse < 3) {
475 o.permissions = buildUnnamed3774();
476 }
477 buildCounterTestIamPermissionsResponse--;
478 return o;
479 }
480
481 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) {
482 buildCounterTestIamPermissionsResponse++;
483 if (buildCounterTestIamPermissionsResponse < 3) {
484 checkUnnamed3774(o.permissions);
485 }
486 buildCounterTestIamPermissionsResponse--;
487 }
488
336 core.int buildCounterVariable = 0; 489 core.int buildCounterVariable = 0;
337 buildVariable() { 490 buildVariable() {
338 var o = new api.Variable(); 491 var o = new api.Variable();
339 buildCounterVariable++; 492 buildCounterVariable++;
340 if (buildCounterVariable < 3) { 493 if (buildCounterVariable < 3) {
341 o.name = "foo"; 494 o.name = "foo";
342 o.state = "foo"; 495 o.state = "foo";
343 o.text = "foo"; 496 o.text = "foo";
344 o.updateTime = "foo"; 497 o.updateTime = "foo";
345 o.value = "foo"; 498 o.value = "foo";
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 } 556 }
404 557
405 checkWatchVariableRequest(api.WatchVariableRequest o) { 558 checkWatchVariableRequest(api.WatchVariableRequest o) {
406 buildCounterWatchVariableRequest++; 559 buildCounterWatchVariableRequest++;
407 if (buildCounterWatchVariableRequest < 3) { 560 if (buildCounterWatchVariableRequest < 3) {
408 unittest.expect(o.newerThan, unittest.equals('foo')); 561 unittest.expect(o.newerThan, unittest.equals('foo'));
409 } 562 }
410 buildCounterWatchVariableRequest--; 563 buildCounterWatchVariableRequest--;
411 } 564 }
412 565
566 buildUnnamed3775() {
567 var o = new core.List<core.String>();
568 o.add("foo");
569 o.add("foo");
570 return o;
571 }
572
573 checkUnnamed3775(core.List<core.String> o) {
574 unittest.expect(o, unittest.hasLength(2));
575 unittest.expect(o[0], unittest.equals('foo'));
576 unittest.expect(o[1], unittest.equals('foo'));
577 }
578
579 buildUnnamed3776() {
580 var o = new core.List<core.String>();
581 o.add("foo");
582 o.add("foo");
583 return o;
584 }
585
586 checkUnnamed3776(core.List<core.String> o) {
587 unittest.expect(o, unittest.hasLength(2));
588 unittest.expect(o[0], unittest.equals('foo'));
589 unittest.expect(o[1], unittest.equals('foo'));
590 }
591
592 buildUnnamed3777() {
593 var o = new core.List<core.String>();
594 o.add("foo");
595 o.add("foo");
596 return o;
597 }
598
599 checkUnnamed3777(core.List<core.String> o) {
600 unittest.expect(o, unittest.hasLength(2));
601 unittest.expect(o[0], unittest.equals('foo'));
602 unittest.expect(o[1], unittest.equals('foo'));
603 }
604
413 605
414 main() { 606 main() {
607 unittest.group("obj-schema-Binding", () {
608 unittest.test("to-json--from-json", () {
609 var o = buildBinding();
610 var od = new api.Binding.fromJson(o.toJson());
611 checkBinding(od);
612 });
613 });
614
615
415 unittest.group("obj-schema-Cardinality", () { 616 unittest.group("obj-schema-Cardinality", () {
416 unittest.test("to-json--from-json", () { 617 unittest.test("to-json--from-json", () {
417 var o = buildCardinality(); 618 var o = buildCardinality();
418 var od = new api.Cardinality.fromJson(o.toJson()); 619 var od = new api.Cardinality.fromJson(o.toJson());
419 checkCardinality(od); 620 checkCardinality(od);
420 }); 621 });
421 }); 622 });
422 623
423 624
424 unittest.group("obj-schema-Empty", () { 625 unittest.group("obj-schema-Empty", () {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 669
469 unittest.group("obj-schema-Operation", () { 670 unittest.group("obj-schema-Operation", () {
470 unittest.test("to-json--from-json", () { 671 unittest.test("to-json--from-json", () {
471 var o = buildOperation(); 672 var o = buildOperation();
472 var od = new api.Operation.fromJson(o.toJson()); 673 var od = new api.Operation.fromJson(o.toJson());
473 checkOperation(od); 674 checkOperation(od);
474 }); 675 });
475 }); 676 });
476 677
477 678
679 unittest.group("obj-schema-Policy", () {
680 unittest.test("to-json--from-json", () {
681 var o = buildPolicy();
682 var od = new api.Policy.fromJson(o.toJson());
683 checkPolicy(od);
684 });
685 });
686
687
478 unittest.group("obj-schema-RuntimeConfig", () { 688 unittest.group("obj-schema-RuntimeConfig", () {
479 unittest.test("to-json--from-json", () { 689 unittest.test("to-json--from-json", () {
480 var o = buildRuntimeConfig(); 690 var o = buildRuntimeConfig();
481 var od = new api.RuntimeConfig.fromJson(o.toJson()); 691 var od = new api.RuntimeConfig.fromJson(o.toJson());
482 checkRuntimeConfig(od); 692 checkRuntimeConfig(od);
483 }); 693 });
484 }); 694 });
485 695
486 696
697 unittest.group("obj-schema-SetIamPolicyRequest", () {
698 unittest.test("to-json--from-json", () {
699 var o = buildSetIamPolicyRequest();
700 var od = new api.SetIamPolicyRequest.fromJson(o.toJson());
701 checkSetIamPolicyRequest(od);
702 });
703 });
704
705
487 unittest.group("obj-schema-Status", () { 706 unittest.group("obj-schema-Status", () {
488 unittest.test("to-json--from-json", () { 707 unittest.test("to-json--from-json", () {
489 var o = buildStatus(); 708 var o = buildStatus();
490 var od = new api.Status.fromJson(o.toJson()); 709 var od = new api.Status.fromJson(o.toJson());
491 checkStatus(od); 710 checkStatus(od);
492 }); 711 });
493 }); 712 });
494 713
495 714
715 unittest.group("obj-schema-TestIamPermissionsRequest", () {
716 unittest.test("to-json--from-json", () {
717 var o = buildTestIamPermissionsRequest();
718 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson());
719 checkTestIamPermissionsRequest(od);
720 });
721 });
722
723
724 unittest.group("obj-schema-TestIamPermissionsResponse", () {
725 unittest.test("to-json--from-json", () {
726 var o = buildTestIamPermissionsResponse();
727 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson());
728 checkTestIamPermissionsResponse(od);
729 });
730 });
731
732
496 unittest.group("obj-schema-Variable", () { 733 unittest.group("obj-schema-Variable", () {
497 unittest.test("to-json--from-json", () { 734 unittest.test("to-json--from-json", () {
498 var o = buildVariable(); 735 var o = buildVariable();
499 var od = new api.Variable.fromJson(o.toJson()); 736 var od = new api.Variable.fromJson(o.toJson());
500 checkVariable(od); 737 checkVariable(od);
501 }); 738 });
502 }); 739 });
503 740
504 741
505 unittest.group("obj-schema-Waiter", () { 742 unittest.group("obj-schema-Waiter", () {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 "content-type" : "application/json; charset=utf-8", 892 "content-type" : "application/json; charset=utf-8",
656 }; 893 };
657 var resp = convert.JSON.encode(buildRuntimeConfig()); 894 var resp = convert.JSON.encode(buildRuntimeConfig());
658 return new async.Future.value(stringResponse(200, h, resp)); 895 return new async.Future.value(stringResponse(200, h, resp));
659 }), true); 896 }), true);
660 res.get(arg_name).then(unittest.expectAsync(((api.RuntimeConfig response) { 897 res.get(arg_name).then(unittest.expectAsync(((api.RuntimeConfig response) {
661 checkRuntimeConfig(response); 898 checkRuntimeConfig(response);
662 }))); 899 })));
663 }); 900 });
664 901
902 unittest.test("method--getIamPolicy", () {
903
904 var mock = new HttpServerMock();
905 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs;
906 var arg_resource = "foo";
907 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
908 var path = (req.url).path;
909 var pathOffset = 0;
910 var index;
911 var subPart;
912 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
913 pathOffset += 1;
914 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
915 pathOffset += 8;
916 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
917
918 var query = (req.url).query;
919 var queryOffset = 0;
920 var queryMap = {};
921 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
922 parseBool(n) {
923 if (n == "true") return true;
924 if (n == "false") return false;
925 if (n == null) return null;
926 throw new core.ArgumentError("Invalid boolean: $n");
927 }
928 if (query.length > 0) {
929 for (var part in query.split("&")) {
930 var keyvalue = part.split("=");
931 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
932 }
933 }
934
935
936 var h = {
937 "content-type" : "application/json; charset=utf-8",
938 };
939 var resp = convert.JSON.encode(buildPolicy());
940 return new async.Future.value(stringResponse(200, h, resp));
941 }), true);
942 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp onse) {
943 checkPolicy(response);
944 })));
945 });
946
665 unittest.test("method--list", () { 947 unittest.test("method--list", () {
666 948
667 var mock = new HttpServerMock(); 949 var mock = new HttpServerMock();
668 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 950 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs;
669 var arg_parent = "foo"; 951 var arg_parent = "foo";
670 var arg_pageSize = 42; 952 var arg_pageSize = 42;
671 var arg_pageToken = "foo"; 953 var arg_pageToken = "foo";
672 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 954 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
673 var path = (req.url).path; 955 var path = (req.url).path;
674 var pathOffset = 0; 956 var pathOffset = 0;
(...skipping 29 matching lines...) Expand all
704 "content-type" : "application/json; charset=utf-8", 986 "content-type" : "application/json; charset=utf-8",
705 }; 987 };
706 var resp = convert.JSON.encode(buildListConfigsResponse()); 988 var resp = convert.JSON.encode(buildListConfigsResponse());
707 return new async.Future.value(stringResponse(200, h, resp)); 989 return new async.Future.value(stringResponse(200, h, resp));
708 }), true); 990 }), true);
709 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync(((api.ListConfigsResponse response) { 991 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync(((api.ListConfigsResponse response) {
710 checkListConfigsResponse(response); 992 checkListConfigsResponse(response);
711 }))); 993 })));
712 }); 994 });
713 995
996 unittest.test("method--setIamPolicy", () {
997
998 var mock = new HttpServerMock();
999 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs;
1000 var arg_request = buildSetIamPolicyRequest();
1001 var arg_resource = "foo";
1002 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1003 var obj = new api.SetIamPolicyRequest.fromJson(json);
1004 checkSetIamPolicyRequest(obj);
1005
1006 var path = (req.url).path;
1007 var pathOffset = 0;
1008 var index;
1009 var subPart;
1010 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1011 pathOffset += 1;
1012 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
1013 pathOffset += 8;
1014 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1015
1016 var query = (req.url).query;
1017 var queryOffset = 0;
1018 var queryMap = {};
1019 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1020 parseBool(n) {
1021 if (n == "true") return true;
1022 if (n == "false") return false;
1023 if (n == null) return null;
1024 throw new core.ArgumentError("Invalid boolean: $n");
1025 }
1026 if (query.length > 0) {
1027 for (var part in query.split("&")) {
1028 var keyvalue = part.split("=");
1029 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1030 }
1031 }
1032
1033
1034 var h = {
1035 "content-type" : "application/json; charset=utf-8",
1036 };
1037 var resp = convert.JSON.encode(buildPolicy());
1038 return new async.Future.value(stringResponse(200, h, resp));
1039 }), true);
1040 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap i.Policy response) {
1041 checkPolicy(response);
1042 })));
1043 });
1044
1045 unittest.test("method--testIamPermissions", () {
1046
1047 var mock = new HttpServerMock();
1048 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs;
1049 var arg_request = buildTestIamPermissionsRequest();
1050 var arg_resource = "foo";
1051 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1052 var obj = new api.TestIamPermissionsRequest.fromJson(json);
1053 checkTestIamPermissionsRequest(obj);
1054
1055 var path = (req.url).path;
1056 var pathOffset = 0;
1057 var index;
1058 var subPart;
1059 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1060 pathOffset += 1;
1061 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
1062 pathOffset += 8;
1063 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1064
1065 var query = (req.url).query;
1066 var queryOffset = 0;
1067 var queryMap = {};
1068 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1069 parseBool(n) {
1070 if (n == "true") return true;
1071 if (n == "false") return false;
1072 if (n == null) return null;
1073 throw new core.ArgumentError("Invalid boolean: $n");
1074 }
1075 if (query.length > 0) {
1076 for (var part in query.split("&")) {
1077 var keyvalue = part.split("=");
1078 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1079 }
1080 }
1081
1082
1083 var h = {
1084 "content-type" : "application/json; charset=utf-8",
1085 };
1086 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1087 return new async.Future.value(stringResponse(200, h, resp));
1088 }), true);
1089 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn c(((api.TestIamPermissionsResponse response) {
1090 checkTestIamPermissionsResponse(response);
1091 })));
1092 });
1093
714 unittest.test("method--update", () { 1094 unittest.test("method--update", () {
715 1095
716 var mock = new HttpServerMock(); 1096 var mock = new HttpServerMock();
717 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs; 1097 api.ProjectsConfigsResourceApi res = new api.RuntimeconfigApi(mock).projec ts.configs;
718 var arg_request = buildRuntimeConfig(); 1098 var arg_request = buildRuntimeConfig();
719 var arg_name = "foo"; 1099 var arg_name = "foo";
720 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1100 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
721 var obj = new api.RuntimeConfig.fromJson(json); 1101 var obj = new api.RuntimeConfig.fromJson(json);
722 checkRuntimeConfig(obj); 1102 checkRuntimeConfig(obj);
723 1103
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 "content-type" : "application/json; charset=utf-8", 1182 "content-type" : "application/json; charset=utf-8",
803 }; 1183 };
804 var resp = convert.JSON.encode(buildOperation()); 1184 var resp = convert.JSON.encode(buildOperation());
805 return new async.Future.value(stringResponse(200, h, resp)); 1185 return new async.Future.value(stringResponse(200, h, resp));
806 }), true); 1186 }), true);
807 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) { 1187 res.get(arg_name).then(unittest.expectAsync(((api.Operation response) {
808 checkOperation(response); 1188 checkOperation(response);
809 }))); 1189 })));
810 }); 1190 });
811 1191
1192 unittest.test("method--testIamPermissions", () {
1193
1194 var mock = new HttpServerMock();
1195 api.ProjectsConfigsOperationsResourceApi res = new api.RuntimeconfigApi(mo ck).projects.configs.operations;
1196 var arg_resource = "foo";
1197 var arg_permissions = buildUnnamed3775();
1198 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1199 var path = (req.url).path;
1200 var pathOffset = 0;
1201 var index;
1202 var subPart;
1203 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1204 pathOffset += 1;
1205 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
1206 pathOffset += 8;
1207 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1208
1209 var query = (req.url).query;
1210 var queryOffset = 0;
1211 var queryMap = {};
1212 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1213 parseBool(n) {
1214 if (n == "true") return true;
1215 if (n == "false") return false;
1216 if (n == null) return null;
1217 throw new core.ArgumentError("Invalid boolean: $n");
1218 }
1219 if (query.length > 0) {
1220 for (var part in query.split("&")) {
1221 var keyvalue = part.split("=");
1222 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1223 }
1224 }
1225 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions ));
1226
1227
1228 var h = {
1229 "content-type" : "application/json; charset=utf-8",
1230 };
1231 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1232 return new async.Future.value(stringResponse(200, h, resp));
1233 }), true);
1234 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un ittest.expectAsync(((api.TestIamPermissionsResponse response) {
1235 checkTestIamPermissionsResponse(response);
1236 })));
1237 });
1238
812 }); 1239 });
813 1240
814 1241
815 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () { 1242 unittest.group("resource-ProjectsConfigsVariablesResourceApi", () {
816 unittest.test("method--create", () { 1243 unittest.test("method--create", () {
817 1244
818 var mock = new HttpServerMock(); 1245 var mock = new HttpServerMock();
819 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1246 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables;
820 var arg_request = buildVariable(); 1247 var arg_request = buildVariable();
821 var arg_parent = "foo"; 1248 var arg_parent = "foo";
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 "content-type" : "application/json; charset=utf-8", 1427 "content-type" : "application/json; charset=utf-8",
1001 }; 1428 };
1002 var resp = convert.JSON.encode(buildListVariablesResponse()); 1429 var resp = convert.JSON.encode(buildListVariablesResponse());
1003 return new async.Future.value(stringResponse(200, h, resp)); 1430 return new async.Future.value(stringResponse(200, h, resp));
1004 }), true); 1431 }), true);
1005 res.list(arg_parent, pageSize: arg_pageSize, filter: arg_filter, pageToken : arg_pageToken).then(unittest.expectAsync(((api.ListVariablesResponse response) { 1432 res.list(arg_parent, pageSize: arg_pageSize, filter: arg_filter, pageToken : arg_pageToken).then(unittest.expectAsync(((api.ListVariablesResponse response) {
1006 checkListVariablesResponse(response); 1433 checkListVariablesResponse(response);
1007 }))); 1434 })));
1008 }); 1435 });
1009 1436
1437 unittest.test("method--testIamPermissions", () {
1438
1439 var mock = new HttpServerMock();
1440 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables;
1441 var arg_resource = "foo";
1442 var arg_permissions = buildUnnamed3776();
1443 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1444 var path = (req.url).path;
1445 var pathOffset = 0;
1446 var index;
1447 var subPart;
1448 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1449 pathOffset += 1;
1450 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
1451 pathOffset += 8;
1452 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1453
1454 var query = (req.url).query;
1455 var queryOffset = 0;
1456 var queryMap = {};
1457 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1458 parseBool(n) {
1459 if (n == "true") return true;
1460 if (n == "false") return false;
1461 if (n == null) return null;
1462 throw new core.ArgumentError("Invalid boolean: $n");
1463 }
1464 if (query.length > 0) {
1465 for (var part in query.split("&")) {
1466 var keyvalue = part.split("=");
1467 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1468 }
1469 }
1470 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions ));
1471
1472
1473 var h = {
1474 "content-type" : "application/json; charset=utf-8",
1475 };
1476 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1477 return new async.Future.value(stringResponse(200, h, resp));
1478 }), true);
1479 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un ittest.expectAsync(((api.TestIamPermissionsResponse response) {
1480 checkTestIamPermissionsResponse(response);
1481 })));
1482 });
1483
1010 unittest.test("method--update", () { 1484 unittest.test("method--update", () {
1011 1485
1012 var mock = new HttpServerMock(); 1486 var mock = new HttpServerMock();
1013 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables; 1487 api.ProjectsConfigsVariablesResourceApi res = new api.RuntimeconfigApi(moc k).projects.configs.variables;
1014 var arg_request = buildVariable(); 1488 var arg_request = buildVariable();
1015 var arg_name = "foo"; 1489 var arg_name = "foo";
1016 mock.register(unittest.expectAsync((http.BaseRequest req, json) { 1490 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1017 var obj = new api.Variable.fromJson(json); 1491 var obj = new api.Variable.fromJson(json);
1018 checkVariable(obj); 1492 checkVariable(obj);
1019 1493
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 "content-type" : "application/json; charset=utf-8", 1766 "content-type" : "application/json; charset=utf-8",
1293 }; 1767 };
1294 var resp = convert.JSON.encode(buildListWaitersResponse()); 1768 var resp = convert.JSON.encode(buildListWaitersResponse());
1295 return new async.Future.value(stringResponse(200, h, resp)); 1769 return new async.Future.value(stringResponse(200, h, resp));
1296 }), true); 1770 }), true);
1297 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync(((api.ListWaitersResponse response) { 1771 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the n(unittest.expectAsync(((api.ListWaitersResponse response) {
1298 checkListWaitersResponse(response); 1772 checkListWaitersResponse(response);
1299 }))); 1773 })));
1300 }); 1774 });
1301 1775
1776 unittest.test("method--testIamPermissions", () {
1777
1778 var mock = new HttpServerMock();
1779 api.ProjectsConfigsWaitersResourceApi res = new api.RuntimeconfigApi(mock) .projects.configs.waiters;
1780 var arg_resource = "foo";
1781 var arg_permissions = buildUnnamed3777();
1782 mock.register(unittest.expectAsync((http.BaseRequest req, json) {
1783 var path = (req.url).path;
1784 var pathOffset = 0;
1785 var index;
1786 var subPart;
1787 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ als("/"));
1788 pathOffset += 1;
1789 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ als("v1beta1/"));
1790 pathOffset += 8;
1791 // NOTE: We cannot test reserved expansions due to the inability to reve rse the operation;
1792
1793 var query = (req.url).query;
1794 var queryOffset = 0;
1795 var queryMap = {};
1796 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v);
1797 parseBool(n) {
1798 if (n == "true") return true;
1799 if (n == "false") return false;
1800 if (n == null) return null;
1801 throw new core.ArgumentError("Invalid boolean: $n");
1802 }
1803 if (query.length > 0) {
1804 for (var part in query.split("&")) {
1805 var keyvalue = part.split("=");
1806 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d ecodeQueryComponent(keyvalue[1]));
1807 }
1808 }
1809 unittest.expect(queryMap["permissions"], unittest.equals(arg_permissions ));
1810
1811
1812 var h = {
1813 "content-type" : "application/json; charset=utf-8",
1814 };
1815 var resp = convert.JSON.encode(buildTestIamPermissionsResponse());
1816 return new async.Future.value(stringResponse(200, h, resp));
1817 }), true);
1818 res.testIamPermissions(arg_resource, permissions: arg_permissions).then(un ittest.expectAsync(((api.TestIamPermissionsResponse response) {
1819 checkTestIamPermissionsResponse(response);
1820 })));
1821 });
1822
1302 }); 1823 });
1303 1824
1304 1825
1305 } 1826 }
1306 1827
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698