| OLD | NEW |
| 1 library googleapis_beta.cloudresourcemanager.v1beta1.test; | 1 library googleapis_beta.cloudresourcemanager.v1beta1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis_beta/cloudresourcemanager/v1beta1.dart' as api; | 12 import 'package:googleapis_beta/cloudresourcemanager/v1beta1.dart' as api; |
| 13 | 13 |
| 14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 15 core.Function _callback; |
| 16 core.bool _expectJson; | 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 19 _callback = callback; |
| 20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 } else { | 39 } else { |
| 40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 41 return _callback(request, data); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 core.int buildCounterAncestor = 0; | 54 core.int buildCounterAncestor = 0; |
| 55 buildAncestor() { | 55 buildAncestor() { |
| 56 var o = new api.Ancestor(); | 56 var o = new api.Ancestor(); |
| 57 buildCounterAncestor++; | 57 buildCounterAncestor++; |
| 58 if (buildCounterAncestor < 3) { | 58 if (buildCounterAncestor < 3) { |
| 59 o.resourceId = buildResourceId(); | 59 o.resourceId = buildResourceId(); |
| 60 } | 60 } |
| 61 buildCounterAncestor--; | 61 buildCounterAncestor--; |
| 62 return o; | 62 return o; |
| 63 } | 63 } |
| 64 | 64 |
| 65 checkAncestor(api.Ancestor o) { | 65 checkAncestor(api.Ancestor o) { |
| 66 buildCounterAncestor++; | 66 buildCounterAncestor++; |
| 67 if (buildCounterAncestor < 3) { | 67 if (buildCounterAncestor < 3) { |
| 68 checkResourceId(o.resourceId); | 68 checkResourceId(o.resourceId); |
| 69 } | 69 } |
| 70 buildCounterAncestor--; | 70 buildCounterAncestor--; |
| 71 } | 71 } |
| 72 | 72 |
| 73 buildUnnamed3795() { | 73 buildUnnamed3269() { |
| 74 var o = new core.List<api.AuditLogConfig>(); | 74 var o = new core.List<api.AuditLogConfig>(); |
| 75 o.add(buildAuditLogConfig()); | 75 o.add(buildAuditLogConfig()); |
| 76 o.add(buildAuditLogConfig()); | 76 o.add(buildAuditLogConfig()); |
| 77 return o; | 77 return o; |
| 78 } | 78 } |
| 79 | 79 |
| 80 checkUnnamed3795(core.List<api.AuditLogConfig> o) { | 80 checkUnnamed3269(core.List<api.AuditLogConfig> o) { |
| 81 unittest.expect(o, unittest.hasLength(2)); | 81 unittest.expect(o, unittest.hasLength(2)); |
| 82 checkAuditLogConfig(o[0]); | 82 checkAuditLogConfig(o[0]); |
| 83 checkAuditLogConfig(o[1]); | 83 checkAuditLogConfig(o[1]); |
| 84 } | 84 } |
| 85 | 85 |
| 86 core.int buildCounterAuditConfig = 0; | 86 core.int buildCounterAuditConfig = 0; |
| 87 buildAuditConfig() { | 87 buildAuditConfig() { |
| 88 var o = new api.AuditConfig(); | 88 var o = new api.AuditConfig(); |
| 89 buildCounterAuditConfig++; | 89 buildCounterAuditConfig++; |
| 90 if (buildCounterAuditConfig < 3) { | 90 if (buildCounterAuditConfig < 3) { |
| 91 o.auditLogConfigs = buildUnnamed3795(); | 91 o.auditLogConfigs = buildUnnamed3269(); |
| 92 o.service = "foo"; | 92 o.service = "foo"; |
| 93 } | 93 } |
| 94 buildCounterAuditConfig--; | 94 buildCounterAuditConfig--; |
| 95 return o; | 95 return o; |
| 96 } | 96 } |
| 97 | 97 |
| 98 checkAuditConfig(api.AuditConfig o) { | 98 checkAuditConfig(api.AuditConfig o) { |
| 99 buildCounterAuditConfig++; | 99 buildCounterAuditConfig++; |
| 100 if (buildCounterAuditConfig < 3) { | 100 if (buildCounterAuditConfig < 3) { |
| 101 checkUnnamed3795(o.auditLogConfigs); | 101 checkUnnamed3269(o.auditLogConfigs); |
| 102 unittest.expect(o.service, unittest.equals('foo')); | 102 unittest.expect(o.service, unittest.equals('foo')); |
| 103 } | 103 } |
| 104 buildCounterAuditConfig--; | 104 buildCounterAuditConfig--; |
| 105 } | 105 } |
| 106 | 106 |
| 107 buildUnnamed3796() { | 107 buildUnnamed3270() { |
| 108 var o = new core.List<core.String>(); | 108 var o = new core.List<core.String>(); |
| 109 o.add("foo"); | 109 o.add("foo"); |
| 110 o.add("foo"); | 110 o.add("foo"); |
| 111 return o; | 111 return o; |
| 112 } | 112 } |
| 113 | 113 |
| 114 checkUnnamed3796(core.List<core.String> o) { | 114 checkUnnamed3270(core.List<core.String> o) { |
| 115 unittest.expect(o, unittest.hasLength(2)); | 115 unittest.expect(o, unittest.hasLength(2)); |
| 116 unittest.expect(o[0], unittest.equals('foo')); | 116 unittest.expect(o[0], unittest.equals('foo')); |
| 117 unittest.expect(o[1], unittest.equals('foo')); | 117 unittest.expect(o[1], unittest.equals('foo')); |
| 118 } | 118 } |
| 119 | 119 |
| 120 core.int buildCounterAuditLogConfig = 0; | 120 core.int buildCounterAuditLogConfig = 0; |
| 121 buildAuditLogConfig() { | 121 buildAuditLogConfig() { |
| 122 var o = new api.AuditLogConfig(); | 122 var o = new api.AuditLogConfig(); |
| 123 buildCounterAuditLogConfig++; | 123 buildCounterAuditLogConfig++; |
| 124 if (buildCounterAuditLogConfig < 3) { | 124 if (buildCounterAuditLogConfig < 3) { |
| 125 o.exemptedMembers = buildUnnamed3796(); | 125 o.exemptedMembers = buildUnnamed3270(); |
| 126 o.logType = "foo"; | 126 o.logType = "foo"; |
| 127 } | 127 } |
| 128 buildCounterAuditLogConfig--; | 128 buildCounterAuditLogConfig--; |
| 129 return o; | 129 return o; |
| 130 } | 130 } |
| 131 | 131 |
| 132 checkAuditLogConfig(api.AuditLogConfig o) { | 132 checkAuditLogConfig(api.AuditLogConfig o) { |
| 133 buildCounterAuditLogConfig++; | 133 buildCounterAuditLogConfig++; |
| 134 if (buildCounterAuditLogConfig < 3) { | 134 if (buildCounterAuditLogConfig < 3) { |
| 135 checkUnnamed3796(o.exemptedMembers); | 135 checkUnnamed3270(o.exemptedMembers); |
| 136 unittest.expect(o.logType, unittest.equals('foo')); | 136 unittest.expect(o.logType, unittest.equals('foo')); |
| 137 } | 137 } |
| 138 buildCounterAuditLogConfig--; | 138 buildCounterAuditLogConfig--; |
| 139 } | 139 } |
| 140 | 140 |
| 141 buildUnnamed3797() { | 141 buildUnnamed3271() { |
| 142 var o = new core.List<core.String>(); | 142 var o = new core.List<core.String>(); |
| 143 o.add("foo"); | 143 o.add("foo"); |
| 144 o.add("foo"); | 144 o.add("foo"); |
| 145 return o; | 145 return o; |
| 146 } | 146 } |
| 147 | 147 |
| 148 checkUnnamed3797(core.List<core.String> o) { | 148 checkUnnamed3271(core.List<core.String> o) { |
| 149 unittest.expect(o, unittest.hasLength(2)); | 149 unittest.expect(o, unittest.hasLength(2)); |
| 150 unittest.expect(o[0], unittest.equals('foo')); | 150 unittest.expect(o[0], unittest.equals('foo')); |
| 151 unittest.expect(o[1], unittest.equals('foo')); | 151 unittest.expect(o[1], unittest.equals('foo')); |
| 152 } | 152 } |
| 153 | 153 |
| 154 core.int buildCounterBinding = 0; | 154 core.int buildCounterBinding = 0; |
| 155 buildBinding() { | 155 buildBinding() { |
| 156 var o = new api.Binding(); | 156 var o = new api.Binding(); |
| 157 buildCounterBinding++; | 157 buildCounterBinding++; |
| 158 if (buildCounterBinding < 3) { | 158 if (buildCounterBinding < 3) { |
| 159 o.members = buildUnnamed3797(); | 159 o.members = buildUnnamed3271(); |
| 160 o.role = "foo"; | 160 o.role = "foo"; |
| 161 } | 161 } |
| 162 buildCounterBinding--; | 162 buildCounterBinding--; |
| 163 return o; | 163 return o; |
| 164 } | 164 } |
| 165 | 165 |
| 166 checkBinding(api.Binding o) { | 166 checkBinding(api.Binding o) { |
| 167 buildCounterBinding++; | 167 buildCounterBinding++; |
| 168 if (buildCounterBinding < 3) { | 168 if (buildCounterBinding < 3) { |
| 169 checkUnnamed3797(o.members); | 169 checkUnnamed3271(o.members); |
| 170 unittest.expect(o.role, unittest.equals('foo')); | 170 unittest.expect(o.role, unittest.equals('foo')); |
| 171 } | 171 } |
| 172 buildCounterBinding--; | 172 buildCounterBinding--; |
| 173 } | 173 } |
| 174 | 174 |
| 175 core.int buildCounterEmpty = 0; | 175 core.int buildCounterEmpty = 0; |
| 176 buildEmpty() { | 176 buildEmpty() { |
| 177 var o = new api.Empty(); | 177 var o = new api.Empty(); |
| 178 buildCounterEmpty++; | 178 buildCounterEmpty++; |
| 179 if (buildCounterEmpty < 3) { | 179 if (buildCounterEmpty < 3) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 return o; | 243 return o; |
| 244 } | 244 } |
| 245 | 245 |
| 246 checkGetAncestryRequest(api.GetAncestryRequest o) { | 246 checkGetAncestryRequest(api.GetAncestryRequest o) { |
| 247 buildCounterGetAncestryRequest++; | 247 buildCounterGetAncestryRequest++; |
| 248 if (buildCounterGetAncestryRequest < 3) { | 248 if (buildCounterGetAncestryRequest < 3) { |
| 249 } | 249 } |
| 250 buildCounterGetAncestryRequest--; | 250 buildCounterGetAncestryRequest--; |
| 251 } | 251 } |
| 252 | 252 |
| 253 buildUnnamed3798() { | 253 buildUnnamed3272() { |
| 254 var o = new core.List<api.Ancestor>(); | 254 var o = new core.List<api.Ancestor>(); |
| 255 o.add(buildAncestor()); | 255 o.add(buildAncestor()); |
| 256 o.add(buildAncestor()); | 256 o.add(buildAncestor()); |
| 257 return o; | 257 return o; |
| 258 } | 258 } |
| 259 | 259 |
| 260 checkUnnamed3798(core.List<api.Ancestor> o) { | 260 checkUnnamed3272(core.List<api.Ancestor> o) { |
| 261 unittest.expect(o, unittest.hasLength(2)); | 261 unittest.expect(o, unittest.hasLength(2)); |
| 262 checkAncestor(o[0]); | 262 checkAncestor(o[0]); |
| 263 checkAncestor(o[1]); | 263 checkAncestor(o[1]); |
| 264 } | 264 } |
| 265 | 265 |
| 266 core.int buildCounterGetAncestryResponse = 0; | 266 core.int buildCounterGetAncestryResponse = 0; |
| 267 buildGetAncestryResponse() { | 267 buildGetAncestryResponse() { |
| 268 var o = new api.GetAncestryResponse(); | 268 var o = new api.GetAncestryResponse(); |
| 269 buildCounterGetAncestryResponse++; | 269 buildCounterGetAncestryResponse++; |
| 270 if (buildCounterGetAncestryResponse < 3) { | 270 if (buildCounterGetAncestryResponse < 3) { |
| 271 o.ancestor = buildUnnamed3798(); | 271 o.ancestor = buildUnnamed3272(); |
| 272 } | 272 } |
| 273 buildCounterGetAncestryResponse--; | 273 buildCounterGetAncestryResponse--; |
| 274 return o; | 274 return o; |
| 275 } | 275 } |
| 276 | 276 |
| 277 checkGetAncestryResponse(api.GetAncestryResponse o) { | 277 checkGetAncestryResponse(api.GetAncestryResponse o) { |
| 278 buildCounterGetAncestryResponse++; | 278 buildCounterGetAncestryResponse++; |
| 279 if (buildCounterGetAncestryResponse < 3) { | 279 if (buildCounterGetAncestryResponse < 3) { |
| 280 checkUnnamed3798(o.ancestor); | 280 checkUnnamed3272(o.ancestor); |
| 281 } | 281 } |
| 282 buildCounterGetAncestryResponse--; | 282 buildCounterGetAncestryResponse--; |
| 283 } | 283 } |
| 284 | 284 |
| 285 core.int buildCounterGetIamPolicyRequest = 0; | 285 core.int buildCounterGetIamPolicyRequest = 0; |
| 286 buildGetIamPolicyRequest() { | 286 buildGetIamPolicyRequest() { |
| 287 var o = new api.GetIamPolicyRequest(); | 287 var o = new api.GetIamPolicyRequest(); |
| 288 buildCounterGetIamPolicyRequest++; | 288 buildCounterGetIamPolicyRequest++; |
| 289 if (buildCounterGetIamPolicyRequest < 3) { | 289 if (buildCounterGetIamPolicyRequest < 3) { |
| 290 } | 290 } |
| 291 buildCounterGetIamPolicyRequest--; | 291 buildCounterGetIamPolicyRequest--; |
| 292 return o; | 292 return o; |
| 293 } | 293 } |
| 294 | 294 |
| 295 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { | 295 checkGetIamPolicyRequest(api.GetIamPolicyRequest o) { |
| 296 buildCounterGetIamPolicyRequest++; | 296 buildCounterGetIamPolicyRequest++; |
| 297 if (buildCounterGetIamPolicyRequest < 3) { | 297 if (buildCounterGetIamPolicyRequest < 3) { |
| 298 } | 298 } |
| 299 buildCounterGetIamPolicyRequest--; | 299 buildCounterGetIamPolicyRequest--; |
| 300 } | 300 } |
| 301 | 301 |
| 302 buildUnnamed3799() { | 302 buildUnnamed3273() { |
| 303 var o = new core.List<api.Organization>(); | 303 var o = new core.List<api.Organization>(); |
| 304 o.add(buildOrganization()); | 304 o.add(buildOrganization()); |
| 305 o.add(buildOrganization()); | 305 o.add(buildOrganization()); |
| 306 return o; | 306 return o; |
| 307 } | 307 } |
| 308 | 308 |
| 309 checkUnnamed3799(core.List<api.Organization> o) { | 309 checkUnnamed3273(core.List<api.Organization> o) { |
| 310 unittest.expect(o, unittest.hasLength(2)); | 310 unittest.expect(o, unittest.hasLength(2)); |
| 311 checkOrganization(o[0]); | 311 checkOrganization(o[0]); |
| 312 checkOrganization(o[1]); | 312 checkOrganization(o[1]); |
| 313 } | 313 } |
| 314 | 314 |
| 315 core.int buildCounterListOrganizationsResponse = 0; | 315 core.int buildCounterListOrganizationsResponse = 0; |
| 316 buildListOrganizationsResponse() { | 316 buildListOrganizationsResponse() { |
| 317 var o = new api.ListOrganizationsResponse(); | 317 var o = new api.ListOrganizationsResponse(); |
| 318 buildCounterListOrganizationsResponse++; | 318 buildCounterListOrganizationsResponse++; |
| 319 if (buildCounterListOrganizationsResponse < 3) { | 319 if (buildCounterListOrganizationsResponse < 3) { |
| 320 o.nextPageToken = "foo"; | 320 o.nextPageToken = "foo"; |
| 321 o.organizations = buildUnnamed3799(); | 321 o.organizations = buildUnnamed3273(); |
| 322 } | 322 } |
| 323 buildCounterListOrganizationsResponse--; | 323 buildCounterListOrganizationsResponse--; |
| 324 return o; | 324 return o; |
| 325 } | 325 } |
| 326 | 326 |
| 327 checkListOrganizationsResponse(api.ListOrganizationsResponse o) { | 327 checkListOrganizationsResponse(api.ListOrganizationsResponse o) { |
| 328 buildCounterListOrganizationsResponse++; | 328 buildCounterListOrganizationsResponse++; |
| 329 if (buildCounterListOrganizationsResponse < 3) { | 329 if (buildCounterListOrganizationsResponse < 3) { |
| 330 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 330 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 331 checkUnnamed3799(o.organizations); | 331 checkUnnamed3273(o.organizations); |
| 332 } | 332 } |
| 333 buildCounterListOrganizationsResponse--; | 333 buildCounterListOrganizationsResponse--; |
| 334 } | 334 } |
| 335 | 335 |
| 336 buildUnnamed3800() { | 336 buildUnnamed3274() { |
| 337 var o = new core.List<api.Project>(); | 337 var o = new core.List<api.Project>(); |
| 338 o.add(buildProject()); | 338 o.add(buildProject()); |
| 339 o.add(buildProject()); | 339 o.add(buildProject()); |
| 340 return o; | 340 return o; |
| 341 } | 341 } |
| 342 | 342 |
| 343 checkUnnamed3800(core.List<api.Project> o) { | 343 checkUnnamed3274(core.List<api.Project> o) { |
| 344 unittest.expect(o, unittest.hasLength(2)); | 344 unittest.expect(o, unittest.hasLength(2)); |
| 345 checkProject(o[0]); | 345 checkProject(o[0]); |
| 346 checkProject(o[1]); | 346 checkProject(o[1]); |
| 347 } | 347 } |
| 348 | 348 |
| 349 core.int buildCounterListProjectsResponse = 0; | 349 core.int buildCounterListProjectsResponse = 0; |
| 350 buildListProjectsResponse() { | 350 buildListProjectsResponse() { |
| 351 var o = new api.ListProjectsResponse(); | 351 var o = new api.ListProjectsResponse(); |
| 352 buildCounterListProjectsResponse++; | 352 buildCounterListProjectsResponse++; |
| 353 if (buildCounterListProjectsResponse < 3) { | 353 if (buildCounterListProjectsResponse < 3) { |
| 354 o.nextPageToken = "foo"; | 354 o.nextPageToken = "foo"; |
| 355 o.projects = buildUnnamed3800(); | 355 o.projects = buildUnnamed3274(); |
| 356 } | 356 } |
| 357 buildCounterListProjectsResponse--; | 357 buildCounterListProjectsResponse--; |
| 358 return o; | 358 return o; |
| 359 } | 359 } |
| 360 | 360 |
| 361 checkListProjectsResponse(api.ListProjectsResponse o) { | 361 checkListProjectsResponse(api.ListProjectsResponse o) { |
| 362 buildCounterListProjectsResponse++; | 362 buildCounterListProjectsResponse++; |
| 363 if (buildCounterListProjectsResponse < 3) { | 363 if (buildCounterListProjectsResponse < 3) { |
| 364 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 364 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 365 checkUnnamed3800(o.projects); | 365 checkUnnamed3274(o.projects); |
| 366 } | 366 } |
| 367 buildCounterListProjectsResponse--; | 367 buildCounterListProjectsResponse--; |
| 368 } | 368 } |
| 369 | 369 |
| 370 core.int buildCounterOrganization = 0; | 370 core.int buildCounterOrganization = 0; |
| 371 buildOrganization() { | 371 buildOrganization() { |
| 372 var o = new api.Organization(); | 372 var o = new api.Organization(); |
| 373 buildCounterOrganization++; | 373 buildCounterOrganization++; |
| 374 if (buildCounterOrganization < 3) { | 374 if (buildCounterOrganization < 3) { |
| 375 o.creationTime = "foo"; | 375 o.creationTime = "foo"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 | 409 |
| 410 checkOrganizationOwner(api.OrganizationOwner o) { | 410 checkOrganizationOwner(api.OrganizationOwner o) { |
| 411 buildCounterOrganizationOwner++; | 411 buildCounterOrganizationOwner++; |
| 412 if (buildCounterOrganizationOwner < 3) { | 412 if (buildCounterOrganizationOwner < 3) { |
| 413 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); | 413 unittest.expect(o.directoryCustomerId, unittest.equals('foo')); |
| 414 } | 414 } |
| 415 buildCounterOrganizationOwner--; | 415 buildCounterOrganizationOwner--; |
| 416 } | 416 } |
| 417 | 417 |
| 418 buildUnnamed3801() { | 418 buildUnnamed3275() { |
| 419 var o = new core.List<api.AuditConfig>(); | 419 var o = new core.List<api.AuditConfig>(); |
| 420 o.add(buildAuditConfig()); | 420 o.add(buildAuditConfig()); |
| 421 o.add(buildAuditConfig()); | 421 o.add(buildAuditConfig()); |
| 422 return o; | 422 return o; |
| 423 } | 423 } |
| 424 | 424 |
| 425 checkUnnamed3801(core.List<api.AuditConfig> o) { | 425 checkUnnamed3275(core.List<api.AuditConfig> o) { |
| 426 unittest.expect(o, unittest.hasLength(2)); | 426 unittest.expect(o, unittest.hasLength(2)); |
| 427 checkAuditConfig(o[0]); | 427 checkAuditConfig(o[0]); |
| 428 checkAuditConfig(o[1]); | 428 checkAuditConfig(o[1]); |
| 429 } | 429 } |
| 430 | 430 |
| 431 buildUnnamed3802() { | 431 buildUnnamed3276() { |
| 432 var o = new core.List<api.Binding>(); | 432 var o = new core.List<api.Binding>(); |
| 433 o.add(buildBinding()); | 433 o.add(buildBinding()); |
| 434 o.add(buildBinding()); | 434 o.add(buildBinding()); |
| 435 return o; | 435 return o; |
| 436 } | 436 } |
| 437 | 437 |
| 438 checkUnnamed3802(core.List<api.Binding> o) { | 438 checkUnnamed3276(core.List<api.Binding> o) { |
| 439 unittest.expect(o, unittest.hasLength(2)); | 439 unittest.expect(o, unittest.hasLength(2)); |
| 440 checkBinding(o[0]); | 440 checkBinding(o[0]); |
| 441 checkBinding(o[1]); | 441 checkBinding(o[1]); |
| 442 } | 442 } |
| 443 | 443 |
| 444 core.int buildCounterPolicy = 0; | 444 core.int buildCounterPolicy = 0; |
| 445 buildPolicy() { | 445 buildPolicy() { |
| 446 var o = new api.Policy(); | 446 var o = new api.Policy(); |
| 447 buildCounterPolicy++; | 447 buildCounterPolicy++; |
| 448 if (buildCounterPolicy < 3) { | 448 if (buildCounterPolicy < 3) { |
| 449 o.auditConfigs = buildUnnamed3801(); | 449 o.auditConfigs = buildUnnamed3275(); |
| 450 o.bindings = buildUnnamed3802(); | 450 o.bindings = buildUnnamed3276(); |
| 451 o.etag = "foo"; | 451 o.etag = "foo"; |
| 452 o.version = 42; | 452 o.version = 42; |
| 453 } | 453 } |
| 454 buildCounterPolicy--; | 454 buildCounterPolicy--; |
| 455 return o; | 455 return o; |
| 456 } | 456 } |
| 457 | 457 |
| 458 checkPolicy(api.Policy o) { | 458 checkPolicy(api.Policy o) { |
| 459 buildCounterPolicy++; | 459 buildCounterPolicy++; |
| 460 if (buildCounterPolicy < 3) { | 460 if (buildCounterPolicy < 3) { |
| 461 checkUnnamed3801(o.auditConfigs); | 461 checkUnnamed3275(o.auditConfigs); |
| 462 checkUnnamed3802(o.bindings); | 462 checkUnnamed3276(o.bindings); |
| 463 unittest.expect(o.etag, unittest.equals('foo')); | 463 unittest.expect(o.etag, unittest.equals('foo')); |
| 464 unittest.expect(o.version, unittest.equals(42)); | 464 unittest.expect(o.version, unittest.equals(42)); |
| 465 } | 465 } |
| 466 buildCounterPolicy--; | 466 buildCounterPolicy--; |
| 467 } | 467 } |
| 468 | 468 |
| 469 buildUnnamed3803() { | 469 buildUnnamed3277() { |
| 470 var o = new core.Map<core.String, core.String>(); | 470 var o = new core.Map<core.String, core.String>(); |
| 471 o["x"] = "foo"; | 471 o["x"] = "foo"; |
| 472 o["y"] = "foo"; | 472 o["y"] = "foo"; |
| 473 return o; | 473 return o; |
| 474 } | 474 } |
| 475 | 475 |
| 476 checkUnnamed3803(core.Map<core.String, core.String> o) { | 476 checkUnnamed3277(core.Map<core.String, core.String> o) { |
| 477 unittest.expect(o, unittest.hasLength(2)); | 477 unittest.expect(o, unittest.hasLength(2)); |
| 478 unittest.expect(o["x"], unittest.equals('foo')); | 478 unittest.expect(o["x"], unittest.equals('foo')); |
| 479 unittest.expect(o["y"], unittest.equals('foo')); | 479 unittest.expect(o["y"], unittest.equals('foo')); |
| 480 } | 480 } |
| 481 | 481 |
| 482 core.int buildCounterProject = 0; | 482 core.int buildCounterProject = 0; |
| 483 buildProject() { | 483 buildProject() { |
| 484 var o = new api.Project(); | 484 var o = new api.Project(); |
| 485 buildCounterProject++; | 485 buildCounterProject++; |
| 486 if (buildCounterProject < 3) { | 486 if (buildCounterProject < 3) { |
| 487 o.createTime = "foo"; | 487 o.createTime = "foo"; |
| 488 o.labels = buildUnnamed3803(); | 488 o.labels = buildUnnamed3277(); |
| 489 o.lifecycleState = "foo"; | 489 o.lifecycleState = "foo"; |
| 490 o.name = "foo"; | 490 o.name = "foo"; |
| 491 o.parent = buildResourceId(); | 491 o.parent = buildResourceId(); |
| 492 o.projectId = "foo"; | 492 o.projectId = "foo"; |
| 493 o.projectNumber = "foo"; | 493 o.projectNumber = "foo"; |
| 494 } | 494 } |
| 495 buildCounterProject--; | 495 buildCounterProject--; |
| 496 return o; | 496 return o; |
| 497 } | 497 } |
| 498 | 498 |
| 499 checkProject(api.Project o) { | 499 checkProject(api.Project o) { |
| 500 buildCounterProject++; | 500 buildCounterProject++; |
| 501 if (buildCounterProject < 3) { | 501 if (buildCounterProject < 3) { |
| 502 unittest.expect(o.createTime, unittest.equals('foo')); | 502 unittest.expect(o.createTime, unittest.equals('foo')); |
| 503 checkUnnamed3803(o.labels); | 503 checkUnnamed3277(o.labels); |
| 504 unittest.expect(o.lifecycleState, unittest.equals('foo')); | 504 unittest.expect(o.lifecycleState, unittest.equals('foo')); |
| 505 unittest.expect(o.name, unittest.equals('foo')); | 505 unittest.expect(o.name, unittest.equals('foo')); |
| 506 checkResourceId(o.parent); | 506 checkResourceId(o.parent); |
| 507 unittest.expect(o.projectId, unittest.equals('foo')); | 507 unittest.expect(o.projectId, unittest.equals('foo')); |
| 508 unittest.expect(o.projectNumber, unittest.equals('foo')); | 508 unittest.expect(o.projectNumber, unittest.equals('foo')); |
| 509 } | 509 } |
| 510 buildCounterProject--; | 510 buildCounterProject--; |
| 511 } | 511 } |
| 512 | 512 |
| 513 core.int buildCounterProjectCreationStatus = 0; | 513 core.int buildCounterProjectCreationStatus = 0; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { | 569 checkSetIamPolicyRequest(api.SetIamPolicyRequest o) { |
| 570 buildCounterSetIamPolicyRequest++; | 570 buildCounterSetIamPolicyRequest++; |
| 571 if (buildCounterSetIamPolicyRequest < 3) { | 571 if (buildCounterSetIamPolicyRequest < 3) { |
| 572 checkPolicy(o.policy); | 572 checkPolicy(o.policy); |
| 573 unittest.expect(o.updateMask, unittest.equals('foo')); | 573 unittest.expect(o.updateMask, unittest.equals('foo')); |
| 574 } | 574 } |
| 575 buildCounterSetIamPolicyRequest--; | 575 buildCounterSetIamPolicyRequest--; |
| 576 } | 576 } |
| 577 | 577 |
| 578 buildUnnamed3804() { | 578 buildUnnamed3278() { |
| 579 var o = new core.List<core.String>(); | 579 var o = new core.List<core.String>(); |
| 580 o.add("foo"); | 580 o.add("foo"); |
| 581 o.add("foo"); | 581 o.add("foo"); |
| 582 return o; | 582 return o; |
| 583 } | 583 } |
| 584 | 584 |
| 585 checkUnnamed3804(core.List<core.String> o) { | 585 checkUnnamed3278(core.List<core.String> o) { |
| 586 unittest.expect(o, unittest.hasLength(2)); | 586 unittest.expect(o, unittest.hasLength(2)); |
| 587 unittest.expect(o[0], unittest.equals('foo')); | 587 unittest.expect(o[0], unittest.equals('foo')); |
| 588 unittest.expect(o[1], unittest.equals('foo')); | 588 unittest.expect(o[1], unittest.equals('foo')); |
| 589 } | 589 } |
| 590 | 590 |
| 591 core.int buildCounterTestIamPermissionsRequest = 0; | 591 core.int buildCounterTestIamPermissionsRequest = 0; |
| 592 buildTestIamPermissionsRequest() { | 592 buildTestIamPermissionsRequest() { |
| 593 var o = new api.TestIamPermissionsRequest(); | 593 var o = new api.TestIamPermissionsRequest(); |
| 594 buildCounterTestIamPermissionsRequest++; | 594 buildCounterTestIamPermissionsRequest++; |
| 595 if (buildCounterTestIamPermissionsRequest < 3) { | 595 if (buildCounterTestIamPermissionsRequest < 3) { |
| 596 o.permissions = buildUnnamed3804(); | 596 o.permissions = buildUnnamed3278(); |
| 597 } | 597 } |
| 598 buildCounterTestIamPermissionsRequest--; | 598 buildCounterTestIamPermissionsRequest--; |
| 599 return o; | 599 return o; |
| 600 } | 600 } |
| 601 | 601 |
| 602 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 602 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 603 buildCounterTestIamPermissionsRequest++; | 603 buildCounterTestIamPermissionsRequest++; |
| 604 if (buildCounterTestIamPermissionsRequest < 3) { | 604 if (buildCounterTestIamPermissionsRequest < 3) { |
| 605 checkUnnamed3804(o.permissions); | 605 checkUnnamed3278(o.permissions); |
| 606 } | 606 } |
| 607 buildCounterTestIamPermissionsRequest--; | 607 buildCounterTestIamPermissionsRequest--; |
| 608 } | 608 } |
| 609 | 609 |
| 610 buildUnnamed3805() { | 610 buildUnnamed3279() { |
| 611 var o = new core.List<core.String>(); | 611 var o = new core.List<core.String>(); |
| 612 o.add("foo"); | 612 o.add("foo"); |
| 613 o.add("foo"); | 613 o.add("foo"); |
| 614 return o; | 614 return o; |
| 615 } | 615 } |
| 616 | 616 |
| 617 checkUnnamed3805(core.List<core.String> o) { | 617 checkUnnamed3279(core.List<core.String> o) { |
| 618 unittest.expect(o, unittest.hasLength(2)); | 618 unittest.expect(o, unittest.hasLength(2)); |
| 619 unittest.expect(o[0], unittest.equals('foo')); | 619 unittest.expect(o[0], unittest.equals('foo')); |
| 620 unittest.expect(o[1], unittest.equals('foo')); | 620 unittest.expect(o[1], unittest.equals('foo')); |
| 621 } | 621 } |
| 622 | 622 |
| 623 core.int buildCounterTestIamPermissionsResponse = 0; | 623 core.int buildCounterTestIamPermissionsResponse = 0; |
| 624 buildTestIamPermissionsResponse() { | 624 buildTestIamPermissionsResponse() { |
| 625 var o = new api.TestIamPermissionsResponse(); | 625 var o = new api.TestIamPermissionsResponse(); |
| 626 buildCounterTestIamPermissionsResponse++; | 626 buildCounterTestIamPermissionsResponse++; |
| 627 if (buildCounterTestIamPermissionsResponse < 3) { | 627 if (buildCounterTestIamPermissionsResponse < 3) { |
| 628 o.permissions = buildUnnamed3805(); | 628 o.permissions = buildUnnamed3279(); |
| 629 } | 629 } |
| 630 buildCounterTestIamPermissionsResponse--; | 630 buildCounterTestIamPermissionsResponse--; |
| 631 return o; | 631 return o; |
| 632 } | 632 } |
| 633 | 633 |
| 634 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 634 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 635 buildCounterTestIamPermissionsResponse++; | 635 buildCounterTestIamPermissionsResponse++; |
| 636 if (buildCounterTestIamPermissionsResponse < 3) { | 636 if (buildCounterTestIamPermissionsResponse < 3) { |
| 637 checkUnnamed3805(o.permissions); | 637 checkUnnamed3279(o.permissions); |
| 638 } | 638 } |
| 639 buildCounterTestIamPermissionsResponse--; | 639 buildCounterTestIamPermissionsResponse--; |
| 640 } | 640 } |
| 641 | 641 |
| 642 core.int buildCounterUndeleteProjectRequest = 0; | 642 core.int buildCounterUndeleteProjectRequest = 0; |
| 643 buildUndeleteProjectRequest() { | 643 buildUndeleteProjectRequest() { |
| 644 var o = new api.UndeleteProjectRequest(); | 644 var o = new api.UndeleteProjectRequest(); |
| 645 buildCounterUndeleteProjectRequest++; | 645 buildCounterUndeleteProjectRequest++; |
| 646 if (buildCounterUndeleteProjectRequest < 3) { | 646 if (buildCounterUndeleteProjectRequest < 3) { |
| 647 } | 647 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 }); | 856 }); |
| 857 | 857 |
| 858 | 858 |
| 859 unittest.group("resource-OrganizationsResourceApi", () { | 859 unittest.group("resource-OrganizationsResourceApi", () { |
| 860 unittest.test("method--get", () { | 860 unittest.test("method--get", () { |
| 861 | 861 |
| 862 var mock = new HttpServerMock(); | 862 var mock = new HttpServerMock(); |
| 863 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 863 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 864 var arg_name = "foo"; | 864 var arg_name = "foo"; |
| 865 var arg_organizationId = "foo"; | 865 var arg_organizationId = "foo"; |
| 866 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 866 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 867 var path = (req.url).path; | 867 var path = (req.url).path; |
| 868 var pathOffset = 0; | 868 var pathOffset = 0; |
| 869 var index; | 869 var index; |
| 870 var subPart; | 870 var subPart; |
| 871 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 871 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 872 pathOffset += 1; | 872 pathOffset += 1; |
| 873 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 873 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| 874 pathOffset += 8; | 874 pathOffset += 8; |
| 875 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 875 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 876 | 876 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 892 } | 892 } |
| 893 unittest.expect(queryMap["organizationId"].first, unittest.equals(arg_or
ganizationId)); | 893 unittest.expect(queryMap["organizationId"].first, unittest.equals(arg_or
ganizationId)); |
| 894 | 894 |
| 895 | 895 |
| 896 var h = { | 896 var h = { |
| 897 "content-type" : "application/json; charset=utf-8", | 897 "content-type" : "application/json; charset=utf-8", |
| 898 }; | 898 }; |
| 899 var resp = convert.JSON.encode(buildOrganization()); | 899 var resp = convert.JSON.encode(buildOrganization()); |
| 900 return new async.Future.value(stringResponse(200, h, resp)); | 900 return new async.Future.value(stringResponse(200, h, resp)); |
| 901 }), true); | 901 }), true); |
| 902 res.get(arg_name, organizationId: arg_organizationId).then(unittest.expect
Async(((api.Organization response) { | 902 res.get(arg_name, organizationId: arg_organizationId).then(unittest.expect
Async1(((api.Organization response) { |
| 903 checkOrganization(response); | 903 checkOrganization(response); |
| 904 }))); | 904 }))); |
| 905 }); | 905 }); |
| 906 | 906 |
| 907 unittest.test("method--getIamPolicy", () { | 907 unittest.test("method--getIamPolicy", () { |
| 908 | 908 |
| 909 var mock = new HttpServerMock(); | 909 var mock = new HttpServerMock(); |
| 910 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 910 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 911 var arg_request = buildGetIamPolicyRequest(); | 911 var arg_request = buildGetIamPolicyRequest(); |
| 912 var arg_resource = "foo"; | 912 var arg_resource = "foo"; |
| 913 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 913 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 914 var obj = new api.GetIamPolicyRequest.fromJson(json); | 914 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 915 checkGetIamPolicyRequest(obj); | 915 checkGetIamPolicyRequest(obj); |
| 916 | 916 |
| 917 var path = (req.url).path; | 917 var path = (req.url).path; |
| 918 var pathOffset = 0; | 918 var pathOffset = 0; |
| 919 var index; | 919 var index; |
| 920 var subPart; | 920 var subPart; |
| 921 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 921 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 922 pathOffset += 1; | 922 pathOffset += 1; |
| 923 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 923 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 941 } | 941 } |
| 942 } | 942 } |
| 943 | 943 |
| 944 | 944 |
| 945 var h = { | 945 var h = { |
| 946 "content-type" : "application/json; charset=utf-8", | 946 "content-type" : "application/json; charset=utf-8", |
| 947 }; | 947 }; |
| 948 var resp = convert.JSON.encode(buildPolicy()); | 948 var resp = convert.JSON.encode(buildPolicy()); |
| 949 return new async.Future.value(stringResponse(200, h, resp)); | 949 return new async.Future.value(stringResponse(200, h, resp)); |
| 950 }), true); | 950 }), true); |
| 951 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 951 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 952 checkPolicy(response); | 952 checkPolicy(response); |
| 953 }))); | 953 }))); |
| 954 }); | 954 }); |
| 955 | 955 |
| 956 unittest.test("method--list", () { | 956 unittest.test("method--list", () { |
| 957 | 957 |
| 958 var mock = new HttpServerMock(); | 958 var mock = new HttpServerMock(); |
| 959 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 959 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 960 var arg_filter = "foo"; | 960 var arg_filter = "foo"; |
| 961 var arg_pageToken = "foo"; | 961 var arg_pageToken = "foo"; |
| 962 var arg_pageSize = 42; | 962 var arg_pageSize = 42; |
| 963 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 963 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 964 var path = (req.url).path; | 964 var path = (req.url).path; |
| 965 var pathOffset = 0; | 965 var pathOffset = 0; |
| 966 var index; | 966 var index; |
| 967 var subPart; | 967 var subPart; |
| 968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 968 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 969 pathOffset += 1; | 969 pathOffset += 1; |
| 970 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("v1beta1/organizations")); | 970 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("v1beta1/organizations")); |
| 971 pathOffset += 21; | 971 pathOffset += 21; |
| 972 | 972 |
| 973 var query = (req.url).query; | 973 var query = (req.url).query; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 990 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 990 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 991 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 991 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 992 | 992 |
| 993 | 993 |
| 994 var h = { | 994 var h = { |
| 995 "content-type" : "application/json; charset=utf-8", | 995 "content-type" : "application/json; charset=utf-8", |
| 996 }; | 996 }; |
| 997 var resp = convert.JSON.encode(buildListOrganizationsResponse()); | 997 var resp = convert.JSON.encode(buildListOrganizationsResponse()); |
| 998 return new async.Future.value(stringResponse(200, h, resp)); | 998 return new async.Future.value(stringResponse(200, h, resp)); |
| 999 }), true); | 999 }), true); |
| 1000 res.list(filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync(((api.ListOrganizationsResponse response) { | 1000 res.list(filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync1(((api.ListOrganizationsResponse response) { |
| 1001 checkListOrganizationsResponse(response); | 1001 checkListOrganizationsResponse(response); |
| 1002 }))); | 1002 }))); |
| 1003 }); | 1003 }); |
| 1004 | 1004 |
| 1005 unittest.test("method--setIamPolicy", () { | 1005 unittest.test("method--setIamPolicy", () { |
| 1006 | 1006 |
| 1007 var mock = new HttpServerMock(); | 1007 var mock = new HttpServerMock(); |
| 1008 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 1008 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 1009 var arg_request = buildSetIamPolicyRequest(); | 1009 var arg_request = buildSetIamPolicyRequest(); |
| 1010 var arg_resource = "foo"; | 1010 var arg_resource = "foo"; |
| 1011 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1011 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1012 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1012 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 1013 checkSetIamPolicyRequest(obj); | 1013 checkSetIamPolicyRequest(obj); |
| 1014 | 1014 |
| 1015 var path = (req.url).path; | 1015 var path = (req.url).path; |
| 1016 var pathOffset = 0; | 1016 var pathOffset = 0; |
| 1017 var index; | 1017 var index; |
| 1018 var subPart; | 1018 var subPart; |
| 1019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1020 pathOffset += 1; | 1020 pathOffset += 1; |
| 1021 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1021 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1039 } | 1039 } |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 | 1042 |
| 1043 var h = { | 1043 var h = { |
| 1044 "content-type" : "application/json; charset=utf-8", | 1044 "content-type" : "application/json; charset=utf-8", |
| 1045 }; | 1045 }; |
| 1046 var resp = convert.JSON.encode(buildPolicy()); | 1046 var resp = convert.JSON.encode(buildPolicy()); |
| 1047 return new async.Future.value(stringResponse(200, h, resp)); | 1047 return new async.Future.value(stringResponse(200, h, resp)); |
| 1048 }), true); | 1048 }), true); |
| 1049 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1049 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1050 checkPolicy(response); | 1050 checkPolicy(response); |
| 1051 }))); | 1051 }))); |
| 1052 }); | 1052 }); |
| 1053 | 1053 |
| 1054 unittest.test("method--testIamPermissions", () { | 1054 unittest.test("method--testIamPermissions", () { |
| 1055 | 1055 |
| 1056 var mock = new HttpServerMock(); | 1056 var mock = new HttpServerMock(); |
| 1057 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 1057 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 1058 var arg_request = buildTestIamPermissionsRequest(); | 1058 var arg_request = buildTestIamPermissionsRequest(); |
| 1059 var arg_resource = "foo"; | 1059 var arg_resource = "foo"; |
| 1060 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1060 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1061 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1061 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1062 checkTestIamPermissionsRequest(obj); | 1062 checkTestIamPermissionsRequest(obj); |
| 1063 | 1063 |
| 1064 var path = (req.url).path; | 1064 var path = (req.url).path; |
| 1065 var pathOffset = 0; | 1065 var pathOffset = 0; |
| 1066 var index; | 1066 var index; |
| 1067 var subPart; | 1067 var subPart; |
| 1068 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1068 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1069 pathOffset += 1; | 1069 pathOffset += 1; |
| 1070 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1070 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1088 } | 1088 } |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 | 1091 |
| 1092 var h = { | 1092 var h = { |
| 1093 "content-type" : "application/json; charset=utf-8", | 1093 "content-type" : "application/json; charset=utf-8", |
| 1094 }; | 1094 }; |
| 1095 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1095 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1096 return new async.Future.value(stringResponse(200, h, resp)); | 1096 return new async.Future.value(stringResponse(200, h, resp)); |
| 1097 }), true); | 1097 }), true); |
| 1098 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1098 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 1099 checkTestIamPermissionsResponse(response); | 1099 checkTestIamPermissionsResponse(response); |
| 1100 }))); | 1100 }))); |
| 1101 }); | 1101 }); |
| 1102 | 1102 |
| 1103 unittest.test("method--update", () { | 1103 unittest.test("method--update", () { |
| 1104 | 1104 |
| 1105 var mock = new HttpServerMock(); | 1105 var mock = new HttpServerMock(); |
| 1106 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; | 1106 api.OrganizationsResourceApi res = new api.CloudresourcemanagerApi(mock).o
rganizations; |
| 1107 var arg_request = buildOrganization(); | 1107 var arg_request = buildOrganization(); |
| 1108 var arg_name = "foo"; | 1108 var arg_name = "foo"; |
| 1109 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1109 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1110 var obj = new api.Organization.fromJson(json); | 1110 var obj = new api.Organization.fromJson(json); |
| 1111 checkOrganization(obj); | 1111 checkOrganization(obj); |
| 1112 | 1112 |
| 1113 var path = (req.url).path; | 1113 var path = (req.url).path; |
| 1114 var pathOffset = 0; | 1114 var pathOffset = 0; |
| 1115 var index; | 1115 var index; |
| 1116 var subPart; | 1116 var subPart; |
| 1117 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1117 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1118 pathOffset += 1; | 1118 pathOffset += 1; |
| 1119 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); | 1119 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("v1beta1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1137 } | 1137 } |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 | 1140 |
| 1141 var h = { | 1141 var h = { |
| 1142 "content-type" : "application/json; charset=utf-8", | 1142 "content-type" : "application/json; charset=utf-8", |
| 1143 }; | 1143 }; |
| 1144 var resp = convert.JSON.encode(buildOrganization()); | 1144 var resp = convert.JSON.encode(buildOrganization()); |
| 1145 return new async.Future.value(stringResponse(200, h, resp)); | 1145 return new async.Future.value(stringResponse(200, h, resp)); |
| 1146 }), true); | 1146 }), true); |
| 1147 res.update(arg_request, arg_name).then(unittest.expectAsync(((api.Organiza
tion response) { | 1147 res.update(arg_request, arg_name).then(unittest.expectAsync1(((api.Organiz
ation response) { |
| 1148 checkOrganization(response); | 1148 checkOrganization(response); |
| 1149 }))); | 1149 }))); |
| 1150 }); | 1150 }); |
| 1151 | 1151 |
| 1152 }); | 1152 }); |
| 1153 | 1153 |
| 1154 | 1154 |
| 1155 unittest.group("resource-ProjectsResourceApi", () { | 1155 unittest.group("resource-ProjectsResourceApi", () { |
| 1156 unittest.test("method--create", () { | 1156 unittest.test("method--create", () { |
| 1157 | 1157 |
| 1158 var mock = new HttpServerMock(); | 1158 var mock = new HttpServerMock(); |
| 1159 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1159 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1160 var arg_request = buildProject(); | 1160 var arg_request = buildProject(); |
| 1161 var arg_useLegacyStack = true; | 1161 var arg_useLegacyStack = true; |
| 1162 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1162 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1163 var obj = new api.Project.fromJson(json); | 1163 var obj = new api.Project.fromJson(json); |
| 1164 checkProject(obj); | 1164 checkProject(obj); |
| 1165 | 1165 |
| 1166 var path = (req.url).path; | 1166 var path = (req.url).path; |
| 1167 var pathOffset = 0; | 1167 var pathOffset = 0; |
| 1168 var index; | 1168 var index; |
| 1169 var subPart; | 1169 var subPart; |
| 1170 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1170 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1171 pathOffset += 1; | 1171 pathOffset += 1; |
| 1172 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); | 1172 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1190 } | 1190 } |
| 1191 unittest.expect(queryMap["useLegacyStack"].first, unittest.equals("$arg_
useLegacyStack")); | 1191 unittest.expect(queryMap["useLegacyStack"].first, unittest.equals("$arg_
useLegacyStack")); |
| 1192 | 1192 |
| 1193 | 1193 |
| 1194 var h = { | 1194 var h = { |
| 1195 "content-type" : "application/json; charset=utf-8", | 1195 "content-type" : "application/json; charset=utf-8", |
| 1196 }; | 1196 }; |
| 1197 var resp = convert.JSON.encode(buildProject()); | 1197 var resp = convert.JSON.encode(buildProject()); |
| 1198 return new async.Future.value(stringResponse(200, h, resp)); | 1198 return new async.Future.value(stringResponse(200, h, resp)); |
| 1199 }), true); | 1199 }), true); |
| 1200 res.create(arg_request, useLegacyStack: arg_useLegacyStack).then(unittest.
expectAsync(((api.Project response) { | 1200 res.create(arg_request, useLegacyStack: arg_useLegacyStack).then(unittest.
expectAsync1(((api.Project response) { |
| 1201 checkProject(response); | 1201 checkProject(response); |
| 1202 }))); | 1202 }))); |
| 1203 }); | 1203 }); |
| 1204 | 1204 |
| 1205 unittest.test("method--delete", () { | 1205 unittest.test("method--delete", () { |
| 1206 | 1206 |
| 1207 var mock = new HttpServerMock(); | 1207 var mock = new HttpServerMock(); |
| 1208 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1208 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1209 var arg_projectId = "foo"; | 1209 var arg_projectId = "foo"; |
| 1210 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1210 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1211 var path = (req.url).path; | 1211 var path = (req.url).path; |
| 1212 var pathOffset = 0; | 1212 var pathOffset = 0; |
| 1213 var index; | 1213 var index; |
| 1214 var subPart; | 1214 var subPart; |
| 1215 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1215 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1216 pathOffset += 1; | 1216 pathOffset += 1; |
| 1217 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1217 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 1218 pathOffset += 17; | 1218 pathOffset += 17; |
| 1219 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1219 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1220 pathOffset = path.length; | 1220 pathOffset = path.length; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1237 } | 1237 } |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 | 1240 |
| 1241 var h = { | 1241 var h = { |
| 1242 "content-type" : "application/json; charset=utf-8", | 1242 "content-type" : "application/json; charset=utf-8", |
| 1243 }; | 1243 }; |
| 1244 var resp = convert.JSON.encode(buildEmpty()); | 1244 var resp = convert.JSON.encode(buildEmpty()); |
| 1245 return new async.Future.value(stringResponse(200, h, resp)); | 1245 return new async.Future.value(stringResponse(200, h, resp)); |
| 1246 }), true); | 1246 }), true); |
| 1247 res.delete(arg_projectId).then(unittest.expectAsync(((api.Empty response)
{ | 1247 res.delete(arg_projectId).then(unittest.expectAsync1(((api.Empty response)
{ |
| 1248 checkEmpty(response); | 1248 checkEmpty(response); |
| 1249 }))); | 1249 }))); |
| 1250 }); | 1250 }); |
| 1251 | 1251 |
| 1252 unittest.test("method--get", () { | 1252 unittest.test("method--get", () { |
| 1253 | 1253 |
| 1254 var mock = new HttpServerMock(); | 1254 var mock = new HttpServerMock(); |
| 1255 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1255 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1256 var arg_projectId = "foo"; | 1256 var arg_projectId = "foo"; |
| 1257 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1257 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1258 var path = (req.url).path; | 1258 var path = (req.url).path; |
| 1259 var pathOffset = 0; | 1259 var pathOffset = 0; |
| 1260 var index; | 1260 var index; |
| 1261 var subPart; | 1261 var subPart; |
| 1262 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1262 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1263 pathOffset += 1; | 1263 pathOffset += 1; |
| 1264 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1264 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| 1265 pathOffset += 17; | 1265 pathOffset += 17; |
| 1266 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 1266 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1267 pathOffset = path.length; | 1267 pathOffset = path.length; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1284 } | 1284 } |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 | 1287 |
| 1288 var h = { | 1288 var h = { |
| 1289 "content-type" : "application/json; charset=utf-8", | 1289 "content-type" : "application/json; charset=utf-8", |
| 1290 }; | 1290 }; |
| 1291 var resp = convert.JSON.encode(buildProject()); | 1291 var resp = convert.JSON.encode(buildProject()); |
| 1292 return new async.Future.value(stringResponse(200, h, resp)); | 1292 return new async.Future.value(stringResponse(200, h, resp)); |
| 1293 }), true); | 1293 }), true); |
| 1294 res.get(arg_projectId).then(unittest.expectAsync(((api.Project response) { | 1294 res.get(arg_projectId).then(unittest.expectAsync1(((api.Project response)
{ |
| 1295 checkProject(response); | 1295 checkProject(response); |
| 1296 }))); | 1296 }))); |
| 1297 }); | 1297 }); |
| 1298 | 1298 |
| 1299 unittest.test("method--getAncestry", () { | 1299 unittest.test("method--getAncestry", () { |
| 1300 | 1300 |
| 1301 var mock = new HttpServerMock(); | 1301 var mock = new HttpServerMock(); |
| 1302 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1302 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1303 var arg_request = buildGetAncestryRequest(); | 1303 var arg_request = buildGetAncestryRequest(); |
| 1304 var arg_projectId = "foo"; | 1304 var arg_projectId = "foo"; |
| 1305 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1305 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1306 var obj = new api.GetAncestryRequest.fromJson(json); | 1306 var obj = new api.GetAncestryRequest.fromJson(json); |
| 1307 checkGetAncestryRequest(obj); | 1307 checkGetAncestryRequest(obj); |
| 1308 | 1308 |
| 1309 var path = (req.url).path; | 1309 var path = (req.url).path; |
| 1310 var pathOffset = 0; | 1310 var pathOffset = 0; |
| 1311 var index; | 1311 var index; |
| 1312 var subPart; | 1312 var subPart; |
| 1313 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1313 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1314 pathOffset += 1; | 1314 pathOffset += 1; |
| 1315 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1315 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1339 } | 1339 } |
| 1340 } | 1340 } |
| 1341 | 1341 |
| 1342 | 1342 |
| 1343 var h = { | 1343 var h = { |
| 1344 "content-type" : "application/json; charset=utf-8", | 1344 "content-type" : "application/json; charset=utf-8", |
| 1345 }; | 1345 }; |
| 1346 var resp = convert.JSON.encode(buildGetAncestryResponse()); | 1346 var resp = convert.JSON.encode(buildGetAncestryResponse()); |
| 1347 return new async.Future.value(stringResponse(200, h, resp)); | 1347 return new async.Future.value(stringResponse(200, h, resp)); |
| 1348 }), true); | 1348 }), true); |
| 1349 res.getAncestry(arg_request, arg_projectId).then(unittest.expectAsync(((ap
i.GetAncestryResponse response) { | 1349 res.getAncestry(arg_request, arg_projectId).then(unittest.expectAsync1(((a
pi.GetAncestryResponse response) { |
| 1350 checkGetAncestryResponse(response); | 1350 checkGetAncestryResponse(response); |
| 1351 }))); | 1351 }))); |
| 1352 }); | 1352 }); |
| 1353 | 1353 |
| 1354 unittest.test("method--getIamPolicy", () { | 1354 unittest.test("method--getIamPolicy", () { |
| 1355 | 1355 |
| 1356 var mock = new HttpServerMock(); | 1356 var mock = new HttpServerMock(); |
| 1357 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1357 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1358 var arg_request = buildGetIamPolicyRequest(); | 1358 var arg_request = buildGetIamPolicyRequest(); |
| 1359 var arg_resource = "foo"; | 1359 var arg_resource = "foo"; |
| 1360 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1360 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1361 var obj = new api.GetIamPolicyRequest.fromJson(json); | 1361 var obj = new api.GetIamPolicyRequest.fromJson(json); |
| 1362 checkGetIamPolicyRequest(obj); | 1362 checkGetIamPolicyRequest(obj); |
| 1363 | 1363 |
| 1364 var path = (req.url).path; | 1364 var path = (req.url).path; |
| 1365 var pathOffset = 0; | 1365 var pathOffset = 0; |
| 1366 var index; | 1366 var index; |
| 1367 var subPart; | 1367 var subPart; |
| 1368 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1368 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1369 pathOffset += 1; | 1369 pathOffset += 1; |
| 1370 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1370 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1394 } | 1394 } |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 | 1397 |
| 1398 var h = { | 1398 var h = { |
| 1399 "content-type" : "application/json; charset=utf-8", | 1399 "content-type" : "application/json; charset=utf-8", |
| 1400 }; | 1400 }; |
| 1401 var resp = convert.JSON.encode(buildPolicy()); | 1401 var resp = convert.JSON.encode(buildPolicy()); |
| 1402 return new async.Future.value(stringResponse(200, h, resp)); | 1402 return new async.Future.value(stringResponse(200, h, resp)); |
| 1403 }), true); | 1403 }), true); |
| 1404 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1404 res.getIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1405 checkPolicy(response); | 1405 checkPolicy(response); |
| 1406 }))); | 1406 }))); |
| 1407 }); | 1407 }); |
| 1408 | 1408 |
| 1409 unittest.test("method--list", () { | 1409 unittest.test("method--list", () { |
| 1410 | 1410 |
| 1411 var mock = new HttpServerMock(); | 1411 var mock = new HttpServerMock(); |
| 1412 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1412 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1413 var arg_pageSize = 42; | |
| 1414 var arg_filter = "foo"; | 1413 var arg_filter = "foo"; |
| 1415 var arg_pageToken = "foo"; | 1414 var arg_pageToken = "foo"; |
| 1416 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1415 var arg_pageSize = 42; |
| 1416 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1417 var path = (req.url).path; | 1417 var path = (req.url).path; |
| 1418 var pathOffset = 0; | 1418 var pathOffset = 0; |
| 1419 var index; | 1419 var index; |
| 1420 var subPart; | 1420 var subPart; |
| 1421 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1421 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1422 pathOffset += 1; | 1422 pathOffset += 1; |
| 1423 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); | 1423 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("v1beta1/projects")); |
| 1424 pathOffset += 16; | 1424 pathOffset += 16; |
| 1425 | 1425 |
| 1426 var query = (req.url).query; | 1426 var query = (req.url).query; |
| 1427 var queryOffset = 0; | 1427 var queryOffset = 0; |
| 1428 var queryMap = {}; | 1428 var queryMap = {}; |
| 1429 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1429 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1430 parseBool(n) { | 1430 parseBool(n) { |
| 1431 if (n == "true") return true; | 1431 if (n == "true") return true; |
| 1432 if (n == "false") return false; | 1432 if (n == "false") return false; |
| 1433 if (n == null) return null; | 1433 if (n == null) return null; |
| 1434 throw new core.ArgumentError("Invalid boolean: $n"); | 1434 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1435 } | 1435 } |
| 1436 if (query.length > 0) { | 1436 if (query.length > 0) { |
| 1437 for (var part in query.split("&")) { | 1437 for (var part in query.split("&")) { |
| 1438 var keyvalue = part.split("="); | 1438 var keyvalue = part.split("="); |
| 1439 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1439 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1440 } | 1440 } |
| 1441 } | 1441 } |
| 1442 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 1443 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); | 1442 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 1444 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1443 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1444 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1445 | 1445 |
| 1446 | 1446 |
| 1447 var h = { | 1447 var h = { |
| 1448 "content-type" : "application/json; charset=utf-8", | 1448 "content-type" : "application/json; charset=utf-8", |
| 1449 }; | 1449 }; |
| 1450 var resp = convert.JSON.encode(buildListProjectsResponse()); | 1450 var resp = convert.JSON.encode(buildListProjectsResponse()); |
| 1451 return new async.Future.value(stringResponse(200, h, resp)); | 1451 return new async.Future.value(stringResponse(200, h, resp)); |
| 1452 }), true); | 1452 }), true); |
| 1453 res.list(pageSize: arg_pageSize, filter: arg_filter, pageToken: arg_pageTo
ken).then(unittest.expectAsync(((api.ListProjectsResponse response) { | 1453 res.list(filter: arg_filter, pageToken: arg_pageToken, pageSize: arg_pageS
ize).then(unittest.expectAsync1(((api.ListProjectsResponse response) { |
| 1454 checkListProjectsResponse(response); | 1454 checkListProjectsResponse(response); |
| 1455 }))); | 1455 }))); |
| 1456 }); | 1456 }); |
| 1457 | 1457 |
| 1458 unittest.test("method--setIamPolicy", () { | 1458 unittest.test("method--setIamPolicy", () { |
| 1459 | 1459 |
| 1460 var mock = new HttpServerMock(); | 1460 var mock = new HttpServerMock(); |
| 1461 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1461 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1462 var arg_request = buildSetIamPolicyRequest(); | 1462 var arg_request = buildSetIamPolicyRequest(); |
| 1463 var arg_resource = "foo"; | 1463 var arg_resource = "foo"; |
| 1464 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1464 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1465 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1465 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 1466 checkSetIamPolicyRequest(obj); | 1466 checkSetIamPolicyRequest(obj); |
| 1467 | 1467 |
| 1468 var path = (req.url).path; | 1468 var path = (req.url).path; |
| 1469 var pathOffset = 0; | 1469 var pathOffset = 0; |
| 1470 var index; | 1470 var index; |
| 1471 var subPart; | 1471 var subPart; |
| 1472 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1472 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1473 pathOffset += 1; | 1473 pathOffset += 1; |
| 1474 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1474 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1498 } | 1498 } |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 | 1501 |
| 1502 var h = { | 1502 var h = { |
| 1503 "content-type" : "application/json; charset=utf-8", | 1503 "content-type" : "application/json; charset=utf-8", |
| 1504 }; | 1504 }; |
| 1505 var resp = convert.JSON.encode(buildPolicy()); | 1505 var resp = convert.JSON.encode(buildPolicy()); |
| 1506 return new async.Future.value(stringResponse(200, h, resp)); | 1506 return new async.Future.value(stringResponse(200, h, resp)); |
| 1507 }), true); | 1507 }), true); |
| 1508 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1508 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1509 checkPolicy(response); | 1509 checkPolicy(response); |
| 1510 }))); | 1510 }))); |
| 1511 }); | 1511 }); |
| 1512 | 1512 |
| 1513 unittest.test("method--testIamPermissions", () { | 1513 unittest.test("method--testIamPermissions", () { |
| 1514 | 1514 |
| 1515 var mock = new HttpServerMock(); | 1515 var mock = new HttpServerMock(); |
| 1516 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1516 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1517 var arg_request = buildTestIamPermissionsRequest(); | 1517 var arg_request = buildTestIamPermissionsRequest(); |
| 1518 var arg_resource = "foo"; | 1518 var arg_resource = "foo"; |
| 1519 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1519 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1520 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1520 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1521 checkTestIamPermissionsRequest(obj); | 1521 checkTestIamPermissionsRequest(obj); |
| 1522 | 1522 |
| 1523 var path = (req.url).path; | 1523 var path = (req.url).path; |
| 1524 var pathOffset = 0; | 1524 var pathOffset = 0; |
| 1525 var index; | 1525 var index; |
| 1526 var subPart; | 1526 var subPart; |
| 1527 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1527 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1528 pathOffset += 1; | 1528 pathOffset += 1; |
| 1529 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1529 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1553 } | 1553 } |
| 1554 } | 1554 } |
| 1555 | 1555 |
| 1556 | 1556 |
| 1557 var h = { | 1557 var h = { |
| 1558 "content-type" : "application/json; charset=utf-8", | 1558 "content-type" : "application/json; charset=utf-8", |
| 1559 }; | 1559 }; |
| 1560 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1560 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1561 return new async.Future.value(stringResponse(200, h, resp)); | 1561 return new async.Future.value(stringResponse(200, h, resp)); |
| 1562 }), true); | 1562 }), true); |
| 1563 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1563 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 1564 checkTestIamPermissionsResponse(response); | 1564 checkTestIamPermissionsResponse(response); |
| 1565 }))); | 1565 }))); |
| 1566 }); | 1566 }); |
| 1567 | 1567 |
| 1568 unittest.test("method--undelete", () { | 1568 unittest.test("method--undelete", () { |
| 1569 | 1569 |
| 1570 var mock = new HttpServerMock(); | 1570 var mock = new HttpServerMock(); |
| 1571 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1571 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1572 var arg_request = buildUndeleteProjectRequest(); | 1572 var arg_request = buildUndeleteProjectRequest(); |
| 1573 var arg_projectId = "foo"; | 1573 var arg_projectId = "foo"; |
| 1574 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1574 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1575 var obj = new api.UndeleteProjectRequest.fromJson(json); | 1575 var obj = new api.UndeleteProjectRequest.fromJson(json); |
| 1576 checkUndeleteProjectRequest(obj); | 1576 checkUndeleteProjectRequest(obj); |
| 1577 | 1577 |
| 1578 var path = (req.url).path; | 1578 var path = (req.url).path; |
| 1579 var pathOffset = 0; | 1579 var pathOffset = 0; |
| 1580 var index; | 1580 var index; |
| 1581 var subPart; | 1581 var subPart; |
| 1582 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1582 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1583 pathOffset += 1; | 1583 pathOffset += 1; |
| 1584 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1584 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1608 } | 1608 } |
| 1609 } | 1609 } |
| 1610 | 1610 |
| 1611 | 1611 |
| 1612 var h = { | 1612 var h = { |
| 1613 "content-type" : "application/json; charset=utf-8", | 1613 "content-type" : "application/json; charset=utf-8", |
| 1614 }; | 1614 }; |
| 1615 var resp = convert.JSON.encode(buildEmpty()); | 1615 var resp = convert.JSON.encode(buildEmpty()); |
| 1616 return new async.Future.value(stringResponse(200, h, resp)); | 1616 return new async.Future.value(stringResponse(200, h, resp)); |
| 1617 }), true); | 1617 }), true); |
| 1618 res.undelete(arg_request, arg_projectId).then(unittest.expectAsync(((api.E
mpty response) { | 1618 res.undelete(arg_request, arg_projectId).then(unittest.expectAsync1(((api.
Empty response) { |
| 1619 checkEmpty(response); | 1619 checkEmpty(response); |
| 1620 }))); | 1620 }))); |
| 1621 }); | 1621 }); |
| 1622 | 1622 |
| 1623 unittest.test("method--update", () { | 1623 unittest.test("method--update", () { |
| 1624 | 1624 |
| 1625 var mock = new HttpServerMock(); | 1625 var mock = new HttpServerMock(); |
| 1626 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; | 1626 api.ProjectsResourceApi res = new api.CloudresourcemanagerApi(mock).projec
ts; |
| 1627 var arg_request = buildProject(); | 1627 var arg_request = buildProject(); |
| 1628 var arg_projectId = "foo"; | 1628 var arg_projectId = "foo"; |
| 1629 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1629 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1630 var obj = new api.Project.fromJson(json); | 1630 var obj = new api.Project.fromJson(json); |
| 1631 checkProject(obj); | 1631 checkProject(obj); |
| 1632 | 1632 |
| 1633 var path = (req.url).path; | 1633 var path = (req.url).path; |
| 1634 var pathOffset = 0; | 1634 var pathOffset = 0; |
| 1635 var index; | 1635 var index; |
| 1636 var subPart; | 1636 var subPart; |
| 1637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1637 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1638 pathOffset += 1; | 1638 pathOffset += 1; |
| 1639 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); | 1639 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta1/projects/")); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1659 } | 1659 } |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 | 1662 |
| 1663 var h = { | 1663 var h = { |
| 1664 "content-type" : "application/json; charset=utf-8", | 1664 "content-type" : "application/json; charset=utf-8", |
| 1665 }; | 1665 }; |
| 1666 var resp = convert.JSON.encode(buildProject()); | 1666 var resp = convert.JSON.encode(buildProject()); |
| 1667 return new async.Future.value(stringResponse(200, h, resp)); | 1667 return new async.Future.value(stringResponse(200, h, resp)); |
| 1668 }), true); | 1668 }), true); |
| 1669 res.update(arg_request, arg_projectId).then(unittest.expectAsync(((api.Pro
ject response) { | 1669 res.update(arg_request, arg_projectId).then(unittest.expectAsync1(((api.Pr
oject response) { |
| 1670 checkProject(response); | 1670 checkProject(response); |
| 1671 }))); | 1671 }))); |
| 1672 }); | 1672 }); |
| 1673 | 1673 |
| 1674 }); | 1674 }); |
| 1675 | 1675 |
| 1676 | 1676 |
| 1677 } | 1677 } |
| 1678 | 1678 |
| OLD | NEW |