OLD | NEW |
1 library googleapis_beta.cloudresourcemanager.v1beta1.test; | 1 library googleapis_beta.cloudresourcemanager.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 checkAncestor(api.Ancestor o) { | 65 checkAncestor(api.Ancestor o) { |
66 buildCounterAncestor++; | 66 buildCounterAncestor++; |
67 if (buildCounterAncestor < 3) { | 67 if (buildCounterAncestor < 3) { |
68 checkResourceId(o.resourceId); | 68 checkResourceId(o.resourceId); |
69 } | 69 } |
70 buildCounterAncestor--; | 70 buildCounterAncestor--; |
71 } | 71 } |
72 | 72 |
73 buildUnnamed3422() { | 73 buildUnnamed3409() { |
74 var o = new core.List<api.AuditLogConfig>(); | 74 var o = new core.List<api.AuditLogConfig>(); |
75 o.add(buildAuditLogConfig()); | 75 o.add(buildAuditLogConfig()); |
76 o.add(buildAuditLogConfig()); | 76 o.add(buildAuditLogConfig()); |
77 return o; | 77 return o; |
78 } | 78 } |
79 | 79 |
80 checkUnnamed3422(core.List<api.AuditLogConfig> o) { | 80 checkUnnamed3409(core.List<api.AuditLogConfig> o) { |
81 unittest.expect(o, unittest.hasLength(2)); | 81 unittest.expect(o, unittest.hasLength(2)); |
82 checkAuditLogConfig(o[0]); | 82 checkAuditLogConfig(o[0]); |
83 checkAuditLogConfig(o[1]); | 83 checkAuditLogConfig(o[1]); |
84 } | 84 } |
85 | 85 |
86 core.int buildCounterAuditConfig = 0; | 86 core.int buildCounterAuditConfig = 0; |
87 buildAuditConfig() { | 87 buildAuditConfig() { |
88 var o = new api.AuditConfig(); | 88 var o = new api.AuditConfig(); |
89 buildCounterAuditConfig++; | 89 buildCounterAuditConfig++; |
90 if (buildCounterAuditConfig < 3) { | 90 if (buildCounterAuditConfig < 3) { |
91 o.auditLogConfigs = buildUnnamed3422(); | 91 o.auditLogConfigs = buildUnnamed3409(); |
92 o.service = "foo"; | 92 o.service = "foo"; |
93 } | 93 } |
94 buildCounterAuditConfig--; | 94 buildCounterAuditConfig--; |
95 return o; | 95 return o; |
96 } | 96 } |
97 | 97 |
98 checkAuditConfig(api.AuditConfig o) { | 98 checkAuditConfig(api.AuditConfig o) { |
99 buildCounterAuditConfig++; | 99 buildCounterAuditConfig++; |
100 if (buildCounterAuditConfig < 3) { | 100 if (buildCounterAuditConfig < 3) { |
101 checkUnnamed3422(o.auditLogConfigs); | 101 checkUnnamed3409(o.auditLogConfigs); |
102 unittest.expect(o.service, unittest.equals('foo')); | 102 unittest.expect(o.service, unittest.equals('foo')); |
103 } | 103 } |
104 buildCounterAuditConfig--; | 104 buildCounterAuditConfig--; |
105 } | 105 } |
106 | 106 |
107 buildUnnamed3423() { | 107 buildUnnamed3410() { |
108 var o = new core.List<core.String>(); | 108 var o = new core.List<core.String>(); |
109 o.add("foo"); | 109 o.add("foo"); |
110 o.add("foo"); | 110 o.add("foo"); |
111 return o; | 111 return o; |
112 } | 112 } |
113 | 113 |
114 checkUnnamed3423(core.List<core.String> o) { | 114 checkUnnamed3410(core.List<core.String> o) { |
115 unittest.expect(o, unittest.hasLength(2)); | 115 unittest.expect(o, unittest.hasLength(2)); |
116 unittest.expect(o[0], unittest.equals('foo')); | 116 unittest.expect(o[0], unittest.equals('foo')); |
117 unittest.expect(o[1], unittest.equals('foo')); | 117 unittest.expect(o[1], unittest.equals('foo')); |
118 } | 118 } |
119 | 119 |
120 core.int buildCounterAuditLogConfig = 0; | 120 core.int buildCounterAuditLogConfig = 0; |
121 buildAuditLogConfig() { | 121 buildAuditLogConfig() { |
122 var o = new api.AuditLogConfig(); | 122 var o = new api.AuditLogConfig(); |
123 buildCounterAuditLogConfig++; | 123 buildCounterAuditLogConfig++; |
124 if (buildCounterAuditLogConfig < 3) { | 124 if (buildCounterAuditLogConfig < 3) { |
125 o.exemptedMembers = buildUnnamed3423(); | 125 o.exemptedMembers = buildUnnamed3410(); |
126 o.logType = "foo"; | 126 o.logType = "foo"; |
127 } | 127 } |
128 buildCounterAuditLogConfig--; | 128 buildCounterAuditLogConfig--; |
129 return o; | 129 return o; |
130 } | 130 } |
131 | 131 |
132 checkAuditLogConfig(api.AuditLogConfig o) { | 132 checkAuditLogConfig(api.AuditLogConfig o) { |
133 buildCounterAuditLogConfig++; | 133 buildCounterAuditLogConfig++; |
134 if (buildCounterAuditLogConfig < 3) { | 134 if (buildCounterAuditLogConfig < 3) { |
135 checkUnnamed3423(o.exemptedMembers); | 135 checkUnnamed3410(o.exemptedMembers); |
136 unittest.expect(o.logType, unittest.equals('foo')); | 136 unittest.expect(o.logType, unittest.equals('foo')); |
137 } | 137 } |
138 buildCounterAuditLogConfig--; | 138 buildCounterAuditLogConfig--; |
139 } | 139 } |
140 | 140 |
141 buildUnnamed3424() { | 141 buildUnnamed3411() { |
142 var o = new core.List<core.String>(); | 142 var o = new core.List<core.String>(); |
143 o.add("foo"); | 143 o.add("foo"); |
144 o.add("foo"); | 144 o.add("foo"); |
145 return o; | 145 return o; |
146 } | 146 } |
147 | 147 |
148 checkUnnamed3424(core.List<core.String> o) { | 148 checkUnnamed3411(core.List<core.String> o) { |
149 unittest.expect(o, unittest.hasLength(2)); | 149 unittest.expect(o, unittest.hasLength(2)); |
150 unittest.expect(o[0], unittest.equals('foo')); | 150 unittest.expect(o[0], unittest.equals('foo')); |
151 unittest.expect(o[1], unittest.equals('foo')); | 151 unittest.expect(o[1], unittest.equals('foo')); |
152 } | 152 } |
153 | 153 |
154 core.int buildCounterBinding = 0; | 154 core.int buildCounterBinding = 0; |
155 buildBinding() { | 155 buildBinding() { |
156 var o = new api.Binding(); | 156 var o = new api.Binding(); |
157 buildCounterBinding++; | 157 buildCounterBinding++; |
158 if (buildCounterBinding < 3) { | 158 if (buildCounterBinding < 3) { |
159 o.members = buildUnnamed3424(); | 159 o.members = buildUnnamed3411(); |
160 o.role = "foo"; | 160 o.role = "foo"; |
161 } | 161 } |
162 buildCounterBinding--; | 162 buildCounterBinding--; |
163 return o; | 163 return o; |
164 } | 164 } |
165 | 165 |
166 checkBinding(api.Binding o) { | 166 checkBinding(api.Binding o) { |
167 buildCounterBinding++; | 167 buildCounterBinding++; |
168 if (buildCounterBinding < 3) { | 168 if (buildCounterBinding < 3) { |
169 checkUnnamed3424(o.members); | 169 checkUnnamed3411(o.members); |
170 unittest.expect(o.role, unittest.equals('foo')); | 170 unittest.expect(o.role, unittest.equals('foo')); |
171 } | 171 } |
172 buildCounterBinding--; | 172 buildCounterBinding--; |
173 } | 173 } |
174 | 174 |
175 core.int buildCounterBooleanConstraint = 0; | |
176 buildBooleanConstraint() { | |
177 var o = new api.BooleanConstraint(); | |
178 buildCounterBooleanConstraint++; | |
179 if (buildCounterBooleanConstraint < 3) { | |
180 } | |
181 buildCounterBooleanConstraint--; | |
182 return o; | |
183 } | |
184 | |
185 checkBooleanConstraint(api.BooleanConstraint o) { | |
186 buildCounterBooleanConstraint++; | |
187 if (buildCounterBooleanConstraint < 3) { | |
188 } | |
189 buildCounterBooleanConstraint--; | |
190 } | |
191 | |
192 core.int buildCounterBooleanPolicy = 0; | |
193 buildBooleanPolicy() { | |
194 var o = new api.BooleanPolicy(); | |
195 buildCounterBooleanPolicy++; | |
196 if (buildCounterBooleanPolicy < 3) { | |
197 o.enforced = true; | |
198 } | |
199 buildCounterBooleanPolicy--; | |
200 return o; | |
201 } | |
202 | |
203 checkBooleanPolicy(api.BooleanPolicy o) { | |
204 buildCounterBooleanPolicy++; | |
205 if (buildCounterBooleanPolicy < 3) { | |
206 unittest.expect(o.enforced, unittest.isTrue); | |
207 } | |
208 buildCounterBooleanPolicy--; | |
209 } | |
210 | |
211 core.int buildCounterClearOrgPolicyRequest = 0; | |
212 buildClearOrgPolicyRequest() { | |
213 var o = new api.ClearOrgPolicyRequest(); | |
214 buildCounterClearOrgPolicyRequest++; | |
215 if (buildCounterClearOrgPolicyRequest < 3) { | |
216 o.constraint = "foo"; | |
217 o.etag = "foo"; | |
218 } | |
219 buildCounterClearOrgPolicyRequest--; | |
220 return o; | |
221 } | |
222 | |
223 checkClearOrgPolicyRequest(api.ClearOrgPolicyRequest o) { | |
224 buildCounterClearOrgPolicyRequest++; | |
225 if (buildCounterClearOrgPolicyRequest < 3) { | |
226 unittest.expect(o.constraint, unittest.equals('foo')); | |
227 unittest.expect(o.etag, unittest.equals('foo')); | |
228 } | |
229 buildCounterClearOrgPolicyRequest--; | |
230 } | |
231 | |
232 core.int buildCounterConstraint = 0; | |
233 buildConstraint() { | |
234 var o = new api.Constraint(); | |
235 buildCounterConstraint++; | |
236 if (buildCounterConstraint < 3) { | |
237 o.booleanConstraint = buildBooleanConstraint(); | |
238 o.constraintDefault = "foo"; | |
239 o.description = "foo"; | |
240 o.displayName = "foo"; | |
241 o.listConstraint = buildListConstraint(); | |
242 o.name = "foo"; | |
243 o.version = 42; | |
244 } | |
245 buildCounterConstraint--; | |
246 return o; | |
247 } | |
248 | |
249 checkConstraint(api.Constraint o) { | |
250 buildCounterConstraint++; | |
251 if (buildCounterConstraint < 3) { | |
252 checkBooleanConstraint(o.booleanConstraint); | |
253 unittest.expect(o.constraintDefault, unittest.equals('foo')); | |
254 unittest.expect(o.description, unittest.equals('foo')); | |
255 unittest.expect(o.displayName, unittest.equals('foo')); | |
256 checkListConstraint(o.listConstraint); | |
257 unittest.expect(o.name, unittest.equals('foo')); | |
258 unittest.expect(o.version, unittest.equals(42)); | |
259 } | |
260 buildCounterConstraint--; | |
261 } | |
262 | |
263 core.int buildCounterEmpty = 0; | 175 core.int buildCounterEmpty = 0; |
264 buildEmpty() { | 176 buildEmpty() { |
265 var o = new api.Empty(); | 177 var o = new api.Empty(); |
266 buildCounterEmpty++; | 178 buildCounterEmpty++; |
267 if (buildCounterEmpty < 3) { | 179 if (buildCounterEmpty < 3) { |
268 } | 180 } |
269 buildCounterEmpty--; | 181 buildCounterEmpty--; |
270 return o; | 182 return o; |
271 } | 183 } |
272 | 184 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 return o; | 243 return o; |
332 } | 244 } |
333 | 245 |
334 checkGetAncestryRequest(api.GetAncestryRequest o) { | 246 checkGetAncestryRequest(api.GetAncestryRequest o) { |
335 buildCounterGetAncestryRequest++; | 247 buildCounterGetAncestryRequest++; |
336 if (buildCounterGetAncestryRequest < 3) { | 248 if (buildCounterGetAncestryRequest < 3) { |
337 } | 249 } |
338 buildCounterGetAncestryRequest--; | 250 buildCounterGetAncestryRequest--; |
339 } | 251 } |
340 | 252 |
341 buildUnnamed3425() { | 253 buildUnnamed3412() { |
342 var o = new core.List<api.Ancestor>(); | 254 var o = new core.List<api.Ancestor>(); |
343 o.add(buildAncestor()); | 255 o.add(buildAncestor()); |
344 o.add(buildAncestor()); | 256 o.add(buildAncestor()); |
345 return o; | 257 return o; |
346 } | 258 } |
347 | 259 |
348 checkUnnamed3425(core.List<api.Ancestor> o) { | 260 checkUnnamed3412(core.List<api.Ancestor> o) { |
349 unittest.expect(o, unittest.hasLength(2)); | 261 unittest.expect(o, unittest.hasLength(2)); |
350 checkAncestor(o[0]); | 262 checkAncestor(o[0]); |
351 checkAncestor(o[1]); | 263 checkAncestor(o[1]); |
352 } | 264 } |
353 | 265 |
354 core.int buildCounterGetAncestryResponse = 0; | 266 core.int buildCounterGetAncestryResponse = 0; |
355 buildGetAncestryResponse() { | 267 buildGetAncestryResponse() { |
356 var o = new api.GetAncestryResponse(); | 268 var o = new api.GetAncestryResponse(); |
357 buildCounterGetAncestryResponse++; | 269 buildCounterGetAncestryResponse++; |
358 if (buildCounterGetAncestryResponse < 3) { | 270 if (buildCounterGetAncestryResponse < 3) { |
359 o.ancestor = buildUnnamed3425(); | 271 o.ancestor = buildUnnamed3412(); |
360 } | 272 } |
361 buildCounterGetAncestryResponse--; | 273 buildCounterGetAncestryResponse--; |
362 return o; | 274 return o; |
363 } | 275 } |
364 | 276 |
365 checkGetAncestryResponse(api.GetAncestryResponse o) { | 277 checkGetAncestryResponse(api.GetAncestryResponse o) { |
366 buildCounterGetAncestryResponse++; | 278 buildCounterGetAncestryResponse++; |
367 if (buildCounterGetAncestryResponse < 3) { | 279 if (buildCounterGetAncestryResponse < 3) { |
368 checkUnnamed3425(o.ancestor); | 280 checkUnnamed3412(o.ancestor); |
369 } | 281 } |
370 buildCounterGetAncestryResponse--; | 282 buildCounterGetAncestryResponse--; |
371 } | 283 } |
372 | 284 |
373 core.int buildCounterGetEffectiveOrgPolicyRequest = 0; | |
374 buildGetEffectiveOrgPolicyRequest() { | |
375 var o = new api.GetEffectiveOrgPolicyRequest(); | |
376 buildCounterGetEffectiveOrgPolicyRequest++; | |
377 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { | |
378 o.constraint = "foo"; | |
379 } | |
380 buildCounterGetEffectiveOrgPolicyRequest--; | |
381 return o; | |
382 } | |
383 | |
384 checkGetEffectiveOrgPolicyRequest(api.GetEffectiveOrgPolicyRequest o) { | |
385 buildCounterGetEffectiveOrgPolicyRequest++; | |
386 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { | |
387 unittest.expect(o.constraint, unittest.equals('foo')); | |
388 } | |
389 buildCounterGetEffectiveOrgPolicyRequest--; | |
390 } | |
391 | |
392 core.int buildCounterGetIamPolicyRequest = 0; | 285 core.int buildCounterGetIamPolicyRequest = 0; |
393 buildGetIamPolicyRequest() { | 286 buildGetIamPolicyRequest() { |
394 var o = new api.GetIamPolicyRequest(); | 287 var o = new api.GetIamPolicyRequest(); |
395 buildCounterGetIamPolicyRequest++; | 288 buildCounterGetIamPolicyRequest++; |
396 if (buildCounterGetIamPolicyRequest < 3) { | 289 if (buildCounterGetIamPolicyRequest < 3) { |
397 } | 290 } |
398 buildCounterGetIamPolicyRequest--; | 291 buildCounterGetIamPolicyRequest--; |
399 return o; | 292 return o; |
400 } | 293 } |
401 | 294 |
402 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { | 295 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
403 buildCounterGetIamPolicyRequest++; | 296 buildCounterGetIamPolicyRequest++; |
404 if (buildCounterGetIamPolicyRequest < 3) { | 297 if (buildCounterGetIamPolicyRequest < 3) { |
405 } | 298 } |
406 buildCounterGetIamPolicyRequest--; | 299 buildCounterGetIamPolicyRequest--; |
407 } | 300 } |
408 | 301 |
409 core.int buildCounterGetOrgPolicyRequest = 0; | 302 buildUnnamed3413() { |
410 buildGetOrgPolicyRequest() { | |
411 var o = new api.GetOrgPolicyRequest(); | |
412 buildCounterGetOrgPolicyRequest++; | |
413 if (buildCounterGetOrgPolicyRequest < 3) { | |
414 o.constraint = "foo"; | |
415 } | |
416 buildCounterGetOrgPolicyRequest--; | |
417 return o; | |
418 } | |
419 | |
420 checkGetOrgPolicyRequest(api.GetOrgPolicyRequest o) { | |
421 buildCounterGetOrgPolicyRequest++; | |
422 if (buildCounterGetOrgPolicyRequest < 3) { | |
423 unittest.expect(o.constraint, unittest.equals('foo')); | |
424 } | |
425 buildCounterGetOrgPolicyRequest--; | |
426 } | |
427 | |
428 core.int buildCounterListAvailableOrgPolicyConstraintsRequest = 0; | |
429 buildListAvailableOrgPolicyConstraintsRequest() { | |
430 var o = new api.ListAvailableOrgPolicyConstraintsRequest(); | |
431 buildCounterListAvailableOrgPolicyConstraintsRequest++; | |
432 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { | |
433 o.pageSize = 42; | |
434 o.pageToken = "foo"; | |
435 } | |
436 buildCounterListAvailableOrgPolicyConstraintsRequest--; | |
437 return o; | |
438 } | |
439 | |
440 checkListAvailableOrgPolicyConstraintsRequest(api.ListAvailableOrgPolicyConstrai
ntsRequest o) { | |
441 buildCounterListAvailableOrgPolicyConstraintsRequest++; | |
442 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { | |
443 unittest.expect(o.pageSize, unittest.equals(42)); | |
444 unittest.expect(o.pageToken, unittest.equals('foo')); | |
445 } | |
446 buildCounterListAvailableOrgPolicyConstraintsRequest--; | |
447 } | |
448 | |
449 buildUnnamed3426() { | |
450 var o = new core.List<api.Constraint>(); | |
451 o.add(buildConstraint()); | |
452 o.add(buildConstraint()); | |
453 return o; | |
454 } | |
455 | |
456 checkUnnamed3426(core.List<api.Constraint> o) { | |
457 unittest.expect(o, unittest.hasLength(2)); | |
458 checkConstraint(o[0]); | |
459 checkConstraint(o[1]); | |
460 } | |
461 | |
462 core.int buildCounterListAvailableOrgPolicyConstraintsResponse = 0; | |
463 buildListAvailableOrgPolicyConstraintsResponse() { | |
464 var o = new api.ListAvailableOrgPolicyConstraintsResponse(); | |
465 buildCounterListAvailableOrgPolicyConstraintsResponse++; | |
466 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { | |
467 o.constraints = buildUnnamed3426(); | |
468 o.nextPageToken = "foo"; | |
469 } | |
470 buildCounterListAvailableOrgPolicyConstraintsResponse--; | |
471 return o; | |
472 } | |
473 | |
474 checkListAvailableOrgPolicyConstraintsResponse(api.ListAvailableOrgPolicyConstra
intsResponse o) { | |
475 buildCounterListAvailableOrgPolicyConstraintsResponse++; | |
476 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { | |
477 checkUnnamed3426(o.constraints); | |
478 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
479 } | |
480 buildCounterListAvailableOrgPolicyConstraintsResponse--; | |
481 } | |
482 | |
483 core.int buildCounterListConstraint = 0; | |
484 buildListConstraint() { | |
485 var o = new api.ListConstraint(); | |
486 buildCounterListConstraint++; | |
487 if (buildCounterListConstraint < 3) { | |
488 o.suggestedValue = "foo"; | |
489 } | |
490 buildCounterListConstraint--; | |
491 return o; | |
492 } | |
493 | |
494 checkListConstraint(api.ListConstraint o) { | |
495 buildCounterListConstraint++; | |
496 if (buildCounterListConstraint < 3) { | |
497 unittest.expect(o.suggestedValue, unittest.equals('foo')); | |
498 } | |
499 buildCounterListConstraint--; | |
500 } | |
501 | |
502 core.int buildCounterListOrgPoliciesRequest = 0; | |
503 buildListOrgPoliciesRequest() { | |
504 var o = new api.ListOrgPoliciesRequest(); | |
505 buildCounterListOrgPoliciesRequest++; | |
506 if (buildCounterListOrgPoliciesRequest < 3) { | |
507 o.pageSize = 42; | |
508 o.pageToken = "foo"; | |
509 } | |
510 buildCounterListOrgPoliciesRequest--; | |
511 return o; | |
512 } | |
513 | |
514 checkListOrgPoliciesRequest(api.ListOrgPoliciesRequest o) { | |
515 buildCounterListOrgPoliciesRequest++; | |
516 if (buildCounterListOrgPoliciesRequest < 3) { | |
517 unittest.expect(o.pageSize, unittest.equals(42)); | |
518 unittest.expect(o.pageToken, unittest.equals('foo')); | |
519 } | |
520 buildCounterListOrgPoliciesRequest--; | |
521 } | |
522 | |
523 buildUnnamed3427() { | |
524 var o = new core.List<api.OrgPolicy>(); | |
525 o.add(buildOrgPolicy()); | |
526 o.add(buildOrgPolicy()); | |
527 return o; | |
528 } | |
529 | |
530 checkUnnamed3427(core.List<api.OrgPolicy> o) { | |
531 unittest.expect(o, unittest.hasLength(2)); | |
532 checkOrgPolicy(o[0]); | |
533 checkOrgPolicy(o[1]); | |
534 } | |
535 | |
536 core.int buildCounterListOrgPoliciesResponse = 0; | |
537 buildListOrgPoliciesResponse() { | |
538 var o = new api.ListOrgPoliciesResponse(); | |
539 buildCounterListOrgPoliciesResponse++; | |
540 if (buildCounterListOrgPoliciesResponse < 3) { | |
541 o.nextPageToken = "foo"; | |
542 o.policies = buildUnnamed3427(); | |
543 } | |
544 buildCounterListOrgPoliciesResponse--; | |
545 return o; | |
546 } | |
547 | |
548 checkListOrgPoliciesResponse(api.ListOrgPoliciesResponse o) { | |
549 buildCounterListOrgPoliciesResponse++; | |
550 if (buildCounterListOrgPoliciesResponse < 3) { | |
551 unittest.expect(o.nextPageToken, unittest.equals('foo')); | |
552 checkUnnamed3427(o.policies); | |
553 } | |
554 buildCounterListOrgPoliciesResponse--; | |
555 } | |
556 | |
557 buildUnnamed3428() { | |
558 var o = new core.List<api.Organization>(); | 303 var o = new core.List<api.Organization>(); |
559 o.add(buildOrganization()); | 304 o.add(buildOrganization()); |
560 o.add(buildOrganization()); | 305 o.add(buildOrganization()); |
561 return o; | 306 return o; |
562 } | 307 } |
563 | 308 |
564 checkUnnamed3428(core.List<api.Organization> o) { | 309 checkUnnamed3413(core.List<api.Organization> o) { |
565 unittest.expect(o, unittest.hasLength(2)); | 310 unittest.expect(o, unittest.hasLength(2)); |
566 checkOrganization(o[0]); | 311 checkOrganization(o[0]); |
567 checkOrganization(o[1]); | 312 checkOrganization(o[1]); |
568 } | 313 } |
569 | 314 |
570 core.int buildCounterListOrganizationsResponse = 0; | 315 core.int buildCounterListOrganizationsResponse = 0; |
571 buildListOrganizationsResponse() { | 316 buildListOrganizationsResponse() { |
572 var o = new api.ListOrganizationsResponse(); | 317 var o = new api.ListOrganizationsResponse(); |
573 buildCounterListOrganizationsResponse++; | 318 buildCounterListOrganizationsResponse++; |
574 if (buildCounterListOrganizationsResponse < 3) { | 319 if (buildCounterListOrganizationsResponse < 3) { |
575 o.nextPageToken = "foo"; | 320 o.nextPageToken = "foo"; |
576 o.organizations = buildUnnamed3428(); | 321 o.organizations = buildUnnamed3413(); |
577 } | 322 } |
578 buildCounterListOrganizationsResponse--; | 323 buildCounterListOrganizationsResponse--; |
579 return o; | 324 return o; |
580 } | 325 } |
581 | 326 |
582 checkListOrganizationsResponse(api.ListOrganizationsResponse o) { | 327 checkListOrganizationsResponse(api.ListOrganizationsResponse o) { |
583 buildCounterListOrganizationsResponse++; | 328 buildCounterListOrganizationsResponse++; |
584 if (buildCounterListOrganizationsResponse < 3) { | 329 if (buildCounterListOrganizationsResponse < 3) { |
585 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 330 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
586 checkUnnamed3428(o.organizations); | 331 checkUnnamed3413(o.organizations); |
587 } | 332 } |
588 buildCounterListOrganizationsResponse--; | 333 buildCounterListOrganizationsResponse--; |
589 } | 334 } |
590 | 335 |
591 buildUnnamed3429() { | 336 buildUnnamed3414() { |
592 var o = new core.List<core.String>(); | |
593 o.add("foo"); | |
594 o.add("foo"); | |
595 return o; | |
596 } | |
597 | |
598 checkUnnamed3429(core.List<core.String> o) { | |
599 unittest.expect(o, unittest.hasLength(2)); | |
600 unittest.expect(o[0], unittest.equals('foo')); | |
601 unittest.expect(o[1], unittest.equals('foo')); | |
602 } | |
603 | |
604 buildUnnamed3430() { | |
605 var o = new core.List<core.String>(); | |
606 o.add("foo"); | |
607 o.add("foo"); | |
608 return o; | |
609 } | |
610 | |
611 checkUnnamed3430(core.List<core.String> o) { | |
612 unittest.expect(o, unittest.hasLength(2)); | |
613 unittest.expect(o[0], unittest.equals('foo')); | |
614 unittest.expect(o[1], unittest.equals('foo')); | |
615 } | |
616 | |
617 core.int buildCounterListPolicy = 0; | |
618 buildListPolicy() { | |
619 var o = new api.ListPolicy(); | |
620 buildCounterListPolicy++; | |
621 if (buildCounterListPolicy < 3) { | |
622 o.allValues = "foo"; | |
623 o.allowedValues = buildUnnamed3429(); | |
624 o.deniedValues = buildUnnamed3430(); | |
625 o.inheritFromParent = true; | |
626 o.suggestedValue = "foo"; | |
627 } | |
628 buildCounterListPolicy--; | |
629 return o; | |
630 } | |
631 | |
632 checkListPolicy(api.ListPolicy o) { | |
633 buildCounterListPolicy++; | |
634 if (buildCounterListPolicy < 3) { | |
635 unittest.expect(o.allValues, unittest.equals('foo')); | |
636 checkUnnamed3429(o.allowedValues); | |
637 checkUnnamed3430(o.deniedValues); | |
638 unittest.expect(o.inheritFromParent, unittest.isTrue); | |
639 unittest.expect(o.suggestedValue, unittest.equals('foo')); | |
640 } | |
641 buildCounterListPolicy--; | |
642 } | |
643 | |
644 buildUnnamed3431() { | |
645 var o = new core.List<api.Project>(); | 337 var o = new core.List<api.Project>(); |
646 o.add(buildProject()); | 338 o.add(buildProject()); |
647 o.add(buildProject()); | 339 o.add(buildProject()); |
648 return o; | 340 return o; |
649 } | 341 } |
650 | 342 |
651 checkUnnamed3431(core.List<api.Project> o) { | 343 checkUnnamed3414(core.List<api.Project> o) { |
652 unittest.expect(o, unittest.hasLength(2)); | 344 unittest.expect(o, unittest.hasLength(2)); |
653 checkProject(o[0]); | 345 checkProject(o[0]); |
654 checkProject(o[1]); | 346 checkProject(o[1]); |
655 } | 347 } |
656 | 348 |
657 core.int buildCounterListProjectsResponse = 0; | 349 core.int buildCounterListProjectsResponse = 0; |
658 buildListProjectsResponse() { | 350 buildListProjectsResponse() { |
659 var o = new api.ListProjectsResponse(); | 351 var o = new api.ListProjectsResponse(); |
660 buildCounterListProjectsResponse++; | 352 buildCounterListProjectsResponse++; |
661 if (buildCounterListProjectsResponse < 3) { | 353 if (buildCounterListProjectsResponse < 3) { |
662 o.nextPageToken = "foo"; | 354 o.nextPageToken = "foo"; |
663 o.projects = buildUnnamed3431(); | 355 o.projects = buildUnnamed3414(); |
664 } | 356 } |
665 buildCounterListProjectsResponse--; | 357 buildCounterListProjectsResponse--; |
666 return o; | 358 return o; |
667 } | 359 } |
668 | 360 |
669 checkListProjectsResponse(api.ListProjectsResponse o) { | 361 checkListProjectsResponse(api.ListProjectsResponse o) { |
670 buildCounterListProjectsResponse++; | 362 buildCounterListProjectsResponse++; |
671 if (buildCounterListProjectsResponse < 3) { | 363 if (buildCounterListProjectsResponse < 3) { |
672 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 364 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
673 checkUnnamed3431(o.projects); | 365 checkUnnamed3414(o.projects); |
674 } | 366 } |
675 buildCounterListProjectsResponse--; | 367 buildCounterListProjectsResponse--; |
676 } | 368 } |
677 | 369 |
678 core.int buildCounterOrgPolicy = 0; | |
679 buildOrgPolicy() { | |
680 var o = new api.OrgPolicy(); | |
681 buildCounterOrgPolicy++; | |
682 if (buildCounterOrgPolicy < 3) { | |
683 o.booleanPolicy = buildBooleanPolicy(); | |
684 o.constraint = "foo"; | |
685 o.etag = "foo"; | |
686 o.listPolicy = buildListPolicy(); | |
687 o.restoreDefault = buildRestoreDefault(); | |
688 o.updateTime = "foo"; | |
689 o.version = 42; | |
690 } | |
691 buildCounterOrgPolicy--; | |
692 return o; | |
693 } | |
694 | |
695 checkOrgPolicy(api.OrgPolicy o) { | |
696 buildCounterOrgPolicy++; | |
697 if (buildCounterOrgPolicy < 3) { | |
698 checkBooleanPolicy(o.booleanPolicy); | |
699 unittest.expect(o.constraint, unittest.equals('foo')); | |
700 unittest.expect(o.etag, unittest.equals('foo')); | |
701 checkListPolicy(o.listPolicy); | |
702 checkRestoreDefault(o.restoreDefault); | |
703 unittest.expect(o.updateTime, unittest.equals('foo')); | |
704 unittest.expect(o.version, unittest.equals(42)); | |
705 } | |
706 buildCounterOrgPolicy--; | |
707 } | |
708 | |
709 core.int buildCounterOrganization = 0; | 370 core.int buildCounterOrganization = 0; |
710 buildOrganization() { | 371 buildOrganization() { |
711 var o = new api.Organization(); | 372 var o = new api.Organization(); |
712 buildCounterOrganization++; | 373 buildCounterOrganization++; |
713 if (buildCounterOrganization < 3) { | 374 if (buildCounterOrganization < 3) { |
714 o.creationTime = "foo"; | 375 o.creationTime = "foo"; |
715 o.displayName = "foo"; | 376 o.displayName = "foo"; |
716 o.lifecycleState = "foo"; | 377 o.lifecycleState = "foo"; |
717 o.name = "foo"; | 378 o.name = "foo"; |
718 o.organizationId = "foo"; | 379 o.organizationId = "foo"; |
(...skipping 28 matching lines...) Expand all Loading... |
747 } | 408 } |
748 | 409 |
749 checkOrganizationOwner(api.OrganizationOwner o) { | 410 checkOrganizationOwner(api.OrganizationOwner o) { |
750 buildCounterOrganizationOwner++; | 411 buildCounterOrganizationOwner++; |
751 if (buildCounterOrganizationOwner < 3) { | 412 if (buildCounterOrganizationOwner < 3) { |
752 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); | 413 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); |
753 } | 414 } |
754 buildCounterOrganizationOwner--; | 415 buildCounterOrganizationOwner--; |
755 } | 416 } |
756 | 417 |
757 buildUnnamed3432() { | 418 buildUnnamed3415() { |
758 var o = new core.List<api.AuditConfig>(); | 419 var o = new core.List<api.AuditConfig>(); |
759 o.add(buildAuditConfig()); | 420 o.add(buildAuditConfig()); |
760 o.add(buildAuditConfig()); | 421 o.add(buildAuditConfig()); |
761 return o; | 422 return o; |
762 } | 423 } |
763 | 424 |
764 checkUnnamed3432(core.List<api.AuditConfig> o) { | 425 checkUnnamed3415(core.List<api.AuditConfig> o) { |
765 unittest.expect(o, unittest.hasLength(2)); | 426 unittest.expect(o, unittest.hasLength(2)); |
766 checkAuditConfig(o[0]); | 427 checkAuditConfig(o[0]); |
767 checkAuditConfig(o[1]); | 428 checkAuditConfig(o[1]); |
768 } | 429 } |
769 | 430 |
770 buildUnnamed3433() { | 431 buildUnnamed3416() { |
771 var o = new core.List<api.Binding>(); | 432 var o = new core.List<api.Binding>(); |
772 o.add(buildBinding()); | 433 o.add(buildBinding()); |
773 o.add(buildBinding()); | 434 o.add(buildBinding()); |
774 return o; | 435 return o; |
775 } | 436 } |
776 | 437 |
777 checkUnnamed3433(core.List<api.Binding> o) { | 438 checkUnnamed3416(core.List<api.Binding> o) { |
778 unittest.expect(o, unittest.hasLength(2)); | 439 unittest.expect(o, unittest.hasLength(2)); |
779 checkBinding(o[0]); | 440 checkBinding(o[0]); |
780 checkBinding(o[1]); | 441 checkBinding(o[1]); |
781 } | 442 } |
782 | 443 |
783 core.int buildCounterPolicy = 0; | 444 core.int buildCounterPolicy = 0; |
784 buildPolicy() { | 445 buildPolicy() { |
785 var o = new api.Policy(); | 446 var o = new api.Policy(); |
786 buildCounterPolicy++; | 447 buildCounterPolicy++; |
787 if (buildCounterPolicy < 3) { | 448 if (buildCounterPolicy < 3) { |
788 o.auditConfigs = buildUnnamed3432(); | 449 o.auditConfigs = buildUnnamed3415(); |
789 o.bindings = buildUnnamed3433(); | 450 o.bindings = buildUnnamed3416(); |
790 o.etag = "foo"; | 451 o.etag = "foo"; |
791 o.version = 42; | 452 o.version = 42; |
792 } | 453 } |
793 buildCounterPolicy--; | 454 buildCounterPolicy--; |
794 return o; | 455 return o; |
795 } | 456 } |
796 | 457 |
797 checkPolicy(api.Policy o) { | 458 checkPolicy(api.Policy o) { |
798 buildCounterPolicy++; | 459 buildCounterPolicy++; |
799 if (buildCounterPolicy < 3) { | 460 if (buildCounterPolicy < 3) { |
800 checkUnnamed3432(o.auditConfigs); | 461 checkUnnamed3415(o.auditConfigs); |
801 checkUnnamed3433(o.bindings); | 462 checkUnnamed3416(o.bindings); |
802 unittest.expect(o.etag, unittest.equals('foo')); | 463 unittest.expect(o.etag, unittest.equals('foo')); |
803 unittest.expect(o.version, unittest.equals(42)); | 464 unittest.expect(o.version, unittest.equals(42)); |
804 } | 465 } |
805 buildCounterPolicy--; | 466 buildCounterPolicy--; |
806 } | 467 } |
807 | 468 |
808 buildUnnamed3434() { | 469 buildUnnamed3417() { |
809 var o = new core.Map<core.String, core.String>(); | 470 var o = new core.Map<core.String, core.String>(); |
810 o["x"] = "foo"; | 471 o["x"] = "foo"; |
811 o["y"] = "foo"; | 472 o["y"] = "foo"; |
812 return o; | 473 return o; |
813 } | 474 } |
814 | 475 |
815 checkUnnamed3434(core.Map<core.String, core.String> o) { | 476 checkUnnamed3417(core.Map<core.String, core.String> o) { |
816 unittest.expect(o, unittest.hasLength(2)); | 477 unittest.expect(o, unittest.hasLength(2)); |
817 unittest.expect(o["x"], unittest.equals('foo')); | 478 unittest.expect(o["x"], unittest.equals('foo')); |
818 unittest.expect(o["y"], unittest.equals('foo')); | 479 unittest.expect(o["y"], unittest.equals('foo')); |
819 } | 480 } |
820 | 481 |
821 core.int buildCounterProject = 0; | 482 core.int buildCounterProject = 0; |
822 buildProject() { | 483 buildProject() { |
823 var o = new api.Project(); | 484 var o = new api.Project(); |
824 buildCounterProject++; | 485 buildCounterProject++; |
825 if (buildCounterProject < 3) { | 486 if (buildCounterProject < 3) { |
826 o.createTime = "foo"; | 487 o.createTime = "foo"; |
827 o.labels = buildUnnamed3434(); | 488 o.labels = buildUnnamed3417(); |
828 o.lifecycleState = "foo"; | 489 o.lifecycleState = "foo"; |
829 o.name = "foo"; | 490 o.name = "foo"; |
830 o.parent = buildResourceId(); | 491 o.parent = buildResourceId(); |
831 o.projectId = "foo"; | 492 o.projectId = "foo"; |
832 o.projectNumber = "foo"; | 493 o.projectNumber = "foo"; |
833 } | 494 } |
834 buildCounterProject--; | 495 buildCounterProject--; |
835 return o; | 496 return o; |
836 } | 497 } |
837 | 498 |
838 checkProject(api.Project o) { | 499 checkProject(api.Project o) { |
839 buildCounterProject++; | 500 buildCounterProject++; |
840 if (buildCounterProject < 3) { | 501 if (buildCounterProject < 3) { |
841 unittest.expect(o.createTime, unittest.equals('foo')); | 502 unittest.expect(o.createTime, unittest.equals('foo')); |
842 checkUnnamed3434(o.labels); | 503 checkUnnamed3417(o.labels); |
843 unittest.expect(o.lifecycleState, unittest.equals('foo')); | 504 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
844 unittest.expect(o.name, unittest.equals('foo')); | 505 unittest.expect(o.name, unittest.equals('foo')); |
845 checkResourceId(o.parent); | 506 checkResourceId(o.parent); |
846 unittest.expect(o.projectId, unittest.equals('foo')); | 507 unittest.expect(o.projectId, unittest.equals('foo')); |
847 unittest.expect(o.projectNumber, unittest.equals('foo')); | 508 unittest.expect(o.projectNumber, unittest.equals('foo')); |
848 } | 509 } |
849 buildCounterProject--; | 510 buildCounterProject--; |
850 } | 511 } |
851 | 512 |
852 core.int buildCounterProjectCreationStatus = 0; | 513 core.int buildCounterProjectCreationStatus = 0; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 | 547 |
887 checkResourceId(api.ResourceId o) { | 548 checkResourceId(api.ResourceId o) { |
888 buildCounterResourceId++; | 549 buildCounterResourceId++; |
889 if (buildCounterResourceId < 3) { | 550 if (buildCounterResourceId < 3) { |
890 unittest.expect(o.id, unittest.equals('foo')); | 551 unittest.expect(o.id, unittest.equals('foo')); |
891 unittest.expect(o.type, unittest.equals('foo')); | 552 unittest.expect(o.type, unittest.equals('foo')); |
892 } | 553 } |
893 buildCounterResourceId--; | 554 buildCounterResourceId--; |
894 } | 555 } |
895 | 556 |
896 core.int buildCounterRestoreDefault = 0; | |
897 buildRestoreDefault() { | |
898 var o = new api.RestoreDefault(); | |
899 buildCounterRestoreDefault++; | |
900 if (buildCounterRestoreDefault < 3) { | |
901 } | |
902 buildCounterRestoreDefault--; | |
903 return o; | |
904 } | |
905 | |
906 checkRestoreDefault(api.RestoreDefault o) { | |
907 buildCounterRestoreDefault++; | |
908 if (buildCounterRestoreDefault < 3) { | |
909 } | |
910 buildCounterRestoreDefault--; | |
911 } | |
912 | |
913 core.int buildCounterSetIamPolicyRequest = 0; | 557 core.int buildCounterSetIamPolicyRequest = 0; |
914 buildSetIamPolicyRequest() { | 558 buildSetIamPolicyRequest() { |
915 var o = new api.SetIamPolicyRequest(); | 559 var o = new api.SetIamPolicyRequest(); |
916 buildCounterSetIamPolicyRequest++; | 560 buildCounterSetIamPolicyRequest++; |
917 if (buildCounterSetIamPolicyRequest < 3) { | 561 if (buildCounterSetIamPolicyRequest < 3) { |
918 o.policy = buildPolicy(); | 562 o.policy = buildPolicy(); |
919 o.updateMask = "foo"; | 563 o.updateMask = "foo"; |
920 } | 564 } |
921 buildCounterSetIamPolicyRequest--; | 565 buildCounterSetIamPolicyRequest--; |
922 return o; | 566 return o; |
923 } | 567 } |
924 | 568 |
925 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 569 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
926 buildCounterSetIamPolicyRequest++; | 570 buildCounterSetIamPolicyRequest++; |
927 if (buildCounterSetIamPolicyRequest < 3) { | 571 if (buildCounterSetIamPolicyRequest < 3) { |
928 checkPolicy(o.policy); | 572 checkPolicy(o.policy); |
929 unittest.expect(o.updateMask, unittest.equals('foo')); | 573 unittest.expect(o.updateMask, unittest.equals('foo')); |
930 } | 574 } |
931 buildCounterSetIamPolicyRequest--; | 575 buildCounterSetIamPolicyRequest--; |
932 } | 576 } |
933 | 577 |
934 core.int buildCounterSetOrgPolicyRequest = 0; | 578 buildUnnamed3418() { |
935 buildSetOrgPolicyRequest() { | |
936 var o = new api.SetOrgPolicyRequest(); | |
937 buildCounterSetOrgPolicyRequest++; | |
938 if (buildCounterSetOrgPolicyRequest < 3) { | |
939 o.policy = buildOrgPolicy(); | |
940 } | |
941 buildCounterSetOrgPolicyRequest--; | |
942 return o; | |
943 } | |
944 | |
945 checkSetOrgPolicyRequest(api.SetOrgPolicyRequest o) { | |
946 buildCounterSetOrgPolicyRequest++; | |
947 if (buildCounterSetOrgPolicyRequest < 3) { | |
948 checkOrgPolicy(o.policy); | |
949 } | |
950 buildCounterSetOrgPolicyRequest--; | |
951 } | |
952 | |
953 buildUnnamed3435() { | |
954 var o = new core.List<core.String>(); | 579 var o = new core.List<core.String>(); |
955 o.add("foo"); | 580 o.add("foo"); |
956 o.add("foo"); | 581 o.add("foo"); |
957 return o; | 582 return o; |
958 } | 583 } |
959 | 584 |
960 checkUnnamed3435(core.List<core.String> o) { | 585 checkUnnamed3418(core.List<core.String> o) { |
961 unittest.expect(o, unittest.hasLength(2)); | 586 unittest.expect(o, unittest.hasLength(2)); |
962 unittest.expect(o[0], unittest.equals('foo')); | 587 unittest.expect(o[0], unittest.equals('foo')); |
963 unittest.expect(o[1], unittest.equals('foo')); | 588 unittest.expect(o[1], unittest.equals('foo')); |
964 } | 589 } |
965 | 590 |
966 core.int buildCounterTestIamPermissionsRequest = 0; | 591 core.int buildCounterTestIamPermissionsRequest = 0; |
967 buildTestIamPermissionsRequest() { | 592 buildTestIamPermissionsRequest() { |
968 var o = new api.TestIamPermissionsRequest(); | 593 var o = new api.TestIamPermissionsRequest(); |
969 buildCounterTestIamPermissionsRequest++; | 594 buildCounterTestIamPermissionsRequest++; |
970 if (buildCounterTestIamPermissionsRequest < 3) { | 595 if (buildCounterTestIamPermissionsRequest < 3) { |
971 o.permissions = buildUnnamed3435(); | 596 o.permissions = buildUnnamed3418(); |
972 } | 597 } |
973 buildCounterTestIamPermissionsRequest--; | 598 buildCounterTestIamPermissionsRequest--; |
974 return o; | 599 return o; |
975 } | 600 } |
976 | 601 |
977 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 602 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
978 buildCounterTestIamPermissionsRequest++; | 603 buildCounterTestIamPermissionsRequest++; |
979 if (buildCounterTestIamPermissionsRequest < 3) { | 604 if (buildCounterTestIamPermissionsRequest < 3) { |
980 checkUnnamed3435(o.permissions); | 605 checkUnnamed3418(o.permissions); |
981 } | 606 } |
982 buildCounterTestIamPermissionsRequest--; | 607 buildCounterTestIamPermissionsRequest--; |
983 } | 608 } |
984 | 609 |
985 buildUnnamed3436() { | 610 buildUnnamed3419() { |
986 var o = new core.List<core.String>(); | 611 var o = new core.List<core.String>(); |
987 o.add("foo"); | 612 o.add("foo"); |
988 o.add("foo"); | 613 o.add("foo"); |
989 return o; | 614 return o; |
990 } | 615 } |
991 | 616 |
992 checkUnnamed3436(core.List<core.String> o) { | 617 checkUnnamed3419(core.List<core.String> o) { |
993 unittest.expect(o, unittest.hasLength(2)); | 618 unittest.expect(o, unittest.hasLength(2)); |
994 unittest.expect(o[0], unittest.equals('foo')); | 619 unittest.expect(o[0], unittest.equals('foo')); |
995 unittest.expect(o[1], unittest.equals('foo')); | 620 unittest.expect(o[1], unittest.equals('foo')); |
996 } | 621 } |
997 | 622 |
998 core.int buildCounterTestIamPermissionsResponse = 0; | 623 core.int buildCounterTestIamPermissionsResponse = 0; |
999 buildTestIamPermissionsResponse() { | 624 buildTestIamPermissionsResponse() { |
1000 var o = new api.TestIamPermissionsResponse(); | 625 var o = new api.TestIamPermissionsResponse(); |
1001 buildCounterTestIamPermissionsResponse++; | 626 buildCounterTestIamPermissionsResponse++; |
1002 if (buildCounterTestIamPermissionsResponse < 3) { | 627 if (buildCounterTestIamPermissionsResponse < 3) { |
1003 o.permissions = buildUnnamed3436(); | 628 o.permissions = buildUnnamed3419(); |
1004 } | 629 } |
1005 buildCounterTestIamPermissionsResponse--; | 630 buildCounterTestIamPermissionsResponse--; |
1006 return o; | 631 return o; |
1007 } | 632 } |
1008 | 633 |
1009 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 634 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
1010 buildCounterTestIamPermissionsResponse++; | 635 buildCounterTestIamPermissionsResponse++; |
1011 if (buildCounterTestIamPermissionsResponse < 3) { | 636 if (buildCounterTestIamPermissionsResponse < 3) { |
1012 checkUnnamed3436(o.permissions); | 637 checkUnnamed3419(o.permissions); |
1013 } | 638 } |
1014 buildCounterTestIamPermissionsResponse--; | 639 buildCounterTestIamPermissionsResponse--; |
1015 } | 640 } |
1016 | 641 |
1017 core.int buildCounterUndeleteProjectRequest = 0; | 642 core.int buildCounterUndeleteProjectRequest = 0; |
1018 buildUndeleteProjectRequest() { | 643 buildUndeleteProjectRequest() { |
1019 var o = new api.UndeleteProjectRequest(); | 644 var o = new api.UndeleteProjectRequest(); |
1020 buildCounterUndeleteProjectRequest++; | 645 buildCounterUndeleteProjectRequest++; |
1021 if (buildCounterUndeleteProjectRequest < 3) { | 646 if (buildCounterUndeleteProjectRequest < 3) { |
1022 } | 647 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 | 687 |
1063 unittest.group("obj-schema-Binding", () { | 688 unittest.group("obj-schema-Binding", () { |
1064 unittest.test("to-json--from-json", () { | 689 unittest.test("to-json--from-json", () { |
1065 var o = buildBinding(); | 690 var o = buildBinding(); |
1066 var od = new api.Binding.fromJson(o.toJson()); | 691 var od = new api.Binding.fromJson(o.toJson()); |
1067 checkBinding(od); | 692 checkBinding(od); |
1068 }); | 693 }); |
1069 }); | 694 }); |
1070 | 695 |
1071 | 696 |
1072 unittest.group("obj-schema-BooleanConstraint", () { | |
1073 unittest.test("to-json--from-json", () { | |
1074 var o = buildBooleanConstraint(); | |
1075 var od = new api.BooleanConstraint.fromJson(o.toJson()); | |
1076 checkBooleanConstraint(od); | |
1077 }); | |
1078 }); | |
1079 | |
1080 | |
1081 unittest.group("obj-schema-BooleanPolicy", () { | |
1082 unittest.test("to-json--from-json", () { | |
1083 var o = buildBooleanPolicy(); | |
1084 var od = new api.BooleanPolicy.fromJson(o.toJson()); | |
1085 checkBooleanPolicy(od); | |
1086 }); | |
1087 }); | |
1088 | |
1089 | |
1090 unittest.group("obj-schema-ClearOrgPolicyRequest", () { | |
1091 unittest.test("to-json--from-json", () { | |
1092 var o = buildClearOrgPolicyRequest(); | |
1093 var od = new api.ClearOrgPolicyRequest.fromJson(o.toJson()); | |
1094 checkClearOrgPolicyRequest(od); | |
1095 }); | |
1096 }); | |
1097 | |
1098 | |
1099 unittest.group("obj-schema-Constraint", () { | |
1100 unittest.test("to-json--from-json", () { | |
1101 var o = buildConstraint(); | |
1102 var od = new api.Constraint.fromJson(o.toJson()); | |
1103 checkConstraint(od); | |
1104 }); | |
1105 }); | |
1106 | |
1107 | |
1108 unittest.group("obj-schema-Empty", () { | 697 unittest.group("obj-schema-Empty", () { |
1109 unittest.test("to-json--from-json", () { | 698 unittest.test("to-json--from-json", () { |
1110 var o = buildEmpty(); | 699 var o = buildEmpty(); |
1111 var od = new api.Empty.fromJson(o.toJson()); | 700 var od = new api.Empty.fromJson(o.toJson()); |
1112 checkEmpty(od); | 701 checkEmpty(od); |
1113 }); | 702 }); |
1114 }); | 703 }); |
1115 | 704 |
1116 | 705 |
1117 unittest.group("obj-schema-FolderOperation", () { | 706 unittest.group("obj-schema-FolderOperation", () { |
(...skipping 25 matching lines...) Expand all Loading... |
1143 | 732 |
1144 unittest.group("obj-schema-GetAncestryResponse", () { | 733 unittest.group("obj-schema-GetAncestryResponse", () { |
1145 unittest.test("to-json--from-json", () { | 734 unittest.test("to-json--from-json", () { |
1146 var o = buildGetAncestryResponse(); | 735 var o = buildGetAncestryResponse(); |
1147 var od = new api.GetAncestryResponse.fromJson(o.toJson()); | 736 var od = new api.GetAncestryResponse.fromJson(o.toJson()); |
1148 checkGetAncestryResponse(od); | 737 checkGetAncestryResponse(od); |
1149 }); | 738 }); |
1150 }); | 739 }); |
1151 | 740 |
1152 | 741 |
1153 unittest.group("obj-schema-GetEffectiveOrgPolicyRequest", () { | |
1154 unittest.test("to-json--from-json", () { | |
1155 var o = buildGetEffectiveOrgPolicyRequest(); | |
1156 var od = new api.GetEffectiveOrgPolicyRequest.fromJson(o.toJson()); | |
1157 checkGetEffectiveOrgPolicyRequest(od); | |
1158 }); | |
1159 }); | |
1160 | |
1161 | |
1162 unittest.group("obj-schema-GetIamPolicyRequest", () { | 742 unittest.group("obj-schema-GetIamPolicyRequest", () { |
1163 unittest.test("to-json--from-json", () { | 743 unittest.test("to-json--from-json", () { |
1164 var o = buildGetIamPolicyRequest(); | 744 var o = buildGetIamPolicyRequest(); |
1165 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); | 745 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
1166 checkGetIamPolicyRequest(od); | 746 checkGetIamPolicyRequest(od); |
1167 }); | 747 }); |
1168 }); | 748 }); |
1169 | 749 |
1170 | 750 |
1171 unittest.group("obj-schema-GetOrgPolicyRequest", () { | |
1172 unittest.test("to-json--from-json", () { | |
1173 var o = buildGetOrgPolicyRequest(); | |
1174 var od = new api.GetOrgPolicyRequest.fromJson(o.toJson()); | |
1175 checkGetOrgPolicyRequest(od); | |
1176 }); | |
1177 }); | |
1178 | |
1179 | |
1180 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsRequest", () { | |
1181 unittest.test("to-json--from-json", () { | |
1182 var o = buildListAvailableOrgPolicyConstraintsRequest(); | |
1183 var od = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(o.toJso
n()); | |
1184 checkListAvailableOrgPolicyConstraintsRequest(od); | |
1185 }); | |
1186 }); | |
1187 | |
1188 | |
1189 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsResponse", () { | |
1190 unittest.test("to-json--from-json", () { | |
1191 var o = buildListAvailableOrgPolicyConstraintsResponse(); | |
1192 var od = new api.ListAvailableOrgPolicyConstraintsResponse.fromJson(o.toJs
on()); | |
1193 checkListAvailableOrgPolicyConstraintsResponse(od); | |
1194 }); | |
1195 }); | |
1196 | |
1197 | |
1198 unittest.group("obj-schema-ListConstraint", () { | |
1199 unittest.test("to-json--from-json", () { | |
1200 var o = buildListConstraint(); | |
1201 var od = new api.ListConstraint.fromJson(o.toJson()); | |
1202 checkListConstraint(od); | |
1203 }); | |
1204 }); | |
1205 | |
1206 | |
1207 unittest.group("obj-schema-ListOrgPoliciesRequest", () { | |
1208 unittest.test("to-json--from-json", () { | |
1209 var o = buildListOrgPoliciesRequest(); | |
1210 var od = new api.ListOrgPoliciesRequest.fromJson(o.toJson()); | |
1211 checkListOrgPoliciesRequest(od); | |
1212 }); | |
1213 }); | |
1214 | |
1215 | |
1216 unittest.group("obj-schema-ListOrgPoliciesResponse", () { | |
1217 unittest.test("to-json--from-json", () { | |
1218 var o = buildListOrgPoliciesResponse(); | |
1219 var od = new api.ListOrgPoliciesResponse.fromJson(o.toJson()); | |
1220 checkListOrgPoliciesResponse(od); | |
1221 }); | |
1222 }); | |
1223 | |
1224 | |
1225 unittest.group("obj-schema-ListOrganizationsResponse", () { | 751 unittest.group("obj-schema-ListOrganizationsResponse", () { |
1226 unittest.test("to-json--from-json", () { | 752 unittest.test("to-json--from-json", () { |
1227 var o = buildListOrganizationsResponse(); | 753 var o = buildListOrganizationsResponse(); |
1228 var od = new api.ListOrganizationsResponse.fromJson(o.toJson()); | 754 var od = new api.ListOrganizationsResponse.fromJson(o.toJson()); |
1229 checkListOrganizationsResponse(od); | 755 checkListOrganizationsResponse(od); |
1230 }); | 756 }); |
1231 }); | 757 }); |
1232 | 758 |
1233 | 759 |
1234 unittest.group("obj-schema-ListPolicy", () { | |
1235 unittest.test("to-json--from-json", () { | |
1236 var o = buildListPolicy(); | |
1237 var od = new api.ListPolicy.fromJson(o.toJson()); | |
1238 checkListPolicy(od); | |
1239 }); | |
1240 }); | |
1241 | |
1242 | |
1243 unittest.group("obj-schema-ListProjectsResponse", () { | 760 unittest.group("obj-schema-ListProjectsResponse", () { |
1244 unittest.test("to-json--from-json", () { | 761 unittest.test("to-json--from-json", () { |
1245 var o = buildListProjectsResponse(); | 762 var o = buildListProjectsResponse(); |
1246 var od = new api.ListProjectsResponse.fromJson(o.toJson()); | 763 var od = new api.ListProjectsResponse.fromJson(o.toJson()); |
1247 checkListProjectsResponse(od); | 764 checkListProjectsResponse(od); |
1248 }); | 765 }); |
1249 }); | 766 }); |
1250 | 767 |
1251 | 768 |
1252 unittest.group("obj-schema-OrgPolicy", () { | |
1253 unittest.test("to-json--from-json", () { | |
1254 var o = buildOrgPolicy(); | |
1255 var od = new api.OrgPolicy.fromJson(o.toJson()); | |
1256 checkOrgPolicy(od); | |
1257 }); | |
1258 }); | |
1259 | |
1260 | |
1261 unittest.group("obj-schema-Organization", () { | 769 unittest.group("obj-schema-Organization", () { |
1262 unittest.test("to-json--from-json", () { | 770 unittest.test("to-json--from-json", () { |
1263 var o = buildOrganization(); | 771 var o = buildOrganization(); |
1264 var od = new api.Organization.fromJson(o.toJson()); | 772 var od = new api.Organization.fromJson(o.toJson()); |
1265 checkOrganization(od); | 773 checkOrganization(od); |
1266 }); | 774 }); |
1267 }); | 775 }); |
1268 | 776 |
1269 | 777 |
1270 unittest.group("obj-schema-OrganizationOwner", () { | 778 unittest.group("obj-schema-OrganizationOwner", () { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1305 | 813 |
1306 unittest.group("obj-schema-ResourceId", () { | 814 unittest.group("obj-schema-ResourceId", () { |
1307 unittest.test("to-json--from-json", () { | 815 unittest.test("to-json--from-json", () { |
1308 var o = buildResourceId(); | 816 var o = buildResourceId(); |
1309 var od = new api.ResourceId.fromJson(o.toJson()); | 817 var od = new api.ResourceId.fromJson(o.toJson()); |
1310 checkResourceId(od); | 818 checkResourceId(od); |
1311 }); | 819 }); |
1312 }); | 820 }); |
1313 | 821 |
1314 | 822 |
1315 unittest.group("obj-schema-RestoreDefault", () { | |
1316 unittest.test("to-json--from-json", () { | |
1317 var o = buildRestoreDefault(); | |
1318 var od = new api.RestoreDefault.fromJson(o.toJson()); | |
1319 checkRestoreDefault(od); | |
1320 }); | |
1321 }); | |
1322 | |
1323 | |
1324 unittest.group("obj-schema-SetIamPolicyRequest", () { | 823 unittest.group("obj-schema-SetIamPolicyRequest", () { |
1325 unittest.test("to-json--from-json", () { | 824 unittest.test("to-json--from-json", () { |
1326 var o = buildSetIamPolicyRequest(); | 825 var o = buildSetIamPolicyRequest(); |
1327 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); | 826 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); |
1328 checkSetIamPolicyRequest(od); | 827 checkSetIamPolicyRequest(od); |
1329 }); | 828 }); |
1330 }); | 829 }); |
1331 | 830 |
1332 | 831 |
1333 unittest.group("obj-schema-SetOrgPolicyRequest", () { | |
1334 unittest.test("to-json--from-json", () { | |
1335 var o = buildSetOrgPolicyRequest(); | |
1336 var od = new api.SetOrgPolicyRequest.fromJson(o.toJson()); | |
1337 checkSetOrgPolicyRequest(od); | |
1338 }); | |
1339 }); | |
1340 | |
1341 | |
1342 unittest.group("obj-schema-TestIamPermissionsRequest", () { | 832 unittest.group("obj-schema-TestIamPermissionsRequest", () { |
1343 unittest.test("to-json--from-json", () { | 833 unittest.test("to-json--from-json", () { |
1344 var o = buildTestIamPermissionsRequest(); | 834 var o = buildTestIamPermissionsRequest(); |
1345 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); | 835 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); |
1346 checkTestIamPermissionsRequest(od); | 836 checkTestIamPermissionsRequest(od); |
1347 }); | 837 }); |
1348 }); | 838 }); |
1349 | 839 |
1350 | 840 |
1351 unittest.group("obj-schema-TestIamPermissionsResponse", () { | 841 unittest.group("obj-schema-TestIamPermissionsResponse", () { |
1352 unittest.test("to-json--from-json", () { | 842 unittest.test("to-json--from-json", () { |
1353 var o = buildTestIamPermissionsResponse(); | 843 var o = buildTestIamPermissionsResponse(); |
1354 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); | 844 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); |
1355 checkTestIamPermissionsResponse(od); | 845 checkTestIamPermissionsResponse(od); |
1356 }); | 846 }); |
1357 }); | 847 }); |
1358 | 848 |
1359 | 849 |
1360 unittest.group("obj-schema-UndeleteProjectRequest", () { | 850 unittest.group("obj-schema-UndeleteProjectRequest", () { |
1361 unittest.test("to-json--from-json", () { | 851 unittest.test("to-json--from-json", () { |
1362 var o = buildUndeleteProjectRequest(); | 852 var o = buildUndeleteProjectRequest(); |
1363 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); | 853 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); |
1364 checkUndeleteProjectRequest(od); | 854 checkUndeleteProjectRequest(od); |
1365 }); | 855 }); |
1366 }); | 856 }); |
1367 | 857 |
1368 | 858 |
1369 unittest.group("resource-OrganizationsResourceApi", () { | 859 unittest.group("resource-OrganizationsResourceApi", () { |
1370 unittest.test("method--clearOrgPolicy", () { | 860 unittest.test("method--get", () { |
1371 | 861 |
1372 var mock = new HttpServerMock(); | 862 var mock = new HttpServerMock(); |
1373 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 863 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
1374 var arg_request = buildClearOrgPolicyRequest(); | 864 var arg_name = "foo"; |
1375 var arg_resource = "foo"; | 865 var arg_organizationId = "foo"; |
1376 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 866 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1377 var obj = new api.ClearOrgPolicyRequest.fromJson(json); | |
1378 checkClearOrgPolicyRequest(obj); | |
1379 | |
1380 var path = (req.url).path; | 867 var path = (req.url).path; |
1381 var pathOffset = 0; | 868 var pathOffset = 0; |
1382 var index; | 869 var index; |
1383 var subPart; | 870 var subPart; |
1384 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 871 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1385 pathOffset += 1; | 872 pathOffset += 1; |
1386 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 873 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
1387 pathOffset += 8; | 874 pathOffset += 8; |
1388 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 875 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
1389 | 876 |
1390 var query = (req.url).query; | 877 var query = (req.url).query; |
1391 var queryOffset = 0; | 878 var queryOffset = 0; |
1392 var queryMap = {}; | 879 var queryMap = {}; |
1393 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 880 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1394 parseBool(n) { | 881 parseBool(n) { |
1395 if (n == "true") return true; | 882 if (n == "true") return true; |
1396 if (n == "false") return false; | 883 if (n == "false") return false; |
1397 if (n == null) return null; | 884 if (n == null) return null; |
1398 throw new core.ArgumentError("Invalid boolean: $n"); | 885 throw new core.ArgumentError("Invalid boolean: $n"); |
1399 } | 886 } |
1400 if (query.length > 0) { | 887 if (query.length > 0) { |
1401 for (var part in query.split("&")) { | 888 for (var part in query.split("&")) { |
1402 var keyvalue = part.split("="); | 889 var keyvalue = part.split("="); |
1403 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 890 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1404 } | 891 } |
1405 } | 892 } |
| 893 unittest.expect(queryMap["organizationId"].first, unittest.equals(arg_or
ganizationId)); |
1406 | 894 |
1407 | 895 |
1408 var h = { | 896 var h = { |
1409 "content-type" : "application/json; charset=utf-8", | 897 "content-type" : "application/json; charset=utf-8", |
1410 }; | 898 }; |
1411 var resp = convert.JSON.encode(buildEmpty()); | 899 var resp = convert.JSON.encode(buildOrganization()); |
1412 return new async.Future.value(stringResponse(200, h, resp)); | 900 return new async.Future.value(stringResponse(200, h, resp)); |
1413 }), true); | 901 }), true); |
1414 res.clearOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync(((
api.Empty response) { | 902 res.get(arg_name, organizationId: arg_organizationId).then(unittest.expect
Async(((api.Organization response) { |
1415 checkEmpty(response); | 903 checkOrganization(response); |
1416 }))); | 904 }))); |
1417 }); | 905 }); |
1418 | 906 |
1419 unittest.test("method--clearOrgPolicyV1", () { | 907 unittest.test("method--getIamPolicy", () { |
1420 | 908 |
1421 var mock = new HttpServerMock(); | 909 var mock = new HttpServerMock(); |
1422 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 910 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
1423 var arg_request = buildClearOrgPolicyRequest(); | 911 var arg_request = buildGetIamPolicyRequest(); |
1424 var arg_resource = "foo"; | 912 var arg_resource = "foo"; |
1425 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 913 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1426 var obj = new api.ClearOrgPolicyRequest.fromJson(json); | 914 var obj = new api.GetIamPolicyRequest.fromJson(json); |
1427 checkClearOrgPolicyRequest(obj); | 915 checkGetIamPolicyRequest(obj); |
1428 | 916 |
1429 var path = (req.url).path; | 917 var path = (req.url).path; |
1430 var pathOffset = 0; | 918 var pathOffset = 0; |
1431 var index; | 919 var index; |
1432 var subPart; | 920 var subPart; |
1433 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 921 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1434 pathOffset += 1; | 922 pathOffset += 1; |
1435 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 923 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
1436 pathOffset += 8; | 924 pathOffset += 8; |
1437 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 925 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
(...skipping 12 matching lines...) Expand all Loading... |
1450 for (var part in query.split("&")) { | 938 for (var part in query.split("&")) { |
1451 var keyvalue = part.split("="); | 939 var keyvalue = part.split("="); |
1452 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 940 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1453 } | 941 } |
1454 } | 942 } |
1455 | 943 |
1456 | 944 |
1457 var h = { | 945 var h = { |
1458 "content-type" : "application/json; charset=utf-8", | 946 "content-type" : "application/json; charset=utf-8", |
1459 }; | 947 }; |
1460 var resp = convert.JSON.encode(buildEmpty()); | |
1461 return new async.Future.value(stringResponse(200, h, resp)); | |
1462 }), true); | |
1463 res.clearOrgPolicyV1(arg_request, arg_resource).then(unittest.expectAsync(
((api.Empty response) { | |
1464 checkEmpty(response); | |
1465 }))); | |
1466 }); | |
1467 | |
1468 unittest.test("method--get", () { | |
1469 | |
1470 var mock = new HttpServerMock(); | |
1471 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1472 var arg_name = "foo"; | |
1473 var arg_organizationId = "foo"; | |
1474 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1475 var path = (req.url).path; | |
1476 var pathOffset = 0; | |
1477 var index; | |
1478 var subPart; | |
1479 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1480 pathOffset += 1; | |
1481 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1482 pathOffset += 8; | |
1483 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1484 | |
1485 var query = (req.url).query; | |
1486 var queryOffset = 0; | |
1487 var queryMap = {}; | |
1488 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1489 parseBool(n) { | |
1490 if (n == "true") return true; | |
1491 if (n == "false") return false; | |
1492 if (n == null) return null; | |
1493 throw new core.ArgumentError("Invalid boolean: $n"); | |
1494 } | |
1495 if (query.length > 0) { | |
1496 for (var part in query.split("&")) { | |
1497 var keyvalue = part.split("="); | |
1498 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1499 } | |
1500 } | |
1501 unittest.expect(queryMap["organizationId"].first, unittest.equals(arg_or
ganizationId)); | |
1502 | |
1503 | |
1504 var h = { | |
1505 "content-type" : "application/json; charset=utf-8", | |
1506 }; | |
1507 var resp = convert.JSON.encode(buildOrganization()); | |
1508 return new async.Future.value(stringResponse(200, h, resp)); | |
1509 }), true); | |
1510 res.get(arg_name, organizationId: arg_organizationId).then(unittest.expect
Async(((api.Organization response) { | |
1511 checkOrganization(response); | |
1512 }))); | |
1513 }); | |
1514 | |
1515 unittest.test("method--getEffectiveOrgPolicy", () { | |
1516 | |
1517 var mock = new HttpServerMock(); | |
1518 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1519 var arg_request = buildGetEffectiveOrgPolicyRequest(); | |
1520 var arg_resource = "foo"; | |
1521 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1522 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); | |
1523 checkGetEffectiveOrgPolicyRequest(obj); | |
1524 | |
1525 var path = (req.url).path; | |
1526 var pathOffset = 0; | |
1527 var index; | |
1528 var subPart; | |
1529 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1530 pathOffset += 1; | |
1531 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1532 pathOffset += 8; | |
1533 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1534 | |
1535 var query = (req.url).query; | |
1536 var queryOffset = 0; | |
1537 var queryMap = {}; | |
1538 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1539 parseBool(n) { | |
1540 if (n == "true") return true; | |
1541 if (n == "false") return false; | |
1542 if (n == null) return null; | |
1543 throw new core.ArgumentError("Invalid boolean: $n"); | |
1544 } | |
1545 if (query.length > 0) { | |
1546 for (var part in query.split("&")) { | |
1547 var keyvalue = part.split("="); | |
1548 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1549 } | |
1550 } | |
1551 | |
1552 | |
1553 var h = { | |
1554 "content-type" : "application/json; charset=utf-8", | |
1555 }; | |
1556 var resp = convert.JSON.encode(buildOrgPolicy()); | |
1557 return new async.Future.value(stringResponse(200, h, resp)); | |
1558 }), true); | |
1559 res.getEffectiveOrgPolicy(arg_request, arg_resource).then(unittest.expectA
sync(((api.OrgPolicy response) { | |
1560 checkOrgPolicy(response); | |
1561 }))); | |
1562 }); | |
1563 | |
1564 unittest.test("method--getEffectiveOrgPolicyV1", () { | |
1565 | |
1566 var mock = new HttpServerMock(); | |
1567 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1568 var arg_request = buildGetEffectiveOrgPolicyRequest(); | |
1569 var arg_resource = "foo"; | |
1570 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1571 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); | |
1572 checkGetEffectiveOrgPolicyRequest(obj); | |
1573 | |
1574 var path = (req.url).path; | |
1575 var pathOffset = 0; | |
1576 var index; | |
1577 var subPart; | |
1578 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1579 pathOffset += 1; | |
1580 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1581 pathOffset += 8; | |
1582 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1583 | |
1584 var query = (req.url).query; | |
1585 var queryOffset = 0; | |
1586 var queryMap = {}; | |
1587 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1588 parseBool(n) { | |
1589 if (n == "true") return true; | |
1590 if (n == "false") return false; | |
1591 if (n == null) return null; | |
1592 throw new core.ArgumentError("Invalid boolean: $n"); | |
1593 } | |
1594 if (query.length > 0) { | |
1595 for (var part in query.split("&")) { | |
1596 var keyvalue = part.split("="); | |
1597 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1598 } | |
1599 } | |
1600 | |
1601 | |
1602 var h = { | |
1603 "content-type" : "application/json; charset=utf-8", | |
1604 }; | |
1605 var resp = convert.JSON.encode(buildOrgPolicy()); | |
1606 return new async.Future.value(stringResponse(200, h, resp)); | |
1607 }), true); | |
1608 res.getEffectiveOrgPolicyV1(arg_request, arg_resource).then(unittest.expec
tAsync(((api.OrgPolicy response) { | |
1609 checkOrgPolicy(response); | |
1610 }))); | |
1611 }); | |
1612 | |
1613 unittest.test("method--getIamPolicy", () { | |
1614 | |
1615 var mock = new HttpServerMock(); | |
1616 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1617 var arg_request = buildGetIamPolicyRequest(); | |
1618 var arg_resource = "foo"; | |
1619 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1620 var obj = new api.GetIamPolicyRequest.fromJson(json); | |
1621 checkGetIamPolicyRequest(obj); | |
1622 | |
1623 var path = (req.url).path; | |
1624 var pathOffset = 0; | |
1625 var index; | |
1626 var subPart; | |
1627 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1628 pathOffset += 1; | |
1629 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1630 pathOffset += 8; | |
1631 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1632 | |
1633 var query = (req.url).query; | |
1634 var queryOffset = 0; | |
1635 var queryMap = {}; | |
1636 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1637 parseBool(n) { | |
1638 if (n == "true") return true; | |
1639 if (n == "false") return false; | |
1640 if (n == null) return null; | |
1641 throw new core.ArgumentError("Invalid boolean: $n"); | |
1642 } | |
1643 if (query.length > 0) { | |
1644 for (var part in query.split("&")) { | |
1645 var keyvalue = part.split("="); | |
1646 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1647 } | |
1648 } | |
1649 | |
1650 | |
1651 var h = { | |
1652 "content-type" : "application/json; charset=utf-8", | |
1653 }; | |
1654 var resp = convert.JSON.encode(buildPolicy()); | 948 var resp = convert.JSON.encode(buildPolicy()); |
1655 return new async.Future.value(stringResponse(200, h, resp)); | 949 return new async.Future.value(stringResponse(200, h, resp)); |
1656 }), true); | 950 }), true); |
1657 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 951 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
1658 checkPolicy(response); | 952 checkPolicy(response); |
1659 }))); | 953 }))); |
1660 }); | 954 }); |
1661 | 955 |
1662 unittest.test("method--getOrgPolicy", () { | |
1663 | |
1664 var mock = new HttpServerMock(); | |
1665 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1666 var arg_request = buildGetOrgPolicyRequest(); | |
1667 var arg_resource = "foo"; | |
1668 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1669 var obj = new api.GetOrgPolicyRequest.fromJson(json); | |
1670 checkGetOrgPolicyRequest(obj); | |
1671 | |
1672 var path = (req.url).path; | |
1673 var pathOffset = 0; | |
1674 var index; | |
1675 var subPart; | |
1676 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1677 pathOffset += 1; | |
1678 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1679 pathOffset += 8; | |
1680 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1681 | |
1682 var query = (req.url).query; | |
1683 var queryOffset = 0; | |
1684 var queryMap = {}; | |
1685 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1686 parseBool(n) { | |
1687 if (n == "true") return true; | |
1688 if (n == "false") return false; | |
1689 if (n == null) return null; | |
1690 throw new core.ArgumentError("Invalid boolean: $n"); | |
1691 } | |
1692 if (query.length > 0) { | |
1693 for (var part in query.split("&")) { | |
1694 var keyvalue = part.split("="); | |
1695 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1696 } | |
1697 } | |
1698 | |
1699 | |
1700 var h = { | |
1701 "content-type" : "application/json; charset=utf-8", | |
1702 }; | |
1703 var resp = convert.JSON.encode(buildOrgPolicy()); | |
1704 return new async.Future.value(stringResponse(200, h, resp)); | |
1705 }), true); | |
1706 res.getOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.OrgPolicy response) { | |
1707 checkOrgPolicy(response); | |
1708 }))); | |
1709 }); | |
1710 | |
1711 unittest.test("method--getOrgPolicyV1", () { | |
1712 | |
1713 var mock = new HttpServerMock(); | |
1714 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1715 var arg_request = buildGetOrgPolicyRequest(); | |
1716 var arg_resource = "foo"; | |
1717 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1718 var obj = new api.GetOrgPolicyRequest.fromJson(json); | |
1719 checkGetOrgPolicyRequest(obj); | |
1720 | |
1721 var path = (req.url).path; | |
1722 var pathOffset = 0; | |
1723 var index; | |
1724 var subPart; | |
1725 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1726 pathOffset += 1; | |
1727 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1728 pathOffset += 8; | |
1729 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1730 | |
1731 var query = (req.url).query; | |
1732 var queryOffset = 0; | |
1733 var queryMap = {}; | |
1734 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1735 parseBool(n) { | |
1736 if (n == "true") return true; | |
1737 if (n == "false") return false; | |
1738 if (n == null) return null; | |
1739 throw new core.ArgumentError("Invalid boolean: $n"); | |
1740 } | |
1741 if (query.length > 0) { | |
1742 for (var part in query.split("&")) { | |
1743 var keyvalue = part.split("="); | |
1744 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1745 } | |
1746 } | |
1747 | |
1748 | |
1749 var h = { | |
1750 "content-type" : "application/json; charset=utf-8", | |
1751 }; | |
1752 var resp = convert.JSON.encode(buildOrgPolicy()); | |
1753 return new async.Future.value(stringResponse(200, h, resp)); | |
1754 }), true); | |
1755 res.getOrgPolicyV1(arg_request, arg_resource).then(unittest.expectAsync(((
api.OrgPolicy response) { | |
1756 checkOrgPolicy(response); | |
1757 }))); | |
1758 }); | |
1759 | |
1760 unittest.test("method--list", () { | 956 unittest.test("method--list", () { |
1761 | 957 |
1762 var mock = new HttpServerMock(); | 958 var mock = new HttpServerMock(); |
1763 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 959 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 960 var arg_pageToken = "foo"; |
1764 var arg_pageSize = 42; | 961 var arg_pageSize = 42; |
1765 var arg_filter = "foo"; | 962 var arg_filter = "foo"; |
1766 var arg_pageToken = "foo"; | |
1767 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 963 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1768 var path = (req.url).path; | 964 var path = (req.url).path; |
1769 var pathOffset = 0; | 965 var pathOffset = 0; |
1770 var index; | 966 var index; |
1771 var subPart; | 967 var subPart; |
1772 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1773 pathOffset += 1; | 969 pathOffset += 1; |
1774 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("v1beta1/organizations")); | 970 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("v1beta1/organizations")); |
1775 pathOffset += 21; | 971 pathOffset += 21; |
1776 | 972 |
1777 var query = (req.url).query; | 973 var query = (req.url).query; |
1778 var queryOffset = 0; | 974 var queryOffset = 0; |
1779 var queryMap = {}; | 975 var queryMap = {}; |
1780 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 976 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1781 parseBool(n) { | 977 parseBool(n) { |
1782 if (n == "true") return true; | 978 if (n == "true") return true; |
1783 if (n == "false") return false; | 979 if (n == "false") return false; |
1784 if (n == null) return null; | 980 if (n == null) return null; |
1785 throw new core.ArgumentError("Invalid boolean: $n"); | 981 throw new core.ArgumentError("Invalid boolean: $n"); |
1786 } | 982 } |
1787 if (query.length > 0) { | 983 if (query.length > 0) { |
1788 for (var part in query.split("&")) { | 984 for (var part in query.split("&")) { |
1789 var keyvalue = part.split("="); | 985 var keyvalue = part.split("="); |
1790 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 986 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1791 } | 987 } |
1792 } | 988 } |
| 989 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
1793 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 990 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
1794 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 991 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
1795 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
1796 | 992 |
1797 | 993 |
1798 var h = { | 994 var h = { |
1799 "content-type" : "application/json; charset=utf-8", | 995 "content-type" : "application/json; charset=utf-8", |
1800 }; | 996 }; |
1801 var resp = convert.JSON.encode(buildListOrganizationsResponse()); | 997 var resp = convert.JSON.encode(buildListOrganizationsResponse()); |
1802 return new async.Future.value(stringResponse(200, h, resp)); | 998 return new async.Future.value(stringResponse(200, h, resp)); |
1803 }), true); | 999 }), true); |
1804 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ListOrganizationsResponse response) { | 1000 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize, filter: arg_fil
ter).then(unittest.expectAsync(((api.ListOrganizationsResponse response) { |
1805 checkListOrganizationsResponse(response); | 1001 checkListOrganizationsResponse(response); |
1806 }))); | 1002 }))); |
1807 }); | 1003 }); |
1808 | 1004 |
1809 unittest.test("method--listAvailableOrgPolicyConstraints", () { | |
1810 | |
1811 var mock = new HttpServerMock(); | |
1812 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1813 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); | |
1814 var arg_resource = "foo"; | |
1815 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1816 var obj = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json
); | |
1817 checkListAvailableOrgPolicyConstraintsRequest(obj); | |
1818 | |
1819 var path = (req.url).path; | |
1820 var pathOffset = 0; | |
1821 var index; | |
1822 var subPart; | |
1823 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1824 pathOffset += 1; | |
1825 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1826 pathOffset += 8; | |
1827 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1828 | |
1829 var query = (req.url).query; | |
1830 var queryOffset = 0; | |
1831 var queryMap = {}; | |
1832 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1833 parseBool(n) { | |
1834 if (n == "true") return true; | |
1835 if (n == "false") return false; | |
1836 if (n == null) return null; | |
1837 throw new core.ArgumentError("Invalid boolean: $n"); | |
1838 } | |
1839 if (query.length > 0) { | |
1840 for (var part in query.split("&")) { | |
1841 var keyvalue = part.split("="); | |
1842 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1843 } | |
1844 } | |
1845 | |
1846 | |
1847 var h = { | |
1848 "content-type" : "application/json; charset=utf-8", | |
1849 }; | |
1850 var resp = convert.JSON.encode(buildListAvailableOrgPolicyConstraintsRes
ponse()); | |
1851 return new async.Future.value(stringResponse(200, h, resp)); | |
1852 }), true); | |
1853 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then(unit
test.expectAsync(((api.ListAvailableOrgPolicyConstraintsResponse response) { | |
1854 checkListAvailableOrgPolicyConstraintsResponse(response); | |
1855 }))); | |
1856 }); | |
1857 | |
1858 unittest.test("method--listOrgPolicies", () { | |
1859 | |
1860 var mock = new HttpServerMock(); | |
1861 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1862 var arg_request = buildListOrgPoliciesRequest(); | |
1863 var arg_resource = "foo"; | |
1864 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1865 var obj = new api.ListOrgPoliciesRequest.fromJson(json); | |
1866 checkListOrgPoliciesRequest(obj); | |
1867 | |
1868 var path = (req.url).path; | |
1869 var pathOffset = 0; | |
1870 var index; | |
1871 var subPart; | |
1872 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1873 pathOffset += 1; | |
1874 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1875 pathOffset += 8; | |
1876 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1877 | |
1878 var query = (req.url).query; | |
1879 var queryOffset = 0; | |
1880 var queryMap = {}; | |
1881 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1882 parseBool(n) { | |
1883 if (n == "true") return true; | |
1884 if (n == "false") return false; | |
1885 if (n == null) return null; | |
1886 throw new core.ArgumentError("Invalid boolean: $n"); | |
1887 } | |
1888 if (query.length > 0) { | |
1889 for (var part in query.split("&")) { | |
1890 var keyvalue = part.split("="); | |
1891 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1892 } | |
1893 } | |
1894 | |
1895 | |
1896 var h = { | |
1897 "content-type" : "application/json; charset=utf-8", | |
1898 }; | |
1899 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); | |
1900 return new async.Future.value(stringResponse(200, h, resp)); | |
1901 }), true); | |
1902 res.listOrgPolicies(arg_request, arg_resource).then(unittest.expectAsync((
(api.ListOrgPoliciesResponse response) { | |
1903 checkListOrgPoliciesResponse(response); | |
1904 }))); | |
1905 }); | |
1906 | |
1907 unittest.test("method--setIamPolicy", () { | 1005 unittest.test("method--setIamPolicy", () { |
1908 | 1006 |
1909 var mock = new HttpServerMock(); | 1007 var mock = new HttpServerMock(); |
1910 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 1008 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
1911 var arg_request = buildSetIamPolicyRequest(); | 1009 var arg_request = buildSetIamPolicyRequest(); |
1912 var arg_resource = "foo"; | 1010 var arg_resource = "foo"; |
1913 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1914 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1012 var obj = new api.SetIamPolicyRequest.fromJson(json); |
1915 checkSetIamPolicyRequest(obj); | 1013 checkSetIamPolicyRequest(obj); |
1916 | 1014 |
(...skipping 29 matching lines...) Expand all Loading... |
1946 "content-type" : "application/json; charset=utf-8", | 1044 "content-type" : "application/json; charset=utf-8", |
1947 }; | 1045 }; |
1948 var resp = convert.JSON.encode(buildPolicy()); | 1046 var resp = convert.JSON.encode(buildPolicy()); |
1949 return new async.Future.value(stringResponse(200, h, resp)); | 1047 return new async.Future.value(stringResponse(200, h, resp)); |
1950 }), true); | 1048 }), true); |
1951 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1049 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
1952 checkPolicy(response); | 1050 checkPolicy(response); |
1953 }))); | 1051 }))); |
1954 }); | 1052 }); |
1955 | 1053 |
1956 unittest.test("method--setOrgPolicy", () { | |
1957 | |
1958 var mock = new HttpServerMock(); | |
1959 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
1960 var arg_request = buildSetOrgPolicyRequest(); | |
1961 var arg_resource = "foo"; | |
1962 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
1963 var obj = new api.SetOrgPolicyRequest.fromJson(json); | |
1964 checkSetOrgPolicyRequest(obj); | |
1965 | |
1966 var path = (req.url).path; | |
1967 var pathOffset = 0; | |
1968 var index; | |
1969 var subPart; | |
1970 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
1971 pathOffset += 1; | |
1972 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
1973 pathOffset += 8; | |
1974 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
1975 | |
1976 var query = (req.url).query; | |
1977 var queryOffset = 0; | |
1978 var queryMap = {}; | |
1979 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
1980 parseBool(n) { | |
1981 if (n == "true") return true; | |
1982 if (n == "false") return false; | |
1983 if (n == null) return null; | |
1984 throw new core.ArgumentError("Invalid boolean: $n"); | |
1985 } | |
1986 if (query.length > 0) { | |
1987 for (var part in query.split("&")) { | |
1988 var keyvalue = part.split("="); | |
1989 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
1990 } | |
1991 } | |
1992 | |
1993 | |
1994 var h = { | |
1995 "content-type" : "application/json; charset=utf-8", | |
1996 }; | |
1997 var resp = convert.JSON.encode(buildOrgPolicy()); | |
1998 return new async.Future.value(stringResponse(200, h, resp)); | |
1999 }), true); | |
2000 res.setOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.OrgPolicy response) { | |
2001 checkOrgPolicy(response); | |
2002 }))); | |
2003 }); | |
2004 | |
2005 unittest.test("method--setOrgPolicyV1", () { | |
2006 | |
2007 var mock = new HttpServerMock(); | |
2008 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | |
2009 var arg_request = buildSetOrgPolicyRequest(); | |
2010 var arg_resource = "foo"; | |
2011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | |
2012 var obj = new api.SetOrgPolicyRequest.fromJson(json); | |
2013 checkSetOrgPolicyRequest(obj); | |
2014 | |
2015 var path = (req.url).path; | |
2016 var pathOffset = 0; | |
2017 var index; | |
2018 var subPart; | |
2019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | |
2020 pathOffset += 1; | |
2021 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | |
2022 pathOffset += 8; | |
2023 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | |
2024 | |
2025 var query = (req.url).query; | |
2026 var queryOffset = 0; | |
2027 var queryMap = {}; | |
2028 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | |
2029 parseBool(n) { | |
2030 if (n == "true") return true; | |
2031 if (n == "false") return false; | |
2032 if (n == null) return null; | |
2033 throw new core.ArgumentError("Invalid boolean: $n"); | |
2034 } | |
2035 if (query.length > 0) { | |
2036 for (var part in query.split("&")) { | |
2037 var keyvalue = part.split("="); | |
2038 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | |
2039 } | |
2040 } | |
2041 | |
2042 | |
2043 var h = { | |
2044 "content-type" : "application/json; charset=utf-8", | |
2045 }; | |
2046 var resp = convert.JSON.encode(buildOrgPolicy()); | |
2047 return new async.Future.value(stringResponse(200, h, resp)); | |
2048 }), true); | |
2049 res.setOrgPolicyV1(arg_request, arg_resource).then(unittest.expectAsync(((
api.OrgPolicy response) { | |
2050 checkOrgPolicy(response); | |
2051 }))); | |
2052 }); | |
2053 | |
2054 unittest.test("method--testIamPermissions", () { | 1054 unittest.test("method--testIamPermissions", () { |
2055 | 1055 |
2056 var mock = new HttpServerMock(); | 1056 var mock = new HttpServerMock(); |
2057 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 1057 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
2058 var arg_request = buildTestIamPermissionsRequest(); | 1058 var arg_request = buildTestIamPermissionsRequest(); |
2059 var arg_resource = "foo"; | 1059 var arg_resource = "foo"; |
2060 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1060 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2061 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1061 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
2062 checkTestIamPermissionsRequest(obj); | 1062 checkTestIamPermissionsRequest(obj); |
2063 | 1063 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2403 }), true); | 1403 }), true); |
2404 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1404 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { |
2405 checkPolicy(response); | 1405 checkPolicy(response); |
2406 }))); | 1406 }))); |
2407 }); | 1407 }); |
2408 | 1408 |
2409 unittest.test("method--list", () { | 1409 unittest.test("method--list", () { |
2410 | 1410 |
2411 var mock = new HttpServerMock(); | 1411 var mock = new HttpServerMock(); |
2412 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1412 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
2413 var arg_pageSize = 42; | |
2414 var arg_filter = "foo"; | 1413 var arg_filter = "foo"; |
2415 var arg_pageToken = "foo"; | 1414 var arg_pageToken = "foo"; |
| 1415 var arg_pageSize = 42; |
2416 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1416 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
2417 var path = (req.url).path; | 1417 var path = (req.url).path; |
2418 var pathOffset = 0; | 1418 var pathOffset = 0; |
2419 var index; | 1419 var index; |
2420 var subPart; | 1420 var subPart; |
2421 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1421 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
2422 pathOffset += 1; | 1422 pathOffset += 1; |
2423 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); | 1423 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); |
2424 pathOffset += 16; | 1424 pathOffset += 16; |
2425 | 1425 |
2426 var query = (req.url).query; | 1426 var query = (req.url).query; |
2427 var queryOffset = 0; | 1427 var queryOffset = 0; |
2428 var queryMap = {}; | 1428 var queryMap = {}; |
2429 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1429 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
2430 parseBool(n) { | 1430 parseBool(n) { |
2431 if (n == "true") return true; | 1431 if (n == "true") return true; |
2432 if (n == "false") return false; | 1432 if (n == "false") return false; |
2433 if (n == null) return null; | 1433 if (n == null) return null; |
2434 throw new core.ArgumentError("Invalid boolean: $n"); | 1434 throw new core.ArgumentError("Invalid boolean: $n"); |
2435 } | 1435 } |
2436 if (query.length > 0) { | 1436 if (query.length > 0) { |
2437 for (var part in query.split("&")) { | 1437 for (var part in query.split("&")) { |
2438 var keyvalue = part.split("="); | 1438 var keyvalue = part.split("="); |
2439 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1439 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
2440 } | 1440 } |
2441 } | 1441 } |
2442 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
2443 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1442 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
2444 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1443 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1444 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
2445 | 1445 |
2446 | 1446 |
2447 var h = { | 1447 var h = { |
2448 "content-type" : "application/json; charset=utf-8", | 1448 "content-type" : "application/json; charset=utf-8", |
2449 }; | 1449 }; |
2450 var resp = convert.JSON.encode(buildListProjectsResponse()); | 1450 var resp = convert.JSON.encode(buildListProjectsResponse()); |
2451 return new async.Future.value(stringResponse(200, h, resp)); | 1451 return new async.Future.value(stringResponse(200, h, resp)); |
2452 }), true); | 1452 }), true); |
2453 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ListProjectsResponse response) { | 1453 res.list(filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync(((api.ListProjectsResponse response) { |
2454 checkListProjectsResponse(response); | 1454 checkListProjectsResponse(response); |
2455 }))); | 1455 }))); |
2456 }); | 1456 }); |
2457 | 1457 |
2458 unittest.test("method--setIamPolicy", () { | 1458 unittest.test("method--setIamPolicy", () { |
2459 | 1459 |
2460 var mock = new HttpServerMock(); | 1460 var mock = new HttpServerMock(); |
2461 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1461 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
2462 var arg_request = buildSetIamPolicyRequest(); | 1462 var arg_request = buildSetIamPolicyRequest(); |
2463 var arg_resource = "foo"; | 1463 var arg_resource = "foo"; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { | 1669 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { |
2670 checkProject(response); | 1670 checkProject(response); |
2671 }))); | 1671 }))); |
2672 }); | 1672 }); |
2673 | 1673 |
2674 }); | 1674 }); |
2675 | 1675 |
2676 | 1676 |
2677 } | 1677 } |
2678 | 1678 |
OLD | NEW |