| OLD | NEW |
| 1 library googleapis.cloudresourcemanager.v1.test; | 1 library googleapis.cloudresourcemanager.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | 4 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
| 7 | 6 |
| 8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
| 11 | 9 |
| 12 import 'package:googleapis/cloudresourcemanager/v1.dart' as api; | 10 import 'package:googleapis/cloudresourcemanager/v1.dart' as api; |
| 13 | 11 |
| 14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 13 core.Function _callback; |
| 16 core.bool _expectJson; | 14 core.bool _expectJson; |
| 17 | 15 |
| 18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 17 _callback = callback; |
| 20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
| 21 } | 19 } |
| 22 | 20 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { | 22 if (_expectJson) { |
| 25 return request.finalize() | 23 return request |
| 24 .finalize() |
| 26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
| 27 .join('') | 26 .join('') |
| 28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); | 29 return _callback(request, null); |
| 31 } else { | 30 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } | 32 } |
| 34 }); | 33 }); |
| 35 } else { | 34 } else { |
| 36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
| 37 if (stream == null) { | 36 if (stream == null) { |
| 38 return _callback(request, []); | 37 return _callback(request, []); |
| 39 } else { | 38 } else { |
| 40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 40 return _callback(request, data); |
| 42 }); | 41 }); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
| 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 51 } |
| 53 | 52 |
| 54 core.int buildCounterAncestor = 0; | 53 core.int buildCounterAncestor = 0; |
| 55 buildAncestor() { | 54 buildAncestor() { |
| 56 var o = new api.Ancestor(); | 55 var o = new api.Ancestor(); |
| 57 buildCounterAncestor++; | 56 buildCounterAncestor++; |
| 58 if (buildCounterAncestor < 3) { | 57 if (buildCounterAncestor < 3) { |
| 59 o.resourceId = buildResourceId(); | 58 o.resourceId = buildResourceId(); |
| 60 } | 59 } |
| 61 buildCounterAncestor--; | 60 buildCounterAncestor--; |
| 62 return o; | 61 return o; |
| 63 } | 62 } |
| 64 | 63 |
| 65 checkAncestor(api.Ancestor o) { | 64 checkAncestor(api.Ancestor o) { |
| 66 buildCounterAncestor++; | 65 buildCounterAncestor++; |
| 67 if (buildCounterAncestor < 3) { | 66 if (buildCounterAncestor < 3) { |
| 68 checkResourceId(o.resourceId); | 67 checkResourceId(o.resourceId); |
| 69 } | 68 } |
| 70 buildCounterAncestor--; | 69 buildCounterAncestor--; |
| 71 } | 70 } |
| 72 | 71 |
| 73 buildUnnamed1843() { | 72 buildUnnamed1841() { |
| 74 var o = new core.List<api.AuditLogConfig>(); | 73 var o = new core.List<api.AuditLogConfig>(); |
| 75 o.add(buildAuditLogConfig()); | 74 o.add(buildAuditLogConfig()); |
| 76 o.add(buildAuditLogConfig()); | 75 o.add(buildAuditLogConfig()); |
| 77 return o; | 76 return o; |
| 78 } | 77 } |
| 79 | 78 |
| 80 checkUnnamed1843(core.List<api.AuditLogConfig> o) { | 79 checkUnnamed1841(core.List<api.AuditLogConfig> o) { |
| 81 unittest.expect(o, unittest.hasLength(2)); | 80 unittest.expect(o, unittest.hasLength(2)); |
| 82 checkAuditLogConfig(o[0]); | 81 checkAuditLogConfig(o[0]); |
| 83 checkAuditLogConfig(o[1]); | 82 checkAuditLogConfig(o[1]); |
| 84 } | 83 } |
| 85 | 84 |
| 86 core.int buildCounterAuditConfig = 0; | 85 core.int buildCounterAuditConfig = 0; |
| 87 buildAuditConfig() { | 86 buildAuditConfig() { |
| 88 var o = new api.AuditConfig(); | 87 var o = new api.AuditConfig(); |
| 89 buildCounterAuditConfig++; | 88 buildCounterAuditConfig++; |
| 90 if (buildCounterAuditConfig < 3) { | 89 if (buildCounterAuditConfig < 3) { |
| 91 o.auditLogConfigs = buildUnnamed1843(); | 90 o.auditLogConfigs = buildUnnamed1841(); |
| 92 o.service = "foo"; | 91 o.service = "foo"; |
| 93 } | 92 } |
| 94 buildCounterAuditConfig--; | 93 buildCounterAuditConfig--; |
| 95 return o; | 94 return o; |
| 96 } | 95 } |
| 97 | 96 |
| 98 checkAuditConfig(api.AuditConfig o) { | 97 checkAuditConfig(api.AuditConfig o) { |
| 99 buildCounterAuditConfig++; | 98 buildCounterAuditConfig++; |
| 100 if (buildCounterAuditConfig < 3) { | 99 if (buildCounterAuditConfig < 3) { |
| 101 checkUnnamed1843(o.auditLogConfigs); | 100 checkUnnamed1841(o.auditLogConfigs); |
| 102 unittest.expect(o.service, unittest.equals('foo')); | 101 unittest.expect(o.service, unittest.equals('foo')); |
| 103 } | 102 } |
| 104 buildCounterAuditConfig--; | 103 buildCounterAuditConfig--; |
| 105 } | 104 } |
| 106 | 105 |
| 107 buildUnnamed1844() { | 106 buildUnnamed1842() { |
| 108 var o = new core.List<core.String>(); | 107 var o = new core.List<core.String>(); |
| 109 o.add("foo"); | 108 o.add("foo"); |
| 110 o.add("foo"); | 109 o.add("foo"); |
| 111 return o; | 110 return o; |
| 112 } | 111 } |
| 113 | 112 |
| 114 checkUnnamed1844(core.List<core.String> o) { | 113 checkUnnamed1842(core.List<core.String> o) { |
| 115 unittest.expect(o, unittest.hasLength(2)); | 114 unittest.expect(o, unittest.hasLength(2)); |
| 116 unittest.expect(o[0], unittest.equals('foo')); | 115 unittest.expect(o[0], unittest.equals('foo')); |
| 117 unittest.expect(o[1], unittest.equals('foo')); | 116 unittest.expect(o[1], unittest.equals('foo')); |
| 118 } | 117 } |
| 119 | 118 |
| 120 core.int buildCounterAuditLogConfig = 0; | 119 core.int buildCounterAuditLogConfig = 0; |
| 121 buildAuditLogConfig() { | 120 buildAuditLogConfig() { |
| 122 var o = new api.AuditLogConfig(); | 121 var o = new api.AuditLogConfig(); |
| 123 buildCounterAuditLogConfig++; | 122 buildCounterAuditLogConfig++; |
| 124 if (buildCounterAuditLogConfig < 3) { | 123 if (buildCounterAuditLogConfig < 3) { |
| 125 o.exemptedMembers = buildUnnamed1844(); | 124 o.exemptedMembers = buildUnnamed1842(); |
| 126 o.logType = "foo"; | 125 o.logType = "foo"; |
| 127 } | 126 } |
| 128 buildCounterAuditLogConfig--; | 127 buildCounterAuditLogConfig--; |
| 129 return o; | 128 return o; |
| 130 } | 129 } |
| 131 | 130 |
| 132 checkAuditLogConfig(api.AuditLogConfig o) { | 131 checkAuditLogConfig(api.AuditLogConfig o) { |
| 133 buildCounterAuditLogConfig++; | 132 buildCounterAuditLogConfig++; |
| 134 if (buildCounterAuditLogConfig < 3) { | 133 if (buildCounterAuditLogConfig < 3) { |
| 135 checkUnnamed1844(o.exemptedMembers); | 134 checkUnnamed1842(o.exemptedMembers); |
| 136 unittest.expect(o.logType, unittest.equals('foo')); | 135 unittest.expect(o.logType, unittest.equals('foo')); |
| 137 } | 136 } |
| 138 buildCounterAuditLogConfig--; | 137 buildCounterAuditLogConfig--; |
| 139 } | 138 } |
| 140 | 139 |
| 141 buildUnnamed1845() { | 140 buildUnnamed1843() { |
| 142 var o = new core.List<core.String>(); | 141 var o = new core.List<core.String>(); |
| 143 o.add("foo"); | 142 o.add("foo"); |
| 144 o.add("foo"); | 143 o.add("foo"); |
| 145 return o; | 144 return o; |
| 146 } | 145 } |
| 147 | 146 |
| 148 checkUnnamed1845(core.List<core.String> o) { | 147 checkUnnamed1843(core.List<core.String> o) { |
| 149 unittest.expect(o, unittest.hasLength(2)); | 148 unittest.expect(o, unittest.hasLength(2)); |
| 150 unittest.expect(o[0], unittest.equals('foo')); | 149 unittest.expect(o[0], unittest.equals('foo')); |
| 151 unittest.expect(o[1], unittest.equals('foo')); | 150 unittest.expect(o[1], unittest.equals('foo')); |
| 152 } | 151 } |
| 153 | 152 |
| 154 core.int buildCounterBinding = 0; | 153 core.int buildCounterBinding = 0; |
| 155 buildBinding() { | 154 buildBinding() { |
| 156 var o = new api.Binding(); | 155 var o = new api.Binding(); |
| 157 buildCounterBinding++; | 156 buildCounterBinding++; |
| 158 if (buildCounterBinding < 3) { | 157 if (buildCounterBinding < 3) { |
| 159 o.members = buildUnnamed1845(); | 158 o.members = buildUnnamed1843(); |
| 160 o.role = "foo"; | 159 o.role = "foo"; |
| 161 } | 160 } |
| 162 buildCounterBinding--; | 161 buildCounterBinding--; |
| 163 return o; | 162 return o; |
| 164 } | 163 } |
| 165 | 164 |
| 166 checkBinding(api.Binding o) { | 165 checkBinding(api.Binding o) { |
| 167 buildCounterBinding++; | 166 buildCounterBinding++; |
| 168 if (buildCounterBinding < 3) { | 167 if (buildCounterBinding < 3) { |
| 169 checkUnnamed1845(o.members); | 168 checkUnnamed1843(o.members); |
| 170 unittest.expect(o.role, unittest.equals('foo')); | 169 unittest.expect(o.role, unittest.equals('foo')); |
| 171 } | 170 } |
| 172 buildCounterBinding--; | 171 buildCounterBinding--; |
| 173 } | 172 } |
| 174 | 173 |
| 175 core.int buildCounterBooleanConstraint = 0; | 174 core.int buildCounterBooleanConstraint = 0; |
| 176 buildBooleanConstraint() { | 175 buildBooleanConstraint() { |
| 177 var o = new api.BooleanConstraint(); | 176 var o = new api.BooleanConstraint(); |
| 178 buildCounterBooleanConstraint++; | 177 buildCounterBooleanConstraint++; |
| 179 if (buildCounterBooleanConstraint < 3) { | 178 if (buildCounterBooleanConstraint < 3) {} |
| 180 } | |
| 181 buildCounterBooleanConstraint--; | 179 buildCounterBooleanConstraint--; |
| 182 return o; | 180 return o; |
| 183 } | 181 } |
| 184 | 182 |
| 185 checkBooleanConstraint(api.BooleanConstraint o) { | 183 checkBooleanConstraint(api.BooleanConstraint o) { |
| 186 buildCounterBooleanConstraint++; | 184 buildCounterBooleanConstraint++; |
| 187 if (buildCounterBooleanConstraint < 3) { | 185 if (buildCounterBooleanConstraint < 3) {} |
| 188 } | |
| 189 buildCounterBooleanConstraint--; | 186 buildCounterBooleanConstraint--; |
| 190 } | 187 } |
| 191 | 188 |
| 192 core.int buildCounterBooleanPolicy = 0; | 189 core.int buildCounterBooleanPolicy = 0; |
| 193 buildBooleanPolicy() { | 190 buildBooleanPolicy() { |
| 194 var o = new api.BooleanPolicy(); | 191 var o = new api.BooleanPolicy(); |
| 195 buildCounterBooleanPolicy++; | 192 buildCounterBooleanPolicy++; |
| 196 if (buildCounterBooleanPolicy < 3) { | 193 if (buildCounterBooleanPolicy < 3) { |
| 197 o.enforced = true; | 194 o.enforced = true; |
| 198 } | 195 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 unittest.expect(o.name, unittest.equals('foo')); | 254 unittest.expect(o.name, unittest.equals('foo')); |
| 258 unittest.expect(o.version, unittest.equals(42)); | 255 unittest.expect(o.version, unittest.equals(42)); |
| 259 } | 256 } |
| 260 buildCounterConstraint--; | 257 buildCounterConstraint--; |
| 261 } | 258 } |
| 262 | 259 |
| 263 core.int buildCounterEmpty = 0; | 260 core.int buildCounterEmpty = 0; |
| 264 buildEmpty() { | 261 buildEmpty() { |
| 265 var o = new api.Empty(); | 262 var o = new api.Empty(); |
| 266 buildCounterEmpty++; | 263 buildCounterEmpty++; |
| 267 if (buildCounterEmpty < 3) { | 264 if (buildCounterEmpty < 3) {} |
| 268 } | |
| 269 buildCounterEmpty--; | 265 buildCounterEmpty--; |
| 270 return o; | 266 return o; |
| 271 } | 267 } |
| 272 | 268 |
| 273 checkEmpty(api.Empty o) { | 269 checkEmpty(api.Empty o) { |
| 274 buildCounterEmpty++; | 270 buildCounterEmpty++; |
| 275 if (buildCounterEmpty < 3) { | 271 if (buildCounterEmpty < 3) {} |
| 276 } | |
| 277 buildCounterEmpty--; | 272 buildCounterEmpty--; |
| 278 } | 273 } |
| 279 | 274 |
| 280 core.int buildCounterFolderOperation = 0; | 275 core.int buildCounterFolderOperation = 0; |
| 281 buildFolderOperation() { | 276 buildFolderOperation() { |
| 282 var o = new api.FolderOperation(); | 277 var o = new api.FolderOperation(); |
| 283 buildCounterFolderOperation++; | 278 buildCounterFolderOperation++; |
| 284 if (buildCounterFolderOperation < 3) { | 279 if (buildCounterFolderOperation < 3) { |
| 285 o.destinationParent = "foo"; | 280 o.destinationParent = "foo"; |
| 286 o.displayName = "foo"; | 281 o.displayName = "foo"; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 if (buildCounterFolderOperationError < 3) { | 313 if (buildCounterFolderOperationError < 3) { |
| 319 unittest.expect(o.errorMessageId, unittest.equals('foo')); | 314 unittest.expect(o.errorMessageId, unittest.equals('foo')); |
| 320 } | 315 } |
| 321 buildCounterFolderOperationError--; | 316 buildCounterFolderOperationError--; |
| 322 } | 317 } |
| 323 | 318 |
| 324 core.int buildCounterGetAncestryRequest = 0; | 319 core.int buildCounterGetAncestryRequest = 0; |
| 325 buildGetAncestryRequest() { | 320 buildGetAncestryRequest() { |
| 326 var o = new api.GetAncestryRequest(); | 321 var o = new api.GetAncestryRequest(); |
| 327 buildCounterGetAncestryRequest++; | 322 buildCounterGetAncestryRequest++; |
| 328 if (buildCounterGetAncestryRequest < 3) { | 323 if (buildCounterGetAncestryRequest < 3) {} |
| 329 } | |
| 330 buildCounterGetAncestryRequest--; | 324 buildCounterGetAncestryRequest--; |
| 331 return o; | 325 return o; |
| 332 } | 326 } |
| 333 | 327 |
| 334 checkGetAncestryRequest(api.GetAncestryRequest o) { | 328 checkGetAncestryRequest(api.GetAncestryRequest o) { |
| 335 buildCounterGetAncestryRequest++; | 329 buildCounterGetAncestryRequest++; |
| 336 if (buildCounterGetAncestryRequest < 3) { | 330 if (buildCounterGetAncestryRequest < 3) {} |
| 337 } | |
| 338 buildCounterGetAncestryRequest--; | 331 buildCounterGetAncestryRequest--; |
| 339 } | 332 } |
| 340 | 333 |
| 341 buildUnnamed1846() { | 334 buildUnnamed1844() { |
| 342 var o = new core.List<api.Ancestor>(); | 335 var o = new core.List<api.Ancestor>(); |
| 343 o.add(buildAncestor()); | 336 o.add(buildAncestor()); |
| 344 o.add(buildAncestor()); | 337 o.add(buildAncestor()); |
| 345 return o; | 338 return o; |
| 346 } | 339 } |
| 347 | 340 |
| 348 checkUnnamed1846(core.List<api.Ancestor> o) { | 341 checkUnnamed1844(core.List<api.Ancestor> o) { |
| 349 unittest.expect(o, unittest.hasLength(2)); | 342 unittest.expect(o, unittest.hasLength(2)); |
| 350 checkAncestor(o[0]); | 343 checkAncestor(o[0]); |
| 351 checkAncestor(o[1]); | 344 checkAncestor(o[1]); |
| 352 } | 345 } |
| 353 | 346 |
| 354 core.int buildCounterGetAncestryResponse = 0; | 347 core.int buildCounterGetAncestryResponse = 0; |
| 355 buildGetAncestryResponse() { | 348 buildGetAncestryResponse() { |
| 356 var o = new api.GetAncestryResponse(); | 349 var o = new api.GetAncestryResponse(); |
| 357 buildCounterGetAncestryResponse++; | 350 buildCounterGetAncestryResponse++; |
| 358 if (buildCounterGetAncestryResponse < 3) { | 351 if (buildCounterGetAncestryResponse < 3) { |
| 359 o.ancestor = buildUnnamed1846(); | 352 o.ancestor = buildUnnamed1844(); |
| 360 } | 353 } |
| 361 buildCounterGetAncestryResponse--; | 354 buildCounterGetAncestryResponse--; |
| 362 return o; | 355 return o; |
| 363 } | 356 } |
| 364 | 357 |
| 365 checkGetAncestryResponse(api.GetAncestryResponse o) { | 358 checkGetAncestryResponse(api.GetAncestryResponse o) { |
| 366 buildCounterGetAncestryResponse++; | 359 buildCounterGetAncestryResponse++; |
| 367 if (buildCounterGetAncestryResponse < 3) { | 360 if (buildCounterGetAncestryResponse < 3) { |
| 368 checkUnnamed1846(o.ancestor); | 361 checkUnnamed1844(o.ancestor); |
| 369 } | 362 } |
| 370 buildCounterGetAncestryResponse--; | 363 buildCounterGetAncestryResponse--; |
| 371 } | 364 } |
| 372 | 365 |
| 373 core.int buildCounterGetEffectiveOrgPolicyRequest = 0; | 366 core.int buildCounterGetEffectiveOrgPolicyRequest = 0; |
| 374 buildGetEffectiveOrgPolicyRequest() { | 367 buildGetEffectiveOrgPolicyRequest() { |
| 375 var o = new api.GetEffectiveOrgPolicyRequest(); | 368 var o = new api.GetEffectiveOrgPolicyRequest(); |
| 376 buildCounterGetEffectiveOrgPolicyRequest++; | 369 buildCounterGetEffectiveOrgPolicyRequest++; |
| 377 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { | 370 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { |
| 378 o.constraint = "foo"; | 371 o.constraint = "foo"; |
| 379 } | 372 } |
| 380 buildCounterGetEffectiveOrgPolicyRequest--; | 373 buildCounterGetEffectiveOrgPolicyRequest--; |
| 381 return o; | 374 return o; |
| 382 } | 375 } |
| 383 | 376 |
| 384 checkGetEffectiveOrgPolicyRequest(api.GetEffectiveOrgPolicyRequest o) { | 377 checkGetEffectiveOrgPolicyRequest(api.GetEffectiveOrgPolicyRequest o) { |
| 385 buildCounterGetEffectiveOrgPolicyRequest++; | 378 buildCounterGetEffectiveOrgPolicyRequest++; |
| 386 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { | 379 if (buildCounterGetEffectiveOrgPolicyRequest < 3) { |
| 387 unittest.expect(o.constraint, unittest.equals('foo')); | 380 unittest.expect(o.constraint, unittest.equals('foo')); |
| 388 } | 381 } |
| 389 buildCounterGetEffectiveOrgPolicyRequest--; | 382 buildCounterGetEffectiveOrgPolicyRequest--; |
| 390 } | 383 } |
| 391 | 384 |
| 392 core.int buildCounterGetIamPolicyRequest = 0; | 385 core.int buildCounterGetIamPolicyRequest = 0; |
| 393 buildGetIamPolicyRequest() { | 386 buildGetIamPolicyRequest() { |
| 394 var o = new api.GetIamPolicyRequest(); | 387 var o = new api.GetIamPolicyRequest(); |
| 395 buildCounterGetIamPolicyRequest++; | 388 buildCounterGetIamPolicyRequest++; |
| 396 if (buildCounterGetIamPolicyRequest < 3) { | 389 if (buildCounterGetIamPolicyRequest < 3) {} |
| 397 } | |
| 398 buildCounterGetIamPolicyRequest--; | 390 buildCounterGetIamPolicyRequest--; |
| 399 return o; | 391 return o; |
| 400 } | 392 } |
| 401 | 393 |
| 402 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { | 394 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| 403 buildCounterGetIamPolicyRequest++; | 395 buildCounterGetIamPolicyRequest++; |
| 404 if (buildCounterGetIamPolicyRequest < 3) { | 396 if (buildCounterGetIamPolicyRequest < 3) {} |
| 405 } | |
| 406 buildCounterGetIamPolicyRequest--; | 397 buildCounterGetIamPolicyRequest--; |
| 407 } | 398 } |
| 408 | 399 |
| 409 core.int buildCounterGetOrgPolicyRequest = 0; | 400 core.int buildCounterGetOrgPolicyRequest = 0; |
| 410 buildGetOrgPolicyRequest() { | 401 buildGetOrgPolicyRequest() { |
| 411 var o = new api.GetOrgPolicyRequest(); | 402 var o = new api.GetOrgPolicyRequest(); |
| 412 buildCounterGetOrgPolicyRequest++; | 403 buildCounterGetOrgPolicyRequest++; |
| 413 if (buildCounterGetOrgPolicyRequest < 3) { | 404 if (buildCounterGetOrgPolicyRequest < 3) { |
| 414 o.constraint = "foo"; | 405 o.constraint = "foo"; |
| 415 } | 406 } |
| 416 buildCounterGetOrgPolicyRequest--; | 407 buildCounterGetOrgPolicyRequest--; |
| 417 return o; | 408 return o; |
| 418 } | 409 } |
| 419 | 410 |
| 420 checkGetOrgPolicyRequest(api.GetOrgPolicyRequest o) { | 411 checkGetOrgPolicyRequest(api.GetOrgPolicyRequest o) { |
| 421 buildCounterGetOrgPolicyRequest++; | 412 buildCounterGetOrgPolicyRequest++; |
| 422 if (buildCounterGetOrgPolicyRequest < 3) { | 413 if (buildCounterGetOrgPolicyRequest < 3) { |
| 423 unittest.expect(o.constraint, unittest.equals('foo')); | 414 unittest.expect(o.constraint, unittest.equals('foo')); |
| 424 } | 415 } |
| 425 buildCounterGetOrgPolicyRequest--; | 416 buildCounterGetOrgPolicyRequest--; |
| 426 } | 417 } |
| 427 | 418 |
| 428 buildUnnamed1847() { | 419 buildUnnamed1845() { |
| 429 var o = new core.List<core.String>(); | 420 var o = new core.List<core.String>(); |
| 430 o.add("foo"); | 421 o.add("foo"); |
| 431 o.add("foo"); | 422 o.add("foo"); |
| 432 return o; | 423 return o; |
| 433 } | 424 } |
| 434 | 425 |
| 435 checkUnnamed1847(core.List<core.String> o) { | 426 checkUnnamed1845(core.List<core.String> o) { |
| 436 unittest.expect(o, unittest.hasLength(2)); | 427 unittest.expect(o, unittest.hasLength(2)); |
| 437 unittest.expect(o[0], unittest.equals('foo')); | 428 unittest.expect(o[0], unittest.equals('foo')); |
| 438 unittest.expect(o[1], unittest.equals('foo')); | 429 unittest.expect(o[1], unittest.equals('foo')); |
| 439 } | 430 } |
| 440 | 431 |
| 441 core.int buildCounterLien = 0; | 432 core.int buildCounterLien = 0; |
| 442 buildLien() { | 433 buildLien() { |
| 443 var o = new api.Lien(); | 434 var o = new api.Lien(); |
| 444 buildCounterLien++; | 435 buildCounterLien++; |
| 445 if (buildCounterLien < 3) { | 436 if (buildCounterLien < 3) { |
| 446 o.createTime = "foo"; | 437 o.createTime = "foo"; |
| 447 o.name = "foo"; | 438 o.name = "foo"; |
| 448 o.origin = "foo"; | 439 o.origin = "foo"; |
| 449 o.parent = "foo"; | 440 o.parent = "foo"; |
| 450 o.reason = "foo"; | 441 o.reason = "foo"; |
| 451 o.restrictions = buildUnnamed1847(); | 442 o.restrictions = buildUnnamed1845(); |
| 452 } | 443 } |
| 453 buildCounterLien--; | 444 buildCounterLien--; |
| 454 return o; | 445 return o; |
| 455 } | 446 } |
| 456 | 447 |
| 457 checkLien(api.Lien o) { | 448 checkLien(api.Lien o) { |
| 458 buildCounterLien++; | 449 buildCounterLien++; |
| 459 if (buildCounterLien < 3) { | 450 if (buildCounterLien < 3) { |
| 460 unittest.expect(o.createTime, unittest.equals('foo')); | 451 unittest.expect(o.createTime, unittest.equals('foo')); |
| 461 unittest.expect(o.name, unittest.equals('foo')); | 452 unittest.expect(o.name, unittest.equals('foo')); |
| 462 unittest.expect(o.origin, unittest.equals('foo')); | 453 unittest.expect(o.origin, unittest.equals('foo')); |
| 463 unittest.expect(o.parent, unittest.equals('foo')); | 454 unittest.expect(o.parent, unittest.equals('foo')); |
| 464 unittest.expect(o.reason, unittest.equals('foo')); | 455 unittest.expect(o.reason, unittest.equals('foo')); |
| 465 checkUnnamed1847(o.restrictions); | 456 checkUnnamed1845(o.restrictions); |
| 466 } | 457 } |
| 467 buildCounterLien--; | 458 buildCounterLien--; |
| 468 } | 459 } |
| 469 | 460 |
| 470 core.int buildCounterListAvailableOrgPolicyConstraintsRequest = 0; | 461 core.int buildCounterListAvailableOrgPolicyConstraintsRequest = 0; |
| 471 buildListAvailableOrgPolicyConstraintsRequest() { | 462 buildListAvailableOrgPolicyConstraintsRequest() { |
| 472 var o = new api.ListAvailableOrgPolicyConstraintsRequest(); | 463 var o = new api.ListAvailableOrgPolicyConstraintsRequest(); |
| 473 buildCounterListAvailableOrgPolicyConstraintsRequest++; | 464 buildCounterListAvailableOrgPolicyConstraintsRequest++; |
| 474 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { | 465 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { |
| 475 o.pageSize = 42; | 466 o.pageSize = 42; |
| 476 o.pageToken = "foo"; | 467 o.pageToken = "foo"; |
| 477 } | 468 } |
| 478 buildCounterListAvailableOrgPolicyConstraintsRequest--; | 469 buildCounterListAvailableOrgPolicyConstraintsRequest--; |
| 479 return o; | 470 return o; |
| 480 } | 471 } |
| 481 | 472 |
| 482 checkListAvailableOrgPolicyConstraintsRequest(api.ListAvailableOrgPolicyConstrai
ntsRequest o) { | 473 checkListAvailableOrgPolicyConstraintsRequest( |
| 474 api.ListAvailableOrgPolicyConstraintsRequest o) { |
| 483 buildCounterListAvailableOrgPolicyConstraintsRequest++; | 475 buildCounterListAvailableOrgPolicyConstraintsRequest++; |
| 484 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { | 476 if (buildCounterListAvailableOrgPolicyConstraintsRequest < 3) { |
| 485 unittest.expect(o.pageSize, unittest.equals(42)); | 477 unittest.expect(o.pageSize, unittest.equals(42)); |
| 486 unittest.expect(o.pageToken, unittest.equals('foo')); | 478 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 487 } | 479 } |
| 488 buildCounterListAvailableOrgPolicyConstraintsRequest--; | 480 buildCounterListAvailableOrgPolicyConstraintsRequest--; |
| 489 } | 481 } |
| 490 | 482 |
| 491 buildUnnamed1848() { | 483 buildUnnamed1846() { |
| 492 var o = new core.List<api.Constraint>(); | 484 var o = new core.List<api.Constraint>(); |
| 493 o.add(buildConstraint()); | 485 o.add(buildConstraint()); |
| 494 o.add(buildConstraint()); | 486 o.add(buildConstraint()); |
| 495 return o; | 487 return o; |
| 496 } | 488 } |
| 497 | 489 |
| 498 checkUnnamed1848(core.List<api.Constraint> o) { | 490 checkUnnamed1846(core.List<api.Constraint> o) { |
| 499 unittest.expect(o, unittest.hasLength(2)); | 491 unittest.expect(o, unittest.hasLength(2)); |
| 500 checkConstraint(o[0]); | 492 checkConstraint(o[0]); |
| 501 checkConstraint(o[1]); | 493 checkConstraint(o[1]); |
| 502 } | 494 } |
| 503 | 495 |
| 504 core.int buildCounterListAvailableOrgPolicyConstraintsResponse = 0; | 496 core.int buildCounterListAvailableOrgPolicyConstraintsResponse = 0; |
| 505 buildListAvailableOrgPolicyConstraintsResponse() { | 497 buildListAvailableOrgPolicyConstraintsResponse() { |
| 506 var o = new api.ListAvailableOrgPolicyConstraintsResponse(); | 498 var o = new api.ListAvailableOrgPolicyConstraintsResponse(); |
| 507 buildCounterListAvailableOrgPolicyConstraintsResponse++; | 499 buildCounterListAvailableOrgPolicyConstraintsResponse++; |
| 508 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { | 500 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { |
| 509 o.constraints = buildUnnamed1848(); | 501 o.constraints = buildUnnamed1846(); |
| 510 o.nextPageToken = "foo"; | 502 o.nextPageToken = "foo"; |
| 511 } | 503 } |
| 512 buildCounterListAvailableOrgPolicyConstraintsResponse--; | 504 buildCounterListAvailableOrgPolicyConstraintsResponse--; |
| 513 return o; | 505 return o; |
| 514 } | 506 } |
| 515 | 507 |
| 516 checkListAvailableOrgPolicyConstraintsResponse(api.ListAvailableOrgPolicyConstra
intsResponse o) { | 508 checkListAvailableOrgPolicyConstraintsResponse( |
| 509 api.ListAvailableOrgPolicyConstraintsResponse o) { |
| 517 buildCounterListAvailableOrgPolicyConstraintsResponse++; | 510 buildCounterListAvailableOrgPolicyConstraintsResponse++; |
| 518 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { | 511 if (buildCounterListAvailableOrgPolicyConstraintsResponse < 3) { |
| 519 checkUnnamed1848(o.constraints); | 512 checkUnnamed1846(o.constraints); |
| 520 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 513 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 521 } | 514 } |
| 522 buildCounterListAvailableOrgPolicyConstraintsResponse--; | 515 buildCounterListAvailableOrgPolicyConstraintsResponse--; |
| 523 } | 516 } |
| 524 | 517 |
| 525 core.int buildCounterListConstraint = 0; | 518 core.int buildCounterListConstraint = 0; |
| 526 buildListConstraint() { | 519 buildListConstraint() { |
| 527 var o = new api.ListConstraint(); | 520 var o = new api.ListConstraint(); |
| 528 buildCounterListConstraint++; | 521 buildCounterListConstraint++; |
| 529 if (buildCounterListConstraint < 3) { | 522 if (buildCounterListConstraint < 3) { |
| 530 o.suggestedValue = "foo"; | 523 o.suggestedValue = "foo"; |
| 531 } | 524 } |
| 532 buildCounterListConstraint--; | 525 buildCounterListConstraint--; |
| 533 return o; | 526 return o; |
| 534 } | 527 } |
| 535 | 528 |
| 536 checkListConstraint(api.ListConstraint o) { | 529 checkListConstraint(api.ListConstraint o) { |
| 537 buildCounterListConstraint++; | 530 buildCounterListConstraint++; |
| 538 if (buildCounterListConstraint < 3) { | 531 if (buildCounterListConstraint < 3) { |
| 539 unittest.expect(o.suggestedValue, unittest.equals('foo')); | 532 unittest.expect(o.suggestedValue, unittest.equals('foo')); |
| 540 } | 533 } |
| 541 buildCounterListConstraint--; | 534 buildCounterListConstraint--; |
| 542 } | 535 } |
| 543 | 536 |
| 544 buildUnnamed1849() { | 537 buildUnnamed1847() { |
| 545 var o = new core.List<api.Lien>(); | 538 var o = new core.List<api.Lien>(); |
| 546 o.add(buildLien()); | 539 o.add(buildLien()); |
| 547 o.add(buildLien()); | 540 o.add(buildLien()); |
| 548 return o; | 541 return o; |
| 549 } | 542 } |
| 550 | 543 |
| 551 checkUnnamed1849(core.List<api.Lien> o) { | 544 checkUnnamed1847(core.List<api.Lien> o) { |
| 552 unittest.expect(o, unittest.hasLength(2)); | 545 unittest.expect(o, unittest.hasLength(2)); |
| 553 checkLien(o[0]); | 546 checkLien(o[0]); |
| 554 checkLien(o[1]); | 547 checkLien(o[1]); |
| 555 } | 548 } |
| 556 | 549 |
| 557 core.int buildCounterListLiensResponse = 0; | 550 core.int buildCounterListLiensResponse = 0; |
| 558 buildListLiensResponse() { | 551 buildListLiensResponse() { |
| 559 var o = new api.ListLiensResponse(); | 552 var o = new api.ListLiensResponse(); |
| 560 buildCounterListLiensResponse++; | 553 buildCounterListLiensResponse++; |
| 561 if (buildCounterListLiensResponse < 3) { | 554 if (buildCounterListLiensResponse < 3) { |
| 562 o.liens = buildUnnamed1849(); | 555 o.liens = buildUnnamed1847(); |
| 563 o.nextPageToken = "foo"; | 556 o.nextPageToken = "foo"; |
| 564 } | 557 } |
| 565 buildCounterListLiensResponse--; | 558 buildCounterListLiensResponse--; |
| 566 return o; | 559 return o; |
| 567 } | 560 } |
| 568 | 561 |
| 569 checkListLiensResponse(api.ListLiensResponse o) { | 562 checkListLiensResponse(api.ListLiensResponse o) { |
| 570 buildCounterListLiensResponse++; | 563 buildCounterListLiensResponse++; |
| 571 if (buildCounterListLiensResponse < 3) { | 564 if (buildCounterListLiensResponse < 3) { |
| 572 checkUnnamed1849(o.liens); | 565 checkUnnamed1847(o.liens); |
| 573 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 566 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 574 } | 567 } |
| 575 buildCounterListLiensResponse--; | 568 buildCounterListLiensResponse--; |
| 576 } | 569 } |
| 577 | 570 |
| 578 core.int buildCounterListOrgPoliciesRequest = 0; | 571 core.int buildCounterListOrgPoliciesRequest = 0; |
| 579 buildListOrgPoliciesRequest() { | 572 buildListOrgPoliciesRequest() { |
| 580 var o = new api.ListOrgPoliciesRequest(); | 573 var o = new api.ListOrgPoliciesRequest(); |
| 581 buildCounterListOrgPoliciesRequest++; | 574 buildCounterListOrgPoliciesRequest++; |
| 582 if (buildCounterListOrgPoliciesRequest < 3) { | 575 if (buildCounterListOrgPoliciesRequest < 3) { |
| 583 o.pageSize = 42; | 576 o.pageSize = 42; |
| 584 o.pageToken = "foo"; | 577 o.pageToken = "foo"; |
| 585 } | 578 } |
| 586 buildCounterListOrgPoliciesRequest--; | 579 buildCounterListOrgPoliciesRequest--; |
| 587 return o; | 580 return o; |
| 588 } | 581 } |
| 589 | 582 |
| 590 checkListOrgPoliciesRequest(api.ListOrgPoliciesRequest o) { | 583 checkListOrgPoliciesRequest(api.ListOrgPoliciesRequest o) { |
| 591 buildCounterListOrgPoliciesRequest++; | 584 buildCounterListOrgPoliciesRequest++; |
| 592 if (buildCounterListOrgPoliciesRequest < 3) { | 585 if (buildCounterListOrgPoliciesRequest < 3) { |
| 593 unittest.expect(o.pageSize, unittest.equals(42)); | 586 unittest.expect(o.pageSize, unittest.equals(42)); |
| 594 unittest.expect(o.pageToken, unittest.equals('foo')); | 587 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 595 } | 588 } |
| 596 buildCounterListOrgPoliciesRequest--; | 589 buildCounterListOrgPoliciesRequest--; |
| 597 } | 590 } |
| 598 | 591 |
| 599 buildUnnamed1850() { | 592 buildUnnamed1848() { |
| 600 var o = new core.List<api.OrgPolicy>(); | 593 var o = new core.List<api.OrgPolicy>(); |
| 601 o.add(buildOrgPolicy()); | 594 o.add(buildOrgPolicy()); |
| 602 o.add(buildOrgPolicy()); | 595 o.add(buildOrgPolicy()); |
| 603 return o; | 596 return o; |
| 604 } | 597 } |
| 605 | 598 |
| 606 checkUnnamed1850(core.List<api.OrgPolicy> o) { | 599 checkUnnamed1848(core.List<api.OrgPolicy> o) { |
| 607 unittest.expect(o, unittest.hasLength(2)); | 600 unittest.expect(o, unittest.hasLength(2)); |
| 608 checkOrgPolicy(o[0]); | 601 checkOrgPolicy(o[0]); |
| 609 checkOrgPolicy(o[1]); | 602 checkOrgPolicy(o[1]); |
| 610 } | 603 } |
| 611 | 604 |
| 612 core.int buildCounterListOrgPoliciesResponse = 0; | 605 core.int buildCounterListOrgPoliciesResponse = 0; |
| 613 buildListOrgPoliciesResponse() { | 606 buildListOrgPoliciesResponse() { |
| 614 var o = new api.ListOrgPoliciesResponse(); | 607 var o = new api.ListOrgPoliciesResponse(); |
| 615 buildCounterListOrgPoliciesResponse++; | 608 buildCounterListOrgPoliciesResponse++; |
| 616 if (buildCounterListOrgPoliciesResponse < 3) { | 609 if (buildCounterListOrgPoliciesResponse < 3) { |
| 617 o.nextPageToken = "foo"; | 610 o.nextPageToken = "foo"; |
| 618 o.policies = buildUnnamed1850(); | 611 o.policies = buildUnnamed1848(); |
| 619 } | 612 } |
| 620 buildCounterListOrgPoliciesResponse--; | 613 buildCounterListOrgPoliciesResponse--; |
| 621 return o; | 614 return o; |
| 622 } | 615 } |
| 623 | 616 |
| 624 checkListOrgPoliciesResponse(api.ListOrgPoliciesResponse o) { | 617 checkListOrgPoliciesResponse(api.ListOrgPoliciesResponse o) { |
| 625 buildCounterListOrgPoliciesResponse++; | 618 buildCounterListOrgPoliciesResponse++; |
| 626 if (buildCounterListOrgPoliciesResponse < 3) { | 619 if (buildCounterListOrgPoliciesResponse < 3) { |
| 627 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 620 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 628 checkUnnamed1850(o.policies); | 621 checkUnnamed1848(o.policies); |
| 629 } | 622 } |
| 630 buildCounterListOrgPoliciesResponse--; | 623 buildCounterListOrgPoliciesResponse--; |
| 631 } | 624 } |
| 632 | 625 |
| 633 buildUnnamed1851() { | 626 buildUnnamed1849() { |
| 634 var o = new core.List<core.String>(); | 627 var o = new core.List<core.String>(); |
| 635 o.add("foo"); | 628 o.add("foo"); |
| 636 o.add("foo"); | 629 o.add("foo"); |
| 637 return o; | 630 return o; |
| 638 } | 631 } |
| 639 | 632 |
| 640 checkUnnamed1851(core.List<core.String> o) { | 633 checkUnnamed1849(core.List<core.String> o) { |
| 641 unittest.expect(o, unittest.hasLength(2)); | 634 unittest.expect(o, unittest.hasLength(2)); |
| 642 unittest.expect(o[0], unittest.equals('foo')); | 635 unittest.expect(o[0], unittest.equals('foo')); |
| 643 unittest.expect(o[1], unittest.equals('foo')); | 636 unittest.expect(o[1], unittest.equals('foo')); |
| 644 } | 637 } |
| 645 | 638 |
| 646 buildUnnamed1852() { | 639 buildUnnamed1850() { |
| 647 var o = new core.List<core.String>(); | 640 var o = new core.List<core.String>(); |
| 648 o.add("foo"); | 641 o.add("foo"); |
| 649 o.add("foo"); | 642 o.add("foo"); |
| 650 return o; | 643 return o; |
| 651 } | 644 } |
| 652 | 645 |
| 653 checkUnnamed1852(core.List<core.String> o) { | 646 checkUnnamed1850(core.List<core.String> o) { |
| 654 unittest.expect(o, unittest.hasLength(2)); | 647 unittest.expect(o, unittest.hasLength(2)); |
| 655 unittest.expect(o[0], unittest.equals('foo')); | 648 unittest.expect(o[0], unittest.equals('foo')); |
| 656 unittest.expect(o[1], unittest.equals('foo')); | 649 unittest.expect(o[1], unittest.equals('foo')); |
| 657 } | 650 } |
| 658 | 651 |
| 659 core.int buildCounterListPolicy = 0; | 652 core.int buildCounterListPolicy = 0; |
| 660 buildListPolicy() { | 653 buildListPolicy() { |
| 661 var o = new api.ListPolicy(); | 654 var o = new api.ListPolicy(); |
| 662 buildCounterListPolicy++; | 655 buildCounterListPolicy++; |
| 663 if (buildCounterListPolicy < 3) { | 656 if (buildCounterListPolicy < 3) { |
| 664 o.allValues = "foo"; | 657 o.allValues = "foo"; |
| 665 o.allowedValues = buildUnnamed1851(); | 658 o.allowedValues = buildUnnamed1849(); |
| 666 o.deniedValues = buildUnnamed1852(); | 659 o.deniedValues = buildUnnamed1850(); |
| 667 o.inheritFromParent = true; | 660 o.inheritFromParent = true; |
| 668 o.suggestedValue = "foo"; | 661 o.suggestedValue = "foo"; |
| 669 } | 662 } |
| 670 buildCounterListPolicy--; | 663 buildCounterListPolicy--; |
| 671 return o; | 664 return o; |
| 672 } | 665 } |
| 673 | 666 |
| 674 checkListPolicy(api.ListPolicy o) { | 667 checkListPolicy(api.ListPolicy o) { |
| 675 buildCounterListPolicy++; | 668 buildCounterListPolicy++; |
| 676 if (buildCounterListPolicy < 3) { | 669 if (buildCounterListPolicy < 3) { |
| 677 unittest.expect(o.allValues, unittest.equals('foo')); | 670 unittest.expect(o.allValues, unittest.equals('foo')); |
| 678 checkUnnamed1851(o.allowedValues); | 671 checkUnnamed1849(o.allowedValues); |
| 679 checkUnnamed1852(o.deniedValues); | 672 checkUnnamed1850(o.deniedValues); |
| 680 unittest.expect(o.inheritFromParent, unittest.isTrue); | 673 unittest.expect(o.inheritFromParent, unittest.isTrue); |
| 681 unittest.expect(o.suggestedValue, unittest.equals('foo')); | 674 unittest.expect(o.suggestedValue, unittest.equals('foo')); |
| 682 } | 675 } |
| 683 buildCounterListPolicy--; | 676 buildCounterListPolicy--; |
| 684 } | 677 } |
| 685 | 678 |
| 686 buildUnnamed1853() { | 679 buildUnnamed1851() { |
| 687 var o = new core.List<api.Project>(); | 680 var o = new core.List<api.Project>(); |
| 688 o.add(buildProject()); | 681 o.add(buildProject()); |
| 689 o.add(buildProject()); | 682 o.add(buildProject()); |
| 690 return o; | 683 return o; |
| 691 } | 684 } |
| 692 | 685 |
| 693 checkUnnamed1853(core.List<api.Project> o) { | 686 checkUnnamed1851(core.List<api.Project> o) { |
| 694 unittest.expect(o, unittest.hasLength(2)); | 687 unittest.expect(o, unittest.hasLength(2)); |
| 695 checkProject(o[0]); | 688 checkProject(o[0]); |
| 696 checkProject(o[1]); | 689 checkProject(o[1]); |
| 697 } | 690 } |
| 698 | 691 |
| 699 core.int buildCounterListProjectsResponse = 0; | 692 core.int buildCounterListProjectsResponse = 0; |
| 700 buildListProjectsResponse() { | 693 buildListProjectsResponse() { |
| 701 var o = new api.ListProjectsResponse(); | 694 var o = new api.ListProjectsResponse(); |
| 702 buildCounterListProjectsResponse++; | 695 buildCounterListProjectsResponse++; |
| 703 if (buildCounterListProjectsResponse < 3) { | 696 if (buildCounterListProjectsResponse < 3) { |
| 704 o.nextPageToken = "foo"; | 697 o.nextPageToken = "foo"; |
| 705 o.projects = buildUnnamed1853(); | 698 o.projects = buildUnnamed1851(); |
| 706 } | 699 } |
| 707 buildCounterListProjectsResponse--; | 700 buildCounterListProjectsResponse--; |
| 708 return o; | 701 return o; |
| 709 } | 702 } |
| 710 | 703 |
| 711 checkListProjectsResponse(api.ListProjectsResponse o) { | 704 checkListProjectsResponse(api.ListProjectsResponse o) { |
| 712 buildCounterListProjectsResponse++; | 705 buildCounterListProjectsResponse++; |
| 713 if (buildCounterListProjectsResponse < 3) { | 706 if (buildCounterListProjectsResponse < 3) { |
| 714 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 707 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 715 checkUnnamed1853(o.projects); | 708 checkUnnamed1851(o.projects); |
| 716 } | 709 } |
| 717 buildCounterListProjectsResponse--; | 710 buildCounterListProjectsResponse--; |
| 718 } | 711 } |
| 719 | 712 |
| 720 buildUnnamed1854() { | 713 buildUnnamed1852() { |
| 721 var o = new core.Map<core.String, core.Object>(); | 714 var o = new core.Map<core.String, core.Object>(); |
| 722 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 715 o["x"] = { |
| 723 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 716 'list': [1, 2, 3], |
| 717 'bool': true, |
| 718 'string': 'foo' |
| 719 }; |
| 720 o["y"] = { |
| 721 'list': [1, 2, 3], |
| 722 'bool': true, |
| 723 'string': 'foo' |
| 724 }; |
| 724 return o; | 725 return o; |
| 725 } | 726 } |
| 726 | 727 |
| 727 checkUnnamed1854(core.Map<core.String, core.Object> o) { | 728 checkUnnamed1852(core.Map<core.String, core.Object> o) { |
| 728 unittest.expect(o, unittest.hasLength(2)); | 729 unittest.expect(o, unittest.hasLength(2)); |
| 729 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); | 730 var casted1 = (o["x"]) as core.Map; |
| 730 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); | 731 unittest.expect(casted1, unittest.hasLength(3)); |
| 732 unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
| 733 unittest.expect(casted1["bool"], unittest.equals(true)); |
| 734 unittest.expect(casted1["string"], unittest.equals('foo')); |
| 735 var casted2 = (o["y"]) as core.Map; |
| 736 unittest.expect(casted2, unittest.hasLength(3)); |
| 737 unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
| 738 unittest.expect(casted2["bool"], unittest.equals(true)); |
| 739 unittest.expect(casted2["string"], unittest.equals('foo')); |
| 731 } | 740 } |
| 732 | 741 |
| 733 buildUnnamed1855() { | 742 buildUnnamed1853() { |
| 734 var o = new core.Map<core.String, core.Object>(); | 743 var o = new core.Map<core.String, core.Object>(); |
| 735 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 744 o["x"] = { |
| 736 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 745 'list': [1, 2, 3], |
| 746 'bool': true, |
| 747 'string': 'foo' |
| 748 }; |
| 749 o["y"] = { |
| 750 'list': [1, 2, 3], |
| 751 'bool': true, |
| 752 'string': 'foo' |
| 753 }; |
| 737 return o; | 754 return o; |
| 738 } | 755 } |
| 739 | 756 |
| 740 checkUnnamed1855(core.Map<core.String, core.Object> o) { | 757 checkUnnamed1853(core.Map<core.String, core.Object> o) { |
| 741 unittest.expect(o, unittest.hasLength(2)); | 758 unittest.expect(o, unittest.hasLength(2)); |
| 742 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 759 var casted3 = (o["x"]) as core.Map; |
| 743 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 760 unittest.expect(casted3, unittest.hasLength(3)); |
| 761 unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); |
| 762 unittest.expect(casted3["bool"], unittest.equals(true)); |
| 763 unittest.expect(casted3["string"], unittest.equals('foo')); |
| 764 var casted4 = (o["y"]) as core.Map; |
| 765 unittest.expect(casted4, unittest.hasLength(3)); |
| 766 unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); |
| 767 unittest.expect(casted4["bool"], unittest.equals(true)); |
| 768 unittest.expect(casted4["string"], unittest.equals('foo')); |
| 744 } | 769 } |
| 745 | 770 |
| 746 core.int buildCounterOperation = 0; | 771 core.int buildCounterOperation = 0; |
| 747 buildOperation() { | 772 buildOperation() { |
| 748 var o = new api.Operation(); | 773 var o = new api.Operation(); |
| 749 buildCounterOperation++; | 774 buildCounterOperation++; |
| 750 if (buildCounterOperation < 3) { | 775 if (buildCounterOperation < 3) { |
| 751 o.done = true; | 776 o.done = true; |
| 752 o.error = buildStatus(); | 777 o.error = buildStatus(); |
| 753 o.metadata = buildUnnamed1854(); | 778 o.metadata = buildUnnamed1852(); |
| 754 o.name = "foo"; | 779 o.name = "foo"; |
| 755 o.response = buildUnnamed1855(); | 780 o.response = buildUnnamed1853(); |
| 756 } | 781 } |
| 757 buildCounterOperation--; | 782 buildCounterOperation--; |
| 758 return o; | 783 return o; |
| 759 } | 784 } |
| 760 | 785 |
| 761 checkOperation(api.Operation o) { | 786 checkOperation(api.Operation o) { |
| 762 buildCounterOperation++; | 787 buildCounterOperation++; |
| 763 if (buildCounterOperation < 3) { | 788 if (buildCounterOperation < 3) { |
| 764 unittest.expect(o.done, unittest.isTrue); | 789 unittest.expect(o.done, unittest.isTrue); |
| 765 checkStatus(o.error); | 790 checkStatus(o.error); |
| 766 checkUnnamed1854(o.metadata); | 791 checkUnnamed1852(o.metadata); |
| 767 unittest.expect(o.name, unittest.equals('foo')); | 792 unittest.expect(o.name, unittest.equals('foo')); |
| 768 checkUnnamed1855(o.response); | 793 checkUnnamed1853(o.response); |
| 769 } | 794 } |
| 770 buildCounterOperation--; | 795 buildCounterOperation--; |
| 771 } | 796 } |
| 772 | 797 |
| 773 core.int buildCounterOrgPolicy = 0; | 798 core.int buildCounterOrgPolicy = 0; |
| 774 buildOrgPolicy() { | 799 buildOrgPolicy() { |
| 775 var o = new api.OrgPolicy(); | 800 var o = new api.OrgPolicy(); |
| 776 buildCounterOrgPolicy++; | 801 buildCounterOrgPolicy++; |
| 777 if (buildCounterOrgPolicy < 3) { | 802 if (buildCounterOrgPolicy < 3) { |
| 778 o.booleanPolicy = buildBooleanPolicy(); | 803 o.booleanPolicy = buildBooleanPolicy(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 } | 865 } |
| 841 | 866 |
| 842 checkOrganizationOwner(api.OrganizationOwner o) { | 867 checkOrganizationOwner(api.OrganizationOwner o) { |
| 843 buildCounterOrganizationOwner++; | 868 buildCounterOrganizationOwner++; |
| 844 if (buildCounterOrganizationOwner < 3) { | 869 if (buildCounterOrganizationOwner < 3) { |
| 845 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); | 870 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); |
| 846 } | 871 } |
| 847 buildCounterOrganizationOwner--; | 872 buildCounterOrganizationOwner--; |
| 848 } | 873 } |
| 849 | 874 |
| 850 buildUnnamed1856() { | 875 buildUnnamed1854() { |
| 851 var o = new core.List<api.AuditConfig>(); | 876 var o = new core.List<api.AuditConfig>(); |
| 852 o.add(buildAuditConfig()); | 877 o.add(buildAuditConfig()); |
| 853 o.add(buildAuditConfig()); | 878 o.add(buildAuditConfig()); |
| 854 return o; | 879 return o; |
| 855 } | 880 } |
| 856 | 881 |
| 857 checkUnnamed1856(core.List<api.AuditConfig> o) { | 882 checkUnnamed1854(core.List<api.AuditConfig> o) { |
| 858 unittest.expect(o, unittest.hasLength(2)); | 883 unittest.expect(o, unittest.hasLength(2)); |
| 859 checkAuditConfig(o[0]); | 884 checkAuditConfig(o[0]); |
| 860 checkAuditConfig(o[1]); | 885 checkAuditConfig(o[1]); |
| 861 } | 886 } |
| 862 | 887 |
| 863 buildUnnamed1857() { | 888 buildUnnamed1855() { |
| 864 var o = new core.List<api.Binding>(); | 889 var o = new core.List<api.Binding>(); |
| 865 o.add(buildBinding()); | 890 o.add(buildBinding()); |
| 866 o.add(buildBinding()); | 891 o.add(buildBinding()); |
| 867 return o; | 892 return o; |
| 868 } | 893 } |
| 869 | 894 |
| 870 checkUnnamed1857(core.List<api.Binding> o) { | 895 checkUnnamed1855(core.List<api.Binding> o) { |
| 871 unittest.expect(o, unittest.hasLength(2)); | 896 unittest.expect(o, unittest.hasLength(2)); |
| 872 checkBinding(o[0]); | 897 checkBinding(o[0]); |
| 873 checkBinding(o[1]); | 898 checkBinding(o[1]); |
| 874 } | 899 } |
| 875 | 900 |
| 876 core.int buildCounterPolicy = 0; | 901 core.int buildCounterPolicy = 0; |
| 877 buildPolicy() { | 902 buildPolicy() { |
| 878 var o = new api.Policy(); | 903 var o = new api.Policy(); |
| 879 buildCounterPolicy++; | 904 buildCounterPolicy++; |
| 880 if (buildCounterPolicy < 3) { | 905 if (buildCounterPolicy < 3) { |
| 881 o.auditConfigs = buildUnnamed1856(); | 906 o.auditConfigs = buildUnnamed1854(); |
| 882 o.bindings = buildUnnamed1857(); | 907 o.bindings = buildUnnamed1855(); |
| 883 o.etag = "foo"; | 908 o.etag = "foo"; |
| 884 o.version = 42; | 909 o.version = 42; |
| 885 } | 910 } |
| 886 buildCounterPolicy--; | 911 buildCounterPolicy--; |
| 887 return o; | 912 return o; |
| 888 } | 913 } |
| 889 | 914 |
| 890 checkPolicy(api.Policy o) { | 915 checkPolicy(api.Policy o) { |
| 891 buildCounterPolicy++; | 916 buildCounterPolicy++; |
| 892 if (buildCounterPolicy < 3) { | 917 if (buildCounterPolicy < 3) { |
| 893 checkUnnamed1856(o.auditConfigs); | 918 checkUnnamed1854(o.auditConfigs); |
| 894 checkUnnamed1857(o.bindings); | 919 checkUnnamed1855(o.bindings); |
| 895 unittest.expect(o.etag, unittest.equals('foo')); | 920 unittest.expect(o.etag, unittest.equals('foo')); |
| 896 unittest.expect(o.version, unittest.equals(42)); | 921 unittest.expect(o.version, unittest.equals(42)); |
| 897 } | 922 } |
| 898 buildCounterPolicy--; | 923 buildCounterPolicy--; |
| 899 } | 924 } |
| 900 | 925 |
| 901 buildUnnamed1858() { | 926 buildUnnamed1856() { |
| 902 var o = new core.Map<core.String, core.String>(); | 927 var o = new core.Map<core.String, core.String>(); |
| 903 o["x"] = "foo"; | 928 o["x"] = "foo"; |
| 904 o["y"] = "foo"; | 929 o["y"] = "foo"; |
| 905 return o; | 930 return o; |
| 906 } | 931 } |
| 907 | 932 |
| 908 checkUnnamed1858(core.Map<core.String, core.String> o) { | 933 checkUnnamed1856(core.Map<core.String, core.String> o) { |
| 909 unittest.expect(o, unittest.hasLength(2)); | 934 unittest.expect(o, unittest.hasLength(2)); |
| 910 unittest.expect(o["x"], unittest.equals('foo')); | 935 unittest.expect(o["x"], unittest.equals('foo')); |
| 911 unittest.expect(o["y"], unittest.equals('foo')); | 936 unittest.expect(o["y"], unittest.equals('foo')); |
| 912 } | 937 } |
| 913 | 938 |
| 914 core.int buildCounterProject = 0; | 939 core.int buildCounterProject = 0; |
| 915 buildProject() { | 940 buildProject() { |
| 916 var o = new api.Project(); | 941 var o = new api.Project(); |
| 917 buildCounterProject++; | 942 buildCounterProject++; |
| 918 if (buildCounterProject < 3) { | 943 if (buildCounterProject < 3) { |
| 919 o.createTime = "foo"; | 944 o.createTime = "foo"; |
| 920 o.labels = buildUnnamed1858(); | 945 o.labels = buildUnnamed1856(); |
| 921 o.lifecycleState = "foo"; | 946 o.lifecycleState = "foo"; |
| 922 o.name = "foo"; | 947 o.name = "foo"; |
| 923 o.parent = buildResourceId(); | 948 o.parent = buildResourceId(); |
| 924 o.projectId = "foo"; | 949 o.projectId = "foo"; |
| 925 o.projectNumber = "foo"; | 950 o.projectNumber = "foo"; |
| 926 } | 951 } |
| 927 buildCounterProject--; | 952 buildCounterProject--; |
| 928 return o; | 953 return o; |
| 929 } | 954 } |
| 930 | 955 |
| 931 checkProject(api.Project o) { | 956 checkProject(api.Project o) { |
| 932 buildCounterProject++; | 957 buildCounterProject++; |
| 933 if (buildCounterProject < 3) { | 958 if (buildCounterProject < 3) { |
| 934 unittest.expect(o.createTime, unittest.equals('foo')); | 959 unittest.expect(o.createTime, unittest.equals('foo')); |
| 935 checkUnnamed1858(o.labels); | 960 checkUnnamed1856(o.labels); |
| 936 unittest.expect(o.lifecycleState, unittest.equals('foo')); | 961 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
| 937 unittest.expect(o.name, unittest.equals('foo')); | 962 unittest.expect(o.name, unittest.equals('foo')); |
| 938 checkResourceId(o.parent); | 963 checkResourceId(o.parent); |
| 939 unittest.expect(o.projectId, unittest.equals('foo')); | 964 unittest.expect(o.projectId, unittest.equals('foo')); |
| 940 unittest.expect(o.projectNumber, unittest.equals('foo')); | 965 unittest.expect(o.projectNumber, unittest.equals('foo')); |
| 941 } | 966 } |
| 942 buildCounterProject--; | 967 buildCounterProject--; |
| 943 } | 968 } |
| 944 | 969 |
| 945 core.int buildCounterProjectCreationStatus = 0; | 970 core.int buildCounterProjectCreationStatus = 0; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 unittest.expect(o.id, unittest.equals('foo')); | 1008 unittest.expect(o.id, unittest.equals('foo')); |
| 984 unittest.expect(o.type, unittest.equals('foo')); | 1009 unittest.expect(o.type, unittest.equals('foo')); |
| 985 } | 1010 } |
| 986 buildCounterResourceId--; | 1011 buildCounterResourceId--; |
| 987 } | 1012 } |
| 988 | 1013 |
| 989 core.int buildCounterRestoreDefault = 0; | 1014 core.int buildCounterRestoreDefault = 0; |
| 990 buildRestoreDefault() { | 1015 buildRestoreDefault() { |
| 991 var o = new api.RestoreDefault(); | 1016 var o = new api.RestoreDefault(); |
| 992 buildCounterRestoreDefault++; | 1017 buildCounterRestoreDefault++; |
| 993 if (buildCounterRestoreDefault < 3) { | 1018 if (buildCounterRestoreDefault < 3) {} |
| 994 } | |
| 995 buildCounterRestoreDefault--; | 1019 buildCounterRestoreDefault--; |
| 996 return o; | 1020 return o; |
| 997 } | 1021 } |
| 998 | 1022 |
| 999 checkRestoreDefault(api.RestoreDefault o) { | 1023 checkRestoreDefault(api.RestoreDefault o) { |
| 1000 buildCounterRestoreDefault++; | 1024 buildCounterRestoreDefault++; |
| 1001 if (buildCounterRestoreDefault < 3) { | 1025 if (buildCounterRestoreDefault < 3) {} |
| 1002 } | |
| 1003 buildCounterRestoreDefault--; | 1026 buildCounterRestoreDefault--; |
| 1004 } | 1027 } |
| 1005 | 1028 |
| 1006 core.int buildCounterSearchOrganizationsRequest = 0; | 1029 core.int buildCounterSearchOrganizationsRequest = 0; |
| 1007 buildSearchOrganizationsRequest() { | 1030 buildSearchOrganizationsRequest() { |
| 1008 var o = new api.SearchOrganizationsRequest(); | 1031 var o = new api.SearchOrganizationsRequest(); |
| 1009 buildCounterSearchOrganizationsRequest++; | 1032 buildCounterSearchOrganizationsRequest++; |
| 1010 if (buildCounterSearchOrganizationsRequest < 3) { | 1033 if (buildCounterSearchOrganizationsRequest < 3) { |
| 1011 o.filter = "foo"; | 1034 o.filter = "foo"; |
| 1012 o.pageSize = 42; | 1035 o.pageSize = 42; |
| 1013 o.pageToken = "foo"; | 1036 o.pageToken = "foo"; |
| 1014 } | 1037 } |
| 1015 buildCounterSearchOrganizationsRequest--; | 1038 buildCounterSearchOrganizationsRequest--; |
| 1016 return o; | 1039 return o; |
| 1017 } | 1040 } |
| 1018 | 1041 |
| 1019 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { | 1042 checkSearchOrganizationsRequest(api.SearchOrganizationsRequest o) { |
| 1020 buildCounterSearchOrganizationsRequest++; | 1043 buildCounterSearchOrganizationsRequest++; |
| 1021 if (buildCounterSearchOrganizationsRequest < 3) { | 1044 if (buildCounterSearchOrganizationsRequest < 3) { |
| 1022 unittest.expect(o.filter, unittest.equals('foo')); | 1045 unittest.expect(o.filter, unittest.equals('foo')); |
| 1023 unittest.expect(o.pageSize, unittest.equals(42)); | 1046 unittest.expect(o.pageSize, unittest.equals(42)); |
| 1024 unittest.expect(o.pageToken, unittest.equals('foo')); | 1047 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 1025 } | 1048 } |
| 1026 buildCounterSearchOrganizationsRequest--; | 1049 buildCounterSearchOrganizationsRequest--; |
| 1027 } | 1050 } |
| 1028 | 1051 |
| 1029 buildUnnamed1859() { | 1052 buildUnnamed1857() { |
| 1030 var o = new core.List<api.Organization>(); | 1053 var o = new core.List<api.Organization>(); |
| 1031 o.add(buildOrganization()); | 1054 o.add(buildOrganization()); |
| 1032 o.add(buildOrganization()); | 1055 o.add(buildOrganization()); |
| 1033 return o; | 1056 return o; |
| 1034 } | 1057 } |
| 1035 | 1058 |
| 1036 checkUnnamed1859(core.List<api.Organization> o) { | 1059 checkUnnamed1857(core.List<api.Organization> o) { |
| 1037 unittest.expect(o, unittest.hasLength(2)); | 1060 unittest.expect(o, unittest.hasLength(2)); |
| 1038 checkOrganization(o[0]); | 1061 checkOrganization(o[0]); |
| 1039 checkOrganization(o[1]); | 1062 checkOrganization(o[1]); |
| 1040 } | 1063 } |
| 1041 | 1064 |
| 1042 core.int buildCounterSearchOrganizationsResponse = 0; | 1065 core.int buildCounterSearchOrganizationsResponse = 0; |
| 1043 buildSearchOrganizationsResponse() { | 1066 buildSearchOrganizationsResponse() { |
| 1044 var o = new api.SearchOrganizationsResponse(); | 1067 var o = new api.SearchOrganizationsResponse(); |
| 1045 buildCounterSearchOrganizationsResponse++; | 1068 buildCounterSearchOrganizationsResponse++; |
| 1046 if (buildCounterSearchOrganizationsResponse < 3) { | 1069 if (buildCounterSearchOrganizationsResponse < 3) { |
| 1047 o.nextPageToken = "foo"; | 1070 o.nextPageToken = "foo"; |
| 1048 o.organizations = buildUnnamed1859(); | 1071 o.organizations = buildUnnamed1857(); |
| 1049 } | 1072 } |
| 1050 buildCounterSearchOrganizationsResponse--; | 1073 buildCounterSearchOrganizationsResponse--; |
| 1051 return o; | 1074 return o; |
| 1052 } | 1075 } |
| 1053 | 1076 |
| 1054 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { | 1077 checkSearchOrganizationsResponse(api.SearchOrganizationsResponse o) { |
| 1055 buildCounterSearchOrganizationsResponse++; | 1078 buildCounterSearchOrganizationsResponse++; |
| 1056 if (buildCounterSearchOrganizationsResponse < 3) { | 1079 if (buildCounterSearchOrganizationsResponse < 3) { |
| 1057 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 1080 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1058 checkUnnamed1859(o.organizations); | 1081 checkUnnamed1857(o.organizations); |
| 1059 } | 1082 } |
| 1060 buildCounterSearchOrganizationsResponse--; | 1083 buildCounterSearchOrganizationsResponse--; |
| 1061 } | 1084 } |
| 1062 | 1085 |
| 1063 core.int buildCounterSetIamPolicyRequest = 0; | 1086 core.int buildCounterSetIamPolicyRequest = 0; |
| 1064 buildSetIamPolicyRequest() { | 1087 buildSetIamPolicyRequest() { |
| 1065 var o = new api.SetIamPolicyRequest(); | 1088 var o = new api.SetIamPolicyRequest(); |
| 1066 buildCounterSetIamPolicyRequest++; | 1089 buildCounterSetIamPolicyRequest++; |
| 1067 if (buildCounterSetIamPolicyRequest < 3) { | 1090 if (buildCounterSetIamPolicyRequest < 3) { |
| 1068 o.policy = buildPolicy(); | 1091 o.policy = buildPolicy(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1093 } | 1116 } |
| 1094 | 1117 |
| 1095 checkSetOrgPolicyRequest(api.SetOrgPolicyRequest o) { | 1118 checkSetOrgPolicyRequest(api.SetOrgPolicyRequest o) { |
| 1096 buildCounterSetOrgPolicyRequest++; | 1119 buildCounterSetOrgPolicyRequest++; |
| 1097 if (buildCounterSetOrgPolicyRequest < 3) { | 1120 if (buildCounterSetOrgPolicyRequest < 3) { |
| 1098 checkOrgPolicy(o.policy); | 1121 checkOrgPolicy(o.policy); |
| 1099 } | 1122 } |
| 1100 buildCounterSetOrgPolicyRequest--; | 1123 buildCounterSetOrgPolicyRequest--; |
| 1101 } | 1124 } |
| 1102 | 1125 |
| 1103 buildUnnamed1860() { | 1126 buildUnnamed1858() { |
| 1104 var o = new core.Map<core.String, core.Object>(); | 1127 var o = new core.Map<core.String, core.Object>(); |
| 1105 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1128 o["x"] = { |
| 1106 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1129 'list': [1, 2, 3], |
| 1130 'bool': true, |
| 1131 'string': 'foo' |
| 1132 }; |
| 1133 o["y"] = { |
| 1134 'list': [1, 2, 3], |
| 1135 'bool': true, |
| 1136 'string': 'foo' |
| 1137 }; |
| 1107 return o; | 1138 return o; |
| 1108 } | 1139 } |
| 1109 | 1140 |
| 1110 checkUnnamed1860(core.Map<core.String, core.Object> o) { | 1141 checkUnnamed1858(core.Map<core.String, core.Object> o) { |
| 1111 unittest.expect(o, unittest.hasLength(2)); | 1142 unittest.expect(o, unittest.hasLength(2)); |
| 1112 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); | 1143 var casted5 = (o["x"]) as core.Map; |
| 1113 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); | 1144 unittest.expect(casted5, unittest.hasLength(3)); |
| 1145 unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); |
| 1146 unittest.expect(casted5["bool"], unittest.equals(true)); |
| 1147 unittest.expect(casted5["string"], unittest.equals('foo')); |
| 1148 var casted6 = (o["y"]) as core.Map; |
| 1149 unittest.expect(casted6, unittest.hasLength(3)); |
| 1150 unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); |
| 1151 unittest.expect(casted6["bool"], unittest.equals(true)); |
| 1152 unittest.expect(casted6["string"], unittest.equals('foo')); |
| 1114 } | 1153 } |
| 1115 | 1154 |
| 1116 buildUnnamed1861() { | 1155 buildUnnamed1859() { |
| 1117 var o = new core.List<core.Map<core.String, core.Object>>(); | 1156 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 1118 o.add(buildUnnamed1860()); | 1157 o.add(buildUnnamed1858()); |
| 1119 o.add(buildUnnamed1860()); | 1158 o.add(buildUnnamed1858()); |
| 1120 return o; | 1159 return o; |
| 1121 } | 1160 } |
| 1122 | 1161 |
| 1123 checkUnnamed1861(core.List<core.Map<core.String, core.Object>> o) { | 1162 checkUnnamed1859(core.List<core.Map<core.String, core.Object>> o) { |
| 1124 unittest.expect(o, unittest.hasLength(2)); | 1163 unittest.expect(o, unittest.hasLength(2)); |
| 1125 checkUnnamed1860(o[0]); | 1164 checkUnnamed1858(o[0]); |
| 1126 checkUnnamed1860(o[1]); | 1165 checkUnnamed1858(o[1]); |
| 1127 } | 1166 } |
| 1128 | 1167 |
| 1129 core.int buildCounterStatus = 0; | 1168 core.int buildCounterStatus = 0; |
| 1130 buildStatus() { | 1169 buildStatus() { |
| 1131 var o = new api.Status(); | 1170 var o = new api.Status(); |
| 1132 buildCounterStatus++; | 1171 buildCounterStatus++; |
| 1133 if (buildCounterStatus < 3) { | 1172 if (buildCounterStatus < 3) { |
| 1134 o.code = 42; | 1173 o.code = 42; |
| 1135 o.details = buildUnnamed1861(); | 1174 o.details = buildUnnamed1859(); |
| 1136 o.message = "foo"; | 1175 o.message = "foo"; |
| 1137 } | 1176 } |
| 1138 buildCounterStatus--; | 1177 buildCounterStatus--; |
| 1139 return o; | 1178 return o; |
| 1140 } | 1179 } |
| 1141 | 1180 |
| 1142 checkStatus(api.Status o) { | 1181 checkStatus(api.Status o) { |
| 1143 buildCounterStatus++; | 1182 buildCounterStatus++; |
| 1144 if (buildCounterStatus < 3) { | 1183 if (buildCounterStatus < 3) { |
| 1145 unittest.expect(o.code, unittest.equals(42)); | 1184 unittest.expect(o.code, unittest.equals(42)); |
| 1146 checkUnnamed1861(o.details); | 1185 checkUnnamed1859(o.details); |
| 1147 unittest.expect(o.message, unittest.equals('foo')); | 1186 unittest.expect(o.message, unittest.equals('foo')); |
| 1148 } | 1187 } |
| 1149 buildCounterStatus--; | 1188 buildCounterStatus--; |
| 1150 } | 1189 } |
| 1151 | 1190 |
| 1152 buildUnnamed1862() { | 1191 buildUnnamed1860() { |
| 1153 var o = new core.List<core.String>(); | 1192 var o = new core.List<core.String>(); |
| 1154 o.add("foo"); | 1193 o.add("foo"); |
| 1155 o.add("foo"); | 1194 o.add("foo"); |
| 1156 return o; | 1195 return o; |
| 1157 } | 1196 } |
| 1158 | 1197 |
| 1159 checkUnnamed1862(core.List<core.String> o) { | 1198 checkUnnamed1860(core.List<core.String> o) { |
| 1160 unittest.expect(o, unittest.hasLength(2)); | 1199 unittest.expect(o, unittest.hasLength(2)); |
| 1161 unittest.expect(o[0], unittest.equals('foo')); | 1200 unittest.expect(o[0], unittest.equals('foo')); |
| 1162 unittest.expect(o[1], unittest.equals('foo')); | 1201 unittest.expect(o[1], unittest.equals('foo')); |
| 1163 } | 1202 } |
| 1164 | 1203 |
| 1165 core.int buildCounterTestIamPermissionsRequest = 0; | 1204 core.int buildCounterTestIamPermissionsRequest = 0; |
| 1166 buildTestIamPermissionsRequest() { | 1205 buildTestIamPermissionsRequest() { |
| 1167 var o = new api.TestIamPermissionsRequest(); | 1206 var o = new api.TestIamPermissionsRequest(); |
| 1168 buildCounterTestIamPermissionsRequest++; | 1207 buildCounterTestIamPermissionsRequest++; |
| 1169 if (buildCounterTestIamPermissionsRequest < 3) { | 1208 if (buildCounterTestIamPermissionsRequest < 3) { |
| 1170 o.permissions = buildUnnamed1862(); | 1209 o.permissions = buildUnnamed1860(); |
| 1171 } | 1210 } |
| 1172 buildCounterTestIamPermissionsRequest--; | 1211 buildCounterTestIamPermissionsRequest--; |
| 1173 return o; | 1212 return o; |
| 1174 } | 1213 } |
| 1175 | 1214 |
| 1176 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 1215 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 1177 buildCounterTestIamPermissionsRequest++; | 1216 buildCounterTestIamPermissionsRequest++; |
| 1178 if (buildCounterTestIamPermissionsRequest < 3) { | 1217 if (buildCounterTestIamPermissionsRequest < 3) { |
| 1179 checkUnnamed1862(o.permissions); | 1218 checkUnnamed1860(o.permissions); |
| 1180 } | 1219 } |
| 1181 buildCounterTestIamPermissionsRequest--; | 1220 buildCounterTestIamPermissionsRequest--; |
| 1182 } | 1221 } |
| 1183 | 1222 |
| 1184 buildUnnamed1863() { | 1223 buildUnnamed1861() { |
| 1185 var o = new core.List<core.String>(); | 1224 var o = new core.List<core.String>(); |
| 1186 o.add("foo"); | 1225 o.add("foo"); |
| 1187 o.add("foo"); | 1226 o.add("foo"); |
| 1188 return o; | 1227 return o; |
| 1189 } | 1228 } |
| 1190 | 1229 |
| 1191 checkUnnamed1863(core.List<core.String> o) { | 1230 checkUnnamed1861(core.List<core.String> o) { |
| 1192 unittest.expect(o, unittest.hasLength(2)); | 1231 unittest.expect(o, unittest.hasLength(2)); |
| 1193 unittest.expect(o[0], unittest.equals('foo')); | 1232 unittest.expect(o[0], unittest.equals('foo')); |
| 1194 unittest.expect(o[1], unittest.equals('foo')); | 1233 unittest.expect(o[1], unittest.equals('foo')); |
| 1195 } | 1234 } |
| 1196 | 1235 |
| 1197 core.int buildCounterTestIamPermissionsResponse = 0; | 1236 core.int buildCounterTestIamPermissionsResponse = 0; |
| 1198 buildTestIamPermissionsResponse() { | 1237 buildTestIamPermissionsResponse() { |
| 1199 var o = new api.TestIamPermissionsResponse(); | 1238 var o = new api.TestIamPermissionsResponse(); |
| 1200 buildCounterTestIamPermissionsResponse++; | 1239 buildCounterTestIamPermissionsResponse++; |
| 1201 if (buildCounterTestIamPermissionsResponse < 3) { | 1240 if (buildCounterTestIamPermissionsResponse < 3) { |
| 1202 o.permissions = buildUnnamed1863(); | 1241 o.permissions = buildUnnamed1861(); |
| 1203 } | 1242 } |
| 1204 buildCounterTestIamPermissionsResponse--; | 1243 buildCounterTestIamPermissionsResponse--; |
| 1205 return o; | 1244 return o; |
| 1206 } | 1245 } |
| 1207 | 1246 |
| 1208 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 1247 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 1209 buildCounterTestIamPermissionsResponse++; | 1248 buildCounterTestIamPermissionsResponse++; |
| 1210 if (buildCounterTestIamPermissionsResponse < 3) { | 1249 if (buildCounterTestIamPermissionsResponse < 3) { |
| 1211 checkUnnamed1863(o.permissions); | 1250 checkUnnamed1861(o.permissions); |
| 1212 } | 1251 } |
| 1213 buildCounterTestIamPermissionsResponse--; | 1252 buildCounterTestIamPermissionsResponse--; |
| 1214 } | 1253 } |
| 1215 | 1254 |
| 1216 core.int buildCounterUndeleteProjectRequest = 0; | 1255 core.int buildCounterUndeleteProjectRequest = 0; |
| 1217 buildUndeleteProjectRequest() { | 1256 buildUndeleteProjectRequest() { |
| 1218 var o = new api.UndeleteProjectRequest(); | 1257 var o = new api.UndeleteProjectRequest(); |
| 1219 buildCounterUndeleteProjectRequest++; | 1258 buildCounterUndeleteProjectRequest++; |
| 1220 if (buildCounterUndeleteProjectRequest < 3) { | 1259 if (buildCounterUndeleteProjectRequest < 3) {} |
| 1221 } | |
| 1222 buildCounterUndeleteProjectRequest--; | 1260 buildCounterUndeleteProjectRequest--; |
| 1223 return o; | 1261 return o; |
| 1224 } | 1262 } |
| 1225 | 1263 |
| 1226 checkUndeleteProjectRequest(api.UndeleteProjectRequest o) { | 1264 checkUndeleteProjectRequest(api.UndeleteProjectRequest o) { |
| 1227 buildCounterUndeleteProjectRequest++; | 1265 buildCounterUndeleteProjectRequest++; |
| 1228 if (buildCounterUndeleteProjectRequest < 3) { | 1266 if (buildCounterUndeleteProjectRequest < 3) {} |
| 1229 } | |
| 1230 buildCounterUndeleteProjectRequest--; | 1267 buildCounterUndeleteProjectRequest--; |
| 1231 } | 1268 } |
| 1232 | 1269 |
| 1233 | |
| 1234 main() { | 1270 main() { |
| 1235 unittest.group("obj-schema-Ancestor", () { | 1271 unittest.group("obj-schema-Ancestor", () { |
| 1236 unittest.test("to-json--from-json", () { | 1272 unittest.test("to-json--from-json", () { |
| 1237 var o = buildAncestor(); | 1273 var o = buildAncestor(); |
| 1238 var od = new api.Ancestor.fromJson(o.toJson()); | 1274 var od = new api.Ancestor.fromJson(o.toJson()); |
| 1239 checkAncestor(od); | 1275 checkAncestor(od); |
| 1240 }); | 1276 }); |
| 1241 }); | 1277 }); |
| 1242 | 1278 |
| 1243 | |
| 1244 unittest.group("obj-schema-AuditConfig", () { | 1279 unittest.group("obj-schema-AuditConfig", () { |
| 1245 unittest.test("to-json--from-json", () { | 1280 unittest.test("to-json--from-json", () { |
| 1246 var o = buildAuditConfig(); | 1281 var o = buildAuditConfig(); |
| 1247 var od = new api.AuditConfig.fromJson(o.toJson()); | 1282 var od = new api.AuditConfig.fromJson(o.toJson()); |
| 1248 checkAuditConfig(od); | 1283 checkAuditConfig(od); |
| 1249 }); | 1284 }); |
| 1250 }); | 1285 }); |
| 1251 | 1286 |
| 1252 | |
| 1253 unittest.group("obj-schema-AuditLogConfig", () { | 1287 unittest.group("obj-schema-AuditLogConfig", () { |
| 1254 unittest.test("to-json--from-json", () { | 1288 unittest.test("to-json--from-json", () { |
| 1255 var o = buildAuditLogConfig(); | 1289 var o = buildAuditLogConfig(); |
| 1256 var od = new api.AuditLogConfig.fromJson(o.toJson()); | 1290 var od = new api.AuditLogConfig.fromJson(o.toJson()); |
| 1257 checkAuditLogConfig(od); | 1291 checkAuditLogConfig(od); |
| 1258 }); | 1292 }); |
| 1259 }); | 1293 }); |
| 1260 | 1294 |
| 1261 | |
| 1262 unittest.group("obj-schema-Binding", () { | 1295 unittest.group("obj-schema-Binding", () { |
| 1263 unittest.test("to-json--from-json", () { | 1296 unittest.test("to-json--from-json", () { |
| 1264 var o = buildBinding(); | 1297 var o = buildBinding(); |
| 1265 var od = new api.Binding.fromJson(o.toJson()); | 1298 var od = new api.Binding.fromJson(o.toJson()); |
| 1266 checkBinding(od); | 1299 checkBinding(od); |
| 1267 }); | 1300 }); |
| 1268 }); | 1301 }); |
| 1269 | 1302 |
| 1270 | |
| 1271 unittest.group("obj-schema-BooleanConstraint", () { | 1303 unittest.group("obj-schema-BooleanConstraint", () { |
| 1272 unittest.test("to-json--from-json", () { | 1304 unittest.test("to-json--from-json", () { |
| 1273 var o = buildBooleanConstraint(); | 1305 var o = buildBooleanConstraint(); |
| 1274 var od = new api.BooleanConstraint.fromJson(o.toJson()); | 1306 var od = new api.BooleanConstraint.fromJson(o.toJson()); |
| 1275 checkBooleanConstraint(od); | 1307 checkBooleanConstraint(od); |
| 1276 }); | 1308 }); |
| 1277 }); | 1309 }); |
| 1278 | 1310 |
| 1279 | |
| 1280 unittest.group("obj-schema-BooleanPolicy", () { | 1311 unittest.group("obj-schema-BooleanPolicy", () { |
| 1281 unittest.test("to-json--from-json", () { | 1312 unittest.test("to-json--from-json", () { |
| 1282 var o = buildBooleanPolicy(); | 1313 var o = buildBooleanPolicy(); |
| 1283 var od = new api.BooleanPolicy.fromJson(o.toJson()); | 1314 var od = new api.BooleanPolicy.fromJson(o.toJson()); |
| 1284 checkBooleanPolicy(od); | 1315 checkBooleanPolicy(od); |
| 1285 }); | 1316 }); |
| 1286 }); | 1317 }); |
| 1287 | 1318 |
| 1288 | |
| 1289 unittest.group("obj-schema-ClearOrgPolicyRequest", () { | 1319 unittest.group("obj-schema-ClearOrgPolicyRequest", () { |
| 1290 unittest.test("to-json--from-json", () { | 1320 unittest.test("to-json--from-json", () { |
| 1291 var o = buildClearOrgPolicyRequest(); | 1321 var o = buildClearOrgPolicyRequest(); |
| 1292 var od = new api.ClearOrgPolicyRequest.fromJson(o.toJson()); | 1322 var od = new api.ClearOrgPolicyRequest.fromJson(o.toJson()); |
| 1293 checkClearOrgPolicyRequest(od); | 1323 checkClearOrgPolicyRequest(od); |
| 1294 }); | 1324 }); |
| 1295 }); | 1325 }); |
| 1296 | 1326 |
| 1297 | |
| 1298 unittest.group("obj-schema-Constraint", () { | 1327 unittest.group("obj-schema-Constraint", () { |
| 1299 unittest.test("to-json--from-json", () { | 1328 unittest.test("to-json--from-json", () { |
| 1300 var o = buildConstraint(); | 1329 var o = buildConstraint(); |
| 1301 var od = new api.Constraint.fromJson(o.toJson()); | 1330 var od = new api.Constraint.fromJson(o.toJson()); |
| 1302 checkConstraint(od); | 1331 checkConstraint(od); |
| 1303 }); | 1332 }); |
| 1304 }); | 1333 }); |
| 1305 | 1334 |
| 1306 | |
| 1307 unittest.group("obj-schema-Empty", () { | 1335 unittest.group("obj-schema-Empty", () { |
| 1308 unittest.test("to-json--from-json", () { | 1336 unittest.test("to-json--from-json", () { |
| 1309 var o = buildEmpty(); | 1337 var o = buildEmpty(); |
| 1310 var od = new api.Empty.fromJson(o.toJson()); | 1338 var od = new api.Empty.fromJson(o.toJson()); |
| 1311 checkEmpty(od); | 1339 checkEmpty(od); |
| 1312 }); | 1340 }); |
| 1313 }); | 1341 }); |
| 1314 | 1342 |
| 1315 | |
| 1316 unittest.group("obj-schema-FolderOperation", () { | 1343 unittest.group("obj-schema-FolderOperation", () { |
| 1317 unittest.test("to-json--from-json", () { | 1344 unittest.test("to-json--from-json", () { |
| 1318 var o = buildFolderOperation(); | 1345 var o = buildFolderOperation(); |
| 1319 var od = new api.FolderOperation.fromJson(o.toJson()); | 1346 var od = new api.FolderOperation.fromJson(o.toJson()); |
| 1320 checkFolderOperation(od); | 1347 checkFolderOperation(od); |
| 1321 }); | 1348 }); |
| 1322 }); | 1349 }); |
| 1323 | 1350 |
| 1324 | |
| 1325 unittest.group("obj-schema-FolderOperationError", () { | 1351 unittest.group("obj-schema-FolderOperationError", () { |
| 1326 unittest.test("to-json--from-json", () { | 1352 unittest.test("to-json--from-json", () { |
| 1327 var o = buildFolderOperationError(); | 1353 var o = buildFolderOperationError(); |
| 1328 var od = new api.FolderOperationError.fromJson(o.toJson()); | 1354 var od = new api.FolderOperationError.fromJson(o.toJson()); |
| 1329 checkFolderOperationError(od); | 1355 checkFolderOperationError(od); |
| 1330 }); | 1356 }); |
| 1331 }); | 1357 }); |
| 1332 | 1358 |
| 1333 | |
| 1334 unittest.group("obj-schema-GetAncestryRequest", () { | 1359 unittest.group("obj-schema-GetAncestryRequest", () { |
| 1335 unittest.test("to-json--from-json", () { | 1360 unittest.test("to-json--from-json", () { |
| 1336 var o = buildGetAncestryRequest(); | 1361 var o = buildGetAncestryRequest(); |
| 1337 var od = new api.GetAncestryRequest.fromJson(o.toJson()); | 1362 var od = new api.GetAncestryRequest.fromJson(o.toJson()); |
| 1338 checkGetAncestryRequest(od); | 1363 checkGetAncestryRequest(od); |
| 1339 }); | 1364 }); |
| 1340 }); | 1365 }); |
| 1341 | 1366 |
| 1342 | |
| 1343 unittest.group("obj-schema-GetAncestryResponse", () { | 1367 unittest.group("obj-schema-GetAncestryResponse", () { |
| 1344 unittest.test("to-json--from-json", () { | 1368 unittest.test("to-json--from-json", () { |
| 1345 var o = buildGetAncestryResponse(); | 1369 var o = buildGetAncestryResponse(); |
| 1346 var od = new api.GetAncestryResponse.fromJson(o.toJson()); | 1370 var od = new api.GetAncestryResponse.fromJson(o.toJson()); |
| 1347 checkGetAncestryResponse(od); | 1371 checkGetAncestryResponse(od); |
| 1348 }); | 1372 }); |
| 1349 }); | 1373 }); |
| 1350 | 1374 |
| 1351 | |
| 1352 unittest.group("obj-schema-GetEffectiveOrgPolicyRequest", () { | 1375 unittest.group("obj-schema-GetEffectiveOrgPolicyRequest", () { |
| 1353 unittest.test("to-json--from-json", () { | 1376 unittest.test("to-json--from-json", () { |
| 1354 var o = buildGetEffectiveOrgPolicyRequest(); | 1377 var o = buildGetEffectiveOrgPolicyRequest(); |
| 1355 var od = new api.GetEffectiveOrgPolicyRequest.fromJson(o.toJson()); | 1378 var od = new api.GetEffectiveOrgPolicyRequest.fromJson(o.toJson()); |
| 1356 checkGetEffectiveOrgPolicyRequest(od); | 1379 checkGetEffectiveOrgPolicyRequest(od); |
| 1357 }); | 1380 }); |
| 1358 }); | 1381 }); |
| 1359 | 1382 |
| 1360 | |
| 1361 unittest.group("obj-schema-GetIamPolicyRequest", () { | 1383 unittest.group("obj-schema-GetIamPolicyRequest", () { |
| 1362 unittest.test("to-json--from-json", () { | 1384 unittest.test("to-json--from-json", () { |
| 1363 var o = buildGetIamPolicyRequest(); | 1385 var o = buildGetIamPolicyRequest(); |
| 1364 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); | 1386 var od = new api.GetIamPolicyRequest.fromJson(o.toJson()); |
| 1365 checkGetIamPolicyRequest(od); | 1387 checkGetIamPolicyRequest(od); |
| 1366 }); | 1388 }); |
| 1367 }); | 1389 }); |
| 1368 | 1390 |
| 1369 | |
| 1370 unittest.group("obj-schema-GetOrgPolicyRequest", () { | 1391 unittest.group("obj-schema-GetOrgPolicyRequest", () { |
| 1371 unittest.test("to-json--from-json", () { | 1392 unittest.test("to-json--from-json", () { |
| 1372 var o = buildGetOrgPolicyRequest(); | 1393 var o = buildGetOrgPolicyRequest(); |
| 1373 var od = new api.GetOrgPolicyRequest.fromJson(o.toJson()); | 1394 var od = new api.GetOrgPolicyRequest.fromJson(o.toJson()); |
| 1374 checkGetOrgPolicyRequest(od); | 1395 checkGetOrgPolicyRequest(od); |
| 1375 }); | 1396 }); |
| 1376 }); | 1397 }); |
| 1377 | 1398 |
| 1378 | |
| 1379 unittest.group("obj-schema-Lien", () { | 1399 unittest.group("obj-schema-Lien", () { |
| 1380 unittest.test("to-json--from-json", () { | 1400 unittest.test("to-json--from-json", () { |
| 1381 var o = buildLien(); | 1401 var o = buildLien(); |
| 1382 var od = new api.Lien.fromJson(o.toJson()); | 1402 var od = new api.Lien.fromJson(o.toJson()); |
| 1383 checkLien(od); | 1403 checkLien(od); |
| 1384 }); | 1404 }); |
| 1385 }); | 1405 }); |
| 1386 | 1406 |
| 1387 | |
| 1388 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsRequest", () { | 1407 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsRequest", () { |
| 1389 unittest.test("to-json--from-json", () { | 1408 unittest.test("to-json--from-json", () { |
| 1390 var o = buildListAvailableOrgPolicyConstraintsRequest(); | 1409 var o = buildListAvailableOrgPolicyConstraintsRequest(); |
| 1391 var od = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(o.toJso
n()); | 1410 var od = |
| 1411 new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(o.toJson()); |
| 1392 checkListAvailableOrgPolicyConstraintsRequest(od); | 1412 checkListAvailableOrgPolicyConstraintsRequest(od); |
| 1393 }); | 1413 }); |
| 1394 }); | 1414 }); |
| 1395 | 1415 |
| 1396 | |
| 1397 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsResponse", () { | 1416 unittest.group("obj-schema-ListAvailableOrgPolicyConstraintsResponse", () { |
| 1398 unittest.test("to-json--from-json", () { | 1417 unittest.test("to-json--from-json", () { |
| 1399 var o = buildListAvailableOrgPolicyConstraintsResponse(); | 1418 var o = buildListAvailableOrgPolicyConstraintsResponse(); |
| 1400 var od = new api.ListAvailableOrgPolicyConstraintsResponse.fromJson(o.toJs
on()); | 1419 var od = new api.ListAvailableOrgPolicyConstraintsResponse.fromJson( |
| 1420 o.toJson()); |
| 1401 checkListAvailableOrgPolicyConstraintsResponse(od); | 1421 checkListAvailableOrgPolicyConstraintsResponse(od); |
| 1402 }); | 1422 }); |
| 1403 }); | 1423 }); |
| 1404 | 1424 |
| 1405 | |
| 1406 unittest.group("obj-schema-ListConstraint", () { | 1425 unittest.group("obj-schema-ListConstraint", () { |
| 1407 unittest.test("to-json--from-json", () { | 1426 unittest.test("to-json--from-json", () { |
| 1408 var o = buildListConstraint(); | 1427 var o = buildListConstraint(); |
| 1409 var od = new api.ListConstraint.fromJson(o.toJson()); | 1428 var od = new api.ListConstraint.fromJson(o.toJson()); |
| 1410 checkListConstraint(od); | 1429 checkListConstraint(od); |
| 1411 }); | 1430 }); |
| 1412 }); | 1431 }); |
| 1413 | 1432 |
| 1414 | |
| 1415 unittest.group("obj-schema-ListLiensResponse", () { | 1433 unittest.group("obj-schema-ListLiensResponse", () { |
| 1416 unittest.test("to-json--from-json", () { | 1434 unittest.test("to-json--from-json", () { |
| 1417 var o = buildListLiensResponse(); | 1435 var o = buildListLiensResponse(); |
| 1418 var od = new api.ListLiensResponse.fromJson(o.toJson()); | 1436 var od = new api.ListLiensResponse.fromJson(o.toJson()); |
| 1419 checkListLiensResponse(od); | 1437 checkListLiensResponse(od); |
| 1420 }); | 1438 }); |
| 1421 }); | 1439 }); |
| 1422 | 1440 |
| 1423 | |
| 1424 unittest.group("obj-schema-ListOrgPoliciesRequest", () { | 1441 unittest.group("obj-schema-ListOrgPoliciesRequest", () { |
| 1425 unittest.test("to-json--from-json", () { | 1442 unittest.test("to-json--from-json", () { |
| 1426 var o = buildListOrgPoliciesRequest(); | 1443 var o = buildListOrgPoliciesRequest(); |
| 1427 var od = new api.ListOrgPoliciesRequest.fromJson(o.toJson()); | 1444 var od = new api.ListOrgPoliciesRequest.fromJson(o.toJson()); |
| 1428 checkListOrgPoliciesRequest(od); | 1445 checkListOrgPoliciesRequest(od); |
| 1429 }); | 1446 }); |
| 1430 }); | 1447 }); |
| 1431 | 1448 |
| 1432 | |
| 1433 unittest.group("obj-schema-ListOrgPoliciesResponse", () { | 1449 unittest.group("obj-schema-ListOrgPoliciesResponse", () { |
| 1434 unittest.test("to-json--from-json", () { | 1450 unittest.test("to-json--from-json", () { |
| 1435 var o = buildListOrgPoliciesResponse(); | 1451 var o = buildListOrgPoliciesResponse(); |
| 1436 var od = new api.ListOrgPoliciesResponse.fromJson(o.toJson()); | 1452 var od = new api.ListOrgPoliciesResponse.fromJson(o.toJson()); |
| 1437 checkListOrgPoliciesResponse(od); | 1453 checkListOrgPoliciesResponse(od); |
| 1438 }); | 1454 }); |
| 1439 }); | 1455 }); |
| 1440 | 1456 |
| 1441 | |
| 1442 unittest.group("obj-schema-ListPolicy", () { | 1457 unittest.group("obj-schema-ListPolicy", () { |
| 1443 unittest.test("to-json--from-json", () { | 1458 unittest.test("to-json--from-json", () { |
| 1444 var o = buildListPolicy(); | 1459 var o = buildListPolicy(); |
| 1445 var od = new api.ListPolicy.fromJson(o.toJson()); | 1460 var od = new api.ListPolicy.fromJson(o.toJson()); |
| 1446 checkListPolicy(od); | 1461 checkListPolicy(od); |
| 1447 }); | 1462 }); |
| 1448 }); | 1463 }); |
| 1449 | 1464 |
| 1450 | |
| 1451 unittest.group("obj-schema-ListProjectsResponse", () { | 1465 unittest.group("obj-schema-ListProjectsResponse", () { |
| 1452 unittest.test("to-json--from-json", () { | 1466 unittest.test("to-json--from-json", () { |
| 1453 var o = buildListProjectsResponse(); | 1467 var o = buildListProjectsResponse(); |
| 1454 var od = new api.ListProjectsResponse.fromJson(o.toJson()); | 1468 var od = new api.ListProjectsResponse.fromJson(o.toJson()); |
| 1455 checkListProjectsResponse(od); | 1469 checkListProjectsResponse(od); |
| 1456 }); | 1470 }); |
| 1457 }); | 1471 }); |
| 1458 | 1472 |
| 1459 | |
| 1460 unittest.group("obj-schema-Operation", () { | 1473 unittest.group("obj-schema-Operation", () { |
| 1461 unittest.test("to-json--from-json", () { | 1474 unittest.test("to-json--from-json", () { |
| 1462 var o = buildOperation(); | 1475 var o = buildOperation(); |
| 1463 var od = new api.Operation.fromJson(o.toJson()); | 1476 var od = new api.Operation.fromJson(o.toJson()); |
| 1464 checkOperation(od); | 1477 checkOperation(od); |
| 1465 }); | 1478 }); |
| 1466 }); | 1479 }); |
| 1467 | 1480 |
| 1468 | |
| 1469 unittest.group("obj-schema-OrgPolicy", () { | 1481 unittest.group("obj-schema-OrgPolicy", () { |
| 1470 unittest.test("to-json--from-json", () { | 1482 unittest.test("to-json--from-json", () { |
| 1471 var o = buildOrgPolicy(); | 1483 var o = buildOrgPolicy(); |
| 1472 var od = new api.OrgPolicy.fromJson(o.toJson()); | 1484 var od = new api.OrgPolicy.fromJson(o.toJson()); |
| 1473 checkOrgPolicy(od); | 1485 checkOrgPolicy(od); |
| 1474 }); | 1486 }); |
| 1475 }); | 1487 }); |
| 1476 | 1488 |
| 1477 | |
| 1478 unittest.group("obj-schema-Organization", () { | 1489 unittest.group("obj-schema-Organization", () { |
| 1479 unittest.test("to-json--from-json", () { | 1490 unittest.test("to-json--from-json", () { |
| 1480 var o = buildOrganization(); | 1491 var o = buildOrganization(); |
| 1481 var od = new api.Organization.fromJson(o.toJson()); | 1492 var od = new api.Organization.fromJson(o.toJson()); |
| 1482 checkOrganization(od); | 1493 checkOrganization(od); |
| 1483 }); | 1494 }); |
| 1484 }); | 1495 }); |
| 1485 | 1496 |
| 1486 | |
| 1487 unittest.group("obj-schema-OrganizationOwner", () { | 1497 unittest.group("obj-schema-OrganizationOwner", () { |
| 1488 unittest.test("to-json--from-json", () { | 1498 unittest.test("to-json--from-json", () { |
| 1489 var o = buildOrganizationOwner(); | 1499 var o = buildOrganizationOwner(); |
| 1490 var od = new api.OrganizationOwner.fromJson(o.toJson()); | 1500 var od = new api.OrganizationOwner.fromJson(o.toJson()); |
| 1491 checkOrganizationOwner(od); | 1501 checkOrganizationOwner(od); |
| 1492 }); | 1502 }); |
| 1493 }); | 1503 }); |
| 1494 | 1504 |
| 1495 | |
| 1496 unittest.group("obj-schema-Policy", () { | 1505 unittest.group("obj-schema-Policy", () { |
| 1497 unittest.test("to-json--from-json", () { | 1506 unittest.test("to-json--from-json", () { |
| 1498 var o = buildPolicy(); | 1507 var o = buildPolicy(); |
| 1499 var od = new api.Policy.fromJson(o.toJson()); | 1508 var od = new api.Policy.fromJson(o.toJson()); |
| 1500 checkPolicy(od); | 1509 checkPolicy(od); |
| 1501 }); | 1510 }); |
| 1502 }); | 1511 }); |
| 1503 | 1512 |
| 1504 | |
| 1505 unittest.group("obj-schema-Project", () { | 1513 unittest.group("obj-schema-Project", () { |
| 1506 unittest.test("to-json--from-json", () { | 1514 unittest.test("to-json--from-json", () { |
| 1507 var o = buildProject(); | 1515 var o = buildProject(); |
| 1508 var od = new api.Project.fromJson(o.toJson()); | 1516 var od = new api.Project.fromJson(o.toJson()); |
| 1509 checkProject(od); | 1517 checkProject(od); |
| 1510 }); | 1518 }); |
| 1511 }); | 1519 }); |
| 1512 | 1520 |
| 1513 | |
| 1514 unittest.group("obj-schema-ProjectCreationStatus", () { | 1521 unittest.group("obj-schema-ProjectCreationStatus", () { |
| 1515 unittest.test("to-json--from-json", () { | 1522 unittest.test("to-json--from-json", () { |
| 1516 var o = buildProjectCreationStatus(); | 1523 var o = buildProjectCreationStatus(); |
| 1517 var od = new api.ProjectCreationStatus.fromJson(o.toJson()); | 1524 var od = new api.ProjectCreationStatus.fromJson(o.toJson()); |
| 1518 checkProjectCreationStatus(od); | 1525 checkProjectCreationStatus(od); |
| 1519 }); | 1526 }); |
| 1520 }); | 1527 }); |
| 1521 | 1528 |
| 1522 | |
| 1523 unittest.group("obj-schema-ResourceId", () { | 1529 unittest.group("obj-schema-ResourceId", () { |
| 1524 unittest.test("to-json--from-json", () { | 1530 unittest.test("to-json--from-json", () { |
| 1525 var o = buildResourceId(); | 1531 var o = buildResourceId(); |
| 1526 var od = new api.ResourceId.fromJson(o.toJson()); | 1532 var od = new api.ResourceId.fromJson(o.toJson()); |
| 1527 checkResourceId(od); | 1533 checkResourceId(od); |
| 1528 }); | 1534 }); |
| 1529 }); | 1535 }); |
| 1530 | 1536 |
| 1531 | |
| 1532 unittest.group("obj-schema-RestoreDefault", () { | 1537 unittest.group("obj-schema-RestoreDefault", () { |
| 1533 unittest.test("to-json--from-json", () { | 1538 unittest.test("to-json--from-json", () { |
| 1534 var o = buildRestoreDefault(); | 1539 var o = buildRestoreDefault(); |
| 1535 var od = new api.RestoreDefault.fromJson(o.toJson()); | 1540 var od = new api.RestoreDefault.fromJson(o.toJson()); |
| 1536 checkRestoreDefault(od); | 1541 checkRestoreDefault(od); |
| 1537 }); | 1542 }); |
| 1538 }); | 1543 }); |
| 1539 | 1544 |
| 1540 | |
| 1541 unittest.group("obj-schema-SearchOrganizationsRequest", () { | 1545 unittest.group("obj-schema-SearchOrganizationsRequest", () { |
| 1542 unittest.test("to-json--from-json", () { | 1546 unittest.test("to-json--from-json", () { |
| 1543 var o = buildSearchOrganizationsRequest(); | 1547 var o = buildSearchOrganizationsRequest(); |
| 1544 var od = new api.SearchOrganizationsRequest.fromJson(o.toJson()); | 1548 var od = new api.SearchOrganizationsRequest.fromJson(o.toJson()); |
| 1545 checkSearchOrganizationsRequest(od); | 1549 checkSearchOrganizationsRequest(od); |
| 1546 }); | 1550 }); |
| 1547 }); | 1551 }); |
| 1548 | 1552 |
| 1549 | |
| 1550 unittest.group("obj-schema-SearchOrganizationsResponse", () { | 1553 unittest.group("obj-schema-SearchOrganizationsResponse", () { |
| 1551 unittest.test("to-json--from-json", () { | 1554 unittest.test("to-json--from-json", () { |
| 1552 var o = buildSearchOrganizationsResponse(); | 1555 var o = buildSearchOrganizationsResponse(); |
| 1553 var od = new api.SearchOrganizationsResponse.fromJson(o.toJson()); | 1556 var od = new api.SearchOrganizationsResponse.fromJson(o.toJson()); |
| 1554 checkSearchOrganizationsResponse(od); | 1557 checkSearchOrganizationsResponse(od); |
| 1555 }); | 1558 }); |
| 1556 }); | 1559 }); |
| 1557 | 1560 |
| 1558 | |
| 1559 unittest.group("obj-schema-SetIamPolicyRequest", () { | 1561 unittest.group("obj-schema-SetIamPolicyRequest", () { |
| 1560 unittest.test("to-json--from-json", () { | 1562 unittest.test("to-json--from-json", () { |
| 1561 var o = buildSetIamPolicyRequest(); | 1563 var o = buildSetIamPolicyRequest(); |
| 1562 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); | 1564 var od = new api.SetIamPolicyRequest.fromJson(o.toJson()); |
| 1563 checkSetIamPolicyRequest(od); | 1565 checkSetIamPolicyRequest(od); |
| 1564 }); | 1566 }); |
| 1565 }); | 1567 }); |
| 1566 | 1568 |
| 1567 | |
| 1568 unittest.group("obj-schema-SetOrgPolicyRequest", () { | 1569 unittest.group("obj-schema-SetOrgPolicyRequest", () { |
| 1569 unittest.test("to-json--from-json", () { | 1570 unittest.test("to-json--from-json", () { |
| 1570 var o = buildSetOrgPolicyRequest(); | 1571 var o = buildSetOrgPolicyRequest(); |
| 1571 var od = new api.SetOrgPolicyRequest.fromJson(o.toJson()); | 1572 var od = new api.SetOrgPolicyRequest.fromJson(o.toJson()); |
| 1572 checkSetOrgPolicyRequest(od); | 1573 checkSetOrgPolicyRequest(od); |
| 1573 }); | 1574 }); |
| 1574 }); | 1575 }); |
| 1575 | 1576 |
| 1576 | |
| 1577 unittest.group("obj-schema-Status", () { | 1577 unittest.group("obj-schema-Status", () { |
| 1578 unittest.test("to-json--from-json", () { | 1578 unittest.test("to-json--from-json", () { |
| 1579 var o = buildStatus(); | 1579 var o = buildStatus(); |
| 1580 var od = new api.Status.fromJson(o.toJson()); | 1580 var od = new api.Status.fromJson(o.toJson()); |
| 1581 checkStatus(od); | 1581 checkStatus(od); |
| 1582 }); | 1582 }); |
| 1583 }); | 1583 }); |
| 1584 | 1584 |
| 1585 | |
| 1586 unittest.group("obj-schema-TestIamPermissionsRequest", () { | 1585 unittest.group("obj-schema-TestIamPermissionsRequest", () { |
| 1587 unittest.test("to-json--from-json", () { | 1586 unittest.test("to-json--from-json", () { |
| 1588 var o = buildTestIamPermissionsRequest(); | 1587 var o = buildTestIamPermissionsRequest(); |
| 1589 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); | 1588 var od = new api.TestIamPermissionsRequest.fromJson(o.toJson()); |
| 1590 checkTestIamPermissionsRequest(od); | 1589 checkTestIamPermissionsRequest(od); |
| 1591 }); | 1590 }); |
| 1592 }); | 1591 }); |
| 1593 | 1592 |
| 1594 | |
| 1595 unittest.group("obj-schema-TestIamPermissionsResponse", () { | 1593 unittest.group("obj-schema-TestIamPermissionsResponse", () { |
| 1596 unittest.test("to-json--from-json", () { | 1594 unittest.test("to-json--from-json", () { |
| 1597 var o = buildTestIamPermissionsResponse(); | 1595 var o = buildTestIamPermissionsResponse(); |
| 1598 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); | 1596 var od = new api.TestIamPermissionsResponse.fromJson(o.toJson()); |
| 1599 checkTestIamPermissionsResponse(od); | 1597 checkTestIamPermissionsResponse(od); |
| 1600 }); | 1598 }); |
| 1601 }); | 1599 }); |
| 1602 | 1600 |
| 1603 | |
| 1604 unittest.group("obj-schema-UndeleteProjectRequest", () { | 1601 unittest.group("obj-schema-UndeleteProjectRequest", () { |
| 1605 unittest.test("to-json--from-json", () { | 1602 unittest.test("to-json--from-json", () { |
| 1606 var o = buildUndeleteProjectRequest(); | 1603 var o = buildUndeleteProjectRequest(); |
| 1607 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); | 1604 var od = new api.UndeleteProjectRequest.fromJson(o.toJson()); |
| 1608 checkUndeleteProjectRequest(od); | 1605 checkUndeleteProjectRequest(od); |
| 1609 }); | 1606 }); |
| 1610 }); | 1607 }); |
| 1611 | 1608 |
| 1612 | |
| 1613 unittest.group("resource-FoldersResourceApi", () { | 1609 unittest.group("resource-FoldersResourceApi", () { |
| 1614 unittest.test("method--clearOrgPolicy", () { | 1610 unittest.test("method--clearOrgPolicy", () { |
| 1615 | |
| 1616 var mock = new HttpServerMock(); | 1611 var mock = new HttpServerMock(); |
| 1617 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1612 api.FoldersResourceApi res = |
| 1613 new api.CloudresourcemanagerApi(mock).folders; |
| 1618 var arg_request = buildClearOrgPolicyRequest(); | 1614 var arg_request = buildClearOrgPolicyRequest(); |
| 1619 var arg_resource = "foo"; | 1615 var arg_resource = "foo"; |
| 1620 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1616 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1621 var obj = new api.ClearOrgPolicyRequest.fromJson(json); | 1617 var obj = new api.ClearOrgPolicyRequest.fromJson(json); |
| 1622 checkClearOrgPolicyRequest(obj); | 1618 checkClearOrgPolicyRequest(obj); |
| 1623 | 1619 |
| 1624 var path = (req.url).path; | 1620 var path = (req.url).path; |
| 1625 var pathOffset = 0; | 1621 var pathOffset = 0; |
| 1626 var index; | 1622 var index; |
| 1627 var subPart; | 1623 var subPart; |
| 1628 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1624 unittest.expect( |
| 1625 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1629 pathOffset += 1; | 1626 pathOffset += 1; |
| 1630 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1627 unittest.expect( |
| 1628 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1631 pathOffset += 3; | 1629 pathOffset += 3; |
| 1632 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1630 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1633 | 1631 |
| 1634 var query = (req.url).query; | 1632 var query = (req.url).query; |
| 1635 var queryOffset = 0; | 1633 var queryOffset = 0; |
| 1636 var queryMap = {}; | 1634 var queryMap = {}; |
| 1637 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1635 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1638 parseBool(n) { | 1636 parseBool(n) { |
| 1639 if (n == "true") return true; | 1637 if (n == "true") return true; |
| 1640 if (n == "false") return false; | 1638 if (n == "false") return false; |
| 1641 if (n == null) return null; | 1639 if (n == null) return null; |
| 1642 throw new core.ArgumentError("Invalid boolean: $n"); | 1640 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1643 } | 1641 } |
| 1642 |
| 1644 if (query.length > 0) { | 1643 if (query.length > 0) { |
| 1645 for (var part in query.split("&")) { | 1644 for (var part in query.split("&")) { |
| 1646 var keyvalue = part.split("="); | 1645 var keyvalue = part.split("="); |
| 1647 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1646 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1647 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1648 } | 1648 } |
| 1649 } | 1649 } |
| 1650 | 1650 |
| 1651 | |
| 1652 var h = { | 1651 var h = { |
| 1653 "content-type" : "application/json; charset=utf-8", | 1652 "content-type": "application/json; charset=utf-8", |
| 1654 }; | 1653 }; |
| 1655 var resp = convert.JSON.encode(buildEmpty()); | 1654 var resp = convert.JSON.encode(buildEmpty()); |
| 1656 return new async.Future.value(stringResponse(200, h, resp)); | 1655 return new async.Future.value(stringResponse(200, h, resp)); |
| 1657 }), true); | 1656 }), true); |
| 1658 res.clearOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1((
(api.Empty response) { | 1657 res |
| 1658 .clearOrgPolicy(arg_request, arg_resource) |
| 1659 .then(unittest.expectAsync1(((api.Empty response) { |
| 1659 checkEmpty(response); | 1660 checkEmpty(response); |
| 1660 }))); | 1661 }))); |
| 1661 }); | 1662 }); |
| 1662 | 1663 |
| 1663 unittest.test("method--getEffectiveOrgPolicy", () { | 1664 unittest.test("method--getEffectiveOrgPolicy", () { |
| 1664 | |
| 1665 var mock = new HttpServerMock(); | 1665 var mock = new HttpServerMock(); |
| 1666 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1666 api.FoldersResourceApi res = |
| 1667 new api.CloudresourcemanagerApi(mock).folders; |
| 1667 var arg_request = buildGetEffectiveOrgPolicyRequest(); | 1668 var arg_request = buildGetEffectiveOrgPolicyRequest(); |
| 1668 var arg_resource = "foo"; | 1669 var arg_resource = "foo"; |
| 1669 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1670 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1670 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); | 1671 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); |
| 1671 checkGetEffectiveOrgPolicyRequest(obj); | 1672 checkGetEffectiveOrgPolicyRequest(obj); |
| 1672 | 1673 |
| 1673 var path = (req.url).path; | 1674 var path = (req.url).path; |
| 1674 var pathOffset = 0; | 1675 var pathOffset = 0; |
| 1675 var index; | 1676 var index; |
| 1676 var subPart; | 1677 var subPart; |
| 1677 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1678 unittest.expect( |
| 1679 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1678 pathOffset += 1; | 1680 pathOffset += 1; |
| 1679 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1681 unittest.expect( |
| 1682 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1680 pathOffset += 3; | 1683 pathOffset += 3; |
| 1681 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1684 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1682 | 1685 |
| 1683 var query = (req.url).query; | 1686 var query = (req.url).query; |
| 1684 var queryOffset = 0; | 1687 var queryOffset = 0; |
| 1685 var queryMap = {}; | 1688 var queryMap = {}; |
| 1686 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1689 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1687 parseBool(n) { | 1690 parseBool(n) { |
| 1688 if (n == "true") return true; | 1691 if (n == "true") return true; |
| 1689 if (n == "false") return false; | 1692 if (n == "false") return false; |
| 1690 if (n == null) return null; | 1693 if (n == null) return null; |
| 1691 throw new core.ArgumentError("Invalid boolean: $n"); | 1694 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1692 } | 1695 } |
| 1696 |
| 1693 if (query.length > 0) { | 1697 if (query.length > 0) { |
| 1694 for (var part in query.split("&")) { | 1698 for (var part in query.split("&")) { |
| 1695 var keyvalue = part.split("="); | 1699 var keyvalue = part.split("="); |
| 1696 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1700 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1701 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1697 } | 1702 } |
| 1698 } | 1703 } |
| 1699 | 1704 |
| 1700 | |
| 1701 var h = { | 1705 var h = { |
| 1702 "content-type" : "application/json; charset=utf-8", | 1706 "content-type": "application/json; charset=utf-8", |
| 1703 }; | 1707 }; |
| 1704 var resp = convert.JSON.encode(buildOrgPolicy()); | 1708 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 1705 return new async.Future.value(stringResponse(200, h, resp)); | 1709 return new async.Future.value(stringResponse(200, h, resp)); |
| 1706 }), true); | 1710 }), true); |
| 1707 res.getEffectiveOrgPolicy(arg_request, arg_resource).then(unittest.expectA
sync1(((api.OrgPolicy response) { | 1711 res |
| 1712 .getEffectiveOrgPolicy(arg_request, arg_resource) |
| 1713 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 1708 checkOrgPolicy(response); | 1714 checkOrgPolicy(response); |
| 1709 }))); | 1715 }))); |
| 1710 }); | 1716 }); |
| 1711 | 1717 |
| 1712 unittest.test("method--getOrgPolicy", () { | 1718 unittest.test("method--getOrgPolicy", () { |
| 1713 | |
| 1714 var mock = new HttpServerMock(); | 1719 var mock = new HttpServerMock(); |
| 1715 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1720 api.FoldersResourceApi res = |
| 1721 new api.CloudresourcemanagerApi(mock).folders; |
| 1716 var arg_request = buildGetOrgPolicyRequest(); | 1722 var arg_request = buildGetOrgPolicyRequest(); |
| 1717 var arg_resource = "foo"; | 1723 var arg_resource = "foo"; |
| 1718 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1724 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1719 var obj = new api.GetOrgPolicyRequest.fromJson(json); | 1725 var obj = new api.GetOrgPolicyRequest.fromJson(json); |
| 1720 checkGetOrgPolicyRequest(obj); | 1726 checkGetOrgPolicyRequest(obj); |
| 1721 | 1727 |
| 1722 var path = (req.url).path; | 1728 var path = (req.url).path; |
| 1723 var pathOffset = 0; | 1729 var pathOffset = 0; |
| 1724 var index; | 1730 var index; |
| 1725 var subPart; | 1731 var subPart; |
| 1726 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1732 unittest.expect( |
| 1733 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1727 pathOffset += 1; | 1734 pathOffset += 1; |
| 1728 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1735 unittest.expect( |
| 1736 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1729 pathOffset += 3; | 1737 pathOffset += 3; |
| 1730 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1738 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1731 | 1739 |
| 1732 var query = (req.url).query; | 1740 var query = (req.url).query; |
| 1733 var queryOffset = 0; | 1741 var queryOffset = 0; |
| 1734 var queryMap = {}; | 1742 var queryMap = {}; |
| 1735 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1743 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1736 parseBool(n) { | 1744 parseBool(n) { |
| 1737 if (n == "true") return true; | 1745 if (n == "true") return true; |
| 1738 if (n == "false") return false; | 1746 if (n == "false") return false; |
| 1739 if (n == null) return null; | 1747 if (n == null) return null; |
| 1740 throw new core.ArgumentError("Invalid boolean: $n"); | 1748 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1741 } | 1749 } |
| 1750 |
| 1742 if (query.length > 0) { | 1751 if (query.length > 0) { |
| 1743 for (var part in query.split("&")) { | 1752 for (var part in query.split("&")) { |
| 1744 var keyvalue = part.split("="); | 1753 var keyvalue = part.split("="); |
| 1745 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1754 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1755 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1746 } | 1756 } |
| 1747 } | 1757 } |
| 1748 | 1758 |
| 1749 | |
| 1750 var h = { | 1759 var h = { |
| 1751 "content-type" : "application/json; charset=utf-8", | 1760 "content-type": "application/json; charset=utf-8", |
| 1752 }; | 1761 }; |
| 1753 var resp = convert.JSON.encode(buildOrgPolicy()); | 1762 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 1754 return new async.Future.value(stringResponse(200, h, resp)); | 1763 return new async.Future.value(stringResponse(200, h, resp)); |
| 1755 }), true); | 1764 }), true); |
| 1756 res.getOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 1765 res |
| 1766 .getOrgPolicy(arg_request, arg_resource) |
| 1767 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 1757 checkOrgPolicy(response); | 1768 checkOrgPolicy(response); |
| 1758 }))); | 1769 }))); |
| 1759 }); | 1770 }); |
| 1760 | 1771 |
| 1761 unittest.test("method--listAvailableOrgPolicyConstraints", () { | 1772 unittest.test("method--listAvailableOrgPolicyConstraints", () { |
| 1762 | |
| 1763 var mock = new HttpServerMock(); | 1773 var mock = new HttpServerMock(); |
| 1764 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1774 api.FoldersResourceApi res = |
| 1775 new api.CloudresourcemanagerApi(mock).folders; |
| 1765 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); | 1776 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); |
| 1766 var arg_resource = "foo"; | 1777 var arg_resource = "foo"; |
| 1767 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1778 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1768 var obj = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json
); | 1779 var obj = |
| 1780 new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json); |
| 1769 checkListAvailableOrgPolicyConstraintsRequest(obj); | 1781 checkListAvailableOrgPolicyConstraintsRequest(obj); |
| 1770 | 1782 |
| 1771 var path = (req.url).path; | 1783 var path = (req.url).path; |
| 1772 var pathOffset = 0; | 1784 var pathOffset = 0; |
| 1773 var index; | 1785 var index; |
| 1774 var subPart; | 1786 var subPart; |
| 1775 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1787 unittest.expect( |
| 1788 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1776 pathOffset += 1; | 1789 pathOffset += 1; |
| 1777 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1790 unittest.expect( |
| 1791 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1778 pathOffset += 3; | 1792 pathOffset += 3; |
| 1779 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1793 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1780 | 1794 |
| 1781 var query = (req.url).query; | 1795 var query = (req.url).query; |
| 1782 var queryOffset = 0; | 1796 var queryOffset = 0; |
| 1783 var queryMap = {}; | 1797 var queryMap = {}; |
| 1784 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1798 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1785 parseBool(n) { | 1799 parseBool(n) { |
| 1786 if (n == "true") return true; | 1800 if (n == "true") return true; |
| 1787 if (n == "false") return false; | 1801 if (n == "false") return false; |
| 1788 if (n == null) return null; | 1802 if (n == null) return null; |
| 1789 throw new core.ArgumentError("Invalid boolean: $n"); | 1803 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1790 } | 1804 } |
| 1805 |
| 1791 if (query.length > 0) { | 1806 if (query.length > 0) { |
| 1792 for (var part in query.split("&")) { | 1807 for (var part in query.split("&")) { |
| 1793 var keyvalue = part.split("="); | 1808 var keyvalue = part.split("="); |
| 1794 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1809 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1810 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1795 } | 1811 } |
| 1796 } | 1812 } |
| 1797 | 1813 |
| 1798 | |
| 1799 var h = { | 1814 var h = { |
| 1800 "content-type" : "application/json; charset=utf-8", | 1815 "content-type": "application/json; charset=utf-8", |
| 1801 }; | 1816 }; |
| 1802 var resp = convert.JSON.encode(buildListAvailableOrgPolicyConstraintsRes
ponse()); | 1817 var resp = convert.JSON |
| 1818 .encode(buildListAvailableOrgPolicyConstraintsResponse()); |
| 1803 return new async.Future.value(stringResponse(200, h, resp)); | 1819 return new async.Future.value(stringResponse(200, h, resp)); |
| 1804 }), true); | 1820 }), true); |
| 1805 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then(unit
test.expectAsync1(((api.ListAvailableOrgPolicyConstraintsResponse response) { | 1821 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then( |
| 1822 unittest.expectAsync1( |
| 1823 ((api.ListAvailableOrgPolicyConstraintsResponse response) { |
| 1806 checkListAvailableOrgPolicyConstraintsResponse(response); | 1824 checkListAvailableOrgPolicyConstraintsResponse(response); |
| 1807 }))); | 1825 }))); |
| 1808 }); | 1826 }); |
| 1809 | 1827 |
| 1810 unittest.test("method--listOrgPolicies", () { | 1828 unittest.test("method--listOrgPolicies", () { |
| 1811 | |
| 1812 var mock = new HttpServerMock(); | 1829 var mock = new HttpServerMock(); |
| 1813 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1830 api.FoldersResourceApi res = |
| 1831 new api.CloudresourcemanagerApi(mock).folders; |
| 1814 var arg_request = buildListOrgPoliciesRequest(); | 1832 var arg_request = buildListOrgPoliciesRequest(); |
| 1815 var arg_resource = "foo"; | 1833 var arg_resource = "foo"; |
| 1816 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1834 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1817 var obj = new api.ListOrgPoliciesRequest.fromJson(json); | 1835 var obj = new api.ListOrgPoliciesRequest.fromJson(json); |
| 1818 checkListOrgPoliciesRequest(obj); | 1836 checkListOrgPoliciesRequest(obj); |
| 1819 | 1837 |
| 1820 var path = (req.url).path; | 1838 var path = (req.url).path; |
| 1821 var pathOffset = 0; | 1839 var pathOffset = 0; |
| 1822 var index; | 1840 var index; |
| 1823 var subPart; | 1841 var subPart; |
| 1824 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1842 unittest.expect( |
| 1843 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1825 pathOffset += 1; | 1844 pathOffset += 1; |
| 1826 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1845 unittest.expect( |
| 1846 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1827 pathOffset += 3; | 1847 pathOffset += 3; |
| 1828 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1848 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1829 | 1849 |
| 1830 var query = (req.url).query; | 1850 var query = (req.url).query; |
| 1831 var queryOffset = 0; | 1851 var queryOffset = 0; |
| 1832 var queryMap = {}; | 1852 var queryMap = {}; |
| 1833 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1853 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1834 parseBool(n) { | 1854 parseBool(n) { |
| 1835 if (n == "true") return true; | 1855 if (n == "true") return true; |
| 1836 if (n == "false") return false; | 1856 if (n == "false") return false; |
| 1837 if (n == null) return null; | 1857 if (n == null) return null; |
| 1838 throw new core.ArgumentError("Invalid boolean: $n"); | 1858 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1839 } | 1859 } |
| 1860 |
| 1840 if (query.length > 0) { | 1861 if (query.length > 0) { |
| 1841 for (var part in query.split("&")) { | 1862 for (var part in query.split("&")) { |
| 1842 var keyvalue = part.split("="); | 1863 var keyvalue = part.split("="); |
| 1843 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1864 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1865 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1844 } | 1866 } |
| 1845 } | 1867 } |
| 1846 | 1868 |
| 1847 | |
| 1848 var h = { | 1869 var h = { |
| 1849 "content-type" : "application/json; charset=utf-8", | 1870 "content-type": "application/json; charset=utf-8", |
| 1850 }; | 1871 }; |
| 1851 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); | 1872 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); |
| 1852 return new async.Future.value(stringResponse(200, h, resp)); | 1873 return new async.Future.value(stringResponse(200, h, resp)); |
| 1853 }), true); | 1874 }), true); |
| 1854 res.listOrgPolicies(arg_request, arg_resource).then(unittest.expectAsync1(
((api.ListOrgPoliciesResponse response) { | 1875 res |
| 1876 .listOrgPolicies(arg_request, arg_resource) |
| 1877 .then(unittest.expectAsync1(((api.ListOrgPoliciesResponse response) { |
| 1855 checkListOrgPoliciesResponse(response); | 1878 checkListOrgPoliciesResponse(response); |
| 1856 }))); | 1879 }))); |
| 1857 }); | 1880 }); |
| 1858 | 1881 |
| 1859 unittest.test("method--setOrgPolicy", () { | 1882 unittest.test("method--setOrgPolicy", () { |
| 1860 | |
| 1861 var mock = new HttpServerMock(); | 1883 var mock = new HttpServerMock(); |
| 1862 api.FoldersResourceApi res = new api.CloudresourcemanagerApi(mock).folders
; | 1884 api.FoldersResourceApi res = |
| 1885 new api.CloudresourcemanagerApi(mock).folders; |
| 1863 var arg_request = buildSetOrgPolicyRequest(); | 1886 var arg_request = buildSetOrgPolicyRequest(); |
| 1864 var arg_resource = "foo"; | 1887 var arg_resource = "foo"; |
| 1865 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1888 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1866 var obj = new api.SetOrgPolicyRequest.fromJson(json); | 1889 var obj = new api.SetOrgPolicyRequest.fromJson(json); |
| 1867 checkSetOrgPolicyRequest(obj); | 1890 checkSetOrgPolicyRequest(obj); |
| 1868 | 1891 |
| 1869 var path = (req.url).path; | 1892 var path = (req.url).path; |
| 1870 var pathOffset = 0; | 1893 var pathOffset = 0; |
| 1871 var index; | 1894 var index; |
| 1872 var subPart; | 1895 var subPart; |
| 1873 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1896 unittest.expect( |
| 1897 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1874 pathOffset += 1; | 1898 pathOffset += 1; |
| 1875 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1899 unittest.expect( |
| 1900 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1876 pathOffset += 3; | 1901 pathOffset += 3; |
| 1877 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1902 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1878 | 1903 |
| 1879 var query = (req.url).query; | 1904 var query = (req.url).query; |
| 1880 var queryOffset = 0; | 1905 var queryOffset = 0; |
| 1881 var queryMap = {}; | 1906 var queryMap = {}; |
| 1882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1907 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1883 parseBool(n) { | 1908 parseBool(n) { |
| 1884 if (n == "true") return true; | 1909 if (n == "true") return true; |
| 1885 if (n == "false") return false; | 1910 if (n == "false") return false; |
| 1886 if (n == null) return null; | 1911 if (n == null) return null; |
| 1887 throw new core.ArgumentError("Invalid boolean: $n"); | 1912 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1888 } | 1913 } |
| 1914 |
| 1889 if (query.length > 0) { | 1915 if (query.length > 0) { |
| 1890 for (var part in query.split("&")) { | 1916 for (var part in query.split("&")) { |
| 1891 var keyvalue = part.split("="); | 1917 var keyvalue = part.split("="); |
| 1892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1918 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1919 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1893 } | 1920 } |
| 1894 } | 1921 } |
| 1895 | 1922 |
| 1896 | |
| 1897 var h = { | 1923 var h = { |
| 1898 "content-type" : "application/json; charset=utf-8", | 1924 "content-type": "application/json; charset=utf-8", |
| 1899 }; | 1925 }; |
| 1900 var resp = convert.JSON.encode(buildOrgPolicy()); | 1926 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 1901 return new async.Future.value(stringResponse(200, h, resp)); | 1927 return new async.Future.value(stringResponse(200, h, resp)); |
| 1902 }), true); | 1928 }), true); |
| 1903 res.setOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 1929 res |
| 1930 .setOrgPolicy(arg_request, arg_resource) |
| 1931 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 1904 checkOrgPolicy(response); | 1932 checkOrgPolicy(response); |
| 1905 }))); | 1933 }))); |
| 1906 }); | 1934 }); |
| 1907 | |
| 1908 }); | 1935 }); |
| 1909 | 1936 |
| 1910 | |
| 1911 unittest.group("resource-LiensResourceApi", () { | 1937 unittest.group("resource-LiensResourceApi", () { |
| 1912 unittest.test("method--create", () { | 1938 unittest.test("method--create", () { |
| 1913 | |
| 1914 var mock = new HttpServerMock(); | 1939 var mock = new HttpServerMock(); |
| 1915 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; | 1940 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 1916 var arg_request = buildLien(); | 1941 var arg_request = buildLien(); |
| 1917 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1942 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1918 var obj = new api.Lien.fromJson(json); | 1943 var obj = new api.Lien.fromJson(json); |
| 1919 checkLien(obj); | 1944 checkLien(obj); |
| 1920 | 1945 |
| 1921 var path = (req.url).path; | 1946 var path = (req.url).path; |
| 1922 var pathOffset = 0; | 1947 var pathOffset = 0; |
| 1923 var index; | 1948 var index; |
| 1924 var subPart; | 1949 var subPart; |
| 1925 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1950 unittest.expect( |
| 1951 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1926 pathOffset += 1; | 1952 pathOffset += 1; |
| 1927 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1/liens")); | 1953 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 1954 unittest.equals("v1/liens")); |
| 1928 pathOffset += 8; | 1955 pathOffset += 8; |
| 1929 | 1956 |
| 1930 var query = (req.url).query; | 1957 var query = (req.url).query; |
| 1931 var queryOffset = 0; | 1958 var queryOffset = 0; |
| 1932 var queryMap = {}; | 1959 var queryMap = {}; |
| 1933 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1960 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1934 parseBool(n) { | 1961 parseBool(n) { |
| 1935 if (n == "true") return true; | 1962 if (n == "true") return true; |
| 1936 if (n == "false") return false; | 1963 if (n == "false") return false; |
| 1937 if (n == null) return null; | 1964 if (n == null) return null; |
| 1938 throw new core.ArgumentError("Invalid boolean: $n"); | 1965 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1939 } | 1966 } |
| 1967 |
| 1940 if (query.length > 0) { | 1968 if (query.length > 0) { |
| 1941 for (var part in query.split("&")) { | 1969 for (var part in query.split("&")) { |
| 1942 var keyvalue = part.split("="); | 1970 var keyvalue = part.split("="); |
| 1943 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1971 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1972 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1944 } | 1973 } |
| 1945 } | 1974 } |
| 1946 | 1975 |
| 1947 | |
| 1948 var h = { | 1976 var h = { |
| 1949 "content-type" : "application/json; charset=utf-8", | 1977 "content-type": "application/json; charset=utf-8", |
| 1950 }; | 1978 }; |
| 1951 var resp = convert.JSON.encode(buildLien()); | 1979 var resp = convert.JSON.encode(buildLien()); |
| 1952 return new async.Future.value(stringResponse(200, h, resp)); | 1980 return new async.Future.value(stringResponse(200, h, resp)); |
| 1953 }), true); | 1981 }), true); |
| 1954 res.create(arg_request).then(unittest.expectAsync1(((api.Lien response) { | 1982 res.create(arg_request).then(unittest.expectAsync1(((api.Lien response) { |
| 1955 checkLien(response); | 1983 checkLien(response); |
| 1956 }))); | 1984 }))); |
| 1957 }); | 1985 }); |
| 1958 | 1986 |
| 1959 unittest.test("method--delete", () { | 1987 unittest.test("method--delete", () { |
| 1960 | |
| 1961 var mock = new HttpServerMock(); | 1988 var mock = new HttpServerMock(); |
| 1962 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; | 1989 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 1963 var arg_name = "foo"; | 1990 var arg_name = "foo"; |
| 1964 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1991 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1965 var path = (req.url).path; | 1992 var path = (req.url).path; |
| 1966 var pathOffset = 0; | 1993 var pathOffset = 0; |
| 1967 var index; | 1994 var index; |
| 1968 var subPart; | 1995 var subPart; |
| 1969 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1996 unittest.expect( |
| 1997 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1970 pathOffset += 1; | 1998 pathOffset += 1; |
| 1971 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1999 unittest.expect( |
| 2000 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 1972 pathOffset += 3; | 2001 pathOffset += 3; |
| 1973 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2002 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1974 | 2003 |
| 1975 var query = (req.url).query; | 2004 var query = (req.url).query; |
| 1976 var queryOffset = 0; | 2005 var queryOffset = 0; |
| 1977 var queryMap = {}; | 2006 var queryMap = {}; |
| 1978 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2007 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1979 parseBool(n) { | 2008 parseBool(n) { |
| 1980 if (n == "true") return true; | 2009 if (n == "true") return true; |
| 1981 if (n == "false") return false; | 2010 if (n == "false") return false; |
| 1982 if (n == null) return null; | 2011 if (n == null) return null; |
| 1983 throw new core.ArgumentError("Invalid boolean: $n"); | 2012 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1984 } | 2013 } |
| 2014 |
| 1985 if (query.length > 0) { | 2015 if (query.length > 0) { |
| 1986 for (var part in query.split("&")) { | 2016 for (var part in query.split("&")) { |
| 1987 var keyvalue = part.split("="); | 2017 var keyvalue = part.split("="); |
| 1988 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2018 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2019 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1989 } | 2020 } |
| 1990 } | 2021 } |
| 1991 | 2022 |
| 1992 | |
| 1993 var h = { | 2023 var h = { |
| 1994 "content-type" : "application/json; charset=utf-8", | 2024 "content-type": "application/json; charset=utf-8", |
| 1995 }; | 2025 }; |
| 1996 var resp = convert.JSON.encode(buildEmpty()); | 2026 var resp = convert.JSON.encode(buildEmpty()); |
| 1997 return new async.Future.value(stringResponse(200, h, resp)); | 2027 return new async.Future.value(stringResponse(200, h, resp)); |
| 1998 }), true); | 2028 }), true); |
| 1999 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { | 2029 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2000 checkEmpty(response); | 2030 checkEmpty(response); |
| 2001 }))); | 2031 }))); |
| 2002 }); | 2032 }); |
| 2003 | 2033 |
| 2004 unittest.test("method--list", () { | 2034 unittest.test("method--list", () { |
| 2005 | |
| 2006 var mock = new HttpServerMock(); | 2035 var mock = new HttpServerMock(); |
| 2007 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; | 2036 api.LiensResourceApi res = new api.CloudresourcemanagerApi(mock).liens; |
| 2037 var arg_parent = "foo"; |
| 2008 var arg_pageToken = "foo"; | 2038 var arg_pageToken = "foo"; |
| 2009 var arg_pageSize = 42; | 2039 var arg_pageSize = 42; |
| 2010 var arg_parent = "foo"; | |
| 2011 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2040 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2012 var path = (req.url).path; | 2041 var path = (req.url).path; |
| 2013 var pathOffset = 0; | 2042 var pathOffset = 0; |
| 2014 var index; | 2043 var index; |
| 2015 var subPart; | 2044 var subPart; |
| 2016 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2045 unittest.expect( |
| 2046 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2017 pathOffset += 1; | 2047 pathOffset += 1; |
| 2018 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1/liens")); | 2048 unittest.expect(path.substring(pathOffset, pathOffset + 8), |
| 2049 unittest.equals("v1/liens")); |
| 2019 pathOffset += 8; | 2050 pathOffset += 8; |
| 2020 | 2051 |
| 2021 var query = (req.url).query; | 2052 var query = (req.url).query; |
| 2022 var queryOffset = 0; | 2053 var queryOffset = 0; |
| 2023 var queryMap = {}; | 2054 var queryMap = {}; |
| 2024 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2055 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2025 parseBool(n) { | 2056 parseBool(n) { |
| 2026 if (n == "true") return true; | 2057 if (n == "true") return true; |
| 2027 if (n == "false") return false; | 2058 if (n == "false") return false; |
| 2028 if (n == null) return null; | 2059 if (n == null) return null; |
| 2029 throw new core.ArgumentError("Invalid boolean: $n"); | 2060 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2030 } | 2061 } |
| 2062 |
| 2031 if (query.length > 0) { | 2063 if (query.length > 0) { |
| 2032 for (var part in query.split("&")) { | 2064 for (var part in query.split("&")) { |
| 2033 var keyvalue = part.split("="); | 2065 var keyvalue = part.split("="); |
| 2034 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2066 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2067 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2035 } | 2068 } |
| 2036 } | 2069 } |
| 2037 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 2038 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 2039 unittest.expect(queryMap["parent"].first, unittest.equals(arg_parent)); | 2070 unittest.expect(queryMap["parent"].first, unittest.equals(arg_parent)); |
| 2040 | 2071 unittest.expect( |
| 2072 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 2073 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 2074 unittest.equals(arg_pageSize)); |
| 2041 | 2075 |
| 2042 var h = { | 2076 var h = { |
| 2043 "content-type" : "application/json; charset=utf-8", | 2077 "content-type": "application/json; charset=utf-8", |
| 2044 }; | 2078 }; |
| 2045 var resp = convert.JSON.encode(buildListLiensResponse()); | 2079 var resp = convert.JSON.encode(buildListLiensResponse()); |
| 2046 return new async.Future.value(stringResponse(200, h, resp)); | 2080 return new async.Future.value(stringResponse(200, h, resp)); |
| 2047 }), true); | 2081 }), true); |
| 2048 res.list(pageToken: arg_pageToken, pageSize: arg_pageSize, parent: arg_par
ent).then(unittest.expectAsync1(((api.ListLiensResponse response) { | 2082 res |
| 2083 .list( |
| 2084 parent: arg_parent, |
| 2085 pageToken: arg_pageToken, |
| 2086 pageSize: arg_pageSize) |
| 2087 .then(unittest.expectAsync1(((api.ListLiensResponse response) { |
| 2049 checkListLiensResponse(response); | 2088 checkListLiensResponse(response); |
| 2050 }))); | 2089 }))); |
| 2051 }); | 2090 }); |
| 2052 | |
| 2053 }); | 2091 }); |
| 2054 | 2092 |
| 2055 | |
| 2056 unittest.group("resource-OperationsResourceApi", () { | 2093 unittest.group("resource-OperationsResourceApi", () { |
| 2057 unittest.test("method--get", () { | 2094 unittest.test("method--get", () { |
| 2058 | |
| 2059 var mock = new HttpServerMock(); | 2095 var mock = new HttpServerMock(); |
| 2060 api.OperationsResourceApi res = new api.CloudresourcemanagerApi(mock).oper
ations; | 2096 api.OperationsResourceApi res = |
| 2097 new api.CloudresourcemanagerApi(mock).operations; |
| 2061 var arg_name = "foo"; | 2098 var arg_name = "foo"; |
| 2062 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2099 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2063 var path = (req.url).path; | 2100 var path = (req.url).path; |
| 2064 var pathOffset = 0; | 2101 var pathOffset = 0; |
| 2065 var index; | 2102 var index; |
| 2066 var subPart; | 2103 var subPart; |
| 2067 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2104 unittest.expect( |
| 2105 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2068 pathOffset += 1; | 2106 pathOffset += 1; |
| 2069 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2107 unittest.expect( |
| 2108 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2070 pathOffset += 3; | 2109 pathOffset += 3; |
| 2071 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2110 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2072 | 2111 |
| 2073 var query = (req.url).query; | 2112 var query = (req.url).query; |
| 2074 var queryOffset = 0; | 2113 var queryOffset = 0; |
| 2075 var queryMap = {}; | 2114 var queryMap = {}; |
| 2076 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2115 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2077 parseBool(n) { | 2116 parseBool(n) { |
| 2078 if (n == "true") return true; | 2117 if (n == "true") return true; |
| 2079 if (n == "false") return false; | 2118 if (n == "false") return false; |
| 2080 if (n == null) return null; | 2119 if (n == null) return null; |
| 2081 throw new core.ArgumentError("Invalid boolean: $n"); | 2120 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2082 } | 2121 } |
| 2122 |
| 2083 if (query.length > 0) { | 2123 if (query.length > 0) { |
| 2084 for (var part in query.split("&")) { | 2124 for (var part in query.split("&")) { |
| 2085 var keyvalue = part.split("="); | 2125 var keyvalue = part.split("="); |
| 2086 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2126 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2127 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2087 } | 2128 } |
| 2088 } | 2129 } |
| 2089 | 2130 |
| 2090 | |
| 2091 var h = { | 2131 var h = { |
| 2092 "content-type" : "application/json; charset=utf-8", | 2132 "content-type": "application/json; charset=utf-8", |
| 2093 }; | 2133 }; |
| 2094 var resp = convert.JSON.encode(buildOperation()); | 2134 var resp = convert.JSON.encode(buildOperation()); |
| 2095 return new async.Future.value(stringResponse(200, h, resp)); | 2135 return new async.Future.value(stringResponse(200, h, resp)); |
| 2096 }), true); | 2136 }), true); |
| 2097 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { | 2137 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
| 2098 checkOperation(response); | 2138 checkOperation(response); |
| 2099 }))); | 2139 }))); |
| 2100 }); | 2140 }); |
| 2101 | |
| 2102 }); | 2141 }); |
| 2103 | 2142 |
| 2104 | |
| 2105 unittest.group("resource-OrganizationsResourceApi", () { | 2143 unittest.group("resource-OrganizationsResourceApi", () { |
| 2106 unittest.test("method--clearOrgPolicy", () { | 2144 unittest.test("method--clearOrgPolicy", () { |
| 2107 | |
| 2108 var mock = new HttpServerMock(); | 2145 var mock = new HttpServerMock(); |
| 2109 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2146 api.OrganizationsResourceApi res = |
| 2147 new api.CloudresourcemanagerApi(mock).organizations; |
| 2110 var arg_request = buildClearOrgPolicyRequest(); | 2148 var arg_request = buildClearOrgPolicyRequest(); |
| 2111 var arg_resource = "foo"; | 2149 var arg_resource = "foo"; |
| 2112 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2150 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2113 var obj = new api.ClearOrgPolicyRequest.fromJson(json); | 2151 var obj = new api.ClearOrgPolicyRequest.fromJson(json); |
| 2114 checkClearOrgPolicyRequest(obj); | 2152 checkClearOrgPolicyRequest(obj); |
| 2115 | 2153 |
| 2116 var path = (req.url).path; | 2154 var path = (req.url).path; |
| 2117 var pathOffset = 0; | 2155 var pathOffset = 0; |
| 2118 var index; | 2156 var index; |
| 2119 var subPart; | 2157 var subPart; |
| 2120 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2158 unittest.expect( |
| 2159 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2121 pathOffset += 1; | 2160 pathOffset += 1; |
| 2122 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2161 unittest.expect( |
| 2162 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2123 pathOffset += 3; | 2163 pathOffset += 3; |
| 2124 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2164 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2125 | 2165 |
| 2126 var query = (req.url).query; | 2166 var query = (req.url).query; |
| 2127 var queryOffset = 0; | 2167 var queryOffset = 0; |
| 2128 var queryMap = {}; | 2168 var queryMap = {}; |
| 2129 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2169 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2130 parseBool(n) { | 2170 parseBool(n) { |
| 2131 if (n == "true") return true; | 2171 if (n == "true") return true; |
| 2132 if (n == "false") return false; | 2172 if (n == "false") return false; |
| 2133 if (n == null) return null; | 2173 if (n == null) return null; |
| 2134 throw new core.ArgumentError("Invalid boolean: $n"); | 2174 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2135 } | 2175 } |
| 2176 |
| 2136 if (query.length > 0) { | 2177 if (query.length > 0) { |
| 2137 for (var part in query.split("&")) { | 2178 for (var part in query.split("&")) { |
| 2138 var keyvalue = part.split("="); | 2179 var keyvalue = part.split("="); |
| 2139 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2180 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2181 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2140 } | 2182 } |
| 2141 } | 2183 } |
| 2142 | 2184 |
| 2143 | |
| 2144 var h = { | 2185 var h = { |
| 2145 "content-type" : "application/json; charset=utf-8", | 2186 "content-type": "application/json; charset=utf-8", |
| 2146 }; | 2187 }; |
| 2147 var resp = convert.JSON.encode(buildEmpty()); | 2188 var resp = convert.JSON.encode(buildEmpty()); |
| 2148 return new async.Future.value(stringResponse(200, h, resp)); | 2189 return new async.Future.value(stringResponse(200, h, resp)); |
| 2149 }), true); | 2190 }), true); |
| 2150 res.clearOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1((
(api.Empty response) { | 2191 res |
| 2192 .clearOrgPolicy(arg_request, arg_resource) |
| 2193 .then(unittest.expectAsync1(((api.Empty response) { |
| 2151 checkEmpty(response); | 2194 checkEmpty(response); |
| 2152 }))); | 2195 }))); |
| 2153 }); | 2196 }); |
| 2154 | 2197 |
| 2155 unittest.test("method--get", () { | 2198 unittest.test("method--get", () { |
| 2156 | |
| 2157 var mock = new HttpServerMock(); | 2199 var mock = new HttpServerMock(); |
| 2158 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2200 api.OrganizationsResourceApi res = |
| 2201 new api.CloudresourcemanagerApi(mock).organizations; |
| 2159 var arg_name = "foo"; | 2202 var arg_name = "foo"; |
| 2160 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2203 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2161 var path = (req.url).path; | 2204 var path = (req.url).path; |
| 2162 var pathOffset = 0; | 2205 var pathOffset = 0; |
| 2163 var index; | 2206 var index; |
| 2164 var subPart; | 2207 var subPart; |
| 2165 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2208 unittest.expect( |
| 2209 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2166 pathOffset += 1; | 2210 pathOffset += 1; |
| 2167 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2211 unittest.expect( |
| 2212 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2168 pathOffset += 3; | 2213 pathOffset += 3; |
| 2169 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2214 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2170 | 2215 |
| 2171 var query = (req.url).query; | 2216 var query = (req.url).query; |
| 2172 var queryOffset = 0; | 2217 var queryOffset = 0; |
| 2173 var queryMap = {}; | 2218 var queryMap = {}; |
| 2174 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2219 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2175 parseBool(n) { | 2220 parseBool(n) { |
| 2176 if (n == "true") return true; | 2221 if (n == "true") return true; |
| 2177 if (n == "false") return false; | 2222 if (n == "false") return false; |
| 2178 if (n == null) return null; | 2223 if (n == null) return null; |
| 2179 throw new core.ArgumentError("Invalid boolean: $n"); | 2224 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2180 } | 2225 } |
| 2226 |
| 2181 if (query.length > 0) { | 2227 if (query.length > 0) { |
| 2182 for (var part in query.split("&")) { | 2228 for (var part in query.split("&")) { |
| 2183 var keyvalue = part.split("="); | 2229 var keyvalue = part.split("="); |
| 2184 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2230 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2231 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2185 } | 2232 } |
| 2186 } | 2233 } |
| 2187 | 2234 |
| 2188 | |
| 2189 var h = { | 2235 var h = { |
| 2190 "content-type" : "application/json; charset=utf-8", | 2236 "content-type": "application/json; charset=utf-8", |
| 2191 }; | 2237 }; |
| 2192 var resp = convert.JSON.encode(buildOrganization()); | 2238 var resp = convert.JSON.encode(buildOrganization()); |
| 2193 return new async.Future.value(stringResponse(200, h, resp)); | 2239 return new async.Future.value(stringResponse(200, h, resp)); |
| 2194 }), true); | 2240 }), true); |
| 2195 res.get(arg_name).then(unittest.expectAsync1(((api.Organization response)
{ | 2241 res |
| 2242 .get(arg_name) |
| 2243 .then(unittest.expectAsync1(((api.Organization response) { |
| 2196 checkOrganization(response); | 2244 checkOrganization(response); |
| 2197 }))); | 2245 }))); |
| 2198 }); | 2246 }); |
| 2199 | 2247 |
| 2200 unittest.test("method--getEffectiveOrgPolicy", () { | 2248 unittest.test("method--getEffectiveOrgPolicy", () { |
| 2201 | |
| 2202 var mock = new HttpServerMock(); | 2249 var mock = new HttpServerMock(); |
| 2203 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2250 api.OrganizationsResourceApi res = |
| 2251 new api.CloudresourcemanagerApi(mock).organizations; |
| 2204 var arg_request = buildGetEffectiveOrgPolicyRequest(); | 2252 var arg_request = buildGetEffectiveOrgPolicyRequest(); |
| 2205 var arg_resource = "foo"; | 2253 var arg_resource = "foo"; |
| 2206 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2254 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2207 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); | 2255 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); |
| 2208 checkGetEffectiveOrgPolicyRequest(obj); | 2256 checkGetEffectiveOrgPolicyRequest(obj); |
| 2209 | 2257 |
| 2210 var path = (req.url).path; | 2258 var path = (req.url).path; |
| 2211 var pathOffset = 0; | 2259 var pathOffset = 0; |
| 2212 var index; | 2260 var index; |
| 2213 var subPart; | 2261 var subPart; |
| 2214 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2262 unittest.expect( |
| 2263 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2215 pathOffset += 1; | 2264 pathOffset += 1; |
| 2216 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2265 unittest.expect( |
| 2266 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2217 pathOffset += 3; | 2267 pathOffset += 3; |
| 2218 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2268 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2219 | 2269 |
| 2220 var query = (req.url).query; | 2270 var query = (req.url).query; |
| 2221 var queryOffset = 0; | 2271 var queryOffset = 0; |
| 2222 var queryMap = {}; | 2272 var queryMap = {}; |
| 2223 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2273 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2224 parseBool(n) { | 2274 parseBool(n) { |
| 2225 if (n == "true") return true; | 2275 if (n == "true") return true; |
| 2226 if (n == "false") return false; | 2276 if (n == "false") return false; |
| 2227 if (n == null) return null; | 2277 if (n == null) return null; |
| 2228 throw new core.ArgumentError("Invalid boolean: $n"); | 2278 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2229 } | 2279 } |
| 2280 |
| 2230 if (query.length > 0) { | 2281 if (query.length > 0) { |
| 2231 for (var part in query.split("&")) { | 2282 for (var part in query.split("&")) { |
| 2232 var keyvalue = part.split("="); | 2283 var keyvalue = part.split("="); |
| 2233 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2284 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2285 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2234 } | 2286 } |
| 2235 } | 2287 } |
| 2236 | 2288 |
| 2237 | |
| 2238 var h = { | 2289 var h = { |
| 2239 "content-type" : "application/json; charset=utf-8", | 2290 "content-type": "application/json; charset=utf-8", |
| 2240 }; | 2291 }; |
| 2241 var resp = convert.JSON.encode(buildOrgPolicy()); | 2292 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 2242 return new async.Future.value(stringResponse(200, h, resp)); | 2293 return new async.Future.value(stringResponse(200, h, resp)); |
| 2243 }), true); | 2294 }), true); |
| 2244 res.getEffectiveOrgPolicy(arg_request, arg_resource).then(unittest.expectA
sync1(((api.OrgPolicy response) { | 2295 res |
| 2296 .getEffectiveOrgPolicy(arg_request, arg_resource) |
| 2297 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 2245 checkOrgPolicy(response); | 2298 checkOrgPolicy(response); |
| 2246 }))); | 2299 }))); |
| 2247 }); | 2300 }); |
| 2248 | 2301 |
| 2249 unittest.test("method--getIamPolicy", () { | 2302 unittest.test("method--getIamPolicy", () { |
| 2250 | |
| 2251 var mock = new HttpServerMock(); | 2303 var mock = new HttpServerMock(); |
| 2252 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2304 api.OrganizationsResourceApi res = |
| 2305 new api.CloudresourcemanagerApi(mock).organizations; |
| 2253 var arg_request = buildGetIamPolicyRequest(); | 2306 var arg_request = buildGetIamPolicyRequest(); |
| 2254 var arg_resource = "foo"; | 2307 var arg_resource = "foo"; |
| 2255 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2308 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2256 var obj = new api.GetIamPolicyRequest.fromJson(json); | 2309 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 2257 checkGetIamPolicyRequest(obj); | 2310 checkGetIamPolicyRequest(obj); |
| 2258 | 2311 |
| 2259 var path = (req.url).path; | 2312 var path = (req.url).path; |
| 2260 var pathOffset = 0; | 2313 var pathOffset = 0; |
| 2261 var index; | 2314 var index; |
| 2262 var subPart; | 2315 var subPart; |
| 2263 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2316 unittest.expect( |
| 2317 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2264 pathOffset += 1; | 2318 pathOffset += 1; |
| 2265 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2319 unittest.expect( |
| 2320 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2266 pathOffset += 3; | 2321 pathOffset += 3; |
| 2267 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2322 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2268 | 2323 |
| 2269 var query = (req.url).query; | 2324 var query = (req.url).query; |
| 2270 var queryOffset = 0; | 2325 var queryOffset = 0; |
| 2271 var queryMap = {}; | 2326 var queryMap = {}; |
| 2272 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2327 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2273 parseBool(n) { | 2328 parseBool(n) { |
| 2274 if (n == "true") return true; | 2329 if (n == "true") return true; |
| 2275 if (n == "false") return false; | 2330 if (n == "false") return false; |
| 2276 if (n == null) return null; | 2331 if (n == null) return null; |
| 2277 throw new core.ArgumentError("Invalid boolean: $n"); | 2332 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2278 } | 2333 } |
| 2334 |
| 2279 if (query.length > 0) { | 2335 if (query.length > 0) { |
| 2280 for (var part in query.split("&")) { | 2336 for (var part in query.split("&")) { |
| 2281 var keyvalue = part.split("="); | 2337 var keyvalue = part.split("="); |
| 2282 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2338 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2339 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2283 } | 2340 } |
| 2284 } | 2341 } |
| 2285 | 2342 |
| 2286 | |
| 2287 var h = { | 2343 var h = { |
| 2288 "content-type" : "application/json; charset=utf-8", | 2344 "content-type": "application/json; charset=utf-8", |
| 2289 }; | 2345 }; |
| 2290 var resp = convert.JSON.encode(buildPolicy()); | 2346 var resp = convert.JSON.encode(buildPolicy()); |
| 2291 return new async.Future.value(stringResponse(200, h, resp)); | 2347 return new async.Future.value(stringResponse(200, h, resp)); |
| 2292 }), true); | 2348 }), true); |
| 2293 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { | 2349 res |
| 2350 .getIamPolicy(arg_request, arg_resource) |
| 2351 .then(unittest.expectAsync1(((api.Policy response) { |
| 2294 checkPolicy(response); | 2352 checkPolicy(response); |
| 2295 }))); | 2353 }))); |
| 2296 }); | 2354 }); |
| 2297 | 2355 |
| 2298 unittest.test("method--getOrgPolicy", () { | 2356 unittest.test("method--getOrgPolicy", () { |
| 2299 | |
| 2300 var mock = new HttpServerMock(); | 2357 var mock = new HttpServerMock(); |
| 2301 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2358 api.OrganizationsResourceApi res = |
| 2359 new api.CloudresourcemanagerApi(mock).organizations; |
| 2302 var arg_request = buildGetOrgPolicyRequest(); | 2360 var arg_request = buildGetOrgPolicyRequest(); |
| 2303 var arg_resource = "foo"; | 2361 var arg_resource = "foo"; |
| 2304 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2362 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2305 var obj = new api.GetOrgPolicyRequest.fromJson(json); | 2363 var obj = new api.GetOrgPolicyRequest.fromJson(json); |
| 2306 checkGetOrgPolicyRequest(obj); | 2364 checkGetOrgPolicyRequest(obj); |
| 2307 | 2365 |
| 2308 var path = (req.url).path; | 2366 var path = (req.url).path; |
| 2309 var pathOffset = 0; | 2367 var pathOffset = 0; |
| 2310 var index; | 2368 var index; |
| 2311 var subPart; | 2369 var subPart; |
| 2312 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2370 unittest.expect( |
| 2371 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2313 pathOffset += 1; | 2372 pathOffset += 1; |
| 2314 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2373 unittest.expect( |
| 2374 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2315 pathOffset += 3; | 2375 pathOffset += 3; |
| 2316 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2376 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2317 | 2377 |
| 2318 var query = (req.url).query; | 2378 var query = (req.url).query; |
| 2319 var queryOffset = 0; | 2379 var queryOffset = 0; |
| 2320 var queryMap = {}; | 2380 var queryMap = {}; |
| 2321 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2381 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2322 parseBool(n) { | 2382 parseBool(n) { |
| 2323 if (n == "true") return true; | 2383 if (n == "true") return true; |
| 2324 if (n == "false") return false; | 2384 if (n == "false") return false; |
| 2325 if (n == null) return null; | 2385 if (n == null) return null; |
| 2326 throw new core.ArgumentError("Invalid boolean: $n"); | 2386 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2327 } | 2387 } |
| 2388 |
| 2328 if (query.length > 0) { | 2389 if (query.length > 0) { |
| 2329 for (var part in query.split("&")) { | 2390 for (var part in query.split("&")) { |
| 2330 var keyvalue = part.split("="); | 2391 var keyvalue = part.split("="); |
| 2331 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2392 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2393 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2332 } | 2394 } |
| 2333 } | 2395 } |
| 2334 | 2396 |
| 2335 | |
| 2336 var h = { | 2397 var h = { |
| 2337 "content-type" : "application/json; charset=utf-8", | 2398 "content-type": "application/json; charset=utf-8", |
| 2338 }; | 2399 }; |
| 2339 var resp = convert.JSON.encode(buildOrgPolicy()); | 2400 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 2340 return new async.Future.value(stringResponse(200, h, resp)); | 2401 return new async.Future.value(stringResponse(200, h, resp)); |
| 2341 }), true); | 2402 }), true); |
| 2342 res.getOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 2403 res |
| 2404 .getOrgPolicy(arg_request, arg_resource) |
| 2405 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 2343 checkOrgPolicy(response); | 2406 checkOrgPolicy(response); |
| 2344 }))); | 2407 }))); |
| 2345 }); | 2408 }); |
| 2346 | 2409 |
| 2347 unittest.test("method--listAvailableOrgPolicyConstraints", () { | 2410 unittest.test("method--listAvailableOrgPolicyConstraints", () { |
| 2348 | |
| 2349 var mock = new HttpServerMock(); | 2411 var mock = new HttpServerMock(); |
| 2350 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2412 api.OrganizationsResourceApi res = |
| 2413 new api.CloudresourcemanagerApi(mock).organizations; |
| 2351 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); | 2414 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); |
| 2352 var arg_resource = "foo"; | 2415 var arg_resource = "foo"; |
| 2353 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2416 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2354 var obj = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json
); | 2417 var obj = |
| 2418 new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json); |
| 2355 checkListAvailableOrgPolicyConstraintsRequest(obj); | 2419 checkListAvailableOrgPolicyConstraintsRequest(obj); |
| 2356 | 2420 |
| 2357 var path = (req.url).path; | 2421 var path = (req.url).path; |
| 2358 var pathOffset = 0; | 2422 var pathOffset = 0; |
| 2359 var index; | 2423 var index; |
| 2360 var subPart; | 2424 var subPart; |
| 2361 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2425 unittest.expect( |
| 2426 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2362 pathOffset += 1; | 2427 pathOffset += 1; |
| 2363 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2428 unittest.expect( |
| 2429 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2364 pathOffset += 3; | 2430 pathOffset += 3; |
| 2365 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2431 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2366 | 2432 |
| 2367 var query = (req.url).query; | 2433 var query = (req.url).query; |
| 2368 var queryOffset = 0; | 2434 var queryOffset = 0; |
| 2369 var queryMap = {}; | 2435 var queryMap = {}; |
| 2370 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2436 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2371 parseBool(n) { | 2437 parseBool(n) { |
| 2372 if (n == "true") return true; | 2438 if (n == "true") return true; |
| 2373 if (n == "false") return false; | 2439 if (n == "false") return false; |
| 2374 if (n == null) return null; | 2440 if (n == null) return null; |
| 2375 throw new core.ArgumentError("Invalid boolean: $n"); | 2441 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2376 } | 2442 } |
| 2443 |
| 2377 if (query.length > 0) { | 2444 if (query.length > 0) { |
| 2378 for (var part in query.split("&")) { | 2445 for (var part in query.split("&")) { |
| 2379 var keyvalue = part.split("="); | 2446 var keyvalue = part.split("="); |
| 2380 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2447 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2448 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2381 } | 2449 } |
| 2382 } | 2450 } |
| 2383 | 2451 |
| 2384 | |
| 2385 var h = { | 2452 var h = { |
| 2386 "content-type" : "application/json; charset=utf-8", | 2453 "content-type": "application/json; charset=utf-8", |
| 2387 }; | 2454 }; |
| 2388 var resp = convert.JSON.encode(buildListAvailableOrgPolicyConstraintsRes
ponse()); | 2455 var resp = convert.JSON |
| 2456 .encode(buildListAvailableOrgPolicyConstraintsResponse()); |
| 2389 return new async.Future.value(stringResponse(200, h, resp)); | 2457 return new async.Future.value(stringResponse(200, h, resp)); |
| 2390 }), true); | 2458 }), true); |
| 2391 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then(unit
test.expectAsync1(((api.ListAvailableOrgPolicyConstraintsResponse response) { | 2459 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then( |
| 2460 unittest.expectAsync1( |
| 2461 ((api.ListAvailableOrgPolicyConstraintsResponse response) { |
| 2392 checkListAvailableOrgPolicyConstraintsResponse(response); | 2462 checkListAvailableOrgPolicyConstraintsResponse(response); |
| 2393 }))); | 2463 }))); |
| 2394 }); | 2464 }); |
| 2395 | 2465 |
| 2396 unittest.test("method--listOrgPolicies", () { | 2466 unittest.test("method--listOrgPolicies", () { |
| 2397 | |
| 2398 var mock = new HttpServerMock(); | 2467 var mock = new HttpServerMock(); |
| 2399 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2468 api.OrganizationsResourceApi res = |
| 2469 new api.CloudresourcemanagerApi(mock).organizations; |
| 2400 var arg_request = buildListOrgPoliciesRequest(); | 2470 var arg_request = buildListOrgPoliciesRequest(); |
| 2401 var arg_resource = "foo"; | 2471 var arg_resource = "foo"; |
| 2402 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2472 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2403 var obj = new api.ListOrgPoliciesRequest.fromJson(json); | 2473 var obj = new api.ListOrgPoliciesRequest.fromJson(json); |
| 2404 checkListOrgPoliciesRequest(obj); | 2474 checkListOrgPoliciesRequest(obj); |
| 2405 | 2475 |
| 2406 var path = (req.url).path; | 2476 var path = (req.url).path; |
| 2407 var pathOffset = 0; | 2477 var pathOffset = 0; |
| 2408 var index; | 2478 var index; |
| 2409 var subPart; | 2479 var subPart; |
| 2410 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2480 unittest.expect( |
| 2481 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2411 pathOffset += 1; | 2482 pathOffset += 1; |
| 2412 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2483 unittest.expect( |
| 2484 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2413 pathOffset += 3; | 2485 pathOffset += 3; |
| 2414 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2486 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2415 | 2487 |
| 2416 var query = (req.url).query; | 2488 var query = (req.url).query; |
| 2417 var queryOffset = 0; | 2489 var queryOffset = 0; |
| 2418 var queryMap = {}; | 2490 var queryMap = {}; |
| 2419 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2491 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2420 parseBool(n) { | 2492 parseBool(n) { |
| 2421 if (n == "true") return true; | 2493 if (n == "true") return true; |
| 2422 if (n == "false") return false; | 2494 if (n == "false") return false; |
| 2423 if (n == null) return null; | 2495 if (n == null) return null; |
| 2424 throw new core.ArgumentError("Invalid boolean: $n"); | 2496 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2425 } | 2497 } |
| 2498 |
| 2426 if (query.length > 0) { | 2499 if (query.length > 0) { |
| 2427 for (var part in query.split("&")) { | 2500 for (var part in query.split("&")) { |
| 2428 var keyvalue = part.split("="); | 2501 var keyvalue = part.split("="); |
| 2429 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2502 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2503 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2430 } | 2504 } |
| 2431 } | 2505 } |
| 2432 | 2506 |
| 2433 | |
| 2434 var h = { | 2507 var h = { |
| 2435 "content-type" : "application/json; charset=utf-8", | 2508 "content-type": "application/json; charset=utf-8", |
| 2436 }; | 2509 }; |
| 2437 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); | 2510 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); |
| 2438 return new async.Future.value(stringResponse(200, h, resp)); | 2511 return new async.Future.value(stringResponse(200, h, resp)); |
| 2439 }), true); | 2512 }), true); |
| 2440 res.listOrgPolicies(arg_request, arg_resource).then(unittest.expectAsync1(
((api.ListOrgPoliciesResponse response) { | 2513 res |
| 2514 .listOrgPolicies(arg_request, arg_resource) |
| 2515 .then(unittest.expectAsync1(((api.ListOrgPoliciesResponse response) { |
| 2441 checkListOrgPoliciesResponse(response); | 2516 checkListOrgPoliciesResponse(response); |
| 2442 }))); | 2517 }))); |
| 2443 }); | 2518 }); |
| 2444 | 2519 |
| 2445 unittest.test("method--search", () { | 2520 unittest.test("method--search", () { |
| 2446 | |
| 2447 var mock = new HttpServerMock(); | 2521 var mock = new HttpServerMock(); |
| 2448 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2522 api.OrganizationsResourceApi res = |
| 2523 new api.CloudresourcemanagerApi(mock).organizations; |
| 2449 var arg_request = buildSearchOrganizationsRequest(); | 2524 var arg_request = buildSearchOrganizationsRequest(); |
| 2450 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2525 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2451 var obj = new api.SearchOrganizationsRequest.fromJson(json); | 2526 var obj = new api.SearchOrganizationsRequest.fromJson(json); |
| 2452 checkSearchOrganizationsRequest(obj); | 2527 checkSearchOrganizationsRequest(obj); |
| 2453 | 2528 |
| 2454 var path = (req.url).path; | 2529 var path = (req.url).path; |
| 2455 var pathOffset = 0; | 2530 var pathOffset = 0; |
| 2456 var index; | 2531 var index; |
| 2457 var subPart; | 2532 var subPart; |
| 2458 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2533 unittest.expect( |
| 2534 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2459 pathOffset += 1; | 2535 pathOffset += 1; |
| 2460 unittest.expect(path.substring(pathOffset, pathOffset + 23), unittest.eq
uals("v1/organizations:search")); | 2536 unittest.expect(path.substring(pathOffset, pathOffset + 23), |
| 2537 unittest.equals("v1/organizations:search")); |
| 2461 pathOffset += 23; | 2538 pathOffset += 23; |
| 2462 | 2539 |
| 2463 var query = (req.url).query; | 2540 var query = (req.url).query; |
| 2464 var queryOffset = 0; | 2541 var queryOffset = 0; |
| 2465 var queryMap = {}; | 2542 var queryMap = {}; |
| 2466 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2543 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2467 parseBool(n) { | 2544 parseBool(n) { |
| 2468 if (n == "true") return true; | 2545 if (n == "true") return true; |
| 2469 if (n == "false") return false; | 2546 if (n == "false") return false; |
| 2470 if (n == null) return null; | 2547 if (n == null) return null; |
| 2471 throw new core.ArgumentError("Invalid boolean: $n"); | 2548 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2472 } | 2549 } |
| 2550 |
| 2473 if (query.length > 0) { | 2551 if (query.length > 0) { |
| 2474 for (var part in query.split("&")) { | 2552 for (var part in query.split("&")) { |
| 2475 var keyvalue = part.split("="); | 2553 var keyvalue = part.split("="); |
| 2476 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2554 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2555 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2477 } | 2556 } |
| 2478 } | 2557 } |
| 2479 | 2558 |
| 2480 | |
| 2481 var h = { | 2559 var h = { |
| 2482 "content-type" : "application/json; charset=utf-8", | 2560 "content-type": "application/json; charset=utf-8", |
| 2483 }; | 2561 }; |
| 2484 var resp = convert.JSON.encode(buildSearchOrganizationsResponse()); | 2562 var resp = convert.JSON.encode(buildSearchOrganizationsResponse()); |
| 2485 return new async.Future.value(stringResponse(200, h, resp)); | 2563 return new async.Future.value(stringResponse(200, h, resp)); |
| 2486 }), true); | 2564 }), true); |
| 2487 res.search(arg_request).then(unittest.expectAsync1(((api.SearchOrganizatio
nsResponse response) { | 2565 res.search(arg_request).then( |
| 2566 unittest.expectAsync1(((api.SearchOrganizationsResponse response) { |
| 2488 checkSearchOrganizationsResponse(response); | 2567 checkSearchOrganizationsResponse(response); |
| 2489 }))); | 2568 }))); |
| 2490 }); | 2569 }); |
| 2491 | 2570 |
| 2492 unittest.test("method--setIamPolicy", () { | 2571 unittest.test("method--setIamPolicy", () { |
| 2493 | |
| 2494 var mock = new HttpServerMock(); | 2572 var mock = new HttpServerMock(); |
| 2495 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2573 api.OrganizationsResourceApi res = |
| 2574 new api.CloudresourcemanagerApi(mock).organizations; |
| 2496 var arg_request = buildSetIamPolicyRequest(); | 2575 var arg_request = buildSetIamPolicyRequest(); |
| 2497 var arg_resource = "foo"; | 2576 var arg_resource = "foo"; |
| 2498 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2577 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2499 var obj = new api.SetIamPolicyRequest.fromJson(json); | 2578 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 2500 checkSetIamPolicyRequest(obj); | 2579 checkSetIamPolicyRequest(obj); |
| 2501 | 2580 |
| 2502 var path = (req.url).path; | 2581 var path = (req.url).path; |
| 2503 var pathOffset = 0; | 2582 var pathOffset = 0; |
| 2504 var index; | 2583 var index; |
| 2505 var subPart; | 2584 var subPart; |
| 2506 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2585 unittest.expect( |
| 2586 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2507 pathOffset += 1; | 2587 pathOffset += 1; |
| 2508 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2588 unittest.expect( |
| 2589 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2509 pathOffset += 3; | 2590 pathOffset += 3; |
| 2510 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2591 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2511 | 2592 |
| 2512 var query = (req.url).query; | 2593 var query = (req.url).query; |
| 2513 var queryOffset = 0; | 2594 var queryOffset = 0; |
| 2514 var queryMap = {}; | 2595 var queryMap = {}; |
| 2515 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2596 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2516 parseBool(n) { | 2597 parseBool(n) { |
| 2517 if (n == "true") return true; | 2598 if (n == "true") return true; |
| 2518 if (n == "false") return false; | 2599 if (n == "false") return false; |
| 2519 if (n == null) return null; | 2600 if (n == null) return null; |
| 2520 throw new core.ArgumentError("Invalid boolean: $n"); | 2601 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2521 } | 2602 } |
| 2603 |
| 2522 if (query.length > 0) { | 2604 if (query.length > 0) { |
| 2523 for (var part in query.split("&")) { | 2605 for (var part in query.split("&")) { |
| 2524 var keyvalue = part.split("="); | 2606 var keyvalue = part.split("="); |
| 2525 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2607 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2608 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2526 } | 2609 } |
| 2527 } | 2610 } |
| 2528 | 2611 |
| 2529 | |
| 2530 var h = { | 2612 var h = { |
| 2531 "content-type" : "application/json; charset=utf-8", | 2613 "content-type": "application/json; charset=utf-8", |
| 2532 }; | 2614 }; |
| 2533 var resp = convert.JSON.encode(buildPolicy()); | 2615 var resp = convert.JSON.encode(buildPolicy()); |
| 2534 return new async.Future.value(stringResponse(200, h, resp)); | 2616 return new async.Future.value(stringResponse(200, h, resp)); |
| 2535 }), true); | 2617 }), true); |
| 2536 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { | 2618 res |
| 2619 .setIamPolicy(arg_request, arg_resource) |
| 2620 .then(unittest.expectAsync1(((api.Policy response) { |
| 2537 checkPolicy(response); | 2621 checkPolicy(response); |
| 2538 }))); | 2622 }))); |
| 2539 }); | 2623 }); |
| 2540 | 2624 |
| 2541 unittest.test("method--setOrgPolicy", () { | 2625 unittest.test("method--setOrgPolicy", () { |
| 2542 | |
| 2543 var mock = new HttpServerMock(); | 2626 var mock = new HttpServerMock(); |
| 2544 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2627 api.OrganizationsResourceApi res = |
| 2628 new api.CloudresourcemanagerApi(mock).organizations; |
| 2545 var arg_request = buildSetOrgPolicyRequest(); | 2629 var arg_request = buildSetOrgPolicyRequest(); |
| 2546 var arg_resource = "foo"; | 2630 var arg_resource = "foo"; |
| 2547 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2631 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2548 var obj = new api.SetOrgPolicyRequest.fromJson(json); | 2632 var obj = new api.SetOrgPolicyRequest.fromJson(json); |
| 2549 checkSetOrgPolicyRequest(obj); | 2633 checkSetOrgPolicyRequest(obj); |
| 2550 | 2634 |
| 2551 var path = (req.url).path; | 2635 var path = (req.url).path; |
| 2552 var pathOffset = 0; | 2636 var pathOffset = 0; |
| 2553 var index; | 2637 var index; |
| 2554 var subPart; | 2638 var subPart; |
| 2555 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2639 unittest.expect( |
| 2640 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2556 pathOffset += 1; | 2641 pathOffset += 1; |
| 2557 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2642 unittest.expect( |
| 2643 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2558 pathOffset += 3; | 2644 pathOffset += 3; |
| 2559 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2645 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2560 | 2646 |
| 2561 var query = (req.url).query; | 2647 var query = (req.url).query; |
| 2562 var queryOffset = 0; | 2648 var queryOffset = 0; |
| 2563 var queryMap = {}; | 2649 var queryMap = {}; |
| 2564 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2650 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2565 parseBool(n) { | 2651 parseBool(n) { |
| 2566 if (n == "true") return true; | 2652 if (n == "true") return true; |
| 2567 if (n == "false") return false; | 2653 if (n == "false") return false; |
| 2568 if (n == null) return null; | 2654 if (n == null) return null; |
| 2569 throw new core.ArgumentError("Invalid boolean: $n"); | 2655 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2570 } | 2656 } |
| 2657 |
| 2571 if (query.length > 0) { | 2658 if (query.length > 0) { |
| 2572 for (var part in query.split("&")) { | 2659 for (var part in query.split("&")) { |
| 2573 var keyvalue = part.split("="); | 2660 var keyvalue = part.split("="); |
| 2574 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2661 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2662 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2575 } | 2663 } |
| 2576 } | 2664 } |
| 2577 | 2665 |
| 2578 | |
| 2579 var h = { | 2666 var h = { |
| 2580 "content-type" : "application/json; charset=utf-8", | 2667 "content-type": "application/json; charset=utf-8", |
| 2581 }; | 2668 }; |
| 2582 var resp = convert.JSON.encode(buildOrgPolicy()); | 2669 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 2583 return new async.Future.value(stringResponse(200, h, resp)); | 2670 return new async.Future.value(stringResponse(200, h, resp)); |
| 2584 }), true); | 2671 }), true); |
| 2585 res.setOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 2672 res |
| 2673 .setOrgPolicy(arg_request, arg_resource) |
| 2674 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 2586 checkOrgPolicy(response); | 2675 checkOrgPolicy(response); |
| 2587 }))); | 2676 }))); |
| 2588 }); | 2677 }); |
| 2589 | 2678 |
| 2590 unittest.test("method--testIamPermissions", () { | 2679 unittest.test("method--testIamPermissions", () { |
| 2591 | |
| 2592 var mock = new HttpServerMock(); | 2680 var mock = new HttpServerMock(); |
| 2593 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 2681 api.OrganizationsResourceApi res = |
| 2682 new api.CloudresourcemanagerApi(mock).organizations; |
| 2594 var arg_request = buildTestIamPermissionsRequest(); | 2683 var arg_request = buildTestIamPermissionsRequest(); |
| 2595 var arg_resource = "foo"; | 2684 var arg_resource = "foo"; |
| 2596 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2685 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2597 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 2686 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 2598 checkTestIamPermissionsRequest(obj); | 2687 checkTestIamPermissionsRequest(obj); |
| 2599 | 2688 |
| 2600 var path = (req.url).path; | 2689 var path = (req.url).path; |
| 2601 var pathOffset = 0; | 2690 var pathOffset = 0; |
| 2602 var index; | 2691 var index; |
| 2603 var subPart; | 2692 var subPart; |
| 2604 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2693 unittest.expect( |
| 2694 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2605 pathOffset += 1; | 2695 pathOffset += 1; |
| 2606 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2696 unittest.expect( |
| 2697 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2607 pathOffset += 3; | 2698 pathOffset += 3; |
| 2608 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2699 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2609 | 2700 |
| 2610 var query = (req.url).query; | 2701 var query = (req.url).query; |
| 2611 var queryOffset = 0; | 2702 var queryOffset = 0; |
| 2612 var queryMap = {}; | 2703 var queryMap = {}; |
| 2613 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2704 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2614 parseBool(n) { | 2705 parseBool(n) { |
| 2615 if (n == "true") return true; | 2706 if (n == "true") return true; |
| 2616 if (n == "false") return false; | 2707 if (n == "false") return false; |
| 2617 if (n == null) return null; | 2708 if (n == null) return null; |
| 2618 throw new core.ArgumentError("Invalid boolean: $n"); | 2709 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2619 } | 2710 } |
| 2711 |
| 2620 if (query.length > 0) { | 2712 if (query.length > 0) { |
| 2621 for (var part in query.split("&")) { | 2713 for (var part in query.split("&")) { |
| 2622 var keyvalue = part.split("="); | 2714 var keyvalue = part.split("="); |
| 2623 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2715 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2716 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2624 } | 2717 } |
| 2625 } | 2718 } |
| 2626 | 2719 |
| 2627 | |
| 2628 var h = { | 2720 var h = { |
| 2629 "content-type" : "application/json; charset=utf-8", | 2721 "content-type": "application/json; charset=utf-8", |
| 2630 }; | 2722 }; |
| 2631 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 2723 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 2632 return new async.Future.value(stringResponse(200, h, resp)); | 2724 return new async.Future.value(stringResponse(200, h, resp)); |
| 2633 }), true); | 2725 }), true); |
| 2634 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { | 2726 res.testIamPermissions(arg_request, arg_resource).then( |
| 2727 unittest.expectAsync1(((api.TestIamPermissionsResponse response) { |
| 2635 checkTestIamPermissionsResponse(response); | 2728 checkTestIamPermissionsResponse(response); |
| 2636 }))); | 2729 }))); |
| 2637 }); | 2730 }); |
| 2638 | |
| 2639 }); | 2731 }); |
| 2640 | 2732 |
| 2641 | |
| 2642 unittest.group("resource-ProjectsResourceApi", () { | 2733 unittest.group("resource-ProjectsResourceApi", () { |
| 2643 unittest.test("method--clearOrgPolicy", () { | 2734 unittest.test("method--clearOrgPolicy", () { |
| 2644 | |
| 2645 var mock = new HttpServerMock(); | 2735 var mock = new HttpServerMock(); |
| 2646 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 2736 api.ProjectsResourceApi res = |
| 2737 new api.CloudresourcemanagerApi(mock).projects; |
| 2647 var arg_request = buildClearOrgPolicyRequest(); | 2738 var arg_request = buildClearOrgPolicyRequest(); |
| 2648 var arg_resource = "foo"; | 2739 var arg_resource = "foo"; |
| 2649 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2740 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2650 var obj = new api.ClearOrgPolicyRequest.fromJson(json); | 2741 var obj = new api.ClearOrgPolicyRequest.fromJson(json); |
| 2651 checkClearOrgPolicyRequest(obj); | 2742 checkClearOrgPolicyRequest(obj); |
| 2652 | 2743 |
| 2653 var path = (req.url).path; | 2744 var path = (req.url).path; |
| 2654 var pathOffset = 0; | 2745 var pathOffset = 0; |
| 2655 var index; | 2746 var index; |
| 2656 var subPart; | 2747 var subPart; |
| 2657 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2748 unittest.expect( |
| 2749 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2658 pathOffset += 1; | 2750 pathOffset += 1; |
| 2659 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 2751 unittest.expect( |
| 2752 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2660 pathOffset += 3; | 2753 pathOffset += 3; |
| 2661 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 2754 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2662 | 2755 |
| 2663 var query = (req.url).query; | 2756 var query = (req.url).query; |
| 2664 var queryOffset = 0; | 2757 var queryOffset = 0; |
| 2665 var queryMap = {}; | 2758 var queryMap = {}; |
| 2666 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2759 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2667 parseBool(n) { | 2760 parseBool(n) { |
| 2668 if (n == "true") return true; | 2761 if (n == "true") return true; |
| 2669 if (n == "false") return false; | 2762 if (n == "false") return false; |
| 2670 if (n == null) return null; | 2763 if (n == null) return null; |
| 2671 throw new core.ArgumentError("Invalid boolean: $n"); | 2764 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2672 } | 2765 } |
| 2766 |
| 2673 if (query.length > 0) { | 2767 if (query.length > 0) { |
| 2674 for (var part in query.split("&")) { | 2768 for (var part in query.split("&")) { |
| 2675 var keyvalue = part.split("="); | 2769 var keyvalue = part.split("="); |
| 2676 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2770 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2771 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2677 } | 2772 } |
| 2678 } | 2773 } |
| 2679 | 2774 |
| 2680 | |
| 2681 var h = { | 2775 var h = { |
| 2682 "content-type" : "application/json; charset=utf-8", | 2776 "content-type": "application/json; charset=utf-8", |
| 2683 }; | 2777 }; |
| 2684 var resp = convert.JSON.encode(buildEmpty()); | 2778 var resp = convert.JSON.encode(buildEmpty()); |
| 2685 return new async.Future.value(stringResponse(200, h, resp)); | 2779 return new async.Future.value(stringResponse(200, h, resp)); |
| 2686 }), true); | 2780 }), true); |
| 2687 res.clearOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1((
(api.Empty response) { | 2781 res |
| 2782 .clearOrgPolicy(arg_request, arg_resource) |
| 2783 .then(unittest.expectAsync1(((api.Empty response) { |
| 2688 checkEmpty(response); | 2784 checkEmpty(response); |
| 2689 }))); | 2785 }))); |
| 2690 }); | 2786 }); |
| 2691 | 2787 |
| 2692 unittest.test("method--create", () { | 2788 unittest.test("method--create", () { |
| 2693 | |
| 2694 var mock = new HttpServerMock(); | 2789 var mock = new HttpServerMock(); |
| 2695 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 2790 api.ProjectsResourceApi res = |
| 2791 new api.CloudresourcemanagerApi(mock).projects; |
| 2696 var arg_request = buildProject(); | 2792 var arg_request = buildProject(); |
| 2697 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2793 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2698 var obj = new api.Project.fromJson(json); | 2794 var obj = new api.Project.fromJson(json); |
| 2699 checkProject(obj); | 2795 checkProject(obj); |
| 2700 | 2796 |
| 2701 var path = (req.url).path; | 2797 var path = (req.url).path; |
| 2702 var pathOffset = 0; | 2798 var pathOffset = 0; |
| 2703 var index; | 2799 var index; |
| 2704 var subPart; | 2800 var subPart; |
| 2705 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2801 unittest.expect( |
| 2802 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2706 pathOffset += 1; | 2803 pathOffset += 1; |
| 2707 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("v1/projects")); | 2804 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 2805 unittest.equals("v1/projects")); |
| 2708 pathOffset += 11; | 2806 pathOffset += 11; |
| 2709 | 2807 |
| 2710 var query = (req.url).query; | 2808 var query = (req.url).query; |
| 2711 var queryOffset = 0; | 2809 var queryOffset = 0; |
| 2712 var queryMap = {}; | 2810 var queryMap = {}; |
| 2713 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2811 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2714 parseBool(n) { | 2812 parseBool(n) { |
| 2715 if (n == "true") return true; | 2813 if (n == "true") return true; |
| 2716 if (n == "false") return false; | 2814 if (n == "false") return false; |
| 2717 if (n == null) return null; | 2815 if (n == null) return null; |
| 2718 throw new core.ArgumentError("Invalid boolean: $n"); | 2816 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2719 } | 2817 } |
| 2818 |
| 2720 if (query.length > 0) { | 2819 if (query.length > 0) { |
| 2721 for (var part in query.split("&")) { | 2820 for (var part in query.split("&")) { |
| 2722 var keyvalue = part.split("="); | 2821 var keyvalue = part.split("="); |
| 2723 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2822 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2823 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2724 } | 2824 } |
| 2725 } | 2825 } |
| 2726 | 2826 |
| 2727 | |
| 2728 var h = { | 2827 var h = { |
| 2729 "content-type" : "application/json; charset=utf-8", | 2828 "content-type": "application/json; charset=utf-8", |
| 2730 }; | 2829 }; |
| 2731 var resp = convert.JSON.encode(buildOperation()); | 2830 var resp = convert.JSON.encode(buildOperation()); |
| 2732 return new async.Future.value(stringResponse(200, h, resp)); | 2831 return new async.Future.value(stringResponse(200, h, resp)); |
| 2733 }), true); | 2832 }), true); |
| 2734 res.create(arg_request).then(unittest.expectAsync1(((api.Operation respons
e) { | 2833 res |
| 2834 .create(arg_request) |
| 2835 .then(unittest.expectAsync1(((api.Operation response) { |
| 2735 checkOperation(response); | 2836 checkOperation(response); |
| 2736 }))); | 2837 }))); |
| 2737 }); | 2838 }); |
| 2738 | 2839 |
| 2739 unittest.test("method--delete", () { | 2840 unittest.test("method--delete", () { |
| 2740 | |
| 2741 var mock = new HttpServerMock(); | 2841 var mock = new HttpServerMock(); |
| 2742 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 2842 api.ProjectsResourceApi res = |
| 2843 new api.CloudresourcemanagerApi(mock).projects; |
| 2743 var arg_projectId = "foo"; | 2844 var arg_projectId = "foo"; |
| 2744 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2845 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2745 var path = (req.url).path; | 2846 var path = (req.url).path; |
| 2746 var pathOffset = 0; | 2847 var pathOffset = 0; |
| 2747 var index; | 2848 var index; |
| 2748 var subPart; | 2849 var subPart; |
| 2749 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2850 unittest.expect( |
| 2851 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2750 pathOffset += 1; | 2852 pathOffset += 1; |
| 2751 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2853 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2854 unittest.equals("v1/projects/")); |
| 2752 pathOffset += 12; | 2855 pathOffset += 12; |
| 2753 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2856 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2754 pathOffset = path.length; | 2857 pathOffset = path.length; |
| 2755 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2858 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2756 | 2859 |
| 2757 var query = (req.url).query; | 2860 var query = (req.url).query; |
| 2758 var queryOffset = 0; | 2861 var queryOffset = 0; |
| 2759 var queryMap = {}; | 2862 var queryMap = {}; |
| 2760 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2863 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2761 parseBool(n) { | 2864 parseBool(n) { |
| 2762 if (n == "true") return true; | 2865 if (n == "true") return true; |
| 2763 if (n == "false") return false; | 2866 if (n == "false") return false; |
| 2764 if (n == null) return null; | 2867 if (n == null) return null; |
| 2765 throw new core.ArgumentError("Invalid boolean: $n"); | 2868 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2766 } | 2869 } |
| 2870 |
| 2767 if (query.length > 0) { | 2871 if (query.length > 0) { |
| 2768 for (var part in query.split("&")) { | 2872 for (var part in query.split("&")) { |
| 2769 var keyvalue = part.split("="); | 2873 var keyvalue = part.split("="); |
| 2770 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2874 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2875 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2771 } | 2876 } |
| 2772 } | 2877 } |
| 2773 | 2878 |
| 2774 | |
| 2775 var h = { | 2879 var h = { |
| 2776 "content-type" : "application/json; charset=utf-8", | 2880 "content-type": "application/json; charset=utf-8", |
| 2777 }; | 2881 }; |
| 2778 var resp = convert.JSON.encode(buildEmpty()); | 2882 var resp = convert.JSON.encode(buildEmpty()); |
| 2779 return new async.Future.value(stringResponse(200, h, resp)); | 2883 return new async.Future.value(stringResponse(200, h, resp)); |
| 2780 }), true); | 2884 }), true); |
| 2781 res.delete(arg_projectId).then(unittest.expectAsync1(((api.Empty response)
{ | 2885 res |
| 2886 .delete(arg_projectId) |
| 2887 .then(unittest.expectAsync1(((api.Empty response) { |
| 2782 checkEmpty(response); | 2888 checkEmpty(response); |
| 2783 }))); | 2889 }))); |
| 2784 }); | 2890 }); |
| 2785 | 2891 |
| 2786 unittest.test("method--get", () { | 2892 unittest.test("method--get", () { |
| 2787 | |
| 2788 var mock = new HttpServerMock(); | 2893 var mock = new HttpServerMock(); |
| 2789 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 2894 api.ProjectsResourceApi res = |
| 2895 new api.CloudresourcemanagerApi(mock).projects; |
| 2790 var arg_projectId = "foo"; | 2896 var arg_projectId = "foo"; |
| 2791 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2897 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2792 var path = (req.url).path; | 2898 var path = (req.url).path; |
| 2793 var pathOffset = 0; | 2899 var pathOffset = 0; |
| 2794 var index; | 2900 var index; |
| 2795 var subPart; | 2901 var subPart; |
| 2796 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2902 unittest.expect( |
| 2903 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2797 pathOffset += 1; | 2904 pathOffset += 1; |
| 2798 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2905 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2906 unittest.equals("v1/projects/")); |
| 2799 pathOffset += 12; | 2907 pathOffset += 12; |
| 2800 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2908 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2801 pathOffset = path.length; | 2909 pathOffset = path.length; |
| 2802 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2910 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2803 | 2911 |
| 2804 var query = (req.url).query; | 2912 var query = (req.url).query; |
| 2805 var queryOffset = 0; | 2913 var queryOffset = 0; |
| 2806 var queryMap = {}; | 2914 var queryMap = {}; |
| 2807 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2915 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2808 parseBool(n) { | 2916 parseBool(n) { |
| 2809 if (n == "true") return true; | 2917 if (n == "true") return true; |
| 2810 if (n == "false") return false; | 2918 if (n == "false") return false; |
| 2811 if (n == null) return null; | 2919 if (n == null) return null; |
| 2812 throw new core.ArgumentError("Invalid boolean: $n"); | 2920 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2813 } | 2921 } |
| 2922 |
| 2814 if (query.length > 0) { | 2923 if (query.length > 0) { |
| 2815 for (var part in query.split("&")) { | 2924 for (var part in query.split("&")) { |
| 2816 var keyvalue = part.split("="); | 2925 var keyvalue = part.split("="); |
| 2817 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2926 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2927 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2818 } | 2928 } |
| 2819 } | 2929 } |
| 2820 | 2930 |
| 2821 | |
| 2822 var h = { | 2931 var h = { |
| 2823 "content-type" : "application/json; charset=utf-8", | 2932 "content-type": "application/json; charset=utf-8", |
| 2824 }; | 2933 }; |
| 2825 var resp = convert.JSON.encode(buildProject()); | 2934 var resp = convert.JSON.encode(buildProject()); |
| 2826 return new async.Future.value(stringResponse(200, h, resp)); | 2935 return new async.Future.value(stringResponse(200, h, resp)); |
| 2827 }), true); | 2936 }), true); |
| 2828 res.get(arg_projectId).then(unittest.expectAsync1(((api.Project response)
{ | 2937 res |
| 2938 .get(arg_projectId) |
| 2939 .then(unittest.expectAsync1(((api.Project response) { |
| 2829 checkProject(response); | 2940 checkProject(response); |
| 2830 }))); | 2941 }))); |
| 2831 }); | 2942 }); |
| 2832 | 2943 |
| 2833 unittest.test("method--getAncestry", () { | 2944 unittest.test("method--getAncestry", () { |
| 2834 | |
| 2835 var mock = new HttpServerMock(); | 2945 var mock = new HttpServerMock(); |
| 2836 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 2946 api.ProjectsResourceApi res = |
| 2947 new api.CloudresourcemanagerApi(mock).projects; |
| 2837 var arg_request = buildGetAncestryRequest(); | 2948 var arg_request = buildGetAncestryRequest(); |
| 2838 var arg_projectId = "foo"; | 2949 var arg_projectId = "foo"; |
| 2839 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 2950 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2840 var obj = new api.GetAncestryRequest.fromJson(json); | 2951 var obj = new api.GetAncestryRequest.fromJson(json); |
| 2841 checkGetAncestryRequest(obj); | 2952 checkGetAncestryRequest(obj); |
| 2842 | 2953 |
| 2843 var path = (req.url).path; | 2954 var path = (req.url).path; |
| 2844 var pathOffset = 0; | 2955 var pathOffset = 0; |
| 2845 var index; | 2956 var index; |
| 2846 var subPart; | 2957 var subPart; |
| 2847 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2958 unittest.expect( |
| 2959 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2848 pathOffset += 1; | 2960 pathOffset += 1; |
| 2849 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 2961 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2962 unittest.equals("v1/projects/")); |
| 2850 pathOffset += 12; | 2963 pathOffset += 12; |
| 2851 index = path.indexOf(":getAncestry", pathOffset); | 2964 index = path.indexOf(":getAncestry", pathOffset); |
| 2852 unittest.expect(index >= 0, unittest.isTrue); | 2965 unittest.expect(index >= 0, unittest.isTrue); |
| 2853 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2966 subPart = |
| 2967 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2854 pathOffset = index; | 2968 pathOffset = index; |
| 2855 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 2969 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2856 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals(":getAncestry")); | 2970 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 2971 unittest.equals(":getAncestry")); |
| 2857 pathOffset += 12; | 2972 pathOffset += 12; |
| 2858 | 2973 |
| 2859 var query = (req.url).query; | 2974 var query = (req.url).query; |
| 2860 var queryOffset = 0; | 2975 var queryOffset = 0; |
| 2861 var queryMap = {}; | 2976 var queryMap = {}; |
| 2862 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2977 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2863 parseBool(n) { | 2978 parseBool(n) { |
| 2864 if (n == "true") return true; | 2979 if (n == "true") return true; |
| 2865 if (n == "false") return false; | 2980 if (n == "false") return false; |
| 2866 if (n == null) return null; | 2981 if (n == null) return null; |
| 2867 throw new core.ArgumentError("Invalid boolean: $n"); | 2982 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2868 } | 2983 } |
| 2984 |
| 2869 if (query.length > 0) { | 2985 if (query.length > 0) { |
| 2870 for (var part in query.split("&")) { | 2986 for (var part in query.split("&")) { |
| 2871 var keyvalue = part.split("="); | 2987 var keyvalue = part.split("="); |
| 2872 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2988 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 2989 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2873 } | 2990 } |
| 2874 } | 2991 } |
| 2875 | 2992 |
| 2876 | |
| 2877 var h = { | 2993 var h = { |
| 2878 "content-type" : "application/json; charset=utf-8", | 2994 "content-type": "application/json; charset=utf-8", |
| 2879 }; | 2995 }; |
| 2880 var resp = convert.JSON.encode(buildGetAncestryResponse()); | 2996 var resp = convert.JSON.encode(buildGetAncestryResponse()); |
| 2881 return new async.Future.value(stringResponse(200, h, resp)); | 2997 return new async.Future.value(stringResponse(200, h, resp)); |
| 2882 }), true); | 2998 }), true); |
| 2883 res.getAncestry(arg_request, arg_projectId).then(unittest.expectAsync1(((a
pi.GetAncestryResponse response) { | 2999 res |
| 3000 .getAncestry(arg_request, arg_projectId) |
| 3001 .then(unittest.expectAsync1(((api.GetAncestryResponse response) { |
| 2884 checkGetAncestryResponse(response); | 3002 checkGetAncestryResponse(response); |
| 2885 }))); | 3003 }))); |
| 2886 }); | 3004 }); |
| 2887 | 3005 |
| 2888 unittest.test("method--getEffectiveOrgPolicy", () { | 3006 unittest.test("method--getEffectiveOrgPolicy", () { |
| 2889 | |
| 2890 var mock = new HttpServerMock(); | 3007 var mock = new HttpServerMock(); |
| 2891 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3008 api.ProjectsResourceApi res = |
| 3009 new api.CloudresourcemanagerApi(mock).projects; |
| 2892 var arg_request = buildGetEffectiveOrgPolicyRequest(); | 3010 var arg_request = buildGetEffectiveOrgPolicyRequest(); |
| 2893 var arg_resource = "foo"; | 3011 var arg_resource = "foo"; |
| 2894 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3012 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2895 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); | 3013 var obj = new api.GetEffectiveOrgPolicyRequest.fromJson(json); |
| 2896 checkGetEffectiveOrgPolicyRequest(obj); | 3014 checkGetEffectiveOrgPolicyRequest(obj); |
| 2897 | 3015 |
| 2898 var path = (req.url).path; | 3016 var path = (req.url).path; |
| 2899 var pathOffset = 0; | 3017 var pathOffset = 0; |
| 2900 var index; | 3018 var index; |
| 2901 var subPart; | 3019 var subPart; |
| 2902 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3020 unittest.expect( |
| 3021 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2903 pathOffset += 1; | 3022 pathOffset += 1; |
| 2904 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 3023 unittest.expect( |
| 3024 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 2905 pathOffset += 3; | 3025 pathOffset += 3; |
| 2906 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 3026 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2907 | 3027 |
| 2908 var query = (req.url).query; | 3028 var query = (req.url).query; |
| 2909 var queryOffset = 0; | 3029 var queryOffset = 0; |
| 2910 var queryMap = {}; | 3030 var queryMap = {}; |
| 2911 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3031 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2912 parseBool(n) { | 3032 parseBool(n) { |
| 2913 if (n == "true") return true; | 3033 if (n == "true") return true; |
| 2914 if (n == "false") return false; | 3034 if (n == "false") return false; |
| 2915 if (n == null) return null; | 3035 if (n == null) return null; |
| 2916 throw new core.ArgumentError("Invalid boolean: $n"); | 3036 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2917 } | 3037 } |
| 3038 |
| 2918 if (query.length > 0) { | 3039 if (query.length > 0) { |
| 2919 for (var part in query.split("&")) { | 3040 for (var part in query.split("&")) { |
| 2920 var keyvalue = part.split("="); | 3041 var keyvalue = part.split("="); |
| 2921 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3042 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3043 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2922 } | 3044 } |
| 2923 } | 3045 } |
| 2924 | 3046 |
| 2925 | |
| 2926 var h = { | 3047 var h = { |
| 2927 "content-type" : "application/json; charset=utf-8", | 3048 "content-type": "application/json; charset=utf-8", |
| 2928 }; | 3049 }; |
| 2929 var resp = convert.JSON.encode(buildOrgPolicy()); | 3050 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 2930 return new async.Future.value(stringResponse(200, h, resp)); | 3051 return new async.Future.value(stringResponse(200, h, resp)); |
| 2931 }), true); | 3052 }), true); |
| 2932 res.getEffectiveOrgPolicy(arg_request, arg_resource).then(unittest.expectA
sync1(((api.OrgPolicy response) { | 3053 res |
| 3054 .getEffectiveOrgPolicy(arg_request, arg_resource) |
| 3055 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 2933 checkOrgPolicy(response); | 3056 checkOrgPolicy(response); |
| 2934 }))); | 3057 }))); |
| 2935 }); | 3058 }); |
| 2936 | 3059 |
| 2937 unittest.test("method--getIamPolicy", () { | 3060 unittest.test("method--getIamPolicy", () { |
| 2938 | |
| 2939 var mock = new HttpServerMock(); | 3061 var mock = new HttpServerMock(); |
| 2940 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3062 api.ProjectsResourceApi res = |
| 3063 new api.CloudresourcemanagerApi(mock).projects; |
| 2941 var arg_request = buildGetIamPolicyRequest(); | 3064 var arg_request = buildGetIamPolicyRequest(); |
| 2942 var arg_resource = "foo"; | 3065 var arg_resource = "foo"; |
| 2943 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3066 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2944 var obj = new api.GetIamPolicyRequest.fromJson(json); | 3067 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 2945 checkGetIamPolicyRequest(obj); | 3068 checkGetIamPolicyRequest(obj); |
| 2946 | 3069 |
| 2947 var path = (req.url).path; | 3070 var path = (req.url).path; |
| 2948 var pathOffset = 0; | 3071 var pathOffset = 0; |
| 2949 var index; | 3072 var index; |
| 2950 var subPart; | 3073 var subPart; |
| 2951 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3074 unittest.expect( |
| 3075 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 2952 pathOffset += 1; | 3076 pathOffset += 1; |
| 2953 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3077 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3078 unittest.equals("v1/projects/")); |
| 2954 pathOffset += 12; | 3079 pathOffset += 12; |
| 2955 index = path.indexOf(":getIamPolicy", pathOffset); | 3080 index = path.indexOf(":getIamPolicy", pathOffset); |
| 2956 unittest.expect(index >= 0, unittest.isTrue); | 3081 unittest.expect(index >= 0, unittest.isTrue); |
| 2957 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3082 subPart = |
| 3083 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 2958 pathOffset = index; | 3084 pathOffset = index; |
| 2959 unittest.expect(subPart, unittest.equals("$arg_resource")); | 3085 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 2960 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":getIamPolicy")); | 3086 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 3087 unittest.equals(":getIamPolicy")); |
| 2961 pathOffset += 13; | 3088 pathOffset += 13; |
| 2962 | 3089 |
| 2963 var query = (req.url).query; | 3090 var query = (req.url).query; |
| 2964 var queryOffset = 0; | 3091 var queryOffset = 0; |
| 2965 var queryMap = {}; | 3092 var queryMap = {}; |
| 2966 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3093 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2967 parseBool(n) { | 3094 parseBool(n) { |
| 2968 if (n == "true") return true; | 3095 if (n == "true") return true; |
| 2969 if (n == "false") return false; | 3096 if (n == "false") return false; |
| 2970 if (n == null) return null; | 3097 if (n == null) return null; |
| 2971 throw new core.ArgumentError("Invalid boolean: $n"); | 3098 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2972 } | 3099 } |
| 3100 |
| 2973 if (query.length > 0) { | 3101 if (query.length > 0) { |
| 2974 for (var part in query.split("&")) { | 3102 for (var part in query.split("&")) { |
| 2975 var keyvalue = part.split("="); | 3103 var keyvalue = part.split("="); |
| 2976 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3104 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3105 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 2977 } | 3106 } |
| 2978 } | 3107 } |
| 2979 | 3108 |
| 2980 | |
| 2981 var h = { | 3109 var h = { |
| 2982 "content-type" : "application/json; charset=utf-8", | 3110 "content-type": "application/json; charset=utf-8", |
| 2983 }; | 3111 }; |
| 2984 var resp = convert.JSON.encode(buildPolicy()); | 3112 var resp = convert.JSON.encode(buildPolicy()); |
| 2985 return new async.Future.value(stringResponse(200, h, resp)); | 3113 return new async.Future.value(stringResponse(200, h, resp)); |
| 2986 }), true); | 3114 }), true); |
| 2987 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { | 3115 res |
| 3116 .getIamPolicy(arg_request, arg_resource) |
| 3117 .then(unittest.expectAsync1(((api.Policy response) { |
| 2988 checkPolicy(response); | 3118 checkPolicy(response); |
| 2989 }))); | 3119 }))); |
| 2990 }); | 3120 }); |
| 2991 | 3121 |
| 2992 unittest.test("method--getOrgPolicy", () { | 3122 unittest.test("method--getOrgPolicy", () { |
| 2993 | |
| 2994 var mock = new HttpServerMock(); | 3123 var mock = new HttpServerMock(); |
| 2995 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3124 api.ProjectsResourceApi res = |
| 3125 new api.CloudresourcemanagerApi(mock).projects; |
| 2996 var arg_request = buildGetOrgPolicyRequest(); | 3126 var arg_request = buildGetOrgPolicyRequest(); |
| 2997 var arg_resource = "foo"; | 3127 var arg_resource = "foo"; |
| 2998 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3128 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2999 var obj = new api.GetOrgPolicyRequest.fromJson(json); | 3129 var obj = new api.GetOrgPolicyRequest.fromJson(json); |
| 3000 checkGetOrgPolicyRequest(obj); | 3130 checkGetOrgPolicyRequest(obj); |
| 3001 | 3131 |
| 3002 var path = (req.url).path; | 3132 var path = (req.url).path; |
| 3003 var pathOffset = 0; | 3133 var pathOffset = 0; |
| 3004 var index; | 3134 var index; |
| 3005 var subPart; | 3135 var subPart; |
| 3006 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3136 unittest.expect( |
| 3137 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3007 pathOffset += 1; | 3138 pathOffset += 1; |
| 3008 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 3139 unittest.expect( |
| 3140 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 3009 pathOffset += 3; | 3141 pathOffset += 3; |
| 3010 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 3142 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 3011 | 3143 |
| 3012 var query = (req.url).query; | 3144 var query = (req.url).query; |
| 3013 var queryOffset = 0; | 3145 var queryOffset = 0; |
| 3014 var queryMap = {}; | 3146 var queryMap = {}; |
| 3015 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3147 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3016 parseBool(n) { | 3148 parseBool(n) { |
| 3017 if (n == "true") return true; | 3149 if (n == "true") return true; |
| 3018 if (n == "false") return false; | 3150 if (n == "false") return false; |
| 3019 if (n == null) return null; | 3151 if (n == null) return null; |
| 3020 throw new core.ArgumentError("Invalid boolean: $n"); | 3152 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3021 } | 3153 } |
| 3154 |
| 3022 if (query.length > 0) { | 3155 if (query.length > 0) { |
| 3023 for (var part in query.split("&")) { | 3156 for (var part in query.split("&")) { |
| 3024 var keyvalue = part.split("="); | 3157 var keyvalue = part.split("="); |
| 3025 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3158 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3159 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3026 } | 3160 } |
| 3027 } | 3161 } |
| 3028 | 3162 |
| 3029 | |
| 3030 var h = { | 3163 var h = { |
| 3031 "content-type" : "application/json; charset=utf-8", | 3164 "content-type": "application/json; charset=utf-8", |
| 3032 }; | 3165 }; |
| 3033 var resp = convert.JSON.encode(buildOrgPolicy()); | 3166 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 3034 return new async.Future.value(stringResponse(200, h, resp)); | 3167 return new async.Future.value(stringResponse(200, h, resp)); |
| 3035 }), true); | 3168 }), true); |
| 3036 res.getOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 3169 res |
| 3170 .getOrgPolicy(arg_request, arg_resource) |
| 3171 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 3037 checkOrgPolicy(response); | 3172 checkOrgPolicy(response); |
| 3038 }))); | 3173 }))); |
| 3039 }); | 3174 }); |
| 3040 | 3175 |
| 3041 unittest.test("method--list", () { | 3176 unittest.test("method--list", () { |
| 3042 | |
| 3043 var mock = new HttpServerMock(); | 3177 var mock = new HttpServerMock(); |
| 3044 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3178 api.ProjectsResourceApi res = |
| 3045 var arg_pageSize = 42; | 3179 new api.CloudresourcemanagerApi(mock).projects; |
| 3046 var arg_filter = "foo"; | 3180 var arg_filter = "foo"; |
| 3047 var arg_pageToken = "foo"; | 3181 var arg_pageToken = "foo"; |
| 3182 var arg_pageSize = 42; |
| 3048 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3183 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3049 var path = (req.url).path; | 3184 var path = (req.url).path; |
| 3050 var pathOffset = 0; | 3185 var pathOffset = 0; |
| 3051 var index; | 3186 var index; |
| 3052 var subPart; | 3187 var subPart; |
| 3053 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3188 unittest.expect( |
| 3189 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3054 pathOffset += 1; | 3190 pathOffset += 1; |
| 3055 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("v1/projects")); | 3191 unittest.expect(path.substring(pathOffset, pathOffset + 11), |
| 3192 unittest.equals("v1/projects")); |
| 3056 pathOffset += 11; | 3193 pathOffset += 11; |
| 3057 | 3194 |
| 3058 var query = (req.url).query; | 3195 var query = (req.url).query; |
| 3059 var queryOffset = 0; | 3196 var queryOffset = 0; |
| 3060 var queryMap = {}; | 3197 var queryMap = {}; |
| 3061 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3198 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3062 parseBool(n) { | 3199 parseBool(n) { |
| 3063 if (n == "true") return true; | 3200 if (n == "true") return true; |
| 3064 if (n == "false") return false; | 3201 if (n == "false") return false; |
| 3065 if (n == null) return null; | 3202 if (n == null) return null; |
| 3066 throw new core.ArgumentError("Invalid boolean: $n"); | 3203 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3067 } | 3204 } |
| 3205 |
| 3068 if (query.length > 0) { | 3206 if (query.length > 0) { |
| 3069 for (var part in query.split("&")) { | 3207 for (var part in query.split("&")) { |
| 3070 var keyvalue = part.split("="); | 3208 var keyvalue = part.split("="); |
| 3071 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3210 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3072 } | 3211 } |
| 3073 } | 3212 } |
| 3074 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 3075 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 3213 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 3076 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 3214 unittest.expect( |
| 3077 | 3215 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 3216 unittest.expect(core.int.parse(queryMap["pageSize"].first), |
| 3217 unittest.equals(arg_pageSize)); |
| 3078 | 3218 |
| 3079 var h = { | 3219 var h = { |
| 3080 "content-type" : "application/json; charset=utf-8", | 3220 "content-type": "application/json; charset=utf-8", |
| 3081 }; | 3221 }; |
| 3082 var resp = convert.JSON.encode(buildListProjectsResponse()); | 3222 var resp = convert.JSON.encode(buildListProjectsResponse()); |
| 3083 return new async.Future.value(stringResponse(200, h, resp)); | 3223 return new async.Future.value(stringResponse(200, h, resp)); |
| 3084 }), true); | 3224 }), true); |
| 3085 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync1(((api.ListProjectsResponse response) { | 3225 res |
| 3226 .list( |
| 3227 filter: arg_filter, |
| 3228 pageToken: arg_pageToken, |
| 3229 pageSize: arg_pageSize) |
| 3230 .then(unittest.expectAsync1(((api.ListProjectsResponse response) { |
| 3086 checkListProjectsResponse(response); | 3231 checkListProjectsResponse(response); |
| 3087 }))); | 3232 }))); |
| 3088 }); | 3233 }); |
| 3089 | 3234 |
| 3090 unittest.test("method--listAvailableOrgPolicyConstraints", () { | 3235 unittest.test("method--listAvailableOrgPolicyConstraints", () { |
| 3091 | |
| 3092 var mock = new HttpServerMock(); | 3236 var mock = new HttpServerMock(); |
| 3093 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3237 api.ProjectsResourceApi res = |
| 3238 new api.CloudresourcemanagerApi(mock).projects; |
| 3094 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); | 3239 var arg_request = buildListAvailableOrgPolicyConstraintsRequest(); |
| 3095 var arg_resource = "foo"; | 3240 var arg_resource = "foo"; |
| 3096 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3241 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3097 var obj = new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json
); | 3242 var obj = |
| 3243 new api.ListAvailableOrgPolicyConstraintsRequest.fromJson(json); |
| 3098 checkListAvailableOrgPolicyConstraintsRequest(obj); | 3244 checkListAvailableOrgPolicyConstraintsRequest(obj); |
| 3099 | 3245 |
| 3100 var path = (req.url).path; | 3246 var path = (req.url).path; |
| 3101 var pathOffset = 0; | 3247 var pathOffset = 0; |
| 3102 var index; | 3248 var index; |
| 3103 var subPart; | 3249 var subPart; |
| 3104 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3250 unittest.expect( |
| 3251 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3105 pathOffset += 1; | 3252 pathOffset += 1; |
| 3106 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 3253 unittest.expect( |
| 3254 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 3107 pathOffset += 3; | 3255 pathOffset += 3; |
| 3108 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 3256 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 3109 | 3257 |
| 3110 var query = (req.url).query; | 3258 var query = (req.url).query; |
| 3111 var queryOffset = 0; | 3259 var queryOffset = 0; |
| 3112 var queryMap = {}; | 3260 var queryMap = {}; |
| 3113 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3261 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3114 parseBool(n) { | 3262 parseBool(n) { |
| 3115 if (n == "true") return true; | 3263 if (n == "true") return true; |
| 3116 if (n == "false") return false; | 3264 if (n == "false") return false; |
| 3117 if (n == null) return null; | 3265 if (n == null) return null; |
| 3118 throw new core.ArgumentError("Invalid boolean: $n"); | 3266 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3119 } | 3267 } |
| 3268 |
| 3120 if (query.length > 0) { | 3269 if (query.length > 0) { |
| 3121 for (var part in query.split("&")) { | 3270 for (var part in query.split("&")) { |
| 3122 var keyvalue = part.split("="); | 3271 var keyvalue = part.split("="); |
| 3123 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3272 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3273 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3124 } | 3274 } |
| 3125 } | 3275 } |
| 3126 | 3276 |
| 3127 | |
| 3128 var h = { | 3277 var h = { |
| 3129 "content-type" : "application/json; charset=utf-8", | 3278 "content-type": "application/json; charset=utf-8", |
| 3130 }; | 3279 }; |
| 3131 var resp = convert.JSON.encode(buildListAvailableOrgPolicyConstraintsRes
ponse()); | 3280 var resp = convert.JSON |
| 3281 .encode(buildListAvailableOrgPolicyConstraintsResponse()); |
| 3132 return new async.Future.value(stringResponse(200, h, resp)); | 3282 return new async.Future.value(stringResponse(200, h, resp)); |
| 3133 }), true); | 3283 }), true); |
| 3134 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then(unit
test.expectAsync1(((api.ListAvailableOrgPolicyConstraintsResponse response) { | 3284 res.listAvailableOrgPolicyConstraints(arg_request, arg_resource).then( |
| 3285 unittest.expectAsync1( |
| 3286 ((api.ListAvailableOrgPolicyConstraintsResponse response) { |
| 3135 checkListAvailableOrgPolicyConstraintsResponse(response); | 3287 checkListAvailableOrgPolicyConstraintsResponse(response); |
| 3136 }))); | 3288 }))); |
| 3137 }); | 3289 }); |
| 3138 | 3290 |
| 3139 unittest.test("method--listOrgPolicies", () { | 3291 unittest.test("method--listOrgPolicies", () { |
| 3140 | |
| 3141 var mock = new HttpServerMock(); | 3292 var mock = new HttpServerMock(); |
| 3142 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3293 api.ProjectsResourceApi res = |
| 3294 new api.CloudresourcemanagerApi(mock).projects; |
| 3143 var arg_request = buildListOrgPoliciesRequest(); | 3295 var arg_request = buildListOrgPoliciesRequest(); |
| 3144 var arg_resource = "foo"; | 3296 var arg_resource = "foo"; |
| 3145 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3297 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3146 var obj = new api.ListOrgPoliciesRequest.fromJson(json); | 3298 var obj = new api.ListOrgPoliciesRequest.fromJson(json); |
| 3147 checkListOrgPoliciesRequest(obj); | 3299 checkListOrgPoliciesRequest(obj); |
| 3148 | 3300 |
| 3149 var path = (req.url).path; | 3301 var path = (req.url).path; |
| 3150 var pathOffset = 0; | 3302 var pathOffset = 0; |
| 3151 var index; | 3303 var index; |
| 3152 var subPart; | 3304 var subPart; |
| 3153 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3305 unittest.expect( |
| 3306 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3154 pathOffset += 1; | 3307 pathOffset += 1; |
| 3155 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 3308 unittest.expect( |
| 3309 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 3156 pathOffset += 3; | 3310 pathOffset += 3; |
| 3157 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 3311 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 3158 | 3312 |
| 3159 var query = (req.url).query; | 3313 var query = (req.url).query; |
| 3160 var queryOffset = 0; | 3314 var queryOffset = 0; |
| 3161 var queryMap = {}; | 3315 var queryMap = {}; |
| 3162 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3316 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3163 parseBool(n) { | 3317 parseBool(n) { |
| 3164 if (n == "true") return true; | 3318 if (n == "true") return true; |
| 3165 if (n == "false") return false; | 3319 if (n == "false") return false; |
| 3166 if (n == null) return null; | 3320 if (n == null) return null; |
| 3167 throw new core.ArgumentError("Invalid boolean: $n"); | 3321 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3168 } | 3322 } |
| 3323 |
| 3169 if (query.length > 0) { | 3324 if (query.length > 0) { |
| 3170 for (var part in query.split("&")) { | 3325 for (var part in query.split("&")) { |
| 3171 var keyvalue = part.split("="); | 3326 var keyvalue = part.split("="); |
| 3172 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3327 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3328 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3173 } | 3329 } |
| 3174 } | 3330 } |
| 3175 | 3331 |
| 3176 | |
| 3177 var h = { | 3332 var h = { |
| 3178 "content-type" : "application/json; charset=utf-8", | 3333 "content-type": "application/json; charset=utf-8", |
| 3179 }; | 3334 }; |
| 3180 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); | 3335 var resp = convert.JSON.encode(buildListOrgPoliciesResponse()); |
| 3181 return new async.Future.value(stringResponse(200, h, resp)); | 3336 return new async.Future.value(stringResponse(200, h, resp)); |
| 3182 }), true); | 3337 }), true); |
| 3183 res.listOrgPolicies(arg_request, arg_resource).then(unittest.expectAsync1(
((api.ListOrgPoliciesResponse response) { | 3338 res |
| 3339 .listOrgPolicies(arg_request, arg_resource) |
| 3340 .then(unittest.expectAsync1(((api.ListOrgPoliciesResponse response) { |
| 3184 checkListOrgPoliciesResponse(response); | 3341 checkListOrgPoliciesResponse(response); |
| 3185 }))); | 3342 }))); |
| 3186 }); | 3343 }); |
| 3187 | 3344 |
| 3188 unittest.test("method--setIamPolicy", () { | 3345 unittest.test("method--setIamPolicy", () { |
| 3189 | |
| 3190 var mock = new HttpServerMock(); | 3346 var mock = new HttpServerMock(); |
| 3191 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3347 api.ProjectsResourceApi res = |
| 3348 new api.CloudresourcemanagerApi(mock).projects; |
| 3192 var arg_request = buildSetIamPolicyRequest(); | 3349 var arg_request = buildSetIamPolicyRequest(); |
| 3193 var arg_resource = "foo"; | 3350 var arg_resource = "foo"; |
| 3194 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3351 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3195 var obj = new api.SetIamPolicyRequest.fromJson(json); | 3352 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 3196 checkSetIamPolicyRequest(obj); | 3353 checkSetIamPolicyRequest(obj); |
| 3197 | 3354 |
| 3198 var path = (req.url).path; | 3355 var path = (req.url).path; |
| 3199 var pathOffset = 0; | 3356 var pathOffset = 0; |
| 3200 var index; | 3357 var index; |
| 3201 var subPart; | 3358 var subPart; |
| 3202 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3359 unittest.expect( |
| 3360 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3203 pathOffset += 1; | 3361 pathOffset += 1; |
| 3204 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3362 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3363 unittest.equals("v1/projects/")); |
| 3205 pathOffset += 12; | 3364 pathOffset += 12; |
| 3206 index = path.indexOf(":setIamPolicy", pathOffset); | 3365 index = path.indexOf(":setIamPolicy", pathOffset); |
| 3207 unittest.expect(index >= 0, unittest.isTrue); | 3366 unittest.expect(index >= 0, unittest.isTrue); |
| 3208 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3367 subPart = |
| 3368 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3209 pathOffset = index; | 3369 pathOffset = index; |
| 3210 unittest.expect(subPart, unittest.equals("$arg_resource")); | 3370 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 3211 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":setIamPolicy")); | 3371 unittest.expect(path.substring(pathOffset, pathOffset + 13), |
| 3372 unittest.equals(":setIamPolicy")); |
| 3212 pathOffset += 13; | 3373 pathOffset += 13; |
| 3213 | 3374 |
| 3214 var query = (req.url).query; | 3375 var query = (req.url).query; |
| 3215 var queryOffset = 0; | 3376 var queryOffset = 0; |
| 3216 var queryMap = {}; | 3377 var queryMap = {}; |
| 3217 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3378 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3218 parseBool(n) { | 3379 parseBool(n) { |
| 3219 if (n == "true") return true; | 3380 if (n == "true") return true; |
| 3220 if (n == "false") return false; | 3381 if (n == "false") return false; |
| 3221 if (n == null) return null; | 3382 if (n == null) return null; |
| 3222 throw new core.ArgumentError("Invalid boolean: $n"); | 3383 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3223 } | 3384 } |
| 3385 |
| 3224 if (query.length > 0) { | 3386 if (query.length > 0) { |
| 3225 for (var part in query.split("&")) { | 3387 for (var part in query.split("&")) { |
| 3226 var keyvalue = part.split("="); | 3388 var keyvalue = part.split("="); |
| 3227 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3389 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3390 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3228 } | 3391 } |
| 3229 } | 3392 } |
| 3230 | 3393 |
| 3231 | |
| 3232 var h = { | 3394 var h = { |
| 3233 "content-type" : "application/json; charset=utf-8", | 3395 "content-type": "application/json; charset=utf-8", |
| 3234 }; | 3396 }; |
| 3235 var resp = convert.JSON.encode(buildPolicy()); | 3397 var resp = convert.JSON.encode(buildPolicy()); |
| 3236 return new async.Future.value(stringResponse(200, h, resp)); | 3398 return new async.Future.value(stringResponse(200, h, resp)); |
| 3237 }), true); | 3399 }), true); |
| 3238 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { | 3400 res |
| 3401 .setIamPolicy(arg_request, arg_resource) |
| 3402 .then(unittest.expectAsync1(((api.Policy response) { |
| 3239 checkPolicy(response); | 3403 checkPolicy(response); |
| 3240 }))); | 3404 }))); |
| 3241 }); | 3405 }); |
| 3242 | 3406 |
| 3243 unittest.test("method--setOrgPolicy", () { | 3407 unittest.test("method--setOrgPolicy", () { |
| 3244 | |
| 3245 var mock = new HttpServerMock(); | 3408 var mock = new HttpServerMock(); |
| 3246 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3409 api.ProjectsResourceApi res = |
| 3410 new api.CloudresourcemanagerApi(mock).projects; |
| 3247 var arg_request = buildSetOrgPolicyRequest(); | 3411 var arg_request = buildSetOrgPolicyRequest(); |
| 3248 var arg_resource = "foo"; | 3412 var arg_resource = "foo"; |
| 3249 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3413 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3250 var obj = new api.SetOrgPolicyRequest.fromJson(json); | 3414 var obj = new api.SetOrgPolicyRequest.fromJson(json); |
| 3251 checkSetOrgPolicyRequest(obj); | 3415 checkSetOrgPolicyRequest(obj); |
| 3252 | 3416 |
| 3253 var path = (req.url).path; | 3417 var path = (req.url).path; |
| 3254 var pathOffset = 0; | 3418 var pathOffset = 0; |
| 3255 var index; | 3419 var index; |
| 3256 var subPart; | 3420 var subPart; |
| 3257 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3421 unittest.expect( |
| 3422 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3258 pathOffset += 1; | 3423 pathOffset += 1; |
| 3259 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 3424 unittest.expect( |
| 3425 path.substring(pathOffset, pathOffset + 3), unittest.equals("v1/")); |
| 3260 pathOffset += 3; | 3426 pathOffset += 3; |
| 3261 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 3427 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 3262 | 3428 |
| 3263 var query = (req.url).query; | 3429 var query = (req.url).query; |
| 3264 var queryOffset = 0; | 3430 var queryOffset = 0; |
| 3265 var queryMap = {}; | 3431 var queryMap = {}; |
| 3266 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3432 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3267 parseBool(n) { | 3433 parseBool(n) { |
| 3268 if (n == "true") return true; | 3434 if (n == "true") return true; |
| 3269 if (n == "false") return false; | 3435 if (n == "false") return false; |
| 3270 if (n == null) return null; | 3436 if (n == null) return null; |
| 3271 throw new core.ArgumentError("Invalid boolean: $n"); | 3437 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3272 } | 3438 } |
| 3439 |
| 3273 if (query.length > 0) { | 3440 if (query.length > 0) { |
| 3274 for (var part in query.split("&")) { | 3441 for (var part in query.split("&")) { |
| 3275 var keyvalue = part.split("="); | 3442 var keyvalue = part.split("="); |
| 3276 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3443 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3444 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3277 } | 3445 } |
| 3278 } | 3446 } |
| 3279 | 3447 |
| 3280 | |
| 3281 var h = { | 3448 var h = { |
| 3282 "content-type" : "application/json; charset=utf-8", | 3449 "content-type": "application/json; charset=utf-8", |
| 3283 }; | 3450 }; |
| 3284 var resp = convert.JSON.encode(buildOrgPolicy()); | 3451 var resp = convert.JSON.encode(buildOrgPolicy()); |
| 3285 return new async.Future.value(stringResponse(200, h, resp)); | 3452 return new async.Future.value(stringResponse(200, h, resp)); |
| 3286 }), true); | 3453 }), true); |
| 3287 res.setOrgPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.OrgPolicy response) { | 3454 res |
| 3455 .setOrgPolicy(arg_request, arg_resource) |
| 3456 .then(unittest.expectAsync1(((api.OrgPolicy response) { |
| 3288 checkOrgPolicy(response); | 3457 checkOrgPolicy(response); |
| 3289 }))); | 3458 }))); |
| 3290 }); | 3459 }); |
| 3291 | 3460 |
| 3292 unittest.test("method--testIamPermissions", () { | 3461 unittest.test("method--testIamPermissions", () { |
| 3293 | |
| 3294 var mock = new HttpServerMock(); | 3462 var mock = new HttpServerMock(); |
| 3295 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3463 api.ProjectsResourceApi res = |
| 3464 new api.CloudresourcemanagerApi(mock).projects; |
| 3296 var arg_request = buildTestIamPermissionsRequest(); | 3465 var arg_request = buildTestIamPermissionsRequest(); |
| 3297 var arg_resource = "foo"; | 3466 var arg_resource = "foo"; |
| 3298 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3467 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3299 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 3468 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 3300 checkTestIamPermissionsRequest(obj); | 3469 checkTestIamPermissionsRequest(obj); |
| 3301 | 3470 |
| 3302 var path = (req.url).path; | 3471 var path = (req.url).path; |
| 3303 var pathOffset = 0; | 3472 var pathOffset = 0; |
| 3304 var index; | 3473 var index; |
| 3305 var subPart; | 3474 var subPart; |
| 3306 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3475 unittest.expect( |
| 3476 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3307 pathOffset += 1; | 3477 pathOffset += 1; |
| 3308 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3478 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3479 unittest.equals("v1/projects/")); |
| 3309 pathOffset += 12; | 3480 pathOffset += 12; |
| 3310 index = path.indexOf(":testIamPermissions", pathOffset); | 3481 index = path.indexOf(":testIamPermissions", pathOffset); |
| 3311 unittest.expect(index >= 0, unittest.isTrue); | 3482 unittest.expect(index >= 0, unittest.isTrue); |
| 3312 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3483 subPart = |
| 3484 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3313 pathOffset = index; | 3485 pathOffset = index; |
| 3314 unittest.expect(subPart, unittest.equals("$arg_resource")); | 3486 unittest.expect(subPart, unittest.equals("$arg_resource")); |
| 3315 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals(":testIamPermissions")); | 3487 unittest.expect(path.substring(pathOffset, pathOffset + 19), |
| 3488 unittest.equals(":testIamPermissions")); |
| 3316 pathOffset += 19; | 3489 pathOffset += 19; |
| 3317 | 3490 |
| 3318 var query = (req.url).query; | 3491 var query = (req.url).query; |
| 3319 var queryOffset = 0; | 3492 var queryOffset = 0; |
| 3320 var queryMap = {}; | 3493 var queryMap = {}; |
| 3321 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3494 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3322 parseBool(n) { | 3495 parseBool(n) { |
| 3323 if (n == "true") return true; | 3496 if (n == "true") return true; |
| 3324 if (n == "false") return false; | 3497 if (n == "false") return false; |
| 3325 if (n == null) return null; | 3498 if (n == null) return null; |
| 3326 throw new core.ArgumentError("Invalid boolean: $n"); | 3499 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3327 } | 3500 } |
| 3501 |
| 3328 if (query.length > 0) { | 3502 if (query.length > 0) { |
| 3329 for (var part in query.split("&")) { | 3503 for (var part in query.split("&")) { |
| 3330 var keyvalue = part.split("="); | 3504 var keyvalue = part.split("="); |
| 3331 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3505 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3506 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3332 } | 3507 } |
| 3333 } | 3508 } |
| 3334 | 3509 |
| 3335 | |
| 3336 var h = { | 3510 var h = { |
| 3337 "content-type" : "application/json; charset=utf-8", | 3511 "content-type": "application/json; charset=utf-8", |
| 3338 }; | 3512 }; |
| 3339 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 3513 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 3340 return new async.Future.value(stringResponse(200, h, resp)); | 3514 return new async.Future.value(stringResponse(200, h, resp)); |
| 3341 }), true); | 3515 }), true); |
| 3342 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { | 3516 res.testIamPermissions(arg_request, arg_resource).then( |
| 3517 unittest.expectAsync1(((api.TestIamPermissionsResponse response) { |
| 3343 checkTestIamPermissionsResponse(response); | 3518 checkTestIamPermissionsResponse(response); |
| 3344 }))); | 3519 }))); |
| 3345 }); | 3520 }); |
| 3346 | 3521 |
| 3347 unittest.test("method--undelete", () { | 3522 unittest.test("method--undelete", () { |
| 3348 | |
| 3349 var mock = new HttpServerMock(); | 3523 var mock = new HttpServerMock(); |
| 3350 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3524 api.ProjectsResourceApi res = |
| 3525 new api.CloudresourcemanagerApi(mock).projects; |
| 3351 var arg_request = buildUndeleteProjectRequest(); | 3526 var arg_request = buildUndeleteProjectRequest(); |
| 3352 var arg_projectId = "foo"; | 3527 var arg_projectId = "foo"; |
| 3353 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3528 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3354 var obj = new api.UndeleteProjectRequest.fromJson(json); | 3529 var obj = new api.UndeleteProjectRequest.fromJson(json); |
| 3355 checkUndeleteProjectRequest(obj); | 3530 checkUndeleteProjectRequest(obj); |
| 3356 | 3531 |
| 3357 var path = (req.url).path; | 3532 var path = (req.url).path; |
| 3358 var pathOffset = 0; | 3533 var pathOffset = 0; |
| 3359 var index; | 3534 var index; |
| 3360 var subPart; | 3535 var subPart; |
| 3361 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3536 unittest.expect( |
| 3537 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3362 pathOffset += 1; | 3538 pathOffset += 1; |
| 3363 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3539 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3540 unittest.equals("v1/projects/")); |
| 3364 pathOffset += 12; | 3541 pathOffset += 12; |
| 3365 index = path.indexOf(":undelete", pathOffset); | 3542 index = path.indexOf(":undelete", pathOffset); |
| 3366 unittest.expect(index >= 0, unittest.isTrue); | 3543 unittest.expect(index >= 0, unittest.isTrue); |
| 3367 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3544 subPart = |
| 3545 core.Uri.decodeQueryComponent(path.substring(pathOffset, index)); |
| 3368 pathOffset = index; | 3546 pathOffset = index; |
| 3369 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3547 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3370 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als(":undelete")); | 3548 unittest.expect(path.substring(pathOffset, pathOffset + 9), |
| 3549 unittest.equals(":undelete")); |
| 3371 pathOffset += 9; | 3550 pathOffset += 9; |
| 3372 | 3551 |
| 3373 var query = (req.url).query; | 3552 var query = (req.url).query; |
| 3374 var queryOffset = 0; | 3553 var queryOffset = 0; |
| 3375 var queryMap = {}; | 3554 var queryMap = {}; |
| 3376 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3555 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3377 parseBool(n) { | 3556 parseBool(n) { |
| 3378 if (n == "true") return true; | 3557 if (n == "true") return true; |
| 3379 if (n == "false") return false; | 3558 if (n == "false") return false; |
| 3380 if (n == null) return null; | 3559 if (n == null) return null; |
| 3381 throw new core.ArgumentError("Invalid boolean: $n"); | 3560 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3382 } | 3561 } |
| 3562 |
| 3383 if (query.length > 0) { | 3563 if (query.length > 0) { |
| 3384 for (var part in query.split("&")) { | 3564 for (var part in query.split("&")) { |
| 3385 var keyvalue = part.split("="); | 3565 var keyvalue = part.split("="); |
| 3386 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3566 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3567 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3387 } | 3568 } |
| 3388 } | 3569 } |
| 3389 | 3570 |
| 3390 | |
| 3391 var h = { | 3571 var h = { |
| 3392 "content-type" : "application/json; charset=utf-8", | 3572 "content-type": "application/json; charset=utf-8", |
| 3393 }; | 3573 }; |
| 3394 var resp = convert.JSON.encode(buildEmpty()); | 3574 var resp = convert.JSON.encode(buildEmpty()); |
| 3395 return new async.Future.value(stringResponse(200, h, resp)); | 3575 return new async.Future.value(stringResponse(200, h, resp)); |
| 3396 }), true); | 3576 }), true); |
| 3397 res.undelete(arg_request, arg_projectId).then(unittest.expectAsync1(((api.
Empty response) { | 3577 res |
| 3578 .undelete(arg_request, arg_projectId) |
| 3579 .then(unittest.expectAsync1(((api.Empty response) { |
| 3398 checkEmpty(response); | 3580 checkEmpty(response); |
| 3399 }))); | 3581 }))); |
| 3400 }); | 3582 }); |
| 3401 | 3583 |
| 3402 unittest.test("method--update", () { | 3584 unittest.test("method--update", () { |
| 3403 | |
| 3404 var mock = new HttpServerMock(); | 3585 var mock = new HttpServerMock(); |
| 3405 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 3586 api.ProjectsResourceApi res = |
| 3587 new api.CloudresourcemanagerApi(mock).projects; |
| 3406 var arg_request = buildProject(); | 3588 var arg_request = buildProject(); |
| 3407 var arg_projectId = "foo"; | 3589 var arg_projectId = "foo"; |
| 3408 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 3590 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 3409 var obj = new api.Project.fromJson(json); | 3591 var obj = new api.Project.fromJson(json); |
| 3410 checkProject(obj); | 3592 checkProject(obj); |
| 3411 | 3593 |
| 3412 var path = (req.url).path; | 3594 var path = (req.url).path; |
| 3413 var pathOffset = 0; | 3595 var pathOffset = 0; |
| 3414 var index; | 3596 var index; |
| 3415 var subPart; | 3597 var subPart; |
| 3416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3598 unittest.expect( |
| 3599 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 3417 pathOffset += 1; | 3600 pathOffset += 1; |
| 3418 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1/projects/")); | 3601 unittest.expect(path.substring(pathOffset, pathOffset + 12), |
| 3602 unittest.equals("v1/projects/")); |
| 3419 pathOffset += 12; | 3603 pathOffset += 12; |
| 3420 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3604 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3421 pathOffset = path.length; | 3605 pathOffset = path.length; |
| 3422 unittest.expect(subPart, unittest.equals("$arg_projectId")); | 3606 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 3423 | 3607 |
| 3424 var query = (req.url).query; | 3608 var query = (req.url).query; |
| 3425 var queryOffset = 0; | 3609 var queryOffset = 0; |
| 3426 var queryMap = {}; | 3610 var queryMap = {}; |
| 3427 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3611 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3428 parseBool(n) { | 3612 parseBool(n) { |
| 3429 if (n == "true") return true; | 3613 if (n == "true") return true; |
| 3430 if (n == "false") return false; | 3614 if (n == "false") return false; |
| 3431 if (n == null) return null; | 3615 if (n == null) return null; |
| 3432 throw new core.ArgumentError("Invalid boolean: $n"); | 3616 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3433 } | 3617 } |
| 3618 |
| 3434 if (query.length > 0) { | 3619 if (query.length > 0) { |
| 3435 for (var part in query.split("&")) { | 3620 for (var part in query.split("&")) { |
| 3436 var keyvalue = part.split("="); | 3621 var keyvalue = part.split("="); |
| 3437 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3622 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 3623 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 3438 } | 3624 } |
| 3439 } | 3625 } |
| 3440 | 3626 |
| 3441 | |
| 3442 var h = { | 3627 var h = { |
| 3443 "content-type" : "application/json; charset=utf-8", | 3628 "content-type": "application/json; charset=utf-8", |
| 3444 }; | 3629 }; |
| 3445 var resp = convert.JSON.encode(buildProject()); | 3630 var resp = convert.JSON.encode(buildProject()); |
| 3446 return new async.Future.value(stringResponse(200, h, resp)); | 3631 return new async.Future.value(stringResponse(200, h, resp)); |
| 3447 }), true); | 3632 }), true); |
| 3448 res.update(arg_request, arg_projectId).then(unittest.expectAsync1(((api.Pr
oject response) { | 3633 res |
| 3634 .update(arg_request, arg_projectId) |
| 3635 .then(unittest.expectAsync1(((api.Project response) { |
| 3449 checkProject(response); | 3636 checkProject(response); |
| 3450 }))); | 3637 }))); |
| 3451 }); | 3638 }); |
| 3452 | |
| 3453 }); | 3639 }); |
| 3454 | |
| 3455 | |
| 3456 } | 3640 } |
| 3457 | |
| OLD | NEW |