| OLD | NEW |
| 1 library googleapis.iam.v1.test; | 1 library googleapis.iam.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed1301() { | 54 core.int buildCounterAuditData = 0; |
| 55 buildAuditData() { |
| 56 var o = new api.AuditData(); |
| 57 buildCounterAuditData++; |
| 58 if (buildCounterAuditData < 3) { |
| 59 o.policyDelta = buildPolicyDelta(); |
| 60 } |
| 61 buildCounterAuditData--; |
| 62 return o; |
| 63 } |
| 64 |
| 65 checkAuditData(api.AuditData o) { |
| 66 buildCounterAuditData++; |
| 67 if (buildCounterAuditData < 3) { |
| 68 checkPolicyDelta(o.policyDelta); |
| 69 } |
| 70 buildCounterAuditData--; |
| 71 } |
| 72 |
| 73 buildUnnamed1327() { |
| 55 var o = new core.List<core.String>(); | 74 var o = new core.List<core.String>(); |
| 56 o.add("foo"); | 75 o.add("foo"); |
| 57 o.add("foo"); | 76 o.add("foo"); |
| 58 return o; | 77 return o; |
| 59 } | 78 } |
| 60 | 79 |
| 61 checkUnnamed1301(core.List<core.String> o) { | 80 checkUnnamed1327(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 81 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); | 82 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); | 83 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } | 84 } |
| 66 | 85 |
| 67 core.int buildCounterBinding = 0; | 86 core.int buildCounterBinding = 0; |
| 68 buildBinding() { | 87 buildBinding() { |
| 69 var o = new api.Binding(); | 88 var o = new api.Binding(); |
| 70 buildCounterBinding++; | 89 buildCounterBinding++; |
| 71 if (buildCounterBinding < 3) { | 90 if (buildCounterBinding < 3) { |
| 72 o.members = buildUnnamed1301(); | 91 o.members = buildUnnamed1327(); |
| 73 o.role = "foo"; | 92 o.role = "foo"; |
| 74 } | 93 } |
| 75 buildCounterBinding--; | 94 buildCounterBinding--; |
| 76 return o; | 95 return o; |
| 77 } | 96 } |
| 78 | 97 |
| 79 checkBinding(api.Binding o) { | 98 checkBinding(api.Binding o) { |
| 80 buildCounterBinding++; | 99 buildCounterBinding++; |
| 81 if (buildCounterBinding < 3) { | 100 if (buildCounterBinding < 3) { |
| 82 checkUnnamed1301(o.members); | 101 checkUnnamed1327(o.members); |
| 83 unittest.expect(o.role, unittest.equals('foo')); | 102 unittest.expect(o.role, unittest.equals('foo')); |
| 84 } | 103 } |
| 85 buildCounterBinding--; | 104 buildCounterBinding--; |
| 86 } | 105 } |
| 87 | 106 |
| 88 core.int buildCounterCloudAuditOptions = 0; | 107 core.int buildCounterBindingDelta = 0; |
| 89 buildCloudAuditOptions() { | 108 buildBindingDelta() { |
| 90 var o = new api.CloudAuditOptions(); | 109 var o = new api.BindingDelta(); |
| 91 buildCounterCloudAuditOptions++; | 110 buildCounterBindingDelta++; |
| 92 if (buildCounterCloudAuditOptions < 3) { | 111 if (buildCounterBindingDelta < 3) { |
| 112 o.action = "foo"; |
| 113 o.member = "foo"; |
| 114 o.role = "foo"; |
| 93 } | 115 } |
| 94 buildCounterCloudAuditOptions--; | 116 buildCounterBindingDelta--; |
| 95 return o; | 117 return o; |
| 96 } | 118 } |
| 97 | 119 |
| 98 checkCloudAuditOptions(api.CloudAuditOptions o) { | 120 checkBindingDelta(api.BindingDelta o) { |
| 99 buildCounterCloudAuditOptions++; | 121 buildCounterBindingDelta++; |
| 100 if (buildCounterCloudAuditOptions < 3) { | 122 if (buildCounterBindingDelta < 3) { |
| 123 unittest.expect(o.action, unittest.equals('foo')); |
| 124 unittest.expect(o.member, unittest.equals('foo')); |
| 125 unittest.expect(o.role, unittest.equals('foo')); |
| 101 } | 126 } |
| 102 buildCounterCloudAuditOptions--; | 127 buildCounterBindingDelta--; |
| 103 } | |
| 104 | |
| 105 buildUnnamed1302() { | |
| 106 var o = new core.List<core.String>(); | |
| 107 o.add("foo"); | |
| 108 o.add("foo"); | |
| 109 return o; | |
| 110 } | |
| 111 | |
| 112 checkUnnamed1302(core.List<core.String> o) { | |
| 113 unittest.expect(o, unittest.hasLength(2)); | |
| 114 unittest.expect(o[0], unittest.equals('foo')); | |
| 115 unittest.expect(o[1], unittest.equals('foo')); | |
| 116 } | |
| 117 | |
| 118 core.int buildCounterCondition = 0; | |
| 119 buildCondition() { | |
| 120 var o = new api.Condition(); | |
| 121 buildCounterCondition++; | |
| 122 if (buildCounterCondition < 3) { | |
| 123 o.iam = "foo"; | |
| 124 o.op = "foo"; | |
| 125 o.svc = "foo"; | |
| 126 o.sys = "foo"; | |
| 127 o.value = "foo"; | |
| 128 o.values = buildUnnamed1302(); | |
| 129 } | |
| 130 buildCounterCondition--; | |
| 131 return o; | |
| 132 } | |
| 133 | |
| 134 checkCondition(api.Condition o) { | |
| 135 buildCounterCondition++; | |
| 136 if (buildCounterCondition < 3) { | |
| 137 unittest.expect(o.iam, unittest.equals('foo')); | |
| 138 unittest.expect(o.op, unittest.equals('foo')); | |
| 139 unittest.expect(o.svc, unittest.equals('foo')); | |
| 140 unittest.expect(o.sys, unittest.equals('foo')); | |
| 141 unittest.expect(o.value, unittest.equals('foo')); | |
| 142 checkUnnamed1302(o.values); | |
| 143 } | |
| 144 buildCounterCondition--; | |
| 145 } | |
| 146 | |
| 147 core.int buildCounterCounterOptions = 0; | |
| 148 buildCounterOptions() { | |
| 149 var o = new api.CounterOptions(); | |
| 150 buildCounterCounterOptions++; | |
| 151 if (buildCounterCounterOptions < 3) { | |
| 152 o.field = "foo"; | |
| 153 o.metric = "foo"; | |
| 154 } | |
| 155 buildCounterCounterOptions--; | |
| 156 return o; | |
| 157 } | |
| 158 | |
| 159 checkCounterOptions(api.CounterOptions o) { | |
| 160 buildCounterCounterOptions++; | |
| 161 if (buildCounterCounterOptions < 3) { | |
| 162 unittest.expect(o.field, unittest.equals('foo')); | |
| 163 unittest.expect(o.metric, unittest.equals('foo')); | |
| 164 } | |
| 165 buildCounterCounterOptions--; | |
| 166 } | 128 } |
| 167 | 129 |
| 168 core.int buildCounterCreateServiceAccountKeyRequest = 0; | 130 core.int buildCounterCreateServiceAccountKeyRequest = 0; |
| 169 buildCreateServiceAccountKeyRequest() { | 131 buildCreateServiceAccountKeyRequest() { |
| 170 var o = new api.CreateServiceAccountKeyRequest(); | 132 var o = new api.CreateServiceAccountKeyRequest(); |
| 171 buildCounterCreateServiceAccountKeyRequest++; | 133 buildCounterCreateServiceAccountKeyRequest++; |
| 172 if (buildCounterCreateServiceAccountKeyRequest < 3) { | 134 if (buildCounterCreateServiceAccountKeyRequest < 3) { |
| 135 o.keyAlgorithm = "foo"; |
| 173 o.privateKeyType = "foo"; | 136 o.privateKeyType = "foo"; |
| 174 } | 137 } |
| 175 buildCounterCreateServiceAccountKeyRequest--; | 138 buildCounterCreateServiceAccountKeyRequest--; |
| 176 return o; | 139 return o; |
| 177 } | 140 } |
| 178 | 141 |
| 179 checkCreateServiceAccountKeyRequest(api.CreateServiceAccountKeyRequest o) { | 142 checkCreateServiceAccountKeyRequest(api.CreateServiceAccountKeyRequest o) { |
| 180 buildCounterCreateServiceAccountKeyRequest++; | 143 buildCounterCreateServiceAccountKeyRequest++; |
| 181 if (buildCounterCreateServiceAccountKeyRequest < 3) { | 144 if (buildCounterCreateServiceAccountKeyRequest < 3) { |
| 145 unittest.expect(o.keyAlgorithm, unittest.equals('foo')); |
| 182 unittest.expect(o.privateKeyType, unittest.equals('foo')); | 146 unittest.expect(o.privateKeyType, unittest.equals('foo')); |
| 183 } | 147 } |
| 184 buildCounterCreateServiceAccountKeyRequest--; | 148 buildCounterCreateServiceAccountKeyRequest--; |
| 185 } | 149 } |
| 186 | 150 |
| 187 core.int buildCounterCreateServiceAccountRequest = 0; | 151 core.int buildCounterCreateServiceAccountRequest = 0; |
| 188 buildCreateServiceAccountRequest() { | 152 buildCreateServiceAccountRequest() { |
| 189 var o = new api.CreateServiceAccountRequest(); | 153 var o = new api.CreateServiceAccountRequest(); |
| 190 buildCounterCreateServiceAccountRequest++; | 154 buildCounterCreateServiceAccountRequest++; |
| 191 if (buildCounterCreateServiceAccountRequest < 3) { | 155 if (buildCounterCreateServiceAccountRequest < 3) { |
| 192 o.accountId = "foo"; | 156 o.accountId = "foo"; |
| 193 o.serviceAccount = buildServiceAccount(); | 157 o.serviceAccount = buildServiceAccount(); |
| 194 } | 158 } |
| 195 buildCounterCreateServiceAccountRequest--; | 159 buildCounterCreateServiceAccountRequest--; |
| 196 return o; | 160 return o; |
| 197 } | 161 } |
| 198 | 162 |
| 199 checkCreateServiceAccountRequest(api.CreateServiceAccountRequest o) { | 163 checkCreateServiceAccountRequest(api.CreateServiceAccountRequest o) { |
| 200 buildCounterCreateServiceAccountRequest++; | 164 buildCounterCreateServiceAccountRequest++; |
| 201 if (buildCounterCreateServiceAccountRequest < 3) { | 165 if (buildCounterCreateServiceAccountRequest < 3) { |
| 202 unittest.expect(o.accountId, unittest.equals('foo')); | 166 unittest.expect(o.accountId, unittest.equals('foo')); |
| 203 checkServiceAccount(o.serviceAccount); | 167 checkServiceAccount(o.serviceAccount); |
| 204 } | 168 } |
| 205 buildCounterCreateServiceAccountRequest--; | 169 buildCounterCreateServiceAccountRequest--; |
| 206 } | 170 } |
| 207 | 171 |
| 208 core.int buildCounterDataAccessOptions = 0; | |
| 209 buildDataAccessOptions() { | |
| 210 var o = new api.DataAccessOptions(); | |
| 211 buildCounterDataAccessOptions++; | |
| 212 if (buildCounterDataAccessOptions < 3) { | |
| 213 } | |
| 214 buildCounterDataAccessOptions--; | |
| 215 return o; | |
| 216 } | |
| 217 | |
| 218 checkDataAccessOptions(api.DataAccessOptions o) { | |
| 219 buildCounterDataAccessOptions++; | |
| 220 if (buildCounterDataAccessOptions < 3) { | |
| 221 } | |
| 222 buildCounterDataAccessOptions--; | |
| 223 } | |
| 224 | |
| 225 core.int buildCounterEmpty = 0; | 172 core.int buildCounterEmpty = 0; |
| 226 buildEmpty() { | 173 buildEmpty() { |
| 227 var o = new api.Empty(); | 174 var o = new api.Empty(); |
| 228 buildCounterEmpty++; | 175 buildCounterEmpty++; |
| 229 if (buildCounterEmpty < 3) { | 176 if (buildCounterEmpty < 3) { |
| 230 } | 177 } |
| 231 buildCounterEmpty--; | 178 buildCounterEmpty--; |
| 232 return o; | 179 return o; |
| 233 } | 180 } |
| 234 | 181 |
| 235 checkEmpty(api.Empty o) { | 182 checkEmpty(api.Empty o) { |
| 236 buildCounterEmpty++; | 183 buildCounterEmpty++; |
| 237 if (buildCounterEmpty < 3) { | 184 if (buildCounterEmpty < 3) { |
| 238 } | 185 } |
| 239 buildCounterEmpty--; | 186 buildCounterEmpty--; |
| 240 } | 187 } |
| 241 | 188 |
| 242 buildUnnamed1303() { | 189 buildUnnamed1328() { |
| 243 var o = new core.List<api.ServiceAccountKey>(); | 190 var o = new core.List<api.ServiceAccountKey>(); |
| 244 o.add(buildServiceAccountKey()); | 191 o.add(buildServiceAccountKey()); |
| 245 o.add(buildServiceAccountKey()); | 192 o.add(buildServiceAccountKey()); |
| 246 return o; | 193 return o; |
| 247 } | 194 } |
| 248 | 195 |
| 249 checkUnnamed1303(core.List<api.ServiceAccountKey> o) { | 196 checkUnnamed1328(core.List<api.ServiceAccountKey> o) { |
| 250 unittest.expect(o, unittest.hasLength(2)); | 197 unittest.expect(o, unittest.hasLength(2)); |
| 251 checkServiceAccountKey(o[0]); | 198 checkServiceAccountKey(o[0]); |
| 252 checkServiceAccountKey(o[1]); | 199 checkServiceAccountKey(o[1]); |
| 253 } | 200 } |
| 254 | 201 |
| 255 core.int buildCounterListServiceAccountKeysResponse = 0; | 202 core.int buildCounterListServiceAccountKeysResponse = 0; |
| 256 buildListServiceAccountKeysResponse() { | 203 buildListServiceAccountKeysResponse() { |
| 257 var o = new api.ListServiceAccountKeysResponse(); | 204 var o = new api.ListServiceAccountKeysResponse(); |
| 258 buildCounterListServiceAccountKeysResponse++; | 205 buildCounterListServiceAccountKeysResponse++; |
| 259 if (buildCounterListServiceAccountKeysResponse < 3) { | 206 if (buildCounterListServiceAccountKeysResponse < 3) { |
| 260 o.keys = buildUnnamed1303(); | 207 o.keys = buildUnnamed1328(); |
| 261 } | 208 } |
| 262 buildCounterListServiceAccountKeysResponse--; | 209 buildCounterListServiceAccountKeysResponse--; |
| 263 return o; | 210 return o; |
| 264 } | 211 } |
| 265 | 212 |
| 266 checkListServiceAccountKeysResponse(api.ListServiceAccountKeysResponse o) { | 213 checkListServiceAccountKeysResponse(api.ListServiceAccountKeysResponse o) { |
| 267 buildCounterListServiceAccountKeysResponse++; | 214 buildCounterListServiceAccountKeysResponse++; |
| 268 if (buildCounterListServiceAccountKeysResponse < 3) { | 215 if (buildCounterListServiceAccountKeysResponse < 3) { |
| 269 checkUnnamed1303(o.keys); | 216 checkUnnamed1328(o.keys); |
| 270 } | 217 } |
| 271 buildCounterListServiceAccountKeysResponse--; | 218 buildCounterListServiceAccountKeysResponse--; |
| 272 } | 219 } |
| 273 | 220 |
| 274 buildUnnamed1304() { | 221 buildUnnamed1329() { |
| 275 var o = new core.List<api.ServiceAccount>(); | 222 var o = new core.List<api.ServiceAccount>(); |
| 276 o.add(buildServiceAccount()); | 223 o.add(buildServiceAccount()); |
| 277 o.add(buildServiceAccount()); | 224 o.add(buildServiceAccount()); |
| 278 return o; | 225 return o; |
| 279 } | 226 } |
| 280 | 227 |
| 281 checkUnnamed1304(core.List<api.ServiceAccount> o) { | 228 checkUnnamed1329(core.List<api.ServiceAccount> o) { |
| 282 unittest.expect(o, unittest.hasLength(2)); | 229 unittest.expect(o, unittest.hasLength(2)); |
| 283 checkServiceAccount(o[0]); | 230 checkServiceAccount(o[0]); |
| 284 checkServiceAccount(o[1]); | 231 checkServiceAccount(o[1]); |
| 285 } | 232 } |
| 286 | 233 |
| 287 core.int buildCounterListServiceAccountsResponse = 0; | 234 core.int buildCounterListServiceAccountsResponse = 0; |
| 288 buildListServiceAccountsResponse() { | 235 buildListServiceAccountsResponse() { |
| 289 var o = new api.ListServiceAccountsResponse(); | 236 var o = new api.ListServiceAccountsResponse(); |
| 290 buildCounterListServiceAccountsResponse++; | 237 buildCounterListServiceAccountsResponse++; |
| 291 if (buildCounterListServiceAccountsResponse < 3) { | 238 if (buildCounterListServiceAccountsResponse < 3) { |
| 292 o.accounts = buildUnnamed1304(); | 239 o.accounts = buildUnnamed1329(); |
| 293 o.nextPageToken = "foo"; | 240 o.nextPageToken = "foo"; |
| 294 } | 241 } |
| 295 buildCounterListServiceAccountsResponse--; | 242 buildCounterListServiceAccountsResponse--; |
| 296 return o; | 243 return o; |
| 297 } | 244 } |
| 298 | 245 |
| 299 checkListServiceAccountsResponse(api.ListServiceAccountsResponse o) { | 246 checkListServiceAccountsResponse(api.ListServiceAccountsResponse o) { |
| 300 buildCounterListServiceAccountsResponse++; | 247 buildCounterListServiceAccountsResponse++; |
| 301 if (buildCounterListServiceAccountsResponse < 3) { | 248 if (buildCounterListServiceAccountsResponse < 3) { |
| 302 checkUnnamed1304(o.accounts); | 249 checkUnnamed1329(o.accounts); |
| 303 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 250 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 304 } | 251 } |
| 305 buildCounterListServiceAccountsResponse--; | 252 buildCounterListServiceAccountsResponse--; |
| 306 } | 253 } |
| 307 | 254 |
| 308 core.int buildCounterLogConfig = 0; | 255 buildUnnamed1330() { |
| 309 buildLogConfig() { | |
| 310 var o = new api.LogConfig(); | |
| 311 buildCounterLogConfig++; | |
| 312 if (buildCounterLogConfig < 3) { | |
| 313 o.cloudAudit = buildCloudAuditOptions(); | |
| 314 o.counter = buildCounterOptions(); | |
| 315 o.dataAccess = buildDataAccessOptions(); | |
| 316 } | |
| 317 buildCounterLogConfig--; | |
| 318 return o; | |
| 319 } | |
| 320 | |
| 321 checkLogConfig(api.LogConfig o) { | |
| 322 buildCounterLogConfig++; | |
| 323 if (buildCounterLogConfig < 3) { | |
| 324 checkCloudAuditOptions(o.cloudAudit); | |
| 325 checkCounterOptions(o.counter); | |
| 326 checkDataAccessOptions(o.dataAccess); | |
| 327 } | |
| 328 buildCounterLogConfig--; | |
| 329 } | |
| 330 | |
| 331 buildUnnamed1305() { | |
| 332 var o = new core.List<api.Binding>(); | 256 var o = new core.List<api.Binding>(); |
| 333 o.add(buildBinding()); | 257 o.add(buildBinding()); |
| 334 o.add(buildBinding()); | 258 o.add(buildBinding()); |
| 335 return o; | 259 return o; |
| 336 } | 260 } |
| 337 | 261 |
| 338 checkUnnamed1305(core.List<api.Binding> o) { | 262 checkUnnamed1330(core.List<api.Binding> o) { |
| 339 unittest.expect(o, unittest.hasLength(2)); | 263 unittest.expect(o, unittest.hasLength(2)); |
| 340 checkBinding(o[0]); | 264 checkBinding(o[0]); |
| 341 checkBinding(o[1]); | 265 checkBinding(o[1]); |
| 342 } | 266 } |
| 343 | 267 |
| 344 buildUnnamed1306() { | |
| 345 var o = new core.List<api.Rule>(); | |
| 346 o.add(buildRule()); | |
| 347 o.add(buildRule()); | |
| 348 return o; | |
| 349 } | |
| 350 | |
| 351 checkUnnamed1306(core.List<api.Rule> o) { | |
| 352 unittest.expect(o, unittest.hasLength(2)); | |
| 353 checkRule(o[0]); | |
| 354 checkRule(o[1]); | |
| 355 } | |
| 356 | |
| 357 core.int buildCounterPolicy = 0; | 268 core.int buildCounterPolicy = 0; |
| 358 buildPolicy() { | 269 buildPolicy() { |
| 359 var o = new api.Policy(); | 270 var o = new api.Policy(); |
| 360 buildCounterPolicy++; | 271 buildCounterPolicy++; |
| 361 if (buildCounterPolicy < 3) { | 272 if (buildCounterPolicy < 3) { |
| 362 o.bindings = buildUnnamed1305(); | 273 o.bindings = buildUnnamed1330(); |
| 363 o.etag = "foo"; | 274 o.etag = "foo"; |
| 364 o.rules = buildUnnamed1306(); | |
| 365 o.version = 42; | 275 o.version = 42; |
| 366 } | 276 } |
| 367 buildCounterPolicy--; | 277 buildCounterPolicy--; |
| 368 return o; | 278 return o; |
| 369 } | 279 } |
| 370 | 280 |
| 371 checkPolicy(api.Policy o) { | 281 checkPolicy(api.Policy o) { |
| 372 buildCounterPolicy++; | 282 buildCounterPolicy++; |
| 373 if (buildCounterPolicy < 3) { | 283 if (buildCounterPolicy < 3) { |
| 374 checkUnnamed1305(o.bindings); | 284 checkUnnamed1330(o.bindings); |
| 375 unittest.expect(o.etag, unittest.equals('foo')); | 285 unittest.expect(o.etag, unittest.equals('foo')); |
| 376 checkUnnamed1306(o.rules); | |
| 377 unittest.expect(o.version, unittest.equals(42)); | 286 unittest.expect(o.version, unittest.equals(42)); |
| 378 } | 287 } |
| 379 buildCounterPolicy--; | 288 buildCounterPolicy--; |
| 380 } | 289 } |
| 381 | 290 |
| 382 buildUnnamed1307() { | 291 buildUnnamed1331() { |
| 383 var o = new core.List<api.Condition>(); | 292 var o = new core.List<api.BindingDelta>(); |
| 384 o.add(buildCondition()); | 293 o.add(buildBindingDelta()); |
| 385 o.add(buildCondition()); | 294 o.add(buildBindingDelta()); |
| 386 return o; | 295 return o; |
| 387 } | 296 } |
| 388 | 297 |
| 389 checkUnnamed1307(core.List<api.Condition> o) { | 298 checkUnnamed1331(core.List<api.BindingDelta> o) { |
| 390 unittest.expect(o, unittest.hasLength(2)); | 299 unittest.expect(o, unittest.hasLength(2)); |
| 391 checkCondition(o[0]); | 300 checkBindingDelta(o[0]); |
| 392 checkCondition(o[1]); | 301 checkBindingDelta(o[1]); |
| 393 } | 302 } |
| 394 | 303 |
| 395 buildUnnamed1308() { | 304 core.int buildCounterPolicyDelta = 0; |
| 396 var o = new core.List<core.String>(); | 305 buildPolicyDelta() { |
| 397 o.add("foo"); | 306 var o = new api.PolicyDelta(); |
| 398 o.add("foo"); | 307 buildCounterPolicyDelta++; |
| 308 if (buildCounterPolicyDelta < 3) { |
| 309 o.bindingDeltas = buildUnnamed1331(); |
| 310 } |
| 311 buildCounterPolicyDelta--; |
| 399 return o; | 312 return o; |
| 400 } | 313 } |
| 401 | 314 |
| 402 checkUnnamed1308(core.List<core.String> o) { | 315 checkPolicyDelta(api.PolicyDelta o) { |
| 403 unittest.expect(o, unittest.hasLength(2)); | 316 buildCounterPolicyDelta++; |
| 404 unittest.expect(o[0], unittest.equals('foo')); | 317 if (buildCounterPolicyDelta < 3) { |
| 405 unittest.expect(o[1], unittest.equals('foo')); | 318 checkUnnamed1331(o.bindingDeltas); |
| 319 } |
| 320 buildCounterPolicyDelta--; |
| 406 } | 321 } |
| 407 | 322 |
| 408 buildUnnamed1309() { | 323 core.int buildCounterQueryGrantableRolesRequest = 0; |
| 409 var o = new core.List<api.LogConfig>(); | 324 buildQueryGrantableRolesRequest() { |
| 410 o.add(buildLogConfig()); | 325 var o = new api.QueryGrantableRolesRequest(); |
| 411 o.add(buildLogConfig()); | 326 buildCounterQueryGrantableRolesRequest++; |
| 327 if (buildCounterQueryGrantableRolesRequest < 3) { |
| 328 o.fullResourceName = "foo"; |
| 329 } |
| 330 buildCounterQueryGrantableRolesRequest--; |
| 412 return o; | 331 return o; |
| 413 } | 332 } |
| 414 | 333 |
| 415 checkUnnamed1309(core.List<api.LogConfig> o) { | 334 checkQueryGrantableRolesRequest(api.QueryGrantableRolesRequest o) { |
| 416 unittest.expect(o, unittest.hasLength(2)); | 335 buildCounterQueryGrantableRolesRequest++; |
| 417 checkLogConfig(o[0]); | 336 if (buildCounterQueryGrantableRolesRequest < 3) { |
| 418 checkLogConfig(o[1]); | 337 unittest.expect(o.fullResourceName, unittest.equals('foo')); |
| 338 } |
| 339 buildCounterQueryGrantableRolesRequest--; |
| 419 } | 340 } |
| 420 | 341 |
| 421 buildUnnamed1310() { | 342 buildUnnamed1332() { |
| 422 var o = new core.List<core.String>(); | 343 var o = new core.List<api.Role>(); |
| 423 o.add("foo"); | 344 o.add(buildRole()); |
| 424 o.add("foo"); | 345 o.add(buildRole()); |
| 425 return o; | 346 return o; |
| 426 } | 347 } |
| 427 | 348 |
| 428 checkUnnamed1310(core.List<core.String> o) { | 349 checkUnnamed1332(core.List<api.Role> o) { |
| 429 unittest.expect(o, unittest.hasLength(2)); | 350 unittest.expect(o, unittest.hasLength(2)); |
| 430 unittest.expect(o[0], unittest.equals('foo')); | 351 checkRole(o[0]); |
| 431 unittest.expect(o[1], unittest.equals('foo')); | 352 checkRole(o[1]); |
| 432 } | 353 } |
| 433 | 354 |
| 434 buildUnnamed1311() { | 355 core.int buildCounterQueryGrantableRolesResponse = 0; |
| 435 var o = new core.List<core.String>(); | 356 buildQueryGrantableRolesResponse() { |
| 436 o.add("foo"); | 357 var o = new api.QueryGrantableRolesResponse(); |
| 437 o.add("foo"); | 358 buildCounterQueryGrantableRolesResponse++; |
| 359 if (buildCounterQueryGrantableRolesResponse < 3) { |
| 360 o.roles = buildUnnamed1332(); |
| 361 } |
| 362 buildCounterQueryGrantableRolesResponse--; |
| 438 return o; | 363 return o; |
| 439 } | 364 } |
| 440 | 365 |
| 441 checkUnnamed1311(core.List<core.String> o) { | 366 checkQueryGrantableRolesResponse(api.QueryGrantableRolesResponse o) { |
| 442 unittest.expect(o, unittest.hasLength(2)); | 367 buildCounterQueryGrantableRolesResponse++; |
| 443 unittest.expect(o[0], unittest.equals('foo')); | 368 if (buildCounterQueryGrantableRolesResponse < 3) { |
| 444 unittest.expect(o[1], unittest.equals('foo')); | 369 checkUnnamed1332(o.roles); |
| 370 } |
| 371 buildCounterQueryGrantableRolesResponse--; |
| 445 } | 372 } |
| 446 | 373 |
| 447 core.int buildCounterRule = 0; | 374 core.int buildCounterRole = 0; |
| 448 buildRule() { | 375 buildRole() { |
| 449 var o = new api.Rule(); | 376 var o = new api.Role(); |
| 450 buildCounterRule++; | 377 buildCounterRole++; |
| 451 if (buildCounterRule < 3) { | 378 if (buildCounterRole < 3) { |
| 452 o.action = "foo"; | |
| 453 o.conditions = buildUnnamed1307(); | |
| 454 o.description = "foo"; | 379 o.description = "foo"; |
| 455 o.in_ = buildUnnamed1308(); | 380 o.name = "foo"; |
| 456 o.logConfig = buildUnnamed1309(); | 381 o.title = "foo"; |
| 457 o.notIn = buildUnnamed1310(); | |
| 458 o.permissions = buildUnnamed1311(); | |
| 459 } | 382 } |
| 460 buildCounterRule--; | 383 buildCounterRole--; |
| 461 return o; | 384 return o; |
| 462 } | 385 } |
| 463 | 386 |
| 464 checkRule(api.Rule o) { | 387 checkRole(api.Role o) { |
| 465 buildCounterRule++; | 388 buildCounterRole++; |
| 466 if (buildCounterRule < 3) { | 389 if (buildCounterRole < 3) { |
| 467 unittest.expect(o.action, unittest.equals('foo')); | |
| 468 checkUnnamed1307(o.conditions); | |
| 469 unittest.expect(o.description, unittest.equals('foo')); | 390 unittest.expect(o.description, unittest.equals('foo')); |
| 470 checkUnnamed1308(o.in_); | 391 unittest.expect(o.name, unittest.equals('foo')); |
| 471 checkUnnamed1309(o.logConfig); | 392 unittest.expect(o.title, unittest.equals('foo')); |
| 472 checkUnnamed1310(o.notIn); | |
| 473 checkUnnamed1311(o.permissions); | |
| 474 } | 393 } |
| 475 buildCounterRule--; | 394 buildCounterRole--; |
| 476 } | 395 } |
| 477 | 396 |
| 478 core.int buildCounterServiceAccount = 0; | 397 core.int buildCounterServiceAccount = 0; |
| 479 buildServiceAccount() { | 398 buildServiceAccount() { |
| 480 var o = new api.ServiceAccount(); | 399 var o = new api.ServiceAccount(); |
| 481 buildCounterServiceAccount++; | 400 buildCounterServiceAccount++; |
| 482 if (buildCounterServiceAccount < 3) { | 401 if (buildCounterServiceAccount < 3) { |
| 483 o.displayName = "foo"; | 402 o.displayName = "foo"; |
| 484 o.email = "foo"; | 403 o.email = "foo"; |
| 485 o.etag = "foo"; | 404 o.etag = "foo"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 504 unittest.expect(o.uniqueId, unittest.equals('foo')); | 423 unittest.expect(o.uniqueId, unittest.equals('foo')); |
| 505 } | 424 } |
| 506 buildCounterServiceAccount--; | 425 buildCounterServiceAccount--; |
| 507 } | 426 } |
| 508 | 427 |
| 509 core.int buildCounterServiceAccountKey = 0; | 428 core.int buildCounterServiceAccountKey = 0; |
| 510 buildServiceAccountKey() { | 429 buildServiceAccountKey() { |
| 511 var o = new api.ServiceAccountKey(); | 430 var o = new api.ServiceAccountKey(); |
| 512 buildCounterServiceAccountKey++; | 431 buildCounterServiceAccountKey++; |
| 513 if (buildCounterServiceAccountKey < 3) { | 432 if (buildCounterServiceAccountKey < 3) { |
| 433 o.keyAlgorithm = "foo"; |
| 514 o.name = "foo"; | 434 o.name = "foo"; |
| 515 o.privateKeyData = "foo"; | 435 o.privateKeyData = "foo"; |
| 516 o.privateKeyType = "foo"; | 436 o.privateKeyType = "foo"; |
| 437 o.publicKeyData = "foo"; |
| 517 o.validAfterTime = "foo"; | 438 o.validAfterTime = "foo"; |
| 518 o.validBeforeTime = "foo"; | 439 o.validBeforeTime = "foo"; |
| 519 } | 440 } |
| 520 buildCounterServiceAccountKey--; | 441 buildCounterServiceAccountKey--; |
| 521 return o; | 442 return o; |
| 522 } | 443 } |
| 523 | 444 |
| 524 checkServiceAccountKey(api.ServiceAccountKey o) { | 445 checkServiceAccountKey(api.ServiceAccountKey o) { |
| 525 buildCounterServiceAccountKey++; | 446 buildCounterServiceAccountKey++; |
| 526 if (buildCounterServiceAccountKey < 3) { | 447 if (buildCounterServiceAccountKey < 3) { |
| 448 unittest.expect(o.keyAlgorithm, unittest.equals('foo')); |
| 527 unittest.expect(o.name, unittest.equals('foo')); | 449 unittest.expect(o.name, unittest.equals('foo')); |
| 528 unittest.expect(o.privateKeyData, unittest.equals('foo')); | 450 unittest.expect(o.privateKeyData, unittest.equals('foo')); |
| 529 unittest.expect(o.privateKeyType, unittest.equals('foo')); | 451 unittest.expect(o.privateKeyType, unittest.equals('foo')); |
| 452 unittest.expect(o.publicKeyData, unittest.equals('foo')); |
| 530 unittest.expect(o.validAfterTime, unittest.equals('foo')); | 453 unittest.expect(o.validAfterTime, unittest.equals('foo')); |
| 531 unittest.expect(o.validBeforeTime, unittest.equals('foo')); | 454 unittest.expect(o.validBeforeTime, unittest.equals('foo')); |
| 532 } | 455 } |
| 533 buildCounterServiceAccountKey--; | 456 buildCounterServiceAccountKey--; |
| 534 } | 457 } |
| 535 | 458 |
| 536 core.int buildCounterSetIamPolicyRequest = 0; | 459 core.int buildCounterSetIamPolicyRequest = 0; |
| 537 buildSetIamPolicyRequest() { | 460 buildSetIamPolicyRequest() { |
| 538 var o = new api.SetIamPolicyRequest(); | 461 var o = new api.SetIamPolicyRequest(); |
| 539 buildCounterSetIamPolicyRequest++; | 462 buildCounterSetIamPolicyRequest++; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 508 |
| 586 checkSignBlobResponse(api.SignBlobResponse o) { | 509 checkSignBlobResponse(api.SignBlobResponse o) { |
| 587 buildCounterSignBlobResponse++; | 510 buildCounterSignBlobResponse++; |
| 588 if (buildCounterSignBlobResponse < 3) { | 511 if (buildCounterSignBlobResponse < 3) { |
| 589 unittest.expect(o.keyId, unittest.equals('foo')); | 512 unittest.expect(o.keyId, unittest.equals('foo')); |
| 590 unittest.expect(o.signature, unittest.equals('foo')); | 513 unittest.expect(o.signature, unittest.equals('foo')); |
| 591 } | 514 } |
| 592 buildCounterSignBlobResponse--; | 515 buildCounterSignBlobResponse--; |
| 593 } | 516 } |
| 594 | 517 |
| 595 buildUnnamed1312() { | 518 buildUnnamed1333() { |
| 596 var o = new core.List<core.String>(); | 519 var o = new core.List<core.String>(); |
| 597 o.add("foo"); | 520 o.add("foo"); |
| 598 o.add("foo"); | 521 o.add("foo"); |
| 599 return o; | 522 return o; |
| 600 } | 523 } |
| 601 | 524 |
| 602 checkUnnamed1312(core.List<core.String> o) { | 525 checkUnnamed1333(core.List<core.String> o) { |
| 603 unittest.expect(o, unittest.hasLength(2)); | 526 unittest.expect(o, unittest.hasLength(2)); |
| 604 unittest.expect(o[0], unittest.equals('foo')); | 527 unittest.expect(o[0], unittest.equals('foo')); |
| 605 unittest.expect(o[1], unittest.equals('foo')); | 528 unittest.expect(o[1], unittest.equals('foo')); |
| 606 } | 529 } |
| 607 | 530 |
| 608 core.int buildCounterTestIamPermissionsRequest = 0; | 531 core.int buildCounterTestIamPermissionsRequest = 0; |
| 609 buildTestIamPermissionsRequest() { | 532 buildTestIamPermissionsRequest() { |
| 610 var o = new api.TestIamPermissionsRequest(); | 533 var o = new api.TestIamPermissionsRequest(); |
| 611 buildCounterTestIamPermissionsRequest++; | 534 buildCounterTestIamPermissionsRequest++; |
| 612 if (buildCounterTestIamPermissionsRequest < 3) { | 535 if (buildCounterTestIamPermissionsRequest < 3) { |
| 613 o.permissions = buildUnnamed1312(); | 536 o.permissions = buildUnnamed1333(); |
| 614 } | 537 } |
| 615 buildCounterTestIamPermissionsRequest--; | 538 buildCounterTestIamPermissionsRequest--; |
| 616 return o; | 539 return o; |
| 617 } | 540 } |
| 618 | 541 |
| 619 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 542 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 620 buildCounterTestIamPermissionsRequest++; | 543 buildCounterTestIamPermissionsRequest++; |
| 621 if (buildCounterTestIamPermissionsRequest < 3) { | 544 if (buildCounterTestIamPermissionsRequest < 3) { |
| 622 checkUnnamed1312(o.permissions); | 545 checkUnnamed1333(o.permissions); |
| 623 } | 546 } |
| 624 buildCounterTestIamPermissionsRequest--; | 547 buildCounterTestIamPermissionsRequest--; |
| 625 } | 548 } |
| 626 | 549 |
| 627 buildUnnamed1313() { | 550 buildUnnamed1334() { |
| 628 var o = new core.List<core.String>(); | 551 var o = new core.List<core.String>(); |
| 629 o.add("foo"); | 552 o.add("foo"); |
| 630 o.add("foo"); | 553 o.add("foo"); |
| 631 return o; | 554 return o; |
| 632 } | 555 } |
| 633 | 556 |
| 634 checkUnnamed1313(core.List<core.String> o) { | 557 checkUnnamed1334(core.List<core.String> o) { |
| 635 unittest.expect(o, unittest.hasLength(2)); | 558 unittest.expect(o, unittest.hasLength(2)); |
| 636 unittest.expect(o[0], unittest.equals('foo')); | 559 unittest.expect(o[0], unittest.equals('foo')); |
| 637 unittest.expect(o[1], unittest.equals('foo')); | 560 unittest.expect(o[1], unittest.equals('foo')); |
| 638 } | 561 } |
| 639 | 562 |
| 640 core.int buildCounterTestIamPermissionsResponse = 0; | 563 core.int buildCounterTestIamPermissionsResponse = 0; |
| 641 buildTestIamPermissionsResponse() { | 564 buildTestIamPermissionsResponse() { |
| 642 var o = new api.TestIamPermissionsResponse(); | 565 var o = new api.TestIamPermissionsResponse(); |
| 643 buildCounterTestIamPermissionsResponse++; | 566 buildCounterTestIamPermissionsResponse++; |
| 644 if (buildCounterTestIamPermissionsResponse < 3) { | 567 if (buildCounterTestIamPermissionsResponse < 3) { |
| 645 o.permissions = buildUnnamed1313(); | 568 o.permissions = buildUnnamed1334(); |
| 646 } | 569 } |
| 647 buildCounterTestIamPermissionsResponse--; | 570 buildCounterTestIamPermissionsResponse--; |
| 648 return o; | 571 return o; |
| 649 } | 572 } |
| 650 | 573 |
| 651 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 574 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 652 buildCounterTestIamPermissionsResponse++; | 575 buildCounterTestIamPermissionsResponse++; |
| 653 if (buildCounterTestIamPermissionsResponse < 3) { | 576 if (buildCounterTestIamPermissionsResponse < 3) { |
| 654 checkUnnamed1313(o.permissions); | 577 checkUnnamed1334(o.permissions); |
| 655 } | 578 } |
| 656 buildCounterTestIamPermissionsResponse--; | 579 buildCounterTestIamPermissionsResponse--; |
| 657 } | 580 } |
| 658 | 581 |
| 659 buildUnnamed1314() { | 582 buildUnnamed1335() { |
| 660 var o = new core.List<core.String>(); | 583 var o = new core.List<core.String>(); |
| 661 o.add("foo"); | 584 o.add("foo"); |
| 662 o.add("foo"); | 585 o.add("foo"); |
| 663 return o; | 586 return o; |
| 664 } | 587 } |
| 665 | 588 |
| 666 checkUnnamed1314(core.List<core.String> o) { | 589 checkUnnamed1335(core.List<core.String> o) { |
| 667 unittest.expect(o, unittest.hasLength(2)); | 590 unittest.expect(o, unittest.hasLength(2)); |
| 668 unittest.expect(o[0], unittest.equals('foo')); | 591 unittest.expect(o[0], unittest.equals('foo')); |
| 669 unittest.expect(o[1], unittest.equals('foo')); | 592 unittest.expect(o[1], unittest.equals('foo')); |
| 670 } | 593 } |
| 671 | 594 |
| 672 | 595 |
| 673 main() { | 596 main() { |
| 597 unittest.group("obj-schema-AuditData", () { |
| 598 unittest.test("to-json--from-json", () { |
| 599 var o = buildAuditData(); |
| 600 var od = new api.AuditData.fromJson(o.toJson()); |
| 601 checkAuditData(od); |
| 602 }); |
| 603 }); |
| 604 |
| 605 |
| 674 unittest.group("obj-schema-Binding", () { | 606 unittest.group("obj-schema-Binding", () { |
| 675 unittest.test("to-json--from-json", () { | 607 unittest.test("to-json--from-json", () { |
| 676 var o = buildBinding(); | 608 var o = buildBinding(); |
| 677 var od = new api.Binding.fromJson(o.toJson()); | 609 var od = new api.Binding.fromJson(o.toJson()); |
| 678 checkBinding(od); | 610 checkBinding(od); |
| 679 }); | 611 }); |
| 680 }); | 612 }); |
| 681 | 613 |
| 682 | 614 |
| 683 unittest.group("obj-schema-CloudAuditOptions", () { | 615 unittest.group("obj-schema-BindingDelta", () { |
| 684 unittest.test("to-json--from-json", () { | 616 unittest.test("to-json--from-json", () { |
| 685 var o = buildCloudAuditOptions(); | 617 var o = buildBindingDelta(); |
| 686 var od = new api.CloudAuditOptions.fromJson(o.toJson()); | 618 var od = new api.BindingDelta.fromJson(o.toJson()); |
| 687 checkCloudAuditOptions(od); | 619 checkBindingDelta(od); |
| 688 }); | 620 }); |
| 689 }); | 621 }); |
| 690 | 622 |
| 691 | |
| 692 unittest.group("obj-schema-Condition", () { | |
| 693 unittest.test("to-json--from-json", () { | |
| 694 var o = buildCondition(); | |
| 695 var od = new api.Condition.fromJson(o.toJson()); | |
| 696 checkCondition(od); | |
| 697 }); | |
| 698 }); | |
| 699 | |
| 700 | |
| 701 unittest.group("obj-schema-CounterOptions", () { | |
| 702 unittest.test("to-json--from-json", () { | |
| 703 var o = buildCounterOptions(); | |
| 704 var od = new api.CounterOptions.fromJson(o.toJson()); | |
| 705 checkCounterOptions(od); | |
| 706 }); | |
| 707 }); | |
| 708 | |
| 709 | 623 |
| 710 unittest.group("obj-schema-CreateServiceAccountKeyRequest", () { | 624 unittest.group("obj-schema-CreateServiceAccountKeyRequest", () { |
| 711 unittest.test("to-json--from-json", () { | 625 unittest.test("to-json--from-json", () { |
| 712 var o = buildCreateServiceAccountKeyRequest(); | 626 var o = buildCreateServiceAccountKeyRequest(); |
| 713 var od = new api.CreateServiceAccountKeyRequest.fromJson(o.toJson()); | 627 var od = new api.CreateServiceAccountKeyRequest.fromJson(o.toJson()); |
| 714 checkCreateServiceAccountKeyRequest(od); | 628 checkCreateServiceAccountKeyRequest(od); |
| 715 }); | 629 }); |
| 716 }); | 630 }); |
| 717 | 631 |
| 718 | 632 |
| 719 unittest.group("obj-schema-CreateServiceAccountRequest", () { | 633 unittest.group("obj-schema-CreateServiceAccountRequest", () { |
| 720 unittest.test("to-json--from-json", () { | 634 unittest.test("to-json--from-json", () { |
| 721 var o = buildCreateServiceAccountRequest(); | 635 var o = buildCreateServiceAccountRequest(); |
| 722 var od = new api.CreateServiceAccountRequest.fromJson(o.toJson()); | 636 var od = new api.CreateServiceAccountRequest.fromJson(o.toJson()); |
| 723 checkCreateServiceAccountRequest(od); | 637 checkCreateServiceAccountRequest(od); |
| 724 }); | 638 }); |
| 725 }); | 639 }); |
| 726 | 640 |
| 727 | 641 |
| 728 unittest.group("obj-schema-DataAccessOptions", () { | |
| 729 unittest.test("to-json--from-json", () { | |
| 730 var o = buildDataAccessOptions(); | |
| 731 var od = new api.DataAccessOptions.fromJson(o.toJson()); | |
| 732 checkDataAccessOptions(od); | |
| 733 }); | |
| 734 }); | |
| 735 | |
| 736 | |
| 737 unittest.group("obj-schema-Empty", () { | 642 unittest.group("obj-schema-Empty", () { |
| 738 unittest.test("to-json--from-json", () { | 643 unittest.test("to-json--from-json", () { |
| 739 var o = buildEmpty(); | 644 var o = buildEmpty(); |
| 740 var od = new api.Empty.fromJson(o.toJson()); | 645 var od = new api.Empty.fromJson(o.toJson()); |
| 741 checkEmpty(od); | 646 checkEmpty(od); |
| 742 }); | 647 }); |
| 743 }); | 648 }); |
| 744 | 649 |
| 745 | 650 |
| 746 unittest.group("obj-schema-ListServiceAccountKeysResponse", () { | 651 unittest.group("obj-schema-ListServiceAccountKeysResponse", () { |
| 747 unittest.test("to-json--from-json", () { | 652 unittest.test("to-json--from-json", () { |
| 748 var o = buildListServiceAccountKeysResponse(); | 653 var o = buildListServiceAccountKeysResponse(); |
| 749 var od = new api.ListServiceAccountKeysResponse.fromJson(o.toJson()); | 654 var od = new api.ListServiceAccountKeysResponse.fromJson(o.toJson()); |
| 750 checkListServiceAccountKeysResponse(od); | 655 checkListServiceAccountKeysResponse(od); |
| 751 }); | 656 }); |
| 752 }); | 657 }); |
| 753 | 658 |
| 754 | 659 |
| 755 unittest.group("obj-schema-ListServiceAccountsResponse", () { | 660 unittest.group("obj-schema-ListServiceAccountsResponse", () { |
| 756 unittest.test("to-json--from-json", () { | 661 unittest.test("to-json--from-json", () { |
| 757 var o = buildListServiceAccountsResponse(); | 662 var o = buildListServiceAccountsResponse(); |
| 758 var od = new api.ListServiceAccountsResponse.fromJson(o.toJson()); | 663 var od = new api.ListServiceAccountsResponse.fromJson(o.toJson()); |
| 759 checkListServiceAccountsResponse(od); | 664 checkListServiceAccountsResponse(od); |
| 760 }); | 665 }); |
| 761 }); | 666 }); |
| 762 | 667 |
| 763 | 668 |
| 764 unittest.group("obj-schema-LogConfig", () { | |
| 765 unittest.test("to-json--from-json", () { | |
| 766 var o = buildLogConfig(); | |
| 767 var od = new api.LogConfig.fromJson(o.toJson()); | |
| 768 checkLogConfig(od); | |
| 769 }); | |
| 770 }); | |
| 771 | |
| 772 | |
| 773 unittest.group("obj-schema-Policy", () { | 669 unittest.group("obj-schema-Policy", () { |
| 774 unittest.test("to-json--from-json", () { | 670 unittest.test("to-json--from-json", () { |
| 775 var o = buildPolicy(); | 671 var o = buildPolicy(); |
| 776 var od = new api.Policy.fromJson(o.toJson()); | 672 var od = new api.Policy.fromJson(o.toJson()); |
| 777 checkPolicy(od); | 673 checkPolicy(od); |
| 778 }); | 674 }); |
| 779 }); | 675 }); |
| 780 | 676 |
| 781 | 677 |
| 782 unittest.group("obj-schema-Rule", () { | 678 unittest.group("obj-schema-PolicyDelta", () { |
| 783 unittest.test("to-json--from-json", () { | 679 unittest.test("to-json--from-json", () { |
| 784 var o = buildRule(); | 680 var o = buildPolicyDelta(); |
| 785 var od = new api.Rule.fromJson(o.toJson()); | 681 var od = new api.PolicyDelta.fromJson(o.toJson()); |
| 786 checkRule(od); | 682 checkPolicyDelta(od); |
| 787 }); | 683 }); |
| 788 }); | 684 }); |
| 789 | 685 |
| 686 |
| 687 unittest.group("obj-schema-QueryGrantableRolesRequest", () { |
| 688 unittest.test("to-json--from-json", () { |
| 689 var o = buildQueryGrantableRolesRequest(); |
| 690 var od = new api.QueryGrantableRolesRequest.fromJson(o.toJson()); |
| 691 checkQueryGrantableRolesRequest(od); |
| 692 }); |
| 693 }); |
| 694 |
| 695 |
| 696 unittest.group("obj-schema-QueryGrantableRolesResponse", () { |
| 697 unittest.test("to-json--from-json", () { |
| 698 var o = buildQueryGrantableRolesResponse(); |
| 699 var od = new api.QueryGrantableRolesResponse.fromJson(o.toJson()); |
| 700 checkQueryGrantableRolesResponse(od); |
| 701 }); |
| 702 }); |
| 703 |
| 704 |
| 705 unittest.group("obj-schema-Role", () { |
| 706 unittest.test("to-json--from-json", () { |
| 707 var o = buildRole(); |
| 708 var od = new api.Role.fromJson(o.toJson()); |
| 709 checkRole(od); |
| 710 }); |
| 711 }); |
| 712 |
| 790 | 713 |
| 791 unittest.group("obj-schema-ServiceAccount", () { | 714 unittest.group("obj-schema-ServiceAccount", () { |
| 792 unittest.test("to-json--from-json", () { | 715 unittest.test("to-json--from-json", () { |
| 793 var o = buildServiceAccount(); | 716 var o = buildServiceAccount(); |
| 794 var od = new api.ServiceAccount.fromJson(o.toJson()); | 717 var od = new api.ServiceAccount.fromJson(o.toJson()); |
| 795 checkServiceAccount(od); | 718 checkServiceAccount(od); |
| 796 }); | 719 }); |
| 797 }); | 720 }); |
| 798 | 721 |
| 799 | 722 |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { | 1300 res.delete(arg_name).then(unittest.expectAsync(((api.Empty response) { |
| 1378 checkEmpty(response); | 1301 checkEmpty(response); |
| 1379 }))); | 1302 }))); |
| 1380 }); | 1303 }); |
| 1381 | 1304 |
| 1382 unittest.test("method--get", () { | 1305 unittest.test("method--get", () { |
| 1383 | 1306 |
| 1384 var mock = new HttpServerMock(); | 1307 var mock = new HttpServerMock(); |
| 1385 api.ProjectsServiceAccountsKeysResourceApi res = new api.IamApi(mock).proj
ects.serviceAccounts.keys; | 1308 api.ProjectsServiceAccountsKeysResourceApi res = new api.IamApi(mock).proj
ects.serviceAccounts.keys; |
| 1386 var arg_name = "foo"; | 1309 var arg_name = "foo"; |
| 1310 var arg_publicKeyType = "foo"; |
| 1387 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1311 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1388 var path = (req.url).path; | 1312 var path = (req.url).path; |
| 1389 var pathOffset = 0; | 1313 var pathOffset = 0; |
| 1390 var index; | 1314 var index; |
| 1391 var subPart; | 1315 var subPart; |
| 1392 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1316 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1393 pathOffset += 1; | 1317 pathOffset += 1; |
| 1394 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1318 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1395 pathOffset += 3; | 1319 pathOffset += 3; |
| 1396 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1320 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1397 | 1321 |
| 1398 var query = (req.url).query; | 1322 var query = (req.url).query; |
| 1399 var queryOffset = 0; | 1323 var queryOffset = 0; |
| 1400 var queryMap = {}; | 1324 var queryMap = {}; |
| 1401 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1325 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1402 parseBool(n) { | 1326 parseBool(n) { |
| 1403 if (n == "true") return true; | 1327 if (n == "true") return true; |
| 1404 if (n == "false") return false; | 1328 if (n == "false") return false; |
| 1405 if (n == null) return null; | 1329 if (n == null) return null; |
| 1406 throw new core.ArgumentError("Invalid boolean: $n"); | 1330 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1407 } | 1331 } |
| 1408 if (query.length > 0) { | 1332 if (query.length > 0) { |
| 1409 for (var part in query.split("&")) { | 1333 for (var part in query.split("&")) { |
| 1410 var keyvalue = part.split("="); | 1334 var keyvalue = part.split("="); |
| 1411 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1335 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1412 } | 1336 } |
| 1413 } | 1337 } |
| 1338 unittest.expect(queryMap["publicKeyType"].first, unittest.equals(arg_pub
licKeyType)); |
| 1414 | 1339 |
| 1415 | 1340 |
| 1416 var h = { | 1341 var h = { |
| 1417 "content-type" : "application/json; charset=utf-8", | 1342 "content-type" : "application/json; charset=utf-8", |
| 1418 }; | 1343 }; |
| 1419 var resp = convert.JSON.encode(buildServiceAccountKey()); | 1344 var resp = convert.JSON.encode(buildServiceAccountKey()); |
| 1420 return new async.Future.value(stringResponse(200, h, resp)); | 1345 return new async.Future.value(stringResponse(200, h, resp)); |
| 1421 }), true); | 1346 }), true); |
| 1422 res.get(arg_name).then(unittest.expectAsync(((api.ServiceAccountKey respon
se) { | 1347 res.get(arg_name, publicKeyType: arg_publicKeyType).then(unittest.expectAs
ync(((api.ServiceAccountKey response) { |
| 1423 checkServiceAccountKey(response); | 1348 checkServiceAccountKey(response); |
| 1424 }))); | 1349 }))); |
| 1425 }); | 1350 }); |
| 1426 | 1351 |
| 1427 unittest.test("method--list", () { | 1352 unittest.test("method--list", () { |
| 1428 | 1353 |
| 1429 var mock = new HttpServerMock(); | 1354 var mock = new HttpServerMock(); |
| 1430 api.ProjectsServiceAccountsKeysResourceApi res = new api.IamApi(mock).proj
ects.serviceAccounts.keys; | 1355 api.ProjectsServiceAccountsKeysResourceApi res = new api.IamApi(mock).proj
ects.serviceAccounts.keys; |
| 1431 var arg_name = "foo"; | 1356 var arg_name = "foo"; |
| 1432 var arg_keyTypes = buildUnnamed1314(); | 1357 var arg_keyTypes = buildUnnamed1335(); |
| 1433 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1358 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1434 var path = (req.url).path; | 1359 var path = (req.url).path; |
| 1435 var pathOffset = 0; | 1360 var pathOffset = 0; |
| 1436 var index; | 1361 var index; |
| 1437 var subPart; | 1362 var subPart; |
| 1438 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1363 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1439 pathOffset += 1; | 1364 pathOffset += 1; |
| 1440 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1365 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1441 pathOffset += 3; | 1366 pathOffset += 3; |
| 1442 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1367 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1467 return new async.Future.value(stringResponse(200, h, resp)); | 1392 return new async.Future.value(stringResponse(200, h, resp)); |
| 1468 }), true); | 1393 }), true); |
| 1469 res.list(arg_name, keyTypes: arg_keyTypes).then(unittest.expectAsync(((api
.ListServiceAccountKeysResponse response) { | 1394 res.list(arg_name, keyTypes: arg_keyTypes).then(unittest.expectAsync(((api
.ListServiceAccountKeysResponse response) { |
| 1470 checkListServiceAccountKeysResponse(response); | 1395 checkListServiceAccountKeysResponse(response); |
| 1471 }))); | 1396 }))); |
| 1472 }); | 1397 }); |
| 1473 | 1398 |
| 1474 }); | 1399 }); |
| 1475 | 1400 |
| 1476 | 1401 |
| 1402 unittest.group("resource-RolesResourceApi", () { |
| 1403 unittest.test("method--queryGrantableRoles", () { |
| 1404 |
| 1405 var mock = new HttpServerMock(); |
| 1406 api.RolesResourceApi res = new api.IamApi(mock).roles; |
| 1407 var arg_request = buildQueryGrantableRolesRequest(); |
| 1408 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1409 var obj = new api.QueryGrantableRolesRequest.fromJson(json); |
| 1410 checkQueryGrantableRolesRequest(obj); |
| 1411 |
| 1412 var path = (req.url).path; |
| 1413 var pathOffset = 0; |
| 1414 var index; |
| 1415 var subPart; |
| 1416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1417 pathOffset += 1; |
| 1418 unittest.expect(path.substring(pathOffset, pathOffset + 28), unittest.eq
uals("v1/roles:queryGrantableRoles")); |
| 1419 pathOffset += 28; |
| 1420 |
| 1421 var query = (req.url).query; |
| 1422 var queryOffset = 0; |
| 1423 var queryMap = {}; |
| 1424 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1425 parseBool(n) { |
| 1426 if (n == "true") return true; |
| 1427 if (n == "false") return false; |
| 1428 if (n == null) return null; |
| 1429 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1430 } |
| 1431 if (query.length > 0) { |
| 1432 for (var part in query.split("&")) { |
| 1433 var keyvalue = part.split("="); |
| 1434 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1435 } |
| 1436 } |
| 1437 |
| 1438 |
| 1439 var h = { |
| 1440 "content-type" : "application/json; charset=utf-8", |
| 1441 }; |
| 1442 var resp = convert.JSON.encode(buildQueryGrantableRolesResponse()); |
| 1443 return new async.Future.value(stringResponse(200, h, resp)); |
| 1444 }), true); |
| 1445 res.queryGrantableRoles(arg_request).then(unittest.expectAsync(((api.Query
GrantableRolesResponse response) { |
| 1446 checkQueryGrantableRolesResponse(response); |
| 1447 }))); |
| 1448 }); |
| 1449 |
| 1450 }); |
| 1451 |
| 1452 |
| 1477 } | 1453 } |
| 1478 | 1454 |
| OLD | NEW |