OLD | NEW |
(Empty) | |
| 1 library googleapis.androidmanagement.v1.test; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:test/test.dart' as unittest; |
| 11 |
| 12 import 'package:googleapis/androidmanagement/v1.dart' as api; |
| 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 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)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 core.int buildCounterApiLevelCondition = 0; |
| 55 buildApiLevelCondition() { |
| 56 var o = new api.ApiLevelCondition(); |
| 57 buildCounterApiLevelCondition++; |
| 58 if (buildCounterApiLevelCondition < 3) { |
| 59 o.minApiLevel = 42; |
| 60 } |
| 61 buildCounterApiLevelCondition--; |
| 62 return o; |
| 63 } |
| 64 |
| 65 checkApiLevelCondition(api.ApiLevelCondition o) { |
| 66 buildCounterApiLevelCondition++; |
| 67 if (buildCounterApiLevelCondition < 3) { |
| 68 unittest.expect(o.minApiLevel, unittest.equals(42)); |
| 69 } |
| 70 buildCounterApiLevelCondition--; |
| 71 } |
| 72 |
| 73 buildUnnamed1542() { |
| 74 var o = new core.List<api.ManagedProperty>(); |
| 75 o.add(buildManagedProperty()); |
| 76 o.add(buildManagedProperty()); |
| 77 return o; |
| 78 } |
| 79 |
| 80 checkUnnamed1542(core.List<api.ManagedProperty> o) { |
| 81 unittest.expect(o, unittest.hasLength(2)); |
| 82 checkManagedProperty(o[0]); |
| 83 checkManagedProperty(o[1]); |
| 84 } |
| 85 |
| 86 buildUnnamed1543() { |
| 87 var o = new core.List<api.ApplicationPermission>(); |
| 88 o.add(buildApplicationPermission()); |
| 89 o.add(buildApplicationPermission()); |
| 90 return o; |
| 91 } |
| 92 |
| 93 checkUnnamed1543(core.List<api.ApplicationPermission> o) { |
| 94 unittest.expect(o, unittest.hasLength(2)); |
| 95 checkApplicationPermission(o[0]); |
| 96 checkApplicationPermission(o[1]); |
| 97 } |
| 98 |
| 99 core.int buildCounterApplication = 0; |
| 100 buildApplication() { |
| 101 var o = new api.Application(); |
| 102 buildCounterApplication++; |
| 103 if (buildCounterApplication < 3) { |
| 104 o.managedProperties = buildUnnamed1542(); |
| 105 o.name = "foo"; |
| 106 o.permissions = buildUnnamed1543(); |
| 107 o.title = "foo"; |
| 108 } |
| 109 buildCounterApplication--; |
| 110 return o; |
| 111 } |
| 112 |
| 113 checkApplication(api.Application o) { |
| 114 buildCounterApplication++; |
| 115 if (buildCounterApplication < 3) { |
| 116 checkUnnamed1542(o.managedProperties); |
| 117 unittest.expect(o.name, unittest.equals('foo')); |
| 118 checkUnnamed1543(o.permissions); |
| 119 unittest.expect(o.title, unittest.equals('foo')); |
| 120 } |
| 121 buildCounterApplication--; |
| 122 } |
| 123 |
| 124 core.int buildCounterApplicationPermission = 0; |
| 125 buildApplicationPermission() { |
| 126 var o = new api.ApplicationPermission(); |
| 127 buildCounterApplicationPermission++; |
| 128 if (buildCounterApplicationPermission < 3) { |
| 129 o.description = "foo"; |
| 130 o.name = "foo"; |
| 131 o.permissionId = "foo"; |
| 132 } |
| 133 buildCounterApplicationPermission--; |
| 134 return o; |
| 135 } |
| 136 |
| 137 checkApplicationPermission(api.ApplicationPermission o) { |
| 138 buildCounterApplicationPermission++; |
| 139 if (buildCounterApplicationPermission < 3) { |
| 140 unittest.expect(o.description, unittest.equals('foo')); |
| 141 unittest.expect(o.name, unittest.equals('foo')); |
| 142 unittest.expect(o.permissionId, unittest.equals('foo')); |
| 143 } |
| 144 buildCounterApplicationPermission--; |
| 145 } |
| 146 |
| 147 buildUnnamed1544() { |
| 148 var o = new core.Map<core.String, core.Object>(); |
| 149 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 150 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 151 return o; |
| 152 } |
| 153 |
| 154 checkUnnamed1544(core.Map<core.String, core.Object> o) { |
| 155 unittest.expect(o, unittest.hasLength(2)); |
| 156 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 157 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 158 } |
| 159 |
| 160 buildUnnamed1545() { |
| 161 var o = new core.List<api.PermissionGrant>(); |
| 162 o.add(buildPermissionGrant()); |
| 163 o.add(buildPermissionGrant()); |
| 164 return o; |
| 165 } |
| 166 |
| 167 checkUnnamed1545(core.List<api.PermissionGrant> o) { |
| 168 unittest.expect(o, unittest.hasLength(2)); |
| 169 checkPermissionGrant(o[0]); |
| 170 checkPermissionGrant(o[1]); |
| 171 } |
| 172 |
| 173 core.int buildCounterApplicationPolicy = 0; |
| 174 buildApplicationPolicy() { |
| 175 var o = new api.ApplicationPolicy(); |
| 176 buildCounterApplicationPolicy++; |
| 177 if (buildCounterApplicationPolicy < 3) { |
| 178 o.defaultPermissionPolicy = "foo"; |
| 179 o.installType = "foo"; |
| 180 o.lockTaskAllowed = true; |
| 181 o.managedConfiguration = buildUnnamed1544(); |
| 182 o.packageName = "foo"; |
| 183 o.permissionGrants = buildUnnamed1545(); |
| 184 } |
| 185 buildCounterApplicationPolicy--; |
| 186 return o; |
| 187 } |
| 188 |
| 189 checkApplicationPolicy(api.ApplicationPolicy o) { |
| 190 buildCounterApplicationPolicy++; |
| 191 if (buildCounterApplicationPolicy < 3) { |
| 192 unittest.expect(o.defaultPermissionPolicy, unittest.equals('foo')); |
| 193 unittest.expect(o.installType, unittest.equals('foo')); |
| 194 unittest.expect(o.lockTaskAllowed, unittest.isTrue); |
| 195 checkUnnamed1544(o.managedConfiguration); |
| 196 unittest.expect(o.packageName, unittest.equals('foo')); |
| 197 checkUnnamed1545(o.permissionGrants); |
| 198 } |
| 199 buildCounterApplicationPolicy--; |
| 200 } |
| 201 |
| 202 buildUnnamed1546() { |
| 203 var o = new core.List<core.String>(); |
| 204 o.add("foo"); |
| 205 o.add("foo"); |
| 206 return o; |
| 207 } |
| 208 |
| 209 checkUnnamed1546(core.List<core.String> o) { |
| 210 unittest.expect(o, unittest.hasLength(2)); |
| 211 unittest.expect(o[0], unittest.equals('foo')); |
| 212 unittest.expect(o[1], unittest.equals('foo')); |
| 213 } |
| 214 |
| 215 core.int buildCounterCommand = 0; |
| 216 buildCommand() { |
| 217 var o = new api.Command(); |
| 218 buildCounterCommand++; |
| 219 if (buildCounterCommand < 3) { |
| 220 o.createTime = "foo"; |
| 221 o.duration = "foo"; |
| 222 o.newPassword = "foo"; |
| 223 o.resetPasswordFlags = buildUnnamed1546(); |
| 224 o.type = "foo"; |
| 225 } |
| 226 buildCounterCommand--; |
| 227 return o; |
| 228 } |
| 229 |
| 230 checkCommand(api.Command o) { |
| 231 buildCounterCommand++; |
| 232 if (buildCounterCommand < 3) { |
| 233 unittest.expect(o.createTime, unittest.equals('foo')); |
| 234 unittest.expect(o.duration, unittest.equals('foo')); |
| 235 unittest.expect(o.newPassword, unittest.equals('foo')); |
| 236 checkUnnamed1546(o.resetPasswordFlags); |
| 237 unittest.expect(o.type, unittest.equals('foo')); |
| 238 } |
| 239 buildCounterCommand--; |
| 240 } |
| 241 |
| 242 core.int buildCounterComplianceRule = 0; |
| 243 buildComplianceRule() { |
| 244 var o = new api.ComplianceRule(); |
| 245 buildCounterComplianceRule++; |
| 246 if (buildCounterComplianceRule < 3) { |
| 247 o.apiLevelCondition = buildApiLevelCondition(); |
| 248 o.disableApps = true; |
| 249 o.nonComplianceDetailCondition = buildNonComplianceDetailCondition(); |
| 250 } |
| 251 buildCounterComplianceRule--; |
| 252 return o; |
| 253 } |
| 254 |
| 255 checkComplianceRule(api.ComplianceRule o) { |
| 256 buildCounterComplianceRule++; |
| 257 if (buildCounterComplianceRule < 3) { |
| 258 checkApiLevelCondition(o.apiLevelCondition); |
| 259 unittest.expect(o.disableApps, unittest.isTrue); |
| 260 checkNonComplianceDetailCondition(o.nonComplianceDetailCondition); |
| 261 } |
| 262 buildCounterComplianceRule--; |
| 263 } |
| 264 |
| 265 buildUnnamed1547() { |
| 266 var o = new core.List<api.Display>(); |
| 267 o.add(buildDisplay()); |
| 268 o.add(buildDisplay()); |
| 269 return o; |
| 270 } |
| 271 |
| 272 checkUnnamed1547(core.List<api.Display> o) { |
| 273 unittest.expect(o, unittest.hasLength(2)); |
| 274 checkDisplay(o[0]); |
| 275 checkDisplay(o[1]); |
| 276 } |
| 277 |
| 278 buildUnnamed1548() { |
| 279 var o = new core.List<api.HardwareStatus>(); |
| 280 o.add(buildHardwareStatus()); |
| 281 o.add(buildHardwareStatus()); |
| 282 return o; |
| 283 } |
| 284 |
| 285 checkUnnamed1548(core.List<api.HardwareStatus> o) { |
| 286 unittest.expect(o, unittest.hasLength(2)); |
| 287 checkHardwareStatus(o[0]); |
| 288 checkHardwareStatus(o[1]); |
| 289 } |
| 290 |
| 291 buildUnnamed1549() { |
| 292 var o = new core.List<api.MemoryEvent>(); |
| 293 o.add(buildMemoryEvent()); |
| 294 o.add(buildMemoryEvent()); |
| 295 return o; |
| 296 } |
| 297 |
| 298 checkUnnamed1549(core.List<api.MemoryEvent> o) { |
| 299 unittest.expect(o, unittest.hasLength(2)); |
| 300 checkMemoryEvent(o[0]); |
| 301 checkMemoryEvent(o[1]); |
| 302 } |
| 303 |
| 304 buildUnnamed1550() { |
| 305 var o = new core.List<api.NonComplianceDetail>(); |
| 306 o.add(buildNonComplianceDetail()); |
| 307 o.add(buildNonComplianceDetail()); |
| 308 return o; |
| 309 } |
| 310 |
| 311 checkUnnamed1550(core.List<api.NonComplianceDetail> o) { |
| 312 unittest.expect(o, unittest.hasLength(2)); |
| 313 checkNonComplianceDetail(o[0]); |
| 314 checkNonComplianceDetail(o[1]); |
| 315 } |
| 316 |
| 317 buildUnnamed1551() { |
| 318 var o = new core.List<api.PowerManagementEvent>(); |
| 319 o.add(buildPowerManagementEvent()); |
| 320 o.add(buildPowerManagementEvent()); |
| 321 return o; |
| 322 } |
| 323 |
| 324 checkUnnamed1551(core.List<api.PowerManagementEvent> o) { |
| 325 unittest.expect(o, unittest.hasLength(2)); |
| 326 checkPowerManagementEvent(o[0]); |
| 327 checkPowerManagementEvent(o[1]); |
| 328 } |
| 329 |
| 330 buildUnnamed1552() { |
| 331 var o = new core.List<core.String>(); |
| 332 o.add("foo"); |
| 333 o.add("foo"); |
| 334 return o; |
| 335 } |
| 336 |
| 337 checkUnnamed1552(core.List<core.String> o) { |
| 338 unittest.expect(o, unittest.hasLength(2)); |
| 339 unittest.expect(o[0], unittest.equals('foo')); |
| 340 unittest.expect(o[1], unittest.equals('foo')); |
| 341 } |
| 342 |
| 343 core.int buildCounterDevice = 0; |
| 344 buildDevice() { |
| 345 var o = new api.Device(); |
| 346 buildCounterDevice++; |
| 347 if (buildCounterDevice < 3) { |
| 348 o.apiLevel = 42; |
| 349 o.appliedPolicyName = "foo"; |
| 350 o.appliedPolicyVersion = "foo"; |
| 351 o.appliedState = "foo"; |
| 352 o.disabledReason = buildUserFacingMessage(); |
| 353 o.displays = buildUnnamed1547(); |
| 354 o.enrollmentTime = "foo"; |
| 355 o.enrollmentTokenData = "foo"; |
| 356 o.enrollmentTokenName = "foo"; |
| 357 o.hardwareInfo = buildHardwareInfo(); |
| 358 o.hardwareStatusSamples = buildUnnamed1548(); |
| 359 o.lastPolicyComplianceReportTime = "foo"; |
| 360 o.lastPolicySyncTime = "foo"; |
| 361 o.lastStatusReportTime = "foo"; |
| 362 o.memoryEvents = buildUnnamed1549(); |
| 363 o.memoryInfo = buildMemoryInfo(); |
| 364 o.name = "foo"; |
| 365 o.networkInfo = buildNetworkInfo(); |
| 366 o.nonComplianceDetails = buildUnnamed1550(); |
| 367 o.policyCompliant = true; |
| 368 o.policyName = "foo"; |
| 369 o.powerManagementEvents = buildUnnamed1551(); |
| 370 o.previousDeviceNames = buildUnnamed1552(); |
| 371 o.softwareInfo = buildSoftwareInfo(); |
| 372 o.state = "foo"; |
| 373 o.userName = "foo"; |
| 374 } |
| 375 buildCounterDevice--; |
| 376 return o; |
| 377 } |
| 378 |
| 379 checkDevice(api.Device o) { |
| 380 buildCounterDevice++; |
| 381 if (buildCounterDevice < 3) { |
| 382 unittest.expect(o.apiLevel, unittest.equals(42)); |
| 383 unittest.expect(o.appliedPolicyName, unittest.equals('foo')); |
| 384 unittest.expect(o.appliedPolicyVersion, unittest.equals('foo')); |
| 385 unittest.expect(o.appliedState, unittest.equals('foo')); |
| 386 checkUserFacingMessage(o.disabledReason); |
| 387 checkUnnamed1547(o.displays); |
| 388 unittest.expect(o.enrollmentTime, unittest.equals('foo')); |
| 389 unittest.expect(o.enrollmentTokenData, unittest.equals('foo')); |
| 390 unittest.expect(o.enrollmentTokenName, unittest.equals('foo')); |
| 391 checkHardwareInfo(o.hardwareInfo); |
| 392 checkUnnamed1548(o.hardwareStatusSamples); |
| 393 unittest.expect(o.lastPolicyComplianceReportTime, unittest.equals('foo')); |
| 394 unittest.expect(o.lastPolicySyncTime, unittest.equals('foo')); |
| 395 unittest.expect(o.lastStatusReportTime, unittest.equals('foo')); |
| 396 checkUnnamed1549(o.memoryEvents); |
| 397 checkMemoryInfo(o.memoryInfo); |
| 398 unittest.expect(o.name, unittest.equals('foo')); |
| 399 checkNetworkInfo(o.networkInfo); |
| 400 checkUnnamed1550(o.nonComplianceDetails); |
| 401 unittest.expect(o.policyCompliant, unittest.isTrue); |
| 402 unittest.expect(o.policyName, unittest.equals('foo')); |
| 403 checkUnnamed1551(o.powerManagementEvents); |
| 404 checkUnnamed1552(o.previousDeviceNames); |
| 405 checkSoftwareInfo(o.softwareInfo); |
| 406 unittest.expect(o.state, unittest.equals('foo')); |
| 407 unittest.expect(o.userName, unittest.equals('foo')); |
| 408 } |
| 409 buildCounterDevice--; |
| 410 } |
| 411 |
| 412 core.int buildCounterDisplay = 0; |
| 413 buildDisplay() { |
| 414 var o = new api.Display(); |
| 415 buildCounterDisplay++; |
| 416 if (buildCounterDisplay < 3) { |
| 417 o.density = 42; |
| 418 o.displayId = 42; |
| 419 o.height = 42; |
| 420 o.name = "foo"; |
| 421 o.refreshRate = 42; |
| 422 o.state = "foo"; |
| 423 o.width = 42; |
| 424 } |
| 425 buildCounterDisplay--; |
| 426 return o; |
| 427 } |
| 428 |
| 429 checkDisplay(api.Display o) { |
| 430 buildCounterDisplay++; |
| 431 if (buildCounterDisplay < 3) { |
| 432 unittest.expect(o.density, unittest.equals(42)); |
| 433 unittest.expect(o.displayId, unittest.equals(42)); |
| 434 unittest.expect(o.height, unittest.equals(42)); |
| 435 unittest.expect(o.name, unittest.equals('foo')); |
| 436 unittest.expect(o.refreshRate, unittest.equals(42)); |
| 437 unittest.expect(o.state, unittest.equals('foo')); |
| 438 unittest.expect(o.width, unittest.equals(42)); |
| 439 } |
| 440 buildCounterDisplay--; |
| 441 } |
| 442 |
| 443 core.int buildCounterEmpty = 0; |
| 444 buildEmpty() { |
| 445 var o = new api.Empty(); |
| 446 buildCounterEmpty++; |
| 447 if (buildCounterEmpty < 3) { |
| 448 } |
| 449 buildCounterEmpty--; |
| 450 return o; |
| 451 } |
| 452 |
| 453 checkEmpty(api.Empty o) { |
| 454 buildCounterEmpty++; |
| 455 if (buildCounterEmpty < 3) { |
| 456 } |
| 457 buildCounterEmpty--; |
| 458 } |
| 459 |
| 460 core.int buildCounterEnrollmentToken = 0; |
| 461 buildEnrollmentToken() { |
| 462 var o = new api.EnrollmentToken(); |
| 463 buildCounterEnrollmentToken++; |
| 464 if (buildCounterEnrollmentToken < 3) { |
| 465 o.additionalData = "foo"; |
| 466 o.duration = "foo"; |
| 467 o.expirationTimestamp = "foo"; |
| 468 o.name = "foo"; |
| 469 o.policyName = "foo"; |
| 470 o.qrCode = "foo"; |
| 471 o.value = "foo"; |
| 472 } |
| 473 buildCounterEnrollmentToken--; |
| 474 return o; |
| 475 } |
| 476 |
| 477 checkEnrollmentToken(api.EnrollmentToken o) { |
| 478 buildCounterEnrollmentToken++; |
| 479 if (buildCounterEnrollmentToken < 3) { |
| 480 unittest.expect(o.additionalData, unittest.equals('foo')); |
| 481 unittest.expect(o.duration, unittest.equals('foo')); |
| 482 unittest.expect(o.expirationTimestamp, unittest.equals('foo')); |
| 483 unittest.expect(o.name, unittest.equals('foo')); |
| 484 unittest.expect(o.policyName, unittest.equals('foo')); |
| 485 unittest.expect(o.qrCode, unittest.equals('foo')); |
| 486 unittest.expect(o.value, unittest.equals('foo')); |
| 487 } |
| 488 buildCounterEnrollmentToken--; |
| 489 } |
| 490 |
| 491 buildUnnamed1553() { |
| 492 var o = new core.List<core.String>(); |
| 493 o.add("foo"); |
| 494 o.add("foo"); |
| 495 return o; |
| 496 } |
| 497 |
| 498 checkUnnamed1553(core.List<core.String> o) { |
| 499 unittest.expect(o, unittest.hasLength(2)); |
| 500 unittest.expect(o[0], unittest.equals('foo')); |
| 501 unittest.expect(o[1], unittest.equals('foo')); |
| 502 } |
| 503 |
| 504 core.int buildCounterEnterprise = 0; |
| 505 buildEnterprise() { |
| 506 var o = new api.Enterprise(); |
| 507 buildCounterEnterprise++; |
| 508 if (buildCounterEnterprise < 3) { |
| 509 o.appAutoApprovalEnabled = true; |
| 510 o.enabledNotificationTypes = buildUnnamed1553(); |
| 511 o.enterpriseDisplayName = "foo"; |
| 512 o.logo = buildExternalData(); |
| 513 o.name = "foo"; |
| 514 o.primaryColor = 42; |
| 515 o.pubsubTopic = "foo"; |
| 516 } |
| 517 buildCounterEnterprise--; |
| 518 return o; |
| 519 } |
| 520 |
| 521 checkEnterprise(api.Enterprise o) { |
| 522 buildCounterEnterprise++; |
| 523 if (buildCounterEnterprise < 3) { |
| 524 unittest.expect(o.appAutoApprovalEnabled, unittest.isTrue); |
| 525 checkUnnamed1553(o.enabledNotificationTypes); |
| 526 unittest.expect(o.enterpriseDisplayName, unittest.equals('foo')); |
| 527 checkExternalData(o.logo); |
| 528 unittest.expect(o.name, unittest.equals('foo')); |
| 529 unittest.expect(o.primaryColor, unittest.equals(42)); |
| 530 unittest.expect(o.pubsubTopic, unittest.equals('foo')); |
| 531 } |
| 532 buildCounterEnterprise--; |
| 533 } |
| 534 |
| 535 core.int buildCounterExternalData = 0; |
| 536 buildExternalData() { |
| 537 var o = new api.ExternalData(); |
| 538 buildCounterExternalData++; |
| 539 if (buildCounterExternalData < 3) { |
| 540 o.sha256Hash = "foo"; |
| 541 o.url = "foo"; |
| 542 } |
| 543 buildCounterExternalData--; |
| 544 return o; |
| 545 } |
| 546 |
| 547 checkExternalData(api.ExternalData o) { |
| 548 buildCounterExternalData++; |
| 549 if (buildCounterExternalData < 3) { |
| 550 unittest.expect(o.sha256Hash, unittest.equals('foo')); |
| 551 unittest.expect(o.url, unittest.equals('foo')); |
| 552 } |
| 553 buildCounterExternalData--; |
| 554 } |
| 555 |
| 556 buildUnnamed1554() { |
| 557 var o = new core.List<core.double>(); |
| 558 o.add(42.0); |
| 559 o.add(42.0); |
| 560 return o; |
| 561 } |
| 562 |
| 563 checkUnnamed1554(core.List<core.double> o) { |
| 564 unittest.expect(o, unittest.hasLength(2)); |
| 565 unittest.expect(o[0], unittest.equals(42.0)); |
| 566 unittest.expect(o[1], unittest.equals(42.0)); |
| 567 } |
| 568 |
| 569 buildUnnamed1555() { |
| 570 var o = new core.List<core.double>(); |
| 571 o.add(42.0); |
| 572 o.add(42.0); |
| 573 return o; |
| 574 } |
| 575 |
| 576 checkUnnamed1555(core.List<core.double> o) { |
| 577 unittest.expect(o, unittest.hasLength(2)); |
| 578 unittest.expect(o[0], unittest.equals(42.0)); |
| 579 unittest.expect(o[1], unittest.equals(42.0)); |
| 580 } |
| 581 |
| 582 buildUnnamed1556() { |
| 583 var o = new core.List<core.double>(); |
| 584 o.add(42.0); |
| 585 o.add(42.0); |
| 586 return o; |
| 587 } |
| 588 |
| 589 checkUnnamed1556(core.List<core.double> o) { |
| 590 unittest.expect(o, unittest.hasLength(2)); |
| 591 unittest.expect(o[0], unittest.equals(42.0)); |
| 592 unittest.expect(o[1], unittest.equals(42.0)); |
| 593 } |
| 594 |
| 595 buildUnnamed1557() { |
| 596 var o = new core.List<core.double>(); |
| 597 o.add(42.0); |
| 598 o.add(42.0); |
| 599 return o; |
| 600 } |
| 601 |
| 602 checkUnnamed1557(core.List<core.double> o) { |
| 603 unittest.expect(o, unittest.hasLength(2)); |
| 604 unittest.expect(o[0], unittest.equals(42.0)); |
| 605 unittest.expect(o[1], unittest.equals(42.0)); |
| 606 } |
| 607 |
| 608 buildUnnamed1558() { |
| 609 var o = new core.List<core.double>(); |
| 610 o.add(42.0); |
| 611 o.add(42.0); |
| 612 return o; |
| 613 } |
| 614 |
| 615 checkUnnamed1558(core.List<core.double> o) { |
| 616 unittest.expect(o, unittest.hasLength(2)); |
| 617 unittest.expect(o[0], unittest.equals(42.0)); |
| 618 unittest.expect(o[1], unittest.equals(42.0)); |
| 619 } |
| 620 |
| 621 buildUnnamed1559() { |
| 622 var o = new core.List<core.double>(); |
| 623 o.add(42.0); |
| 624 o.add(42.0); |
| 625 return o; |
| 626 } |
| 627 |
| 628 checkUnnamed1559(core.List<core.double> o) { |
| 629 unittest.expect(o, unittest.hasLength(2)); |
| 630 unittest.expect(o[0], unittest.equals(42.0)); |
| 631 unittest.expect(o[1], unittest.equals(42.0)); |
| 632 } |
| 633 |
| 634 buildUnnamed1560() { |
| 635 var o = new core.List<core.double>(); |
| 636 o.add(42.0); |
| 637 o.add(42.0); |
| 638 return o; |
| 639 } |
| 640 |
| 641 checkUnnamed1560(core.List<core.double> o) { |
| 642 unittest.expect(o, unittest.hasLength(2)); |
| 643 unittest.expect(o[0], unittest.equals(42.0)); |
| 644 unittest.expect(o[1], unittest.equals(42.0)); |
| 645 } |
| 646 |
| 647 buildUnnamed1561() { |
| 648 var o = new core.List<core.double>(); |
| 649 o.add(42.0); |
| 650 o.add(42.0); |
| 651 return o; |
| 652 } |
| 653 |
| 654 checkUnnamed1561(core.List<core.double> o) { |
| 655 unittest.expect(o, unittest.hasLength(2)); |
| 656 unittest.expect(o[0], unittest.equals(42.0)); |
| 657 unittest.expect(o[1], unittest.equals(42.0)); |
| 658 } |
| 659 |
| 660 core.int buildCounterHardwareInfo = 0; |
| 661 buildHardwareInfo() { |
| 662 var o = new api.HardwareInfo(); |
| 663 buildCounterHardwareInfo++; |
| 664 if (buildCounterHardwareInfo < 3) { |
| 665 o.batteryShutdownTemperatures = buildUnnamed1554(); |
| 666 o.batteryThrottlingTemperatures = buildUnnamed1555(); |
| 667 o.brand = "foo"; |
| 668 o.cpuShutdownTemperatures = buildUnnamed1556(); |
| 669 o.cpuThrottlingTemperatures = buildUnnamed1557(); |
| 670 o.deviceBasebandVersion = "foo"; |
| 671 o.gpuShutdownTemperatures = buildUnnamed1558(); |
| 672 o.gpuThrottlingTemperatures = buildUnnamed1559(); |
| 673 o.hardware = "foo"; |
| 674 o.manufacturer = "foo"; |
| 675 o.model = "foo"; |
| 676 o.serialNumber = "foo"; |
| 677 o.skinShutdownTemperatures = buildUnnamed1560(); |
| 678 o.skinThrottlingTemperatures = buildUnnamed1561(); |
| 679 } |
| 680 buildCounterHardwareInfo--; |
| 681 return o; |
| 682 } |
| 683 |
| 684 checkHardwareInfo(api.HardwareInfo o) { |
| 685 buildCounterHardwareInfo++; |
| 686 if (buildCounterHardwareInfo < 3) { |
| 687 checkUnnamed1554(o.batteryShutdownTemperatures); |
| 688 checkUnnamed1555(o.batteryThrottlingTemperatures); |
| 689 unittest.expect(o.brand, unittest.equals('foo')); |
| 690 checkUnnamed1556(o.cpuShutdownTemperatures); |
| 691 checkUnnamed1557(o.cpuThrottlingTemperatures); |
| 692 unittest.expect(o.deviceBasebandVersion, unittest.equals('foo')); |
| 693 checkUnnamed1558(o.gpuShutdownTemperatures); |
| 694 checkUnnamed1559(o.gpuThrottlingTemperatures); |
| 695 unittest.expect(o.hardware, unittest.equals('foo')); |
| 696 unittest.expect(o.manufacturer, unittest.equals('foo')); |
| 697 unittest.expect(o.model, unittest.equals('foo')); |
| 698 unittest.expect(o.serialNumber, unittest.equals('foo')); |
| 699 checkUnnamed1560(o.skinShutdownTemperatures); |
| 700 checkUnnamed1561(o.skinThrottlingTemperatures); |
| 701 } |
| 702 buildCounterHardwareInfo--; |
| 703 } |
| 704 |
| 705 buildUnnamed1562() { |
| 706 var o = new core.List<core.double>(); |
| 707 o.add(42.0); |
| 708 o.add(42.0); |
| 709 return o; |
| 710 } |
| 711 |
| 712 checkUnnamed1562(core.List<core.double> o) { |
| 713 unittest.expect(o, unittest.hasLength(2)); |
| 714 unittest.expect(o[0], unittest.equals(42.0)); |
| 715 unittest.expect(o[1], unittest.equals(42.0)); |
| 716 } |
| 717 |
| 718 buildUnnamed1563() { |
| 719 var o = new core.List<core.double>(); |
| 720 o.add(42.0); |
| 721 o.add(42.0); |
| 722 return o; |
| 723 } |
| 724 |
| 725 checkUnnamed1563(core.List<core.double> o) { |
| 726 unittest.expect(o, unittest.hasLength(2)); |
| 727 unittest.expect(o[0], unittest.equals(42.0)); |
| 728 unittest.expect(o[1], unittest.equals(42.0)); |
| 729 } |
| 730 |
| 731 buildUnnamed1564() { |
| 732 var o = new core.List<core.double>(); |
| 733 o.add(42.0); |
| 734 o.add(42.0); |
| 735 return o; |
| 736 } |
| 737 |
| 738 checkUnnamed1564(core.List<core.double> o) { |
| 739 unittest.expect(o, unittest.hasLength(2)); |
| 740 unittest.expect(o[0], unittest.equals(42.0)); |
| 741 unittest.expect(o[1], unittest.equals(42.0)); |
| 742 } |
| 743 |
| 744 buildUnnamed1565() { |
| 745 var o = new core.List<core.double>(); |
| 746 o.add(42.0); |
| 747 o.add(42.0); |
| 748 return o; |
| 749 } |
| 750 |
| 751 checkUnnamed1565(core.List<core.double> o) { |
| 752 unittest.expect(o, unittest.hasLength(2)); |
| 753 unittest.expect(o[0], unittest.equals(42.0)); |
| 754 unittest.expect(o[1], unittest.equals(42.0)); |
| 755 } |
| 756 |
| 757 buildUnnamed1566() { |
| 758 var o = new core.List<core.double>(); |
| 759 o.add(42.0); |
| 760 o.add(42.0); |
| 761 return o; |
| 762 } |
| 763 |
| 764 checkUnnamed1566(core.List<core.double> o) { |
| 765 unittest.expect(o, unittest.hasLength(2)); |
| 766 unittest.expect(o[0], unittest.equals(42.0)); |
| 767 unittest.expect(o[1], unittest.equals(42.0)); |
| 768 } |
| 769 |
| 770 buildUnnamed1567() { |
| 771 var o = new core.List<core.double>(); |
| 772 o.add(42.0); |
| 773 o.add(42.0); |
| 774 return o; |
| 775 } |
| 776 |
| 777 checkUnnamed1567(core.List<core.double> o) { |
| 778 unittest.expect(o, unittest.hasLength(2)); |
| 779 unittest.expect(o[0], unittest.equals(42.0)); |
| 780 unittest.expect(o[1], unittest.equals(42.0)); |
| 781 } |
| 782 |
| 783 core.int buildCounterHardwareStatus = 0; |
| 784 buildHardwareStatus() { |
| 785 var o = new api.HardwareStatus(); |
| 786 buildCounterHardwareStatus++; |
| 787 if (buildCounterHardwareStatus < 3) { |
| 788 o.batteryTemperatures = buildUnnamed1562(); |
| 789 o.cpuTemperatures = buildUnnamed1563(); |
| 790 o.cpuUsages = buildUnnamed1564(); |
| 791 o.createTime = "foo"; |
| 792 o.fanSpeeds = buildUnnamed1565(); |
| 793 o.gpuTemperatures = buildUnnamed1566(); |
| 794 o.skinTemperatures = buildUnnamed1567(); |
| 795 } |
| 796 buildCounterHardwareStatus--; |
| 797 return o; |
| 798 } |
| 799 |
| 800 checkHardwareStatus(api.HardwareStatus o) { |
| 801 buildCounterHardwareStatus++; |
| 802 if (buildCounterHardwareStatus < 3) { |
| 803 checkUnnamed1562(o.batteryTemperatures); |
| 804 checkUnnamed1563(o.cpuTemperatures); |
| 805 checkUnnamed1564(o.cpuUsages); |
| 806 unittest.expect(o.createTime, unittest.equals('foo')); |
| 807 checkUnnamed1565(o.fanSpeeds); |
| 808 checkUnnamed1566(o.gpuTemperatures); |
| 809 checkUnnamed1567(o.skinTemperatures); |
| 810 } |
| 811 buildCounterHardwareStatus--; |
| 812 } |
| 813 |
| 814 buildUnnamed1568() { |
| 815 var o = new core.List<api.Device>(); |
| 816 o.add(buildDevice()); |
| 817 o.add(buildDevice()); |
| 818 return o; |
| 819 } |
| 820 |
| 821 checkUnnamed1568(core.List<api.Device> o) { |
| 822 unittest.expect(o, unittest.hasLength(2)); |
| 823 checkDevice(o[0]); |
| 824 checkDevice(o[1]); |
| 825 } |
| 826 |
| 827 core.int buildCounterListDevicesResponse = 0; |
| 828 buildListDevicesResponse() { |
| 829 var o = new api.ListDevicesResponse(); |
| 830 buildCounterListDevicesResponse++; |
| 831 if (buildCounterListDevicesResponse < 3) { |
| 832 o.devices = buildUnnamed1568(); |
| 833 o.nextPageToken = "foo"; |
| 834 } |
| 835 buildCounterListDevicesResponse--; |
| 836 return o; |
| 837 } |
| 838 |
| 839 checkListDevicesResponse(api.ListDevicesResponse o) { |
| 840 buildCounterListDevicesResponse++; |
| 841 if (buildCounterListDevicesResponse < 3) { |
| 842 checkUnnamed1568(o.devices); |
| 843 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 844 } |
| 845 buildCounterListDevicesResponse--; |
| 846 } |
| 847 |
| 848 buildUnnamed1569() { |
| 849 var o = new core.List<api.Operation>(); |
| 850 o.add(buildOperation()); |
| 851 o.add(buildOperation()); |
| 852 return o; |
| 853 } |
| 854 |
| 855 checkUnnamed1569(core.List<api.Operation> o) { |
| 856 unittest.expect(o, unittest.hasLength(2)); |
| 857 checkOperation(o[0]); |
| 858 checkOperation(o[1]); |
| 859 } |
| 860 |
| 861 core.int buildCounterListOperationsResponse = 0; |
| 862 buildListOperationsResponse() { |
| 863 var o = new api.ListOperationsResponse(); |
| 864 buildCounterListOperationsResponse++; |
| 865 if (buildCounterListOperationsResponse < 3) { |
| 866 o.nextPageToken = "foo"; |
| 867 o.operations = buildUnnamed1569(); |
| 868 } |
| 869 buildCounterListOperationsResponse--; |
| 870 return o; |
| 871 } |
| 872 |
| 873 checkListOperationsResponse(api.ListOperationsResponse o) { |
| 874 buildCounterListOperationsResponse++; |
| 875 if (buildCounterListOperationsResponse < 3) { |
| 876 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 877 checkUnnamed1569(o.operations); |
| 878 } |
| 879 buildCounterListOperationsResponse--; |
| 880 } |
| 881 |
| 882 buildUnnamed1570() { |
| 883 var o = new core.List<api.Policy>(); |
| 884 o.add(buildPolicy()); |
| 885 o.add(buildPolicy()); |
| 886 return o; |
| 887 } |
| 888 |
| 889 checkUnnamed1570(core.List<api.Policy> o) { |
| 890 unittest.expect(o, unittest.hasLength(2)); |
| 891 checkPolicy(o[0]); |
| 892 checkPolicy(o[1]); |
| 893 } |
| 894 |
| 895 core.int buildCounterListPoliciesResponse = 0; |
| 896 buildListPoliciesResponse() { |
| 897 var o = new api.ListPoliciesResponse(); |
| 898 buildCounterListPoliciesResponse++; |
| 899 if (buildCounterListPoliciesResponse < 3) { |
| 900 o.nextPageToken = "foo"; |
| 901 o.policies = buildUnnamed1570(); |
| 902 } |
| 903 buildCounterListPoliciesResponse--; |
| 904 return o; |
| 905 } |
| 906 |
| 907 checkListPoliciesResponse(api.ListPoliciesResponse o) { |
| 908 buildCounterListPoliciesResponse++; |
| 909 if (buildCounterListPoliciesResponse < 3) { |
| 910 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 911 checkUnnamed1570(o.policies); |
| 912 } |
| 913 buildCounterListPoliciesResponse--; |
| 914 } |
| 915 |
| 916 buildUnnamed1571() { |
| 917 var o = new core.List<api.ManagedPropertyEntry>(); |
| 918 o.add(buildManagedPropertyEntry()); |
| 919 o.add(buildManagedPropertyEntry()); |
| 920 return o; |
| 921 } |
| 922 |
| 923 checkUnnamed1571(core.List<api.ManagedPropertyEntry> o) { |
| 924 unittest.expect(o, unittest.hasLength(2)); |
| 925 checkManagedPropertyEntry(o[0]); |
| 926 checkManagedPropertyEntry(o[1]); |
| 927 } |
| 928 |
| 929 buildUnnamed1572() { |
| 930 var o = new core.List<api.ManagedProperty>(); |
| 931 o.add(buildManagedProperty()); |
| 932 o.add(buildManagedProperty()); |
| 933 return o; |
| 934 } |
| 935 |
| 936 checkUnnamed1572(core.List<api.ManagedProperty> o) { |
| 937 unittest.expect(o, unittest.hasLength(2)); |
| 938 checkManagedProperty(o[0]); |
| 939 checkManagedProperty(o[1]); |
| 940 } |
| 941 |
| 942 core.int buildCounterManagedProperty = 0; |
| 943 buildManagedProperty() { |
| 944 var o = new api.ManagedProperty(); |
| 945 buildCounterManagedProperty++; |
| 946 if (buildCounterManagedProperty < 3) { |
| 947 o.defaultValue = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 948 o.description = "foo"; |
| 949 o.entries = buildUnnamed1571(); |
| 950 o.key = "foo"; |
| 951 o.nestedProperties = buildUnnamed1572(); |
| 952 o.title = "foo"; |
| 953 o.type = "foo"; |
| 954 } |
| 955 buildCounterManagedProperty--; |
| 956 return o; |
| 957 } |
| 958 |
| 959 checkManagedProperty(api.ManagedProperty o) { |
| 960 buildCounterManagedProperty++; |
| 961 if (buildCounterManagedProperty < 3) { |
| 962 var casted3 = (o.defaultValue) as core.Map; unittest.expect(casted3, unittes
t.hasLength(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); u
nittest.expect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3[
"string"], unittest.equals('foo')); |
| 963 unittest.expect(o.description, unittest.equals('foo')); |
| 964 checkUnnamed1571(o.entries); |
| 965 unittest.expect(o.key, unittest.equals('foo')); |
| 966 checkUnnamed1572(o.nestedProperties); |
| 967 unittest.expect(o.title, unittest.equals('foo')); |
| 968 unittest.expect(o.type, unittest.equals('foo')); |
| 969 } |
| 970 buildCounterManagedProperty--; |
| 971 } |
| 972 |
| 973 core.int buildCounterManagedPropertyEntry = 0; |
| 974 buildManagedPropertyEntry() { |
| 975 var o = new api.ManagedPropertyEntry(); |
| 976 buildCounterManagedPropertyEntry++; |
| 977 if (buildCounterManagedPropertyEntry < 3) { |
| 978 o.name = "foo"; |
| 979 o.value = "foo"; |
| 980 } |
| 981 buildCounterManagedPropertyEntry--; |
| 982 return o; |
| 983 } |
| 984 |
| 985 checkManagedPropertyEntry(api.ManagedPropertyEntry o) { |
| 986 buildCounterManagedPropertyEntry++; |
| 987 if (buildCounterManagedPropertyEntry < 3) { |
| 988 unittest.expect(o.name, unittest.equals('foo')); |
| 989 unittest.expect(o.value, unittest.equals('foo')); |
| 990 } |
| 991 buildCounterManagedPropertyEntry--; |
| 992 } |
| 993 |
| 994 core.int buildCounterMemoryEvent = 0; |
| 995 buildMemoryEvent() { |
| 996 var o = new api.MemoryEvent(); |
| 997 buildCounterMemoryEvent++; |
| 998 if (buildCounterMemoryEvent < 3) { |
| 999 o.byteCount = "foo"; |
| 1000 o.createTime = "foo"; |
| 1001 o.eventType = "foo"; |
| 1002 } |
| 1003 buildCounterMemoryEvent--; |
| 1004 return o; |
| 1005 } |
| 1006 |
| 1007 checkMemoryEvent(api.MemoryEvent o) { |
| 1008 buildCounterMemoryEvent++; |
| 1009 if (buildCounterMemoryEvent < 3) { |
| 1010 unittest.expect(o.byteCount, unittest.equals('foo')); |
| 1011 unittest.expect(o.createTime, unittest.equals('foo')); |
| 1012 unittest.expect(o.eventType, unittest.equals('foo')); |
| 1013 } |
| 1014 buildCounterMemoryEvent--; |
| 1015 } |
| 1016 |
| 1017 core.int buildCounterMemoryInfo = 0; |
| 1018 buildMemoryInfo() { |
| 1019 var o = new api.MemoryInfo(); |
| 1020 buildCounterMemoryInfo++; |
| 1021 if (buildCounterMemoryInfo < 3) { |
| 1022 o.totalInternalStorage = "foo"; |
| 1023 o.totalRam = "foo"; |
| 1024 } |
| 1025 buildCounterMemoryInfo--; |
| 1026 return o; |
| 1027 } |
| 1028 |
| 1029 checkMemoryInfo(api.MemoryInfo o) { |
| 1030 buildCounterMemoryInfo++; |
| 1031 if (buildCounterMemoryInfo < 3) { |
| 1032 unittest.expect(o.totalInternalStorage, unittest.equals('foo')); |
| 1033 unittest.expect(o.totalRam, unittest.equals('foo')); |
| 1034 } |
| 1035 buildCounterMemoryInfo--; |
| 1036 } |
| 1037 |
| 1038 core.int buildCounterNetworkInfo = 0; |
| 1039 buildNetworkInfo() { |
| 1040 var o = new api.NetworkInfo(); |
| 1041 buildCounterNetworkInfo++; |
| 1042 if (buildCounterNetworkInfo < 3) { |
| 1043 o.imei = "foo"; |
| 1044 o.meid = "foo"; |
| 1045 o.wifiMacAddress = "foo"; |
| 1046 } |
| 1047 buildCounterNetworkInfo--; |
| 1048 return o; |
| 1049 } |
| 1050 |
| 1051 checkNetworkInfo(api.NetworkInfo o) { |
| 1052 buildCounterNetworkInfo++; |
| 1053 if (buildCounterNetworkInfo < 3) { |
| 1054 unittest.expect(o.imei, unittest.equals('foo')); |
| 1055 unittest.expect(o.meid, unittest.equals('foo')); |
| 1056 unittest.expect(o.wifiMacAddress, unittest.equals('foo')); |
| 1057 } |
| 1058 buildCounterNetworkInfo--; |
| 1059 } |
| 1060 |
| 1061 core.int buildCounterNonComplianceDetail = 0; |
| 1062 buildNonComplianceDetail() { |
| 1063 var o = new api.NonComplianceDetail(); |
| 1064 buildCounterNonComplianceDetail++; |
| 1065 if (buildCounterNonComplianceDetail < 3) { |
| 1066 o.currentValue = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1067 o.fieldPath = "foo"; |
| 1068 o.installationFailureReason = "foo"; |
| 1069 o.nonComplianceReason = "foo"; |
| 1070 o.packageName = "foo"; |
| 1071 o.settingName = "foo"; |
| 1072 } |
| 1073 buildCounterNonComplianceDetail--; |
| 1074 return o; |
| 1075 } |
| 1076 |
| 1077 checkNonComplianceDetail(api.NonComplianceDetail o) { |
| 1078 buildCounterNonComplianceDetail++; |
| 1079 if (buildCounterNonComplianceDetail < 3) { |
| 1080 var casted4 = (o.currentValue) as core.Map; unittest.expect(casted4, unittes
t.hasLength(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); u
nittest.expect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4[
"string"], unittest.equals('foo')); |
| 1081 unittest.expect(o.fieldPath, unittest.equals('foo')); |
| 1082 unittest.expect(o.installationFailureReason, unittest.equals('foo')); |
| 1083 unittest.expect(o.nonComplianceReason, unittest.equals('foo')); |
| 1084 unittest.expect(o.packageName, unittest.equals('foo')); |
| 1085 unittest.expect(o.settingName, unittest.equals('foo')); |
| 1086 } |
| 1087 buildCounterNonComplianceDetail--; |
| 1088 } |
| 1089 |
| 1090 core.int buildCounterNonComplianceDetailCondition = 0; |
| 1091 buildNonComplianceDetailCondition() { |
| 1092 var o = new api.NonComplianceDetailCondition(); |
| 1093 buildCounterNonComplianceDetailCondition++; |
| 1094 if (buildCounterNonComplianceDetailCondition < 3) { |
| 1095 o.nonComplianceReason = "foo"; |
| 1096 o.packageName = "foo"; |
| 1097 o.settingName = "foo"; |
| 1098 } |
| 1099 buildCounterNonComplianceDetailCondition--; |
| 1100 return o; |
| 1101 } |
| 1102 |
| 1103 checkNonComplianceDetailCondition(api.NonComplianceDetailCondition o) { |
| 1104 buildCounterNonComplianceDetailCondition++; |
| 1105 if (buildCounterNonComplianceDetailCondition < 3) { |
| 1106 unittest.expect(o.nonComplianceReason, unittest.equals('foo')); |
| 1107 unittest.expect(o.packageName, unittest.equals('foo')); |
| 1108 unittest.expect(o.settingName, unittest.equals('foo')); |
| 1109 } |
| 1110 buildCounterNonComplianceDetailCondition--; |
| 1111 } |
| 1112 |
| 1113 buildUnnamed1573() { |
| 1114 var o = new core.Map<core.String, core.Object>(); |
| 1115 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1116 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1117 return o; |
| 1118 } |
| 1119 |
| 1120 checkUnnamed1573(core.Map<core.String, core.Object> o) { |
| 1121 unittest.expect(o, unittest.hasLength(2)); |
| 1122 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
| 1123 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
| 1124 } |
| 1125 |
| 1126 buildUnnamed1574() { |
| 1127 var o = new core.Map<core.String, core.Object>(); |
| 1128 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1129 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1130 return o; |
| 1131 } |
| 1132 |
| 1133 checkUnnamed1574(core.Map<core.String, core.Object> o) { |
| 1134 unittest.expect(o, unittest.hasLength(2)); |
| 1135 var casted7 = (o["x"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); |
| 1136 var casted8 = (o["y"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); |
| 1137 } |
| 1138 |
| 1139 core.int buildCounterOperation = 0; |
| 1140 buildOperation() { |
| 1141 var o = new api.Operation(); |
| 1142 buildCounterOperation++; |
| 1143 if (buildCounterOperation < 3) { |
| 1144 o.done = true; |
| 1145 o.error = buildStatus(); |
| 1146 o.metadata = buildUnnamed1573(); |
| 1147 o.name = "foo"; |
| 1148 o.response = buildUnnamed1574(); |
| 1149 } |
| 1150 buildCounterOperation--; |
| 1151 return o; |
| 1152 } |
| 1153 |
| 1154 checkOperation(api.Operation o) { |
| 1155 buildCounterOperation++; |
| 1156 if (buildCounterOperation < 3) { |
| 1157 unittest.expect(o.done, unittest.isTrue); |
| 1158 checkStatus(o.error); |
| 1159 checkUnnamed1573(o.metadata); |
| 1160 unittest.expect(o.name, unittest.equals('foo')); |
| 1161 checkUnnamed1574(o.response); |
| 1162 } |
| 1163 buildCounterOperation--; |
| 1164 } |
| 1165 |
| 1166 core.int buildCounterPasswordRequirements = 0; |
| 1167 buildPasswordRequirements() { |
| 1168 var o = new api.PasswordRequirements(); |
| 1169 buildCounterPasswordRequirements++; |
| 1170 if (buildCounterPasswordRequirements < 3) { |
| 1171 o.maximumFailedPasswordsForWipe = 42; |
| 1172 o.passwordExpirationTimeout = "foo"; |
| 1173 o.passwordHistoryLength = 42; |
| 1174 o.passwordMinimumLength = 42; |
| 1175 o.passwordMinimumLetters = 42; |
| 1176 o.passwordMinimumLowerCase = 42; |
| 1177 o.passwordMinimumNonLetter = 42; |
| 1178 o.passwordMinimumNumeric = 42; |
| 1179 o.passwordMinimumSymbols = 42; |
| 1180 o.passwordMinimumUpperCase = 42; |
| 1181 o.passwordQuality = "foo"; |
| 1182 } |
| 1183 buildCounterPasswordRequirements--; |
| 1184 return o; |
| 1185 } |
| 1186 |
| 1187 checkPasswordRequirements(api.PasswordRequirements o) { |
| 1188 buildCounterPasswordRequirements++; |
| 1189 if (buildCounterPasswordRequirements < 3) { |
| 1190 unittest.expect(o.maximumFailedPasswordsForWipe, unittest.equals(42)); |
| 1191 unittest.expect(o.passwordExpirationTimeout, unittest.equals('foo')); |
| 1192 unittest.expect(o.passwordHistoryLength, unittest.equals(42)); |
| 1193 unittest.expect(o.passwordMinimumLength, unittest.equals(42)); |
| 1194 unittest.expect(o.passwordMinimumLetters, unittest.equals(42)); |
| 1195 unittest.expect(o.passwordMinimumLowerCase, unittest.equals(42)); |
| 1196 unittest.expect(o.passwordMinimumNonLetter, unittest.equals(42)); |
| 1197 unittest.expect(o.passwordMinimumNumeric, unittest.equals(42)); |
| 1198 unittest.expect(o.passwordMinimumSymbols, unittest.equals(42)); |
| 1199 unittest.expect(o.passwordMinimumUpperCase, unittest.equals(42)); |
| 1200 unittest.expect(o.passwordQuality, unittest.equals('foo')); |
| 1201 } |
| 1202 buildCounterPasswordRequirements--; |
| 1203 } |
| 1204 |
| 1205 core.int buildCounterPermissionGrant = 0; |
| 1206 buildPermissionGrant() { |
| 1207 var o = new api.PermissionGrant(); |
| 1208 buildCounterPermissionGrant++; |
| 1209 if (buildCounterPermissionGrant < 3) { |
| 1210 o.permission = "foo"; |
| 1211 o.policy = "foo"; |
| 1212 } |
| 1213 buildCounterPermissionGrant--; |
| 1214 return o; |
| 1215 } |
| 1216 |
| 1217 checkPermissionGrant(api.PermissionGrant o) { |
| 1218 buildCounterPermissionGrant++; |
| 1219 if (buildCounterPermissionGrant < 3) { |
| 1220 unittest.expect(o.permission, unittest.equals('foo')); |
| 1221 unittest.expect(o.policy, unittest.equals('foo')); |
| 1222 } |
| 1223 buildCounterPermissionGrant--; |
| 1224 } |
| 1225 |
| 1226 buildUnnamed1575() { |
| 1227 var o = new core.List<core.String>(); |
| 1228 o.add("foo"); |
| 1229 o.add("foo"); |
| 1230 return o; |
| 1231 } |
| 1232 |
| 1233 checkUnnamed1575(core.List<core.String> o) { |
| 1234 unittest.expect(o, unittest.hasLength(2)); |
| 1235 unittest.expect(o[0], unittest.equals('foo')); |
| 1236 unittest.expect(o[1], unittest.equals('foo')); |
| 1237 } |
| 1238 |
| 1239 buildUnnamed1576() { |
| 1240 var o = new core.List<core.String>(); |
| 1241 o.add("foo"); |
| 1242 o.add("foo"); |
| 1243 return o; |
| 1244 } |
| 1245 |
| 1246 checkUnnamed1576(core.List<core.String> o) { |
| 1247 unittest.expect(o, unittest.hasLength(2)); |
| 1248 unittest.expect(o[0], unittest.equals('foo')); |
| 1249 unittest.expect(o[1], unittest.equals('foo')); |
| 1250 } |
| 1251 |
| 1252 core.int buildCounterPersistentPreferredActivity = 0; |
| 1253 buildPersistentPreferredActivity() { |
| 1254 var o = new api.PersistentPreferredActivity(); |
| 1255 buildCounterPersistentPreferredActivity++; |
| 1256 if (buildCounterPersistentPreferredActivity < 3) { |
| 1257 o.actions = buildUnnamed1575(); |
| 1258 o.categories = buildUnnamed1576(); |
| 1259 o.receiverActivity = "foo"; |
| 1260 } |
| 1261 buildCounterPersistentPreferredActivity--; |
| 1262 return o; |
| 1263 } |
| 1264 |
| 1265 checkPersistentPreferredActivity(api.PersistentPreferredActivity o) { |
| 1266 buildCounterPersistentPreferredActivity++; |
| 1267 if (buildCounterPersistentPreferredActivity < 3) { |
| 1268 checkUnnamed1575(o.actions); |
| 1269 checkUnnamed1576(o.categories); |
| 1270 unittest.expect(o.receiverActivity, unittest.equals('foo')); |
| 1271 } |
| 1272 buildCounterPersistentPreferredActivity--; |
| 1273 } |
| 1274 |
| 1275 buildUnnamed1577() { |
| 1276 var o = new core.List<api.ApplicationPolicy>(); |
| 1277 o.add(buildApplicationPolicy()); |
| 1278 o.add(buildApplicationPolicy()); |
| 1279 return o; |
| 1280 } |
| 1281 |
| 1282 checkUnnamed1577(core.List<api.ApplicationPolicy> o) { |
| 1283 unittest.expect(o, unittest.hasLength(2)); |
| 1284 checkApplicationPolicy(o[0]); |
| 1285 checkApplicationPolicy(o[1]); |
| 1286 } |
| 1287 |
| 1288 buildUnnamed1578() { |
| 1289 var o = new core.List<api.ComplianceRule>(); |
| 1290 o.add(buildComplianceRule()); |
| 1291 o.add(buildComplianceRule()); |
| 1292 return o; |
| 1293 } |
| 1294 |
| 1295 checkUnnamed1578(core.List<api.ComplianceRule> o) { |
| 1296 unittest.expect(o, unittest.hasLength(2)); |
| 1297 checkComplianceRule(o[0]); |
| 1298 checkComplianceRule(o[1]); |
| 1299 } |
| 1300 |
| 1301 buildUnnamed1579() { |
| 1302 var o = new core.List<core.String>(); |
| 1303 o.add("foo"); |
| 1304 o.add("foo"); |
| 1305 return o; |
| 1306 } |
| 1307 |
| 1308 checkUnnamed1579(core.List<core.String> o) { |
| 1309 unittest.expect(o, unittest.hasLength(2)); |
| 1310 unittest.expect(o[0], unittest.equals('foo')); |
| 1311 unittest.expect(o[1], unittest.equals('foo')); |
| 1312 } |
| 1313 |
| 1314 buildUnnamed1580() { |
| 1315 var o = new core.Map<core.String, core.Object>(); |
| 1316 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1317 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1318 return o; |
| 1319 } |
| 1320 |
| 1321 checkUnnamed1580(core.Map<core.String, core.Object> o) { |
| 1322 unittest.expect(o, unittest.hasLength(2)); |
| 1323 var casted9 = (o["x"]) as core.Map; unittest.expect(casted9, unittest.hasLengt
h(3)); unittest.expect(casted9["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted9["bool"], unittest.equals(true)); unittest.expect(casted9["string"],
unittest.equals('foo')); |
| 1324 var casted10 = (o["y"]) as core.Map; unittest.expect(casted10, unittest.hasLen
gth(3)); unittest.expect(casted10["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted10["bool"], unittest.equals(true)); unittest.expect(casted10["stri
ng"], unittest.equals('foo')); |
| 1325 } |
| 1326 |
| 1327 buildUnnamed1581() { |
| 1328 var o = new core.List<api.PersistentPreferredActivity>(); |
| 1329 o.add(buildPersistentPreferredActivity()); |
| 1330 o.add(buildPersistentPreferredActivity()); |
| 1331 return o; |
| 1332 } |
| 1333 |
| 1334 checkUnnamed1581(core.List<api.PersistentPreferredActivity> o) { |
| 1335 unittest.expect(o, unittest.hasLength(2)); |
| 1336 checkPersistentPreferredActivity(o[0]); |
| 1337 checkPersistentPreferredActivity(o[1]); |
| 1338 } |
| 1339 |
| 1340 buildUnnamed1582() { |
| 1341 var o = new core.List<core.String>(); |
| 1342 o.add("foo"); |
| 1343 o.add("foo"); |
| 1344 return o; |
| 1345 } |
| 1346 |
| 1347 checkUnnamed1582(core.List<core.String> o) { |
| 1348 unittest.expect(o, unittest.hasLength(2)); |
| 1349 unittest.expect(o[0], unittest.equals('foo')); |
| 1350 unittest.expect(o[1], unittest.equals('foo')); |
| 1351 } |
| 1352 |
| 1353 core.int buildCounterPolicy = 0; |
| 1354 buildPolicy() { |
| 1355 var o = new api.Policy(); |
| 1356 buildCounterPolicy++; |
| 1357 if (buildCounterPolicy < 3) { |
| 1358 o.addUserDisabled = true; |
| 1359 o.adjustVolumeDisabled = true; |
| 1360 o.applications = buildUnnamed1577(); |
| 1361 o.blockApplicationsEnabled = true; |
| 1362 o.cameraDisabled = true; |
| 1363 o.complianceRules = buildUnnamed1578(); |
| 1364 o.debuggingFeaturesAllowed = true; |
| 1365 o.defaultPermissionPolicy = "foo"; |
| 1366 o.factoryResetDisabled = true; |
| 1367 o.frpAdminEmails = buildUnnamed1579(); |
| 1368 o.installUnknownSourcesAllowed = true; |
| 1369 o.keyguardDisabled = true; |
| 1370 o.maximumTimeToLock = "foo"; |
| 1371 o.modifyAccountsDisabled = true; |
| 1372 o.name = "foo"; |
| 1373 o.networkEscapeHatchEnabled = true; |
| 1374 o.openNetworkConfiguration = buildUnnamed1580(); |
| 1375 o.passwordRequirements = buildPasswordRequirements(); |
| 1376 o.persistentPreferredActivities = buildUnnamed1581(); |
| 1377 o.removeUserDisabled = true; |
| 1378 o.safeBootDisabled = true; |
| 1379 o.screenCaptureDisabled = true; |
| 1380 o.statusBarDisabled = true; |
| 1381 o.statusReportingSettings = buildStatusReportingSettings(); |
| 1382 o.stayOnPluggedModes = buildUnnamed1582(); |
| 1383 o.systemUpdate = buildSystemUpdate(); |
| 1384 o.unmuteMicrophoneDisabled = true; |
| 1385 o.version = "foo"; |
| 1386 } |
| 1387 buildCounterPolicy--; |
| 1388 return o; |
| 1389 } |
| 1390 |
| 1391 checkPolicy(api.Policy o) { |
| 1392 buildCounterPolicy++; |
| 1393 if (buildCounterPolicy < 3) { |
| 1394 unittest.expect(o.addUserDisabled, unittest.isTrue); |
| 1395 unittest.expect(o.adjustVolumeDisabled, unittest.isTrue); |
| 1396 checkUnnamed1577(o.applications); |
| 1397 unittest.expect(o.blockApplicationsEnabled, unittest.isTrue); |
| 1398 unittest.expect(o.cameraDisabled, unittest.isTrue); |
| 1399 checkUnnamed1578(o.complianceRules); |
| 1400 unittest.expect(o.debuggingFeaturesAllowed, unittest.isTrue); |
| 1401 unittest.expect(o.defaultPermissionPolicy, unittest.equals('foo')); |
| 1402 unittest.expect(o.factoryResetDisabled, unittest.isTrue); |
| 1403 checkUnnamed1579(o.frpAdminEmails); |
| 1404 unittest.expect(o.installUnknownSourcesAllowed, unittest.isTrue); |
| 1405 unittest.expect(o.keyguardDisabled, unittest.isTrue); |
| 1406 unittest.expect(o.maximumTimeToLock, unittest.equals('foo')); |
| 1407 unittest.expect(o.modifyAccountsDisabled, unittest.isTrue); |
| 1408 unittest.expect(o.name, unittest.equals('foo')); |
| 1409 unittest.expect(o.networkEscapeHatchEnabled, unittest.isTrue); |
| 1410 checkUnnamed1580(o.openNetworkConfiguration); |
| 1411 checkPasswordRequirements(o.passwordRequirements); |
| 1412 checkUnnamed1581(o.persistentPreferredActivities); |
| 1413 unittest.expect(o.removeUserDisabled, unittest.isTrue); |
| 1414 unittest.expect(o.safeBootDisabled, unittest.isTrue); |
| 1415 unittest.expect(o.screenCaptureDisabled, unittest.isTrue); |
| 1416 unittest.expect(o.statusBarDisabled, unittest.isTrue); |
| 1417 checkStatusReportingSettings(o.statusReportingSettings); |
| 1418 checkUnnamed1582(o.stayOnPluggedModes); |
| 1419 checkSystemUpdate(o.systemUpdate); |
| 1420 unittest.expect(o.unmuteMicrophoneDisabled, unittest.isTrue); |
| 1421 unittest.expect(o.version, unittest.equals('foo')); |
| 1422 } |
| 1423 buildCounterPolicy--; |
| 1424 } |
| 1425 |
| 1426 core.int buildCounterPowerManagementEvent = 0; |
| 1427 buildPowerManagementEvent() { |
| 1428 var o = new api.PowerManagementEvent(); |
| 1429 buildCounterPowerManagementEvent++; |
| 1430 if (buildCounterPowerManagementEvent < 3) { |
| 1431 o.batteryLevel = 42.0; |
| 1432 o.createTime = "foo"; |
| 1433 o.eventType = "foo"; |
| 1434 } |
| 1435 buildCounterPowerManagementEvent--; |
| 1436 return o; |
| 1437 } |
| 1438 |
| 1439 checkPowerManagementEvent(api.PowerManagementEvent o) { |
| 1440 buildCounterPowerManagementEvent++; |
| 1441 if (buildCounterPowerManagementEvent < 3) { |
| 1442 unittest.expect(o.batteryLevel, unittest.equals(42.0)); |
| 1443 unittest.expect(o.createTime, unittest.equals('foo')); |
| 1444 unittest.expect(o.eventType, unittest.equals('foo')); |
| 1445 } |
| 1446 buildCounterPowerManagementEvent--; |
| 1447 } |
| 1448 |
| 1449 core.int buildCounterSignupUrl = 0; |
| 1450 buildSignupUrl() { |
| 1451 var o = new api.SignupUrl(); |
| 1452 buildCounterSignupUrl++; |
| 1453 if (buildCounterSignupUrl < 3) { |
| 1454 o.name = "foo"; |
| 1455 o.url = "foo"; |
| 1456 } |
| 1457 buildCounterSignupUrl--; |
| 1458 return o; |
| 1459 } |
| 1460 |
| 1461 checkSignupUrl(api.SignupUrl o) { |
| 1462 buildCounterSignupUrl++; |
| 1463 if (buildCounterSignupUrl < 3) { |
| 1464 unittest.expect(o.name, unittest.equals('foo')); |
| 1465 unittest.expect(o.url, unittest.equals('foo')); |
| 1466 } |
| 1467 buildCounterSignupUrl--; |
| 1468 } |
| 1469 |
| 1470 core.int buildCounterSoftwareInfo = 0; |
| 1471 buildSoftwareInfo() { |
| 1472 var o = new api.SoftwareInfo(); |
| 1473 buildCounterSoftwareInfo++; |
| 1474 if (buildCounterSoftwareInfo < 3) { |
| 1475 o.androidBuildNumber = "foo"; |
| 1476 o.androidBuildTime = "foo"; |
| 1477 o.androidVersion = "foo"; |
| 1478 o.bootloaderVersion = "foo"; |
| 1479 o.deviceKernelVersion = "foo"; |
| 1480 o.securityPatchLevel = "foo"; |
| 1481 } |
| 1482 buildCounterSoftwareInfo--; |
| 1483 return o; |
| 1484 } |
| 1485 |
| 1486 checkSoftwareInfo(api.SoftwareInfo o) { |
| 1487 buildCounterSoftwareInfo++; |
| 1488 if (buildCounterSoftwareInfo < 3) { |
| 1489 unittest.expect(o.androidBuildNumber, unittest.equals('foo')); |
| 1490 unittest.expect(o.androidBuildTime, unittest.equals('foo')); |
| 1491 unittest.expect(o.androidVersion, unittest.equals('foo')); |
| 1492 unittest.expect(o.bootloaderVersion, unittest.equals('foo')); |
| 1493 unittest.expect(o.deviceKernelVersion, unittest.equals('foo')); |
| 1494 unittest.expect(o.securityPatchLevel, unittest.equals('foo')); |
| 1495 } |
| 1496 buildCounterSoftwareInfo--; |
| 1497 } |
| 1498 |
| 1499 buildUnnamed1583() { |
| 1500 var o = new core.Map<core.String, core.Object>(); |
| 1501 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1502 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1503 return o; |
| 1504 } |
| 1505 |
| 1506 checkUnnamed1583(core.Map<core.String, core.Object> o) { |
| 1507 unittest.expect(o, unittest.hasLength(2)); |
| 1508 var casted11 = (o["x"]) as core.Map; unittest.expect(casted11, unittest.hasLen
gth(3)); unittest.expect(casted11["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted11["bool"], unittest.equals(true)); unittest.expect(casted11["stri
ng"], unittest.equals('foo')); |
| 1509 var casted12 = (o["y"]) as core.Map; unittest.expect(casted12, unittest.hasLen
gth(3)); unittest.expect(casted12["list"], unittest.equals([1, 2, 3])); unittest
.expect(casted12["bool"], unittest.equals(true)); unittest.expect(casted12["stri
ng"], unittest.equals('foo')); |
| 1510 } |
| 1511 |
| 1512 buildUnnamed1584() { |
| 1513 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 1514 o.add(buildUnnamed1583()); |
| 1515 o.add(buildUnnamed1583()); |
| 1516 return o; |
| 1517 } |
| 1518 |
| 1519 checkUnnamed1584(core.List<core.Map<core.String, core.Object>> o) { |
| 1520 unittest.expect(o, unittest.hasLength(2)); |
| 1521 checkUnnamed1583(o[0]); |
| 1522 checkUnnamed1583(o[1]); |
| 1523 } |
| 1524 |
| 1525 core.int buildCounterStatus = 0; |
| 1526 buildStatus() { |
| 1527 var o = new api.Status(); |
| 1528 buildCounterStatus++; |
| 1529 if (buildCounterStatus < 3) { |
| 1530 o.code = 42; |
| 1531 o.details = buildUnnamed1584(); |
| 1532 o.message = "foo"; |
| 1533 } |
| 1534 buildCounterStatus--; |
| 1535 return o; |
| 1536 } |
| 1537 |
| 1538 checkStatus(api.Status o) { |
| 1539 buildCounterStatus++; |
| 1540 if (buildCounterStatus < 3) { |
| 1541 unittest.expect(o.code, unittest.equals(42)); |
| 1542 checkUnnamed1584(o.details); |
| 1543 unittest.expect(o.message, unittest.equals('foo')); |
| 1544 } |
| 1545 buildCounterStatus--; |
| 1546 } |
| 1547 |
| 1548 core.int buildCounterStatusReportingSettings = 0; |
| 1549 buildStatusReportingSettings() { |
| 1550 var o = new api.StatusReportingSettings(); |
| 1551 buildCounterStatusReportingSettings++; |
| 1552 if (buildCounterStatusReportingSettings < 3) { |
| 1553 o.displayInfoEnabled = true; |
| 1554 o.hardwareStatusEnabled = true; |
| 1555 o.memoryInfoEnabled = true; |
| 1556 o.networkInfoEnabled = true; |
| 1557 o.powerManagementEventsEnabled = true; |
| 1558 o.softwareInfoEnabled = true; |
| 1559 } |
| 1560 buildCounterStatusReportingSettings--; |
| 1561 return o; |
| 1562 } |
| 1563 |
| 1564 checkStatusReportingSettings(api.StatusReportingSettings o) { |
| 1565 buildCounterStatusReportingSettings++; |
| 1566 if (buildCounterStatusReportingSettings < 3) { |
| 1567 unittest.expect(o.displayInfoEnabled, unittest.isTrue); |
| 1568 unittest.expect(o.hardwareStatusEnabled, unittest.isTrue); |
| 1569 unittest.expect(o.memoryInfoEnabled, unittest.isTrue); |
| 1570 unittest.expect(o.networkInfoEnabled, unittest.isTrue); |
| 1571 unittest.expect(o.powerManagementEventsEnabled, unittest.isTrue); |
| 1572 unittest.expect(o.softwareInfoEnabled, unittest.isTrue); |
| 1573 } |
| 1574 buildCounterStatusReportingSettings--; |
| 1575 } |
| 1576 |
| 1577 core.int buildCounterSystemUpdate = 0; |
| 1578 buildSystemUpdate() { |
| 1579 var o = new api.SystemUpdate(); |
| 1580 buildCounterSystemUpdate++; |
| 1581 if (buildCounterSystemUpdate < 3) { |
| 1582 o.endMinutes = 42; |
| 1583 o.startMinutes = 42; |
| 1584 o.type = "foo"; |
| 1585 } |
| 1586 buildCounterSystemUpdate--; |
| 1587 return o; |
| 1588 } |
| 1589 |
| 1590 checkSystemUpdate(api.SystemUpdate o) { |
| 1591 buildCounterSystemUpdate++; |
| 1592 if (buildCounterSystemUpdate < 3) { |
| 1593 unittest.expect(o.endMinutes, unittest.equals(42)); |
| 1594 unittest.expect(o.startMinutes, unittest.equals(42)); |
| 1595 unittest.expect(o.type, unittest.equals('foo')); |
| 1596 } |
| 1597 buildCounterSystemUpdate--; |
| 1598 } |
| 1599 |
| 1600 buildUnnamed1585() { |
| 1601 var o = new core.Map<core.String, core.String>(); |
| 1602 o["x"] = "foo"; |
| 1603 o["y"] = "foo"; |
| 1604 return o; |
| 1605 } |
| 1606 |
| 1607 checkUnnamed1585(core.Map<core.String, core.String> o) { |
| 1608 unittest.expect(o, unittest.hasLength(2)); |
| 1609 unittest.expect(o["x"], unittest.equals('foo')); |
| 1610 unittest.expect(o["y"], unittest.equals('foo')); |
| 1611 } |
| 1612 |
| 1613 core.int buildCounterUserFacingMessage = 0; |
| 1614 buildUserFacingMessage() { |
| 1615 var o = new api.UserFacingMessage(); |
| 1616 buildCounterUserFacingMessage++; |
| 1617 if (buildCounterUserFacingMessage < 3) { |
| 1618 o.defaultMessage = "foo"; |
| 1619 o.localizedMessages = buildUnnamed1585(); |
| 1620 } |
| 1621 buildCounterUserFacingMessage--; |
| 1622 return o; |
| 1623 } |
| 1624 |
| 1625 checkUserFacingMessage(api.UserFacingMessage o) { |
| 1626 buildCounterUserFacingMessage++; |
| 1627 if (buildCounterUserFacingMessage < 3) { |
| 1628 unittest.expect(o.defaultMessage, unittest.equals('foo')); |
| 1629 checkUnnamed1585(o.localizedMessages); |
| 1630 } |
| 1631 buildCounterUserFacingMessage--; |
| 1632 } |
| 1633 |
| 1634 buildUnnamed1586() { |
| 1635 var o = new core.List<core.String>(); |
| 1636 o.add("foo"); |
| 1637 o.add("foo"); |
| 1638 return o; |
| 1639 } |
| 1640 |
| 1641 checkUnnamed1586(core.List<core.String> o) { |
| 1642 unittest.expect(o, unittest.hasLength(2)); |
| 1643 unittest.expect(o[0], unittest.equals('foo')); |
| 1644 unittest.expect(o[1], unittest.equals('foo')); |
| 1645 } |
| 1646 |
| 1647 core.int buildCounterWebToken = 0; |
| 1648 buildWebToken() { |
| 1649 var o = new api.WebToken(); |
| 1650 buildCounterWebToken++; |
| 1651 if (buildCounterWebToken < 3) { |
| 1652 o.name = "foo"; |
| 1653 o.parentFrameUrl = "foo"; |
| 1654 o.permissions = buildUnnamed1586(); |
| 1655 o.value = "foo"; |
| 1656 } |
| 1657 buildCounterWebToken--; |
| 1658 return o; |
| 1659 } |
| 1660 |
| 1661 checkWebToken(api.WebToken o) { |
| 1662 buildCounterWebToken++; |
| 1663 if (buildCounterWebToken < 3) { |
| 1664 unittest.expect(o.name, unittest.equals('foo')); |
| 1665 unittest.expect(o.parentFrameUrl, unittest.equals('foo')); |
| 1666 checkUnnamed1586(o.permissions); |
| 1667 unittest.expect(o.value, unittest.equals('foo')); |
| 1668 } |
| 1669 buildCounterWebToken--; |
| 1670 } |
| 1671 |
| 1672 |
| 1673 main() { |
| 1674 unittest.group("obj-schema-ApiLevelCondition", () { |
| 1675 unittest.test("to-json--from-json", () { |
| 1676 var o = buildApiLevelCondition(); |
| 1677 var od = new api.ApiLevelCondition.fromJson(o.toJson()); |
| 1678 checkApiLevelCondition(od); |
| 1679 }); |
| 1680 }); |
| 1681 |
| 1682 |
| 1683 unittest.group("obj-schema-Application", () { |
| 1684 unittest.test("to-json--from-json", () { |
| 1685 var o = buildApplication(); |
| 1686 var od = new api.Application.fromJson(o.toJson()); |
| 1687 checkApplication(od); |
| 1688 }); |
| 1689 }); |
| 1690 |
| 1691 |
| 1692 unittest.group("obj-schema-ApplicationPermission", () { |
| 1693 unittest.test("to-json--from-json", () { |
| 1694 var o = buildApplicationPermission(); |
| 1695 var od = new api.ApplicationPermission.fromJson(o.toJson()); |
| 1696 checkApplicationPermission(od); |
| 1697 }); |
| 1698 }); |
| 1699 |
| 1700 |
| 1701 unittest.group("obj-schema-ApplicationPolicy", () { |
| 1702 unittest.test("to-json--from-json", () { |
| 1703 var o = buildApplicationPolicy(); |
| 1704 var od = new api.ApplicationPolicy.fromJson(o.toJson()); |
| 1705 checkApplicationPolicy(od); |
| 1706 }); |
| 1707 }); |
| 1708 |
| 1709 |
| 1710 unittest.group("obj-schema-Command", () { |
| 1711 unittest.test("to-json--from-json", () { |
| 1712 var o = buildCommand(); |
| 1713 var od = new api.Command.fromJson(o.toJson()); |
| 1714 checkCommand(od); |
| 1715 }); |
| 1716 }); |
| 1717 |
| 1718 |
| 1719 unittest.group("obj-schema-ComplianceRule", () { |
| 1720 unittest.test("to-json--from-json", () { |
| 1721 var o = buildComplianceRule(); |
| 1722 var od = new api.ComplianceRule.fromJson(o.toJson()); |
| 1723 checkComplianceRule(od); |
| 1724 }); |
| 1725 }); |
| 1726 |
| 1727 |
| 1728 unittest.group("obj-schema-Device", () { |
| 1729 unittest.test("to-json--from-json", () { |
| 1730 var o = buildDevice(); |
| 1731 var od = new api.Device.fromJson(o.toJson()); |
| 1732 checkDevice(od); |
| 1733 }); |
| 1734 }); |
| 1735 |
| 1736 |
| 1737 unittest.group("obj-schema-Display", () { |
| 1738 unittest.test("to-json--from-json", () { |
| 1739 var o = buildDisplay(); |
| 1740 var od = new api.Display.fromJson(o.toJson()); |
| 1741 checkDisplay(od); |
| 1742 }); |
| 1743 }); |
| 1744 |
| 1745 |
| 1746 unittest.group("obj-schema-Empty", () { |
| 1747 unittest.test("to-json--from-json", () { |
| 1748 var o = buildEmpty(); |
| 1749 var od = new api.Empty.fromJson(o.toJson()); |
| 1750 checkEmpty(od); |
| 1751 }); |
| 1752 }); |
| 1753 |
| 1754 |
| 1755 unittest.group("obj-schema-EnrollmentToken", () { |
| 1756 unittest.test("to-json--from-json", () { |
| 1757 var o = buildEnrollmentToken(); |
| 1758 var od = new api.EnrollmentToken.fromJson(o.toJson()); |
| 1759 checkEnrollmentToken(od); |
| 1760 }); |
| 1761 }); |
| 1762 |
| 1763 |
| 1764 unittest.group("obj-schema-Enterprise", () { |
| 1765 unittest.test("to-json--from-json", () { |
| 1766 var o = buildEnterprise(); |
| 1767 var od = new api.Enterprise.fromJson(o.toJson()); |
| 1768 checkEnterprise(od); |
| 1769 }); |
| 1770 }); |
| 1771 |
| 1772 |
| 1773 unittest.group("obj-schema-ExternalData", () { |
| 1774 unittest.test("to-json--from-json", () { |
| 1775 var o = buildExternalData(); |
| 1776 var od = new api.ExternalData.fromJson(o.toJson()); |
| 1777 checkExternalData(od); |
| 1778 }); |
| 1779 }); |
| 1780 |
| 1781 |
| 1782 unittest.group("obj-schema-HardwareInfo", () { |
| 1783 unittest.test("to-json--from-json", () { |
| 1784 var o = buildHardwareInfo(); |
| 1785 var od = new api.HardwareInfo.fromJson(o.toJson()); |
| 1786 checkHardwareInfo(od); |
| 1787 }); |
| 1788 }); |
| 1789 |
| 1790 |
| 1791 unittest.group("obj-schema-HardwareStatus", () { |
| 1792 unittest.test("to-json--from-json", () { |
| 1793 var o = buildHardwareStatus(); |
| 1794 var od = new api.HardwareStatus.fromJson(o.toJson()); |
| 1795 checkHardwareStatus(od); |
| 1796 }); |
| 1797 }); |
| 1798 |
| 1799 |
| 1800 unittest.group("obj-schema-ListDevicesResponse", () { |
| 1801 unittest.test("to-json--from-json", () { |
| 1802 var o = buildListDevicesResponse(); |
| 1803 var od = new api.ListDevicesResponse.fromJson(o.toJson()); |
| 1804 checkListDevicesResponse(od); |
| 1805 }); |
| 1806 }); |
| 1807 |
| 1808 |
| 1809 unittest.group("obj-schema-ListOperationsResponse", () { |
| 1810 unittest.test("to-json--from-json", () { |
| 1811 var o = buildListOperationsResponse(); |
| 1812 var od = new api.ListOperationsResponse.fromJson(o.toJson()); |
| 1813 checkListOperationsResponse(od); |
| 1814 }); |
| 1815 }); |
| 1816 |
| 1817 |
| 1818 unittest.group("obj-schema-ListPoliciesResponse", () { |
| 1819 unittest.test("to-json--from-json", () { |
| 1820 var o = buildListPoliciesResponse(); |
| 1821 var od = new api.ListPoliciesResponse.fromJson(o.toJson()); |
| 1822 checkListPoliciesResponse(od); |
| 1823 }); |
| 1824 }); |
| 1825 |
| 1826 |
| 1827 unittest.group("obj-schema-ManagedProperty", () { |
| 1828 unittest.test("to-json--from-json", () { |
| 1829 var o = buildManagedProperty(); |
| 1830 var od = new api.ManagedProperty.fromJson(o.toJson()); |
| 1831 checkManagedProperty(od); |
| 1832 }); |
| 1833 }); |
| 1834 |
| 1835 |
| 1836 unittest.group("obj-schema-ManagedPropertyEntry", () { |
| 1837 unittest.test("to-json--from-json", () { |
| 1838 var o = buildManagedPropertyEntry(); |
| 1839 var od = new api.ManagedPropertyEntry.fromJson(o.toJson()); |
| 1840 checkManagedPropertyEntry(od); |
| 1841 }); |
| 1842 }); |
| 1843 |
| 1844 |
| 1845 unittest.group("obj-schema-MemoryEvent", () { |
| 1846 unittest.test("to-json--from-json", () { |
| 1847 var o = buildMemoryEvent(); |
| 1848 var od = new api.MemoryEvent.fromJson(o.toJson()); |
| 1849 checkMemoryEvent(od); |
| 1850 }); |
| 1851 }); |
| 1852 |
| 1853 |
| 1854 unittest.group("obj-schema-MemoryInfo", () { |
| 1855 unittest.test("to-json--from-json", () { |
| 1856 var o = buildMemoryInfo(); |
| 1857 var od = new api.MemoryInfo.fromJson(o.toJson()); |
| 1858 checkMemoryInfo(od); |
| 1859 }); |
| 1860 }); |
| 1861 |
| 1862 |
| 1863 unittest.group("obj-schema-NetworkInfo", () { |
| 1864 unittest.test("to-json--from-json", () { |
| 1865 var o = buildNetworkInfo(); |
| 1866 var od = new api.NetworkInfo.fromJson(o.toJson()); |
| 1867 checkNetworkInfo(od); |
| 1868 }); |
| 1869 }); |
| 1870 |
| 1871 |
| 1872 unittest.group("obj-schema-NonComplianceDetail", () { |
| 1873 unittest.test("to-json--from-json", () { |
| 1874 var o = buildNonComplianceDetail(); |
| 1875 var od = new api.NonComplianceDetail.fromJson(o.toJson()); |
| 1876 checkNonComplianceDetail(od); |
| 1877 }); |
| 1878 }); |
| 1879 |
| 1880 |
| 1881 unittest.group("obj-schema-NonComplianceDetailCondition", () { |
| 1882 unittest.test("to-json--from-json", () { |
| 1883 var o = buildNonComplianceDetailCondition(); |
| 1884 var od = new api.NonComplianceDetailCondition.fromJson(o.toJson()); |
| 1885 checkNonComplianceDetailCondition(od); |
| 1886 }); |
| 1887 }); |
| 1888 |
| 1889 |
| 1890 unittest.group("obj-schema-Operation", () { |
| 1891 unittest.test("to-json--from-json", () { |
| 1892 var o = buildOperation(); |
| 1893 var od = new api.Operation.fromJson(o.toJson()); |
| 1894 checkOperation(od); |
| 1895 }); |
| 1896 }); |
| 1897 |
| 1898 |
| 1899 unittest.group("obj-schema-PasswordRequirements", () { |
| 1900 unittest.test("to-json--from-json", () { |
| 1901 var o = buildPasswordRequirements(); |
| 1902 var od = new api.PasswordRequirements.fromJson(o.toJson()); |
| 1903 checkPasswordRequirements(od); |
| 1904 }); |
| 1905 }); |
| 1906 |
| 1907 |
| 1908 unittest.group("obj-schema-PermissionGrant", () { |
| 1909 unittest.test("to-json--from-json", () { |
| 1910 var o = buildPermissionGrant(); |
| 1911 var od = new api.PermissionGrant.fromJson(o.toJson()); |
| 1912 checkPermissionGrant(od); |
| 1913 }); |
| 1914 }); |
| 1915 |
| 1916 |
| 1917 unittest.group("obj-schema-PersistentPreferredActivity", () { |
| 1918 unittest.test("to-json--from-json", () { |
| 1919 var o = buildPersistentPreferredActivity(); |
| 1920 var od = new api.PersistentPreferredActivity.fromJson(o.toJson()); |
| 1921 checkPersistentPreferredActivity(od); |
| 1922 }); |
| 1923 }); |
| 1924 |
| 1925 |
| 1926 unittest.group("obj-schema-Policy", () { |
| 1927 unittest.test("to-json--from-json", () { |
| 1928 var o = buildPolicy(); |
| 1929 var od = new api.Policy.fromJson(o.toJson()); |
| 1930 checkPolicy(od); |
| 1931 }); |
| 1932 }); |
| 1933 |
| 1934 |
| 1935 unittest.group("obj-schema-PowerManagementEvent", () { |
| 1936 unittest.test("to-json--from-json", () { |
| 1937 var o = buildPowerManagementEvent(); |
| 1938 var od = new api.PowerManagementEvent.fromJson(o.toJson()); |
| 1939 checkPowerManagementEvent(od); |
| 1940 }); |
| 1941 }); |
| 1942 |
| 1943 |
| 1944 unittest.group("obj-schema-SignupUrl", () { |
| 1945 unittest.test("to-json--from-json", () { |
| 1946 var o = buildSignupUrl(); |
| 1947 var od = new api.SignupUrl.fromJson(o.toJson()); |
| 1948 checkSignupUrl(od); |
| 1949 }); |
| 1950 }); |
| 1951 |
| 1952 |
| 1953 unittest.group("obj-schema-SoftwareInfo", () { |
| 1954 unittest.test("to-json--from-json", () { |
| 1955 var o = buildSoftwareInfo(); |
| 1956 var od = new api.SoftwareInfo.fromJson(o.toJson()); |
| 1957 checkSoftwareInfo(od); |
| 1958 }); |
| 1959 }); |
| 1960 |
| 1961 |
| 1962 unittest.group("obj-schema-Status", () { |
| 1963 unittest.test("to-json--from-json", () { |
| 1964 var o = buildStatus(); |
| 1965 var od = new api.Status.fromJson(o.toJson()); |
| 1966 checkStatus(od); |
| 1967 }); |
| 1968 }); |
| 1969 |
| 1970 |
| 1971 unittest.group("obj-schema-StatusReportingSettings", () { |
| 1972 unittest.test("to-json--from-json", () { |
| 1973 var o = buildStatusReportingSettings(); |
| 1974 var od = new api.StatusReportingSettings.fromJson(o.toJson()); |
| 1975 checkStatusReportingSettings(od); |
| 1976 }); |
| 1977 }); |
| 1978 |
| 1979 |
| 1980 unittest.group("obj-schema-SystemUpdate", () { |
| 1981 unittest.test("to-json--from-json", () { |
| 1982 var o = buildSystemUpdate(); |
| 1983 var od = new api.SystemUpdate.fromJson(o.toJson()); |
| 1984 checkSystemUpdate(od); |
| 1985 }); |
| 1986 }); |
| 1987 |
| 1988 |
| 1989 unittest.group("obj-schema-UserFacingMessage", () { |
| 1990 unittest.test("to-json--from-json", () { |
| 1991 var o = buildUserFacingMessage(); |
| 1992 var od = new api.UserFacingMessage.fromJson(o.toJson()); |
| 1993 checkUserFacingMessage(od); |
| 1994 }); |
| 1995 }); |
| 1996 |
| 1997 |
| 1998 unittest.group("obj-schema-WebToken", () { |
| 1999 unittest.test("to-json--from-json", () { |
| 2000 var o = buildWebToken(); |
| 2001 var od = new api.WebToken.fromJson(o.toJson()); |
| 2002 checkWebToken(od); |
| 2003 }); |
| 2004 }); |
| 2005 |
| 2006 |
| 2007 unittest.group("resource-EnterprisesResourceApi", () { |
| 2008 unittest.test("method--create", () { |
| 2009 |
| 2010 var mock = new HttpServerMock(); |
| 2011 api.EnterprisesResourceApi res = new api.AndroidmanagementApi(mock).enterp
rises; |
| 2012 var arg_request = buildEnterprise(); |
| 2013 var arg_signupUrlName = "foo"; |
| 2014 var arg_enterpriseToken = "foo"; |
| 2015 var arg_projectId = "foo"; |
| 2016 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2017 var obj = new api.Enterprise.fromJson(json); |
| 2018 checkEnterprise(obj); |
| 2019 |
| 2020 var path = (req.url).path; |
| 2021 var pathOffset = 0; |
| 2022 var index; |
| 2023 var subPart; |
| 2024 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2025 pathOffset += 1; |
| 2026 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("v1/enterprises")); |
| 2027 pathOffset += 14; |
| 2028 |
| 2029 var query = (req.url).query; |
| 2030 var queryOffset = 0; |
| 2031 var queryMap = {}; |
| 2032 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2033 parseBool(n) { |
| 2034 if (n == "true") return true; |
| 2035 if (n == "false") return false; |
| 2036 if (n == null) return null; |
| 2037 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2038 } |
| 2039 if (query.length > 0) { |
| 2040 for (var part in query.split("&")) { |
| 2041 var keyvalue = part.split("="); |
| 2042 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2043 } |
| 2044 } |
| 2045 unittest.expect(queryMap["signupUrlName"].first, unittest.equals(arg_sig
nupUrlName)); |
| 2046 unittest.expect(queryMap["enterpriseToken"].first, unittest.equals(arg_e
nterpriseToken)); |
| 2047 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 2048 |
| 2049 |
| 2050 var h = { |
| 2051 "content-type" : "application/json; charset=utf-8", |
| 2052 }; |
| 2053 var resp = convert.JSON.encode(buildEnterprise()); |
| 2054 return new async.Future.value(stringResponse(200, h, resp)); |
| 2055 }), true); |
| 2056 res.create(arg_request, signupUrlName: arg_signupUrlName, enterpriseToken:
arg_enterpriseToken, projectId: arg_projectId).then(unittest.expectAsync1(((api
.Enterprise response) { |
| 2057 checkEnterprise(response); |
| 2058 }))); |
| 2059 }); |
| 2060 |
| 2061 unittest.test("method--get", () { |
| 2062 |
| 2063 var mock = new HttpServerMock(); |
| 2064 api.EnterprisesResourceApi res = new api.AndroidmanagementApi(mock).enterp
rises; |
| 2065 var arg_name = "foo"; |
| 2066 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2067 var path = (req.url).path; |
| 2068 var pathOffset = 0; |
| 2069 var index; |
| 2070 var subPart; |
| 2071 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2072 pathOffset += 1; |
| 2073 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2074 pathOffset += 3; |
| 2075 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2076 |
| 2077 var query = (req.url).query; |
| 2078 var queryOffset = 0; |
| 2079 var queryMap = {}; |
| 2080 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2081 parseBool(n) { |
| 2082 if (n == "true") return true; |
| 2083 if (n == "false") return false; |
| 2084 if (n == null) return null; |
| 2085 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2086 } |
| 2087 if (query.length > 0) { |
| 2088 for (var part in query.split("&")) { |
| 2089 var keyvalue = part.split("="); |
| 2090 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2091 } |
| 2092 } |
| 2093 |
| 2094 |
| 2095 var h = { |
| 2096 "content-type" : "application/json; charset=utf-8", |
| 2097 }; |
| 2098 var resp = convert.JSON.encode(buildEnterprise()); |
| 2099 return new async.Future.value(stringResponse(200, h, resp)); |
| 2100 }), true); |
| 2101 res.get(arg_name).then(unittest.expectAsync1(((api.Enterprise response) { |
| 2102 checkEnterprise(response); |
| 2103 }))); |
| 2104 }); |
| 2105 |
| 2106 unittest.test("method--patch", () { |
| 2107 |
| 2108 var mock = new HttpServerMock(); |
| 2109 api.EnterprisesResourceApi res = new api.AndroidmanagementApi(mock).enterp
rises; |
| 2110 var arg_request = buildEnterprise(); |
| 2111 var arg_name = "foo"; |
| 2112 var arg_updateMask = "foo"; |
| 2113 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2114 var obj = new api.Enterprise.fromJson(json); |
| 2115 checkEnterprise(obj); |
| 2116 |
| 2117 var path = (req.url).path; |
| 2118 var pathOffset = 0; |
| 2119 var index; |
| 2120 var subPart; |
| 2121 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2122 pathOffset += 1; |
| 2123 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2124 pathOffset += 3; |
| 2125 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2126 |
| 2127 var query = (req.url).query; |
| 2128 var queryOffset = 0; |
| 2129 var queryMap = {}; |
| 2130 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2131 parseBool(n) { |
| 2132 if (n == "true") return true; |
| 2133 if (n == "false") return false; |
| 2134 if (n == null) return null; |
| 2135 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2136 } |
| 2137 if (query.length > 0) { |
| 2138 for (var part in query.split("&")) { |
| 2139 var keyvalue = part.split("="); |
| 2140 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2141 } |
| 2142 } |
| 2143 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 2144 |
| 2145 |
| 2146 var h = { |
| 2147 "content-type" : "application/json; charset=utf-8", |
| 2148 }; |
| 2149 var resp = convert.JSON.encode(buildEnterprise()); |
| 2150 return new async.Future.value(stringResponse(200, h, resp)); |
| 2151 }), true); |
| 2152 res.patch(arg_request, arg_name, updateMask: arg_updateMask).then(unittest
.expectAsync1(((api.Enterprise response) { |
| 2153 checkEnterprise(response); |
| 2154 }))); |
| 2155 }); |
| 2156 |
| 2157 }); |
| 2158 |
| 2159 |
| 2160 unittest.group("resource-EnterprisesApplicationsResourceApi", () { |
| 2161 unittest.test("method--get", () { |
| 2162 |
| 2163 var mock = new HttpServerMock(); |
| 2164 api.EnterprisesApplicationsResourceApi res = new api.AndroidmanagementApi(
mock).enterprises.applications; |
| 2165 var arg_name = "foo"; |
| 2166 var arg_languageCode = "foo"; |
| 2167 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2168 var path = (req.url).path; |
| 2169 var pathOffset = 0; |
| 2170 var index; |
| 2171 var subPart; |
| 2172 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2173 pathOffset += 1; |
| 2174 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2175 pathOffset += 3; |
| 2176 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2177 |
| 2178 var query = (req.url).query; |
| 2179 var queryOffset = 0; |
| 2180 var queryMap = {}; |
| 2181 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2182 parseBool(n) { |
| 2183 if (n == "true") return true; |
| 2184 if (n == "false") return false; |
| 2185 if (n == null) return null; |
| 2186 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2187 } |
| 2188 if (query.length > 0) { |
| 2189 for (var part in query.split("&")) { |
| 2190 var keyvalue = part.split("="); |
| 2191 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2192 } |
| 2193 } |
| 2194 unittest.expect(queryMap["languageCode"].first, unittest.equals(arg_lang
uageCode)); |
| 2195 |
| 2196 |
| 2197 var h = { |
| 2198 "content-type" : "application/json; charset=utf-8", |
| 2199 }; |
| 2200 var resp = convert.JSON.encode(buildApplication()); |
| 2201 return new async.Future.value(stringResponse(200, h, resp)); |
| 2202 }), true); |
| 2203 res.get(arg_name, languageCode: arg_languageCode).then(unittest.expectAsyn
c1(((api.Application response) { |
| 2204 checkApplication(response); |
| 2205 }))); |
| 2206 }); |
| 2207 |
| 2208 }); |
| 2209 |
| 2210 |
| 2211 unittest.group("resource-EnterprisesDevicesResourceApi", () { |
| 2212 unittest.test("method--delete", () { |
| 2213 |
| 2214 var mock = new HttpServerMock(); |
| 2215 api.EnterprisesDevicesResourceApi res = new api.AndroidmanagementApi(mock)
.enterprises.devices; |
| 2216 var arg_name = "foo"; |
| 2217 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2218 var path = (req.url).path; |
| 2219 var pathOffset = 0; |
| 2220 var index; |
| 2221 var subPart; |
| 2222 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2223 pathOffset += 1; |
| 2224 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2225 pathOffset += 3; |
| 2226 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2227 |
| 2228 var query = (req.url).query; |
| 2229 var queryOffset = 0; |
| 2230 var queryMap = {}; |
| 2231 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2232 parseBool(n) { |
| 2233 if (n == "true") return true; |
| 2234 if (n == "false") return false; |
| 2235 if (n == null) return null; |
| 2236 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2237 } |
| 2238 if (query.length > 0) { |
| 2239 for (var part in query.split("&")) { |
| 2240 var keyvalue = part.split("="); |
| 2241 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2242 } |
| 2243 } |
| 2244 |
| 2245 |
| 2246 var h = { |
| 2247 "content-type" : "application/json; charset=utf-8", |
| 2248 }; |
| 2249 var resp = convert.JSON.encode(buildEmpty()); |
| 2250 return new async.Future.value(stringResponse(200, h, resp)); |
| 2251 }), true); |
| 2252 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2253 checkEmpty(response); |
| 2254 }))); |
| 2255 }); |
| 2256 |
| 2257 unittest.test("method--get", () { |
| 2258 |
| 2259 var mock = new HttpServerMock(); |
| 2260 api.EnterprisesDevicesResourceApi res = new api.AndroidmanagementApi(mock)
.enterprises.devices; |
| 2261 var arg_name = "foo"; |
| 2262 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2263 var path = (req.url).path; |
| 2264 var pathOffset = 0; |
| 2265 var index; |
| 2266 var subPart; |
| 2267 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2268 pathOffset += 1; |
| 2269 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2270 pathOffset += 3; |
| 2271 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2272 |
| 2273 var query = (req.url).query; |
| 2274 var queryOffset = 0; |
| 2275 var queryMap = {}; |
| 2276 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2277 parseBool(n) { |
| 2278 if (n == "true") return true; |
| 2279 if (n == "false") return false; |
| 2280 if (n == null) return null; |
| 2281 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2282 } |
| 2283 if (query.length > 0) { |
| 2284 for (var part in query.split("&")) { |
| 2285 var keyvalue = part.split("="); |
| 2286 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2287 } |
| 2288 } |
| 2289 |
| 2290 |
| 2291 var h = { |
| 2292 "content-type" : "application/json; charset=utf-8", |
| 2293 }; |
| 2294 var resp = convert.JSON.encode(buildDevice()); |
| 2295 return new async.Future.value(stringResponse(200, h, resp)); |
| 2296 }), true); |
| 2297 res.get(arg_name).then(unittest.expectAsync1(((api.Device response) { |
| 2298 checkDevice(response); |
| 2299 }))); |
| 2300 }); |
| 2301 |
| 2302 unittest.test("method--issueCommand", () { |
| 2303 |
| 2304 var mock = new HttpServerMock(); |
| 2305 api.EnterprisesDevicesResourceApi res = new api.AndroidmanagementApi(mock)
.enterprises.devices; |
| 2306 var arg_request = buildCommand(); |
| 2307 var arg_name = "foo"; |
| 2308 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2309 var obj = new api.Command.fromJson(json); |
| 2310 checkCommand(obj); |
| 2311 |
| 2312 var path = (req.url).path; |
| 2313 var pathOffset = 0; |
| 2314 var index; |
| 2315 var subPart; |
| 2316 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2317 pathOffset += 1; |
| 2318 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2319 pathOffset += 3; |
| 2320 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2321 |
| 2322 var query = (req.url).query; |
| 2323 var queryOffset = 0; |
| 2324 var queryMap = {}; |
| 2325 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2326 parseBool(n) { |
| 2327 if (n == "true") return true; |
| 2328 if (n == "false") return false; |
| 2329 if (n == null) return null; |
| 2330 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2331 } |
| 2332 if (query.length > 0) { |
| 2333 for (var part in query.split("&")) { |
| 2334 var keyvalue = part.split("="); |
| 2335 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2336 } |
| 2337 } |
| 2338 |
| 2339 |
| 2340 var h = { |
| 2341 "content-type" : "application/json; charset=utf-8", |
| 2342 }; |
| 2343 var resp = convert.JSON.encode(buildOperation()); |
| 2344 return new async.Future.value(stringResponse(200, h, resp)); |
| 2345 }), true); |
| 2346 res.issueCommand(arg_request, arg_name).then(unittest.expectAsync1(((api.O
peration response) { |
| 2347 checkOperation(response); |
| 2348 }))); |
| 2349 }); |
| 2350 |
| 2351 unittest.test("method--list", () { |
| 2352 |
| 2353 var mock = new HttpServerMock(); |
| 2354 api.EnterprisesDevicesResourceApi res = new api.AndroidmanagementApi(mock)
.enterprises.devices; |
| 2355 var arg_parent = "foo"; |
| 2356 var arg_pageSize = 42; |
| 2357 var arg_pageToken = "foo"; |
| 2358 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2359 var path = (req.url).path; |
| 2360 var pathOffset = 0; |
| 2361 var index; |
| 2362 var subPart; |
| 2363 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2364 pathOffset += 1; |
| 2365 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2366 pathOffset += 3; |
| 2367 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2368 |
| 2369 var query = (req.url).query; |
| 2370 var queryOffset = 0; |
| 2371 var queryMap = {}; |
| 2372 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2373 parseBool(n) { |
| 2374 if (n == "true") return true; |
| 2375 if (n == "false") return false; |
| 2376 if (n == null) return null; |
| 2377 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2378 } |
| 2379 if (query.length > 0) { |
| 2380 for (var part in query.split("&")) { |
| 2381 var keyvalue = part.split("="); |
| 2382 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2383 } |
| 2384 } |
| 2385 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2386 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2387 |
| 2388 |
| 2389 var h = { |
| 2390 "content-type" : "application/json; charset=utf-8", |
| 2391 }; |
| 2392 var resp = convert.JSON.encode(buildListDevicesResponse()); |
| 2393 return new async.Future.value(stringResponse(200, h, resp)); |
| 2394 }), true); |
| 2395 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListDevicesResponse response) { |
| 2396 checkListDevicesResponse(response); |
| 2397 }))); |
| 2398 }); |
| 2399 |
| 2400 unittest.test("method--patch", () { |
| 2401 |
| 2402 var mock = new HttpServerMock(); |
| 2403 api.EnterprisesDevicesResourceApi res = new api.AndroidmanagementApi(mock)
.enterprises.devices; |
| 2404 var arg_request = buildDevice(); |
| 2405 var arg_name = "foo"; |
| 2406 var arg_updateMask = "foo"; |
| 2407 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2408 var obj = new api.Device.fromJson(json); |
| 2409 checkDevice(obj); |
| 2410 |
| 2411 var path = (req.url).path; |
| 2412 var pathOffset = 0; |
| 2413 var index; |
| 2414 var subPart; |
| 2415 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2416 pathOffset += 1; |
| 2417 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2418 pathOffset += 3; |
| 2419 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2420 |
| 2421 var query = (req.url).query; |
| 2422 var queryOffset = 0; |
| 2423 var queryMap = {}; |
| 2424 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2425 parseBool(n) { |
| 2426 if (n == "true") return true; |
| 2427 if (n == "false") return false; |
| 2428 if (n == null) return null; |
| 2429 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2430 } |
| 2431 if (query.length > 0) { |
| 2432 for (var part in query.split("&")) { |
| 2433 var keyvalue = part.split("="); |
| 2434 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2435 } |
| 2436 } |
| 2437 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 2438 |
| 2439 |
| 2440 var h = { |
| 2441 "content-type" : "application/json; charset=utf-8", |
| 2442 }; |
| 2443 var resp = convert.JSON.encode(buildDevice()); |
| 2444 return new async.Future.value(stringResponse(200, h, resp)); |
| 2445 }), true); |
| 2446 res.patch(arg_request, arg_name, updateMask: arg_updateMask).then(unittest
.expectAsync1(((api.Device response) { |
| 2447 checkDevice(response); |
| 2448 }))); |
| 2449 }); |
| 2450 |
| 2451 }); |
| 2452 |
| 2453 |
| 2454 unittest.group("resource-EnterprisesDevicesOperationsResourceApi", () { |
| 2455 unittest.test("method--cancel", () { |
| 2456 |
| 2457 var mock = new HttpServerMock(); |
| 2458 api.EnterprisesDevicesOperationsResourceApi res = new api.Androidmanagemen
tApi(mock).enterprises.devices.operations; |
| 2459 var arg_name = "foo"; |
| 2460 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2461 var path = (req.url).path; |
| 2462 var pathOffset = 0; |
| 2463 var index; |
| 2464 var subPart; |
| 2465 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2466 pathOffset += 1; |
| 2467 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2468 pathOffset += 3; |
| 2469 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2470 |
| 2471 var query = (req.url).query; |
| 2472 var queryOffset = 0; |
| 2473 var queryMap = {}; |
| 2474 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2475 parseBool(n) { |
| 2476 if (n == "true") return true; |
| 2477 if (n == "false") return false; |
| 2478 if (n == null) return null; |
| 2479 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2480 } |
| 2481 if (query.length > 0) { |
| 2482 for (var part in query.split("&")) { |
| 2483 var keyvalue = part.split("="); |
| 2484 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2485 } |
| 2486 } |
| 2487 |
| 2488 |
| 2489 var h = { |
| 2490 "content-type" : "application/json; charset=utf-8", |
| 2491 }; |
| 2492 var resp = convert.JSON.encode(buildEmpty()); |
| 2493 return new async.Future.value(stringResponse(200, h, resp)); |
| 2494 }), true); |
| 2495 res.cancel(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2496 checkEmpty(response); |
| 2497 }))); |
| 2498 }); |
| 2499 |
| 2500 unittest.test("method--delete", () { |
| 2501 |
| 2502 var mock = new HttpServerMock(); |
| 2503 api.EnterprisesDevicesOperationsResourceApi res = new api.Androidmanagemen
tApi(mock).enterprises.devices.operations; |
| 2504 var arg_name = "foo"; |
| 2505 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2506 var path = (req.url).path; |
| 2507 var pathOffset = 0; |
| 2508 var index; |
| 2509 var subPart; |
| 2510 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2511 pathOffset += 1; |
| 2512 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2513 pathOffset += 3; |
| 2514 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2515 |
| 2516 var query = (req.url).query; |
| 2517 var queryOffset = 0; |
| 2518 var queryMap = {}; |
| 2519 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2520 parseBool(n) { |
| 2521 if (n == "true") return true; |
| 2522 if (n == "false") return false; |
| 2523 if (n == null) return null; |
| 2524 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2525 } |
| 2526 if (query.length > 0) { |
| 2527 for (var part in query.split("&")) { |
| 2528 var keyvalue = part.split("="); |
| 2529 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2530 } |
| 2531 } |
| 2532 |
| 2533 |
| 2534 var h = { |
| 2535 "content-type" : "application/json; charset=utf-8", |
| 2536 }; |
| 2537 var resp = convert.JSON.encode(buildEmpty()); |
| 2538 return new async.Future.value(stringResponse(200, h, resp)); |
| 2539 }), true); |
| 2540 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2541 checkEmpty(response); |
| 2542 }))); |
| 2543 }); |
| 2544 |
| 2545 unittest.test("method--get", () { |
| 2546 |
| 2547 var mock = new HttpServerMock(); |
| 2548 api.EnterprisesDevicesOperationsResourceApi res = new api.Androidmanagemen
tApi(mock).enterprises.devices.operations; |
| 2549 var arg_name = "foo"; |
| 2550 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2551 var path = (req.url).path; |
| 2552 var pathOffset = 0; |
| 2553 var index; |
| 2554 var subPart; |
| 2555 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2556 pathOffset += 1; |
| 2557 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2558 pathOffset += 3; |
| 2559 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2560 |
| 2561 var query = (req.url).query; |
| 2562 var queryOffset = 0; |
| 2563 var queryMap = {}; |
| 2564 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2565 parseBool(n) { |
| 2566 if (n == "true") return true; |
| 2567 if (n == "false") return false; |
| 2568 if (n == null) return null; |
| 2569 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2570 } |
| 2571 if (query.length > 0) { |
| 2572 for (var part in query.split("&")) { |
| 2573 var keyvalue = part.split("="); |
| 2574 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2575 } |
| 2576 } |
| 2577 |
| 2578 |
| 2579 var h = { |
| 2580 "content-type" : "application/json; charset=utf-8", |
| 2581 }; |
| 2582 var resp = convert.JSON.encode(buildOperation()); |
| 2583 return new async.Future.value(stringResponse(200, h, resp)); |
| 2584 }), true); |
| 2585 res.get(arg_name).then(unittest.expectAsync1(((api.Operation response) { |
| 2586 checkOperation(response); |
| 2587 }))); |
| 2588 }); |
| 2589 |
| 2590 unittest.test("method--list", () { |
| 2591 |
| 2592 var mock = new HttpServerMock(); |
| 2593 api.EnterprisesDevicesOperationsResourceApi res = new api.Androidmanagemen
tApi(mock).enterprises.devices.operations; |
| 2594 var arg_name = "foo"; |
| 2595 var arg_pageSize = 42; |
| 2596 var arg_filter = "foo"; |
| 2597 var arg_pageToken = "foo"; |
| 2598 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2599 var path = (req.url).path; |
| 2600 var pathOffset = 0; |
| 2601 var index; |
| 2602 var subPart; |
| 2603 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2604 pathOffset += 1; |
| 2605 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2606 pathOffset += 3; |
| 2607 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2608 |
| 2609 var query = (req.url).query; |
| 2610 var queryOffset = 0; |
| 2611 var queryMap = {}; |
| 2612 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2613 parseBool(n) { |
| 2614 if (n == "true") return true; |
| 2615 if (n == "false") return false; |
| 2616 if (n == null) return null; |
| 2617 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2618 } |
| 2619 if (query.length > 0) { |
| 2620 for (var part in query.split("&")) { |
| 2621 var keyvalue = part.split("="); |
| 2622 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2623 } |
| 2624 } |
| 2625 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2626 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 2627 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2628 |
| 2629 |
| 2630 var h = { |
| 2631 "content-type" : "application/json; charset=utf-8", |
| 2632 }; |
| 2633 var resp = convert.JSON.encode(buildListOperationsResponse()); |
| 2634 return new async.Future.value(stringResponse(200, h, resp)); |
| 2635 }), true); |
| 2636 res.list(arg_name, pageSize: arg_pageSize, filter: arg_filter, pageToken:
arg_pageToken).then(unittest.expectAsync1(((api.ListOperationsResponse response)
{ |
| 2637 checkListOperationsResponse(response); |
| 2638 }))); |
| 2639 }); |
| 2640 |
| 2641 }); |
| 2642 |
| 2643 |
| 2644 unittest.group("resource-EnterprisesEnrollmentTokensResourceApi", () { |
| 2645 unittest.test("method--create", () { |
| 2646 |
| 2647 var mock = new HttpServerMock(); |
| 2648 api.EnterprisesEnrollmentTokensResourceApi res = new api.Androidmanagement
Api(mock).enterprises.enrollmentTokens; |
| 2649 var arg_request = buildEnrollmentToken(); |
| 2650 var arg_parent = "foo"; |
| 2651 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2652 var obj = new api.EnrollmentToken.fromJson(json); |
| 2653 checkEnrollmentToken(obj); |
| 2654 |
| 2655 var path = (req.url).path; |
| 2656 var pathOffset = 0; |
| 2657 var index; |
| 2658 var subPart; |
| 2659 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2660 pathOffset += 1; |
| 2661 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2662 pathOffset += 3; |
| 2663 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2664 |
| 2665 var query = (req.url).query; |
| 2666 var queryOffset = 0; |
| 2667 var queryMap = {}; |
| 2668 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2669 parseBool(n) { |
| 2670 if (n == "true") return true; |
| 2671 if (n == "false") return false; |
| 2672 if (n == null) return null; |
| 2673 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2674 } |
| 2675 if (query.length > 0) { |
| 2676 for (var part in query.split("&")) { |
| 2677 var keyvalue = part.split("="); |
| 2678 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2679 } |
| 2680 } |
| 2681 |
| 2682 |
| 2683 var h = { |
| 2684 "content-type" : "application/json; charset=utf-8", |
| 2685 }; |
| 2686 var resp = convert.JSON.encode(buildEnrollmentToken()); |
| 2687 return new async.Future.value(stringResponse(200, h, resp)); |
| 2688 }), true); |
| 2689 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.Enrol
lmentToken response) { |
| 2690 checkEnrollmentToken(response); |
| 2691 }))); |
| 2692 }); |
| 2693 |
| 2694 unittest.test("method--delete", () { |
| 2695 |
| 2696 var mock = new HttpServerMock(); |
| 2697 api.EnterprisesEnrollmentTokensResourceApi res = new api.Androidmanagement
Api(mock).enterprises.enrollmentTokens; |
| 2698 var arg_name = "foo"; |
| 2699 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2700 var path = (req.url).path; |
| 2701 var pathOffset = 0; |
| 2702 var index; |
| 2703 var subPart; |
| 2704 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2705 pathOffset += 1; |
| 2706 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2707 pathOffset += 3; |
| 2708 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2709 |
| 2710 var query = (req.url).query; |
| 2711 var queryOffset = 0; |
| 2712 var queryMap = {}; |
| 2713 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2714 parseBool(n) { |
| 2715 if (n == "true") return true; |
| 2716 if (n == "false") return false; |
| 2717 if (n == null) return null; |
| 2718 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2719 } |
| 2720 if (query.length > 0) { |
| 2721 for (var part in query.split("&")) { |
| 2722 var keyvalue = part.split("="); |
| 2723 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2724 } |
| 2725 } |
| 2726 |
| 2727 |
| 2728 var h = { |
| 2729 "content-type" : "application/json; charset=utf-8", |
| 2730 }; |
| 2731 var resp = convert.JSON.encode(buildEmpty()); |
| 2732 return new async.Future.value(stringResponse(200, h, resp)); |
| 2733 }), true); |
| 2734 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2735 checkEmpty(response); |
| 2736 }))); |
| 2737 }); |
| 2738 |
| 2739 }); |
| 2740 |
| 2741 |
| 2742 unittest.group("resource-EnterprisesPoliciesResourceApi", () { |
| 2743 unittest.test("method--delete", () { |
| 2744 |
| 2745 var mock = new HttpServerMock(); |
| 2746 api.EnterprisesPoliciesResourceApi res = new api.AndroidmanagementApi(mock
).enterprises.policies; |
| 2747 var arg_name = "foo"; |
| 2748 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2749 var path = (req.url).path; |
| 2750 var pathOffset = 0; |
| 2751 var index; |
| 2752 var subPart; |
| 2753 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2754 pathOffset += 1; |
| 2755 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2756 pathOffset += 3; |
| 2757 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2758 |
| 2759 var query = (req.url).query; |
| 2760 var queryOffset = 0; |
| 2761 var queryMap = {}; |
| 2762 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2763 parseBool(n) { |
| 2764 if (n == "true") return true; |
| 2765 if (n == "false") return false; |
| 2766 if (n == null) return null; |
| 2767 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2768 } |
| 2769 if (query.length > 0) { |
| 2770 for (var part in query.split("&")) { |
| 2771 var keyvalue = part.split("="); |
| 2772 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2773 } |
| 2774 } |
| 2775 |
| 2776 |
| 2777 var h = { |
| 2778 "content-type" : "application/json; charset=utf-8", |
| 2779 }; |
| 2780 var resp = convert.JSON.encode(buildEmpty()); |
| 2781 return new async.Future.value(stringResponse(200, h, resp)); |
| 2782 }), true); |
| 2783 res.delete(arg_name).then(unittest.expectAsync1(((api.Empty response) { |
| 2784 checkEmpty(response); |
| 2785 }))); |
| 2786 }); |
| 2787 |
| 2788 unittest.test("method--get", () { |
| 2789 |
| 2790 var mock = new HttpServerMock(); |
| 2791 api.EnterprisesPoliciesResourceApi res = new api.AndroidmanagementApi(mock
).enterprises.policies; |
| 2792 var arg_name = "foo"; |
| 2793 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2794 var path = (req.url).path; |
| 2795 var pathOffset = 0; |
| 2796 var index; |
| 2797 var subPart; |
| 2798 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2799 pathOffset += 1; |
| 2800 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2801 pathOffset += 3; |
| 2802 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2803 |
| 2804 var query = (req.url).query; |
| 2805 var queryOffset = 0; |
| 2806 var queryMap = {}; |
| 2807 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2808 parseBool(n) { |
| 2809 if (n == "true") return true; |
| 2810 if (n == "false") return false; |
| 2811 if (n == null) return null; |
| 2812 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2813 } |
| 2814 if (query.length > 0) { |
| 2815 for (var part in query.split("&")) { |
| 2816 var keyvalue = part.split("="); |
| 2817 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2818 } |
| 2819 } |
| 2820 |
| 2821 |
| 2822 var h = { |
| 2823 "content-type" : "application/json; charset=utf-8", |
| 2824 }; |
| 2825 var resp = convert.JSON.encode(buildPolicy()); |
| 2826 return new async.Future.value(stringResponse(200, h, resp)); |
| 2827 }), true); |
| 2828 res.get(arg_name).then(unittest.expectAsync1(((api.Policy response) { |
| 2829 checkPolicy(response); |
| 2830 }))); |
| 2831 }); |
| 2832 |
| 2833 unittest.test("method--list", () { |
| 2834 |
| 2835 var mock = new HttpServerMock(); |
| 2836 api.EnterprisesPoliciesResourceApi res = new api.AndroidmanagementApi(mock
).enterprises.policies; |
| 2837 var arg_parent = "foo"; |
| 2838 var arg_pageSize = 42; |
| 2839 var arg_pageToken = "foo"; |
| 2840 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2841 var path = (req.url).path; |
| 2842 var pathOffset = 0; |
| 2843 var index; |
| 2844 var subPart; |
| 2845 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2846 pathOffset += 1; |
| 2847 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2848 pathOffset += 3; |
| 2849 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2850 |
| 2851 var query = (req.url).query; |
| 2852 var queryOffset = 0; |
| 2853 var queryMap = {}; |
| 2854 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2855 parseBool(n) { |
| 2856 if (n == "true") return true; |
| 2857 if (n == "false") return false; |
| 2858 if (n == null) return null; |
| 2859 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2860 } |
| 2861 if (query.length > 0) { |
| 2862 for (var part in query.split("&")) { |
| 2863 var keyvalue = part.split("="); |
| 2864 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2865 } |
| 2866 } |
| 2867 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2868 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2869 |
| 2870 |
| 2871 var h = { |
| 2872 "content-type" : "application/json; charset=utf-8", |
| 2873 }; |
| 2874 var resp = convert.JSON.encode(buildListPoliciesResponse()); |
| 2875 return new async.Future.value(stringResponse(200, h, resp)); |
| 2876 }), true); |
| 2877 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync1(((api.ListPoliciesResponse response) { |
| 2878 checkListPoliciesResponse(response); |
| 2879 }))); |
| 2880 }); |
| 2881 |
| 2882 unittest.test("method--patch", () { |
| 2883 |
| 2884 var mock = new HttpServerMock(); |
| 2885 api.EnterprisesPoliciesResourceApi res = new api.AndroidmanagementApi(mock
).enterprises.policies; |
| 2886 var arg_request = buildPolicy(); |
| 2887 var arg_name = "foo"; |
| 2888 var arg_updateMask = "foo"; |
| 2889 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2890 var obj = new api.Policy.fromJson(json); |
| 2891 checkPolicy(obj); |
| 2892 |
| 2893 var path = (req.url).path; |
| 2894 var pathOffset = 0; |
| 2895 var index; |
| 2896 var subPart; |
| 2897 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2898 pathOffset += 1; |
| 2899 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2900 pathOffset += 3; |
| 2901 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2902 |
| 2903 var query = (req.url).query; |
| 2904 var queryOffset = 0; |
| 2905 var queryMap = {}; |
| 2906 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2907 parseBool(n) { |
| 2908 if (n == "true") return true; |
| 2909 if (n == "false") return false; |
| 2910 if (n == null) return null; |
| 2911 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2912 } |
| 2913 if (query.length > 0) { |
| 2914 for (var part in query.split("&")) { |
| 2915 var keyvalue = part.split("="); |
| 2916 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2917 } |
| 2918 } |
| 2919 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 2920 |
| 2921 |
| 2922 var h = { |
| 2923 "content-type" : "application/json; charset=utf-8", |
| 2924 }; |
| 2925 var resp = convert.JSON.encode(buildPolicy()); |
| 2926 return new async.Future.value(stringResponse(200, h, resp)); |
| 2927 }), true); |
| 2928 res.patch(arg_request, arg_name, updateMask: arg_updateMask).then(unittest
.expectAsync1(((api.Policy response) { |
| 2929 checkPolicy(response); |
| 2930 }))); |
| 2931 }); |
| 2932 |
| 2933 }); |
| 2934 |
| 2935 |
| 2936 unittest.group("resource-EnterprisesWebTokensResourceApi", () { |
| 2937 unittest.test("method--create", () { |
| 2938 |
| 2939 var mock = new HttpServerMock(); |
| 2940 api.EnterprisesWebTokensResourceApi res = new api.AndroidmanagementApi(moc
k).enterprises.webTokens; |
| 2941 var arg_request = buildWebToken(); |
| 2942 var arg_parent = "foo"; |
| 2943 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2944 var obj = new api.WebToken.fromJson(json); |
| 2945 checkWebToken(obj); |
| 2946 |
| 2947 var path = (req.url).path; |
| 2948 var pathOffset = 0; |
| 2949 var index; |
| 2950 var subPart; |
| 2951 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2952 pathOffset += 1; |
| 2953 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2954 pathOffset += 3; |
| 2955 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2956 |
| 2957 var query = (req.url).query; |
| 2958 var queryOffset = 0; |
| 2959 var queryMap = {}; |
| 2960 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2961 parseBool(n) { |
| 2962 if (n == "true") return true; |
| 2963 if (n == "false") return false; |
| 2964 if (n == null) return null; |
| 2965 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2966 } |
| 2967 if (query.length > 0) { |
| 2968 for (var part in query.split("&")) { |
| 2969 var keyvalue = part.split("="); |
| 2970 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2971 } |
| 2972 } |
| 2973 |
| 2974 |
| 2975 var h = { |
| 2976 "content-type" : "application/json; charset=utf-8", |
| 2977 }; |
| 2978 var resp = convert.JSON.encode(buildWebToken()); |
| 2979 return new async.Future.value(stringResponse(200, h, resp)); |
| 2980 }), true); |
| 2981 res.create(arg_request, arg_parent).then(unittest.expectAsync1(((api.WebTo
ken response) { |
| 2982 checkWebToken(response); |
| 2983 }))); |
| 2984 }); |
| 2985 |
| 2986 }); |
| 2987 |
| 2988 |
| 2989 unittest.group("resource-SignupUrlsResourceApi", () { |
| 2990 unittest.test("method--create", () { |
| 2991 |
| 2992 var mock = new HttpServerMock(); |
| 2993 api.SignupUrlsResourceApi res = new api.AndroidmanagementApi(mock).signupU
rls; |
| 2994 var arg_callbackUrl = "foo"; |
| 2995 var arg_projectId = "foo"; |
| 2996 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 2997 var path = (req.url).path; |
| 2998 var pathOffset = 0; |
| 2999 var index; |
| 3000 var subPart; |
| 3001 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3002 pathOffset += 1; |
| 3003 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("v1/signupUrls")); |
| 3004 pathOffset += 13; |
| 3005 |
| 3006 var query = (req.url).query; |
| 3007 var queryOffset = 0; |
| 3008 var queryMap = {}; |
| 3009 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3010 parseBool(n) { |
| 3011 if (n == "true") return true; |
| 3012 if (n == "false") return false; |
| 3013 if (n == null) return null; |
| 3014 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3015 } |
| 3016 if (query.length > 0) { |
| 3017 for (var part in query.split("&")) { |
| 3018 var keyvalue = part.split("="); |
| 3019 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3020 } |
| 3021 } |
| 3022 unittest.expect(queryMap["callbackUrl"].first, unittest.equals(arg_callb
ackUrl)); |
| 3023 unittest.expect(queryMap["projectId"].first, unittest.equals(arg_project
Id)); |
| 3024 |
| 3025 |
| 3026 var h = { |
| 3027 "content-type" : "application/json; charset=utf-8", |
| 3028 }; |
| 3029 var resp = convert.JSON.encode(buildSignupUrl()); |
| 3030 return new async.Future.value(stringResponse(200, h, resp)); |
| 3031 }), true); |
| 3032 res.create(callbackUrl: arg_callbackUrl, projectId: arg_projectId).then(un
ittest.expectAsync1(((api.SignupUrl response) { |
| 3033 checkSignupUrl(response); |
| 3034 }))); |
| 3035 }); |
| 3036 |
| 3037 }); |
| 3038 |
| 3039 |
| 3040 } |
| 3041 |
OLD | NEW |