OLD | NEW |
1 library googleapis_beta.logging.v1beta3.test; | 1 library googleapis_beta.logging.v1beta3.test; |
2 | 2 |
3 import "dart:core" as core; | 3 import "dart:core" as core; |
4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
5 import "dart:async" as async; | 5 import "dart:async" as async; |
6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
7 | 7 |
8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
52 } | 52 } |
53 | 53 |
| 54 core.int buildCounterAuditData = 0; |
| 55 buildAuditData() { |
| 56 var o = new api.AuditData(); |
| 57 buildCounterAuditData++; |
| 58 if (buildCounterAuditData < 3) { |
| 59 o.datasetInsertRequest = buildDatasetInsertRequest(); |
| 60 o.datasetInsertResponse = buildDatasetInsertResponse(); |
| 61 o.datasetListRequest = buildDatasetListRequest(); |
| 62 o.datasetUpdateRequest = buildDatasetUpdateRequest(); |
| 63 o.datasetUpdateResponse = buildDatasetUpdateResponse(); |
| 64 o.jobGetQueryResultsRequest = buildJobGetQueryResultsRequest(); |
| 65 o.jobGetQueryResultsResponse = buildJobGetQueryResultsResponse(); |
| 66 o.jobInsertRequest = buildJobInsertRequest(); |
| 67 o.jobQueryDoneResponse = buildJobQueryDoneResponse(); |
| 68 o.jobQueryRequest = buildJobQueryRequest(); |
| 69 o.jobQueryResponse = buildJobQueryResponse(); |
| 70 o.tableDataListRequest = buildTableDataListRequest(); |
| 71 o.tableInsertRequest = buildTableInsertRequest(); |
| 72 o.tableInsertResponse = buildTableInsertResponse(); |
| 73 o.tableUpdateRequest = buildTableUpdateRequest(); |
| 74 o.tableUpdateResponse = buildTableUpdateResponse(); |
| 75 } |
| 76 buildCounterAuditData--; |
| 77 return o; |
| 78 } |
| 79 |
| 80 checkAuditData(api.AuditData o) { |
| 81 buildCounterAuditData++; |
| 82 if (buildCounterAuditData < 3) { |
| 83 checkDatasetInsertRequest(o.datasetInsertRequest); |
| 84 checkDatasetInsertResponse(o.datasetInsertResponse); |
| 85 checkDatasetListRequest(o.datasetListRequest); |
| 86 checkDatasetUpdateRequest(o.datasetUpdateRequest); |
| 87 checkDatasetUpdateResponse(o.datasetUpdateResponse); |
| 88 checkJobGetQueryResultsRequest(o.jobGetQueryResultsRequest); |
| 89 checkJobGetQueryResultsResponse(o.jobGetQueryResultsResponse); |
| 90 checkJobInsertRequest(o.jobInsertRequest); |
| 91 checkJobQueryDoneResponse(o.jobQueryDoneResponse); |
| 92 checkJobQueryRequest(o.jobQueryRequest); |
| 93 checkJobQueryResponse(o.jobQueryResponse); |
| 94 checkTableDataListRequest(o.tableDataListRequest); |
| 95 checkTableInsertRequest(o.tableInsertRequest); |
| 96 checkTableInsertResponse(o.tableInsertResponse); |
| 97 checkTableUpdateRequest(o.tableUpdateRequest); |
| 98 checkTableUpdateResponse(o.tableUpdateResponse); |
| 99 } |
| 100 buildCounterAuditData--; |
| 101 } |
| 102 |
| 103 buildUnnamed2460() { |
| 104 var o = new core.List<api.AuthorizationInfo>(); |
| 105 o.add(buildAuthorizationInfo()); |
| 106 o.add(buildAuthorizationInfo()); |
| 107 return o; |
| 108 } |
| 109 |
| 110 checkUnnamed2460(core.List<api.AuthorizationInfo> o) { |
| 111 unittest.expect(o, unittest.hasLength(2)); |
| 112 checkAuthorizationInfo(o[0]); |
| 113 checkAuthorizationInfo(o[1]); |
| 114 } |
| 115 |
| 116 buildUnnamed2461() { |
| 117 var o = new core.Map<core.String, core.Object>(); |
| 118 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 119 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 120 return o; |
| 121 } |
| 122 |
| 123 checkUnnamed2461(core.Map<core.String, core.Object> o) { |
| 124 unittest.expect(o, unittest.hasLength(2)); |
| 125 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')); |
| 126 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')); |
| 127 } |
| 128 |
| 129 core.int buildCounterAuditLog = 0; |
| 130 buildAuditLog() { |
| 131 var o = new api.AuditLog(); |
| 132 buildCounterAuditLog++; |
| 133 if (buildCounterAuditLog < 3) { |
| 134 o.authenticationInfo = buildAuthenticationInfo(); |
| 135 o.authorizationInfo = buildUnnamed2460(); |
| 136 o.bigqueryData = buildAuditData(); |
| 137 o.methodName = "foo"; |
| 138 o.numResponseItems = "foo"; |
| 139 o.requestMetadata = buildRequestMetadata(); |
| 140 o.resourceName = "foo"; |
| 141 o.serviceData = buildUnnamed2461(); |
| 142 o.serviceName = "foo"; |
| 143 o.status = buildStatus(); |
| 144 } |
| 145 buildCounterAuditLog--; |
| 146 return o; |
| 147 } |
| 148 |
| 149 checkAuditLog(api.AuditLog o) { |
| 150 buildCounterAuditLog++; |
| 151 if (buildCounterAuditLog < 3) { |
| 152 checkAuthenticationInfo(o.authenticationInfo); |
| 153 checkUnnamed2460(o.authorizationInfo); |
| 154 checkAuditData(o.bigqueryData); |
| 155 unittest.expect(o.methodName, unittest.equals('foo')); |
| 156 unittest.expect(o.numResponseItems, unittest.equals('foo')); |
| 157 checkRequestMetadata(o.requestMetadata); |
| 158 unittest.expect(o.resourceName, unittest.equals('foo')); |
| 159 checkUnnamed2461(o.serviceData); |
| 160 unittest.expect(o.serviceName, unittest.equals('foo')); |
| 161 checkStatus(o.status); |
| 162 } |
| 163 buildCounterAuditLog--; |
| 164 } |
| 165 |
| 166 core.int buildCounterAuthenticationInfo = 0; |
| 167 buildAuthenticationInfo() { |
| 168 var o = new api.AuthenticationInfo(); |
| 169 buildCounterAuthenticationInfo++; |
| 170 if (buildCounterAuthenticationInfo < 3) { |
| 171 o.principalEmail = "foo"; |
| 172 } |
| 173 buildCounterAuthenticationInfo--; |
| 174 return o; |
| 175 } |
| 176 |
| 177 checkAuthenticationInfo(api.AuthenticationInfo o) { |
| 178 buildCounterAuthenticationInfo++; |
| 179 if (buildCounterAuthenticationInfo < 3) { |
| 180 unittest.expect(o.principalEmail, unittest.equals('foo')); |
| 181 } |
| 182 buildCounterAuthenticationInfo--; |
| 183 } |
| 184 |
| 185 core.int buildCounterAuthorizationInfo = 0; |
| 186 buildAuthorizationInfo() { |
| 187 var o = new api.AuthorizationInfo(); |
| 188 buildCounterAuthorizationInfo++; |
| 189 if (buildCounterAuthorizationInfo < 3) { |
| 190 o.granted = true; |
| 191 o.permission = "foo"; |
| 192 o.resource = "foo"; |
| 193 } |
| 194 buildCounterAuthorizationInfo--; |
| 195 return o; |
| 196 } |
| 197 |
| 198 checkAuthorizationInfo(api.AuthorizationInfo o) { |
| 199 buildCounterAuthorizationInfo++; |
| 200 if (buildCounterAuthorizationInfo < 3) { |
| 201 unittest.expect(o.granted, unittest.isTrue); |
| 202 unittest.expect(o.permission, unittest.equals('foo')); |
| 203 unittest.expect(o.resource, unittest.equals('foo')); |
| 204 } |
| 205 buildCounterAuthorizationInfo--; |
| 206 } |
| 207 |
| 208 buildUnnamed2462() { |
| 209 var o = new core.List<api.Entry>(); |
| 210 o.add(buildEntry()); |
| 211 o.add(buildEntry()); |
| 212 return o; |
| 213 } |
| 214 |
| 215 checkUnnamed2462(core.List<api.Entry> o) { |
| 216 unittest.expect(o, unittest.hasLength(2)); |
| 217 checkEntry(o[0]); |
| 218 checkEntry(o[1]); |
| 219 } |
| 220 |
| 221 core.int buildCounterBigQueryAcl = 0; |
| 222 buildBigQueryAcl() { |
| 223 var o = new api.BigQueryAcl(); |
| 224 buildCounterBigQueryAcl++; |
| 225 if (buildCounterBigQueryAcl < 3) { |
| 226 o.entries = buildUnnamed2462(); |
| 227 } |
| 228 buildCounterBigQueryAcl--; |
| 229 return o; |
| 230 } |
| 231 |
| 232 checkBigQueryAcl(api.BigQueryAcl o) { |
| 233 buildCounterBigQueryAcl++; |
| 234 if (buildCounterBigQueryAcl < 3) { |
| 235 checkUnnamed2462(o.entries); |
| 236 } |
| 237 buildCounterBigQueryAcl--; |
| 238 } |
| 239 |
| 240 core.int buildCounterDataset = 0; |
| 241 buildDataset() { |
| 242 var o = new api.Dataset(); |
| 243 buildCounterDataset++; |
| 244 if (buildCounterDataset < 3) { |
| 245 o.acl = buildBigQueryAcl(); |
| 246 o.createTime = "foo"; |
| 247 o.datasetName = buildDatasetName(); |
| 248 o.defaultTableExpireDuration = "foo"; |
| 249 o.info = buildDatasetInfo(); |
| 250 o.updateTime = "foo"; |
| 251 } |
| 252 buildCounterDataset--; |
| 253 return o; |
| 254 } |
| 255 |
| 256 checkDataset(api.Dataset o) { |
| 257 buildCounterDataset++; |
| 258 if (buildCounterDataset < 3) { |
| 259 checkBigQueryAcl(o.acl); |
| 260 unittest.expect(o.createTime, unittest.equals('foo')); |
| 261 checkDatasetName(o.datasetName); |
| 262 unittest.expect(o.defaultTableExpireDuration, unittest.equals('foo')); |
| 263 checkDatasetInfo(o.info); |
| 264 unittest.expect(o.updateTime, unittest.equals('foo')); |
| 265 } |
| 266 buildCounterDataset--; |
| 267 } |
| 268 |
| 269 core.int buildCounterDatasetInfo = 0; |
| 270 buildDatasetInfo() { |
| 271 var o = new api.DatasetInfo(); |
| 272 buildCounterDatasetInfo++; |
| 273 if (buildCounterDatasetInfo < 3) { |
| 274 o.description = "foo"; |
| 275 o.friendlyName = "foo"; |
| 276 } |
| 277 buildCounterDatasetInfo--; |
| 278 return o; |
| 279 } |
| 280 |
| 281 checkDatasetInfo(api.DatasetInfo o) { |
| 282 buildCounterDatasetInfo++; |
| 283 if (buildCounterDatasetInfo < 3) { |
| 284 unittest.expect(o.description, unittest.equals('foo')); |
| 285 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 286 } |
| 287 buildCounterDatasetInfo--; |
| 288 } |
| 289 |
| 290 core.int buildCounterDatasetInsertRequest = 0; |
| 291 buildDatasetInsertRequest() { |
| 292 var o = new api.DatasetInsertRequest(); |
| 293 buildCounterDatasetInsertRequest++; |
| 294 if (buildCounterDatasetInsertRequest < 3) { |
| 295 o.resource = buildDataset(); |
| 296 } |
| 297 buildCounterDatasetInsertRequest--; |
| 298 return o; |
| 299 } |
| 300 |
| 301 checkDatasetInsertRequest(api.DatasetInsertRequest o) { |
| 302 buildCounterDatasetInsertRequest++; |
| 303 if (buildCounterDatasetInsertRequest < 3) { |
| 304 checkDataset(o.resource); |
| 305 } |
| 306 buildCounterDatasetInsertRequest--; |
| 307 } |
| 308 |
| 309 core.int buildCounterDatasetInsertResponse = 0; |
| 310 buildDatasetInsertResponse() { |
| 311 var o = new api.DatasetInsertResponse(); |
| 312 buildCounterDatasetInsertResponse++; |
| 313 if (buildCounterDatasetInsertResponse < 3) { |
| 314 o.resource = buildDataset(); |
| 315 } |
| 316 buildCounterDatasetInsertResponse--; |
| 317 return o; |
| 318 } |
| 319 |
| 320 checkDatasetInsertResponse(api.DatasetInsertResponse o) { |
| 321 buildCounterDatasetInsertResponse++; |
| 322 if (buildCounterDatasetInsertResponse < 3) { |
| 323 checkDataset(o.resource); |
| 324 } |
| 325 buildCounterDatasetInsertResponse--; |
| 326 } |
| 327 |
| 328 core.int buildCounterDatasetListRequest = 0; |
| 329 buildDatasetListRequest() { |
| 330 var o = new api.DatasetListRequest(); |
| 331 buildCounterDatasetListRequest++; |
| 332 if (buildCounterDatasetListRequest < 3) { |
| 333 o.listAll = true; |
| 334 } |
| 335 buildCounterDatasetListRequest--; |
| 336 return o; |
| 337 } |
| 338 |
| 339 checkDatasetListRequest(api.DatasetListRequest o) { |
| 340 buildCounterDatasetListRequest++; |
| 341 if (buildCounterDatasetListRequest < 3) { |
| 342 unittest.expect(o.listAll, unittest.isTrue); |
| 343 } |
| 344 buildCounterDatasetListRequest--; |
| 345 } |
| 346 |
| 347 core.int buildCounterDatasetName = 0; |
| 348 buildDatasetName() { |
| 349 var o = new api.DatasetName(); |
| 350 buildCounterDatasetName++; |
| 351 if (buildCounterDatasetName < 3) { |
| 352 o.datasetId = "foo"; |
| 353 o.projectId = "foo"; |
| 354 } |
| 355 buildCounterDatasetName--; |
| 356 return o; |
| 357 } |
| 358 |
| 359 checkDatasetName(api.DatasetName o) { |
| 360 buildCounterDatasetName++; |
| 361 if (buildCounterDatasetName < 3) { |
| 362 unittest.expect(o.datasetId, unittest.equals('foo')); |
| 363 unittest.expect(o.projectId, unittest.equals('foo')); |
| 364 } |
| 365 buildCounterDatasetName--; |
| 366 } |
| 367 |
| 368 core.int buildCounterDatasetUpdateRequest = 0; |
| 369 buildDatasetUpdateRequest() { |
| 370 var o = new api.DatasetUpdateRequest(); |
| 371 buildCounterDatasetUpdateRequest++; |
| 372 if (buildCounterDatasetUpdateRequest < 3) { |
| 373 o.resource = buildDataset(); |
| 374 } |
| 375 buildCounterDatasetUpdateRequest--; |
| 376 return o; |
| 377 } |
| 378 |
| 379 checkDatasetUpdateRequest(api.DatasetUpdateRequest o) { |
| 380 buildCounterDatasetUpdateRequest++; |
| 381 if (buildCounterDatasetUpdateRequest < 3) { |
| 382 checkDataset(o.resource); |
| 383 } |
| 384 buildCounterDatasetUpdateRequest--; |
| 385 } |
| 386 |
| 387 core.int buildCounterDatasetUpdateResponse = 0; |
| 388 buildDatasetUpdateResponse() { |
| 389 var o = new api.DatasetUpdateResponse(); |
| 390 buildCounterDatasetUpdateResponse++; |
| 391 if (buildCounterDatasetUpdateResponse < 3) { |
| 392 o.resource = buildDataset(); |
| 393 } |
| 394 buildCounterDatasetUpdateResponse--; |
| 395 return o; |
| 396 } |
| 397 |
| 398 checkDatasetUpdateResponse(api.DatasetUpdateResponse o) { |
| 399 buildCounterDatasetUpdateResponse++; |
| 400 if (buildCounterDatasetUpdateResponse < 3) { |
| 401 checkDataset(o.resource); |
| 402 } |
| 403 buildCounterDatasetUpdateResponse--; |
| 404 } |
| 405 |
54 core.int buildCounterEmpty = 0; | 406 core.int buildCounterEmpty = 0; |
55 buildEmpty() { | 407 buildEmpty() { |
56 var o = new api.Empty(); | 408 var o = new api.Empty(); |
57 buildCounterEmpty++; | 409 buildCounterEmpty++; |
58 if (buildCounterEmpty < 3) { | 410 if (buildCounterEmpty < 3) { |
59 } | 411 } |
60 buildCounterEmpty--; | 412 buildCounterEmpty--; |
61 return o; | 413 return o; |
62 } | 414 } |
63 | 415 |
64 checkEmpty(api.Empty o) { | 416 checkEmpty(api.Empty o) { |
65 buildCounterEmpty++; | 417 buildCounterEmpty++; |
66 if (buildCounterEmpty < 3) { | 418 if (buildCounterEmpty < 3) { |
67 } | 419 } |
68 buildCounterEmpty--; | 420 buildCounterEmpty--; |
69 } | 421 } |
70 | 422 |
71 buildUnnamed1594() { | 423 core.int buildCounterEntry = 0; |
| 424 buildEntry() { |
| 425 var o = new api.Entry(); |
| 426 buildCounterEntry++; |
| 427 if (buildCounterEntry < 3) { |
| 428 o.domain = "foo"; |
| 429 o.groupEmail = "foo"; |
| 430 o.role = "foo"; |
| 431 o.specialGroup = "foo"; |
| 432 o.userEmail = "foo"; |
| 433 o.viewName = buildTableName(); |
| 434 } |
| 435 buildCounterEntry--; |
| 436 return o; |
| 437 } |
| 438 |
| 439 checkEntry(api.Entry o) { |
| 440 buildCounterEntry++; |
| 441 if (buildCounterEntry < 3) { |
| 442 unittest.expect(o.domain, unittest.equals('foo')); |
| 443 unittest.expect(o.groupEmail, unittest.equals('foo')); |
| 444 unittest.expect(o.role, unittest.equals('foo')); |
| 445 unittest.expect(o.specialGroup, unittest.equals('foo')); |
| 446 unittest.expect(o.userEmail, unittest.equals('foo')); |
| 447 checkTableName(o.viewName); |
| 448 } |
| 449 buildCounterEntry--; |
| 450 } |
| 451 |
| 452 buildUnnamed2463() { |
72 var o = new core.List<core.String>(); | 453 var o = new core.List<core.String>(); |
73 o.add("foo"); | 454 o.add("foo"); |
74 o.add("foo"); | 455 o.add("foo"); |
75 return o; | 456 return o; |
76 } | 457 } |
77 | 458 |
78 checkUnnamed1594(core.List<core.String> o) { | 459 checkUnnamed2463(core.List<core.String> o) { |
79 unittest.expect(o, unittest.hasLength(2)); | 460 unittest.expect(o, unittest.hasLength(2)); |
80 unittest.expect(o[0], unittest.equals('foo')); | 461 unittest.expect(o[0], unittest.equals('foo')); |
81 unittest.expect(o[1], unittest.equals('foo')); | 462 unittest.expect(o[1], unittest.equals('foo')); |
| 463 } |
| 464 |
| 465 core.int buildCounterExtract = 0; |
| 466 buildExtract() { |
| 467 var o = new api.Extract(); |
| 468 buildCounterExtract++; |
| 469 if (buildCounterExtract < 3) { |
| 470 o.destinationUris = buildUnnamed2463(); |
| 471 o.sourceTable = buildTableName(); |
| 472 } |
| 473 buildCounterExtract--; |
| 474 return o; |
| 475 } |
| 476 |
| 477 checkExtract(api.Extract o) { |
| 478 buildCounterExtract++; |
| 479 if (buildCounterExtract < 3) { |
| 480 checkUnnamed2463(o.destinationUris); |
| 481 checkTableName(o.sourceTable); |
| 482 } |
| 483 buildCounterExtract--; |
| 484 } |
| 485 |
| 486 core.int buildCounterFieldSchema = 0; |
| 487 buildFieldSchema() { |
| 488 var o = new api.FieldSchema(); |
| 489 buildCounterFieldSchema++; |
| 490 if (buildCounterFieldSchema < 3) { |
| 491 o.mode = "foo"; |
| 492 o.name = "foo"; |
| 493 o.schema = buildTableSchema(); |
| 494 o.type = "foo"; |
| 495 } |
| 496 buildCounterFieldSchema--; |
| 497 return o; |
| 498 } |
| 499 |
| 500 checkFieldSchema(api.FieldSchema o) { |
| 501 buildCounterFieldSchema++; |
| 502 if (buildCounterFieldSchema < 3) { |
| 503 unittest.expect(o.mode, unittest.equals('foo')); |
| 504 unittest.expect(o.name, unittest.equals('foo')); |
| 505 checkTableSchema(o.schema); |
| 506 unittest.expect(o.type, unittest.equals('foo')); |
| 507 } |
| 508 buildCounterFieldSchema--; |
| 509 } |
| 510 |
| 511 core.int buildCounterHttpRequest = 0; |
| 512 buildHttpRequest() { |
| 513 var o = new api.HttpRequest(); |
| 514 buildCounterHttpRequest++; |
| 515 if (buildCounterHttpRequest < 3) { |
| 516 o.referer = "foo"; |
| 517 o.remoteIp = "foo"; |
| 518 o.requestMethod = "foo"; |
| 519 o.requestSize = "foo"; |
| 520 o.requestUrl = "foo"; |
| 521 o.responseSize = "foo"; |
| 522 o.status = 42; |
| 523 o.userAgent = "foo"; |
| 524 } |
| 525 buildCounterHttpRequest--; |
| 526 return o; |
| 527 } |
| 528 |
| 529 checkHttpRequest(api.HttpRequest o) { |
| 530 buildCounterHttpRequest++; |
| 531 if (buildCounterHttpRequest < 3) { |
| 532 unittest.expect(o.referer, unittest.equals('foo')); |
| 533 unittest.expect(o.remoteIp, unittest.equals('foo')); |
| 534 unittest.expect(o.requestMethod, unittest.equals('foo')); |
| 535 unittest.expect(o.requestSize, unittest.equals('foo')); |
| 536 unittest.expect(o.requestUrl, unittest.equals('foo')); |
| 537 unittest.expect(o.responseSize, unittest.equals('foo')); |
| 538 unittest.expect(o.status, unittest.equals(42)); |
| 539 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 540 } |
| 541 buildCounterHttpRequest--; |
| 542 } |
| 543 |
| 544 core.int buildCounterJob = 0; |
| 545 buildJob() { |
| 546 var o = new api.Job(); |
| 547 buildCounterJob++; |
| 548 if (buildCounterJob < 3) { |
| 549 o.jobConfiguration = buildJobConfiguration(); |
| 550 o.jobName = buildJobName(); |
| 551 o.jobStatistics = buildJobStatistics(); |
| 552 o.jobStatus = buildJobStatus(); |
| 553 } |
| 554 buildCounterJob--; |
| 555 return o; |
| 556 } |
| 557 |
| 558 checkJob(api.Job o) { |
| 559 buildCounterJob++; |
| 560 if (buildCounterJob < 3) { |
| 561 checkJobConfiguration(o.jobConfiguration); |
| 562 checkJobName(o.jobName); |
| 563 checkJobStatistics(o.jobStatistics); |
| 564 checkJobStatus(o.jobStatus); |
| 565 } |
| 566 buildCounterJob--; |
| 567 } |
| 568 |
| 569 core.int buildCounterJobConfiguration = 0; |
| 570 buildJobConfiguration() { |
| 571 var o = new api.JobConfiguration(); |
| 572 buildCounterJobConfiguration++; |
| 573 if (buildCounterJobConfiguration < 3) { |
| 574 o.dryRun = true; |
| 575 o.extract = buildExtract(); |
| 576 o.load = buildLoad(); |
| 577 o.query = buildQuery(); |
| 578 o.tableCopy = buildTableCopy(); |
| 579 } |
| 580 buildCounterJobConfiguration--; |
| 581 return o; |
| 582 } |
| 583 |
| 584 checkJobConfiguration(api.JobConfiguration o) { |
| 585 buildCounterJobConfiguration++; |
| 586 if (buildCounterJobConfiguration < 3) { |
| 587 unittest.expect(o.dryRun, unittest.isTrue); |
| 588 checkExtract(o.extract); |
| 589 checkLoad(o.load); |
| 590 checkQuery(o.query); |
| 591 checkTableCopy(o.tableCopy); |
| 592 } |
| 593 buildCounterJobConfiguration--; |
| 594 } |
| 595 |
| 596 core.int buildCounterJobGetQueryResultsRequest = 0; |
| 597 buildJobGetQueryResultsRequest() { |
| 598 var o = new api.JobGetQueryResultsRequest(); |
| 599 buildCounterJobGetQueryResultsRequest++; |
| 600 if (buildCounterJobGetQueryResultsRequest < 3) { |
| 601 o.maxResults = 42; |
| 602 o.startRow = "foo"; |
| 603 } |
| 604 buildCounterJobGetQueryResultsRequest--; |
| 605 return o; |
| 606 } |
| 607 |
| 608 checkJobGetQueryResultsRequest(api.JobGetQueryResultsRequest o) { |
| 609 buildCounterJobGetQueryResultsRequest++; |
| 610 if (buildCounterJobGetQueryResultsRequest < 3) { |
| 611 unittest.expect(o.maxResults, unittest.equals(42)); |
| 612 unittest.expect(o.startRow, unittest.equals('foo')); |
| 613 } |
| 614 buildCounterJobGetQueryResultsRequest--; |
| 615 } |
| 616 |
| 617 core.int buildCounterJobGetQueryResultsResponse = 0; |
| 618 buildJobGetQueryResultsResponse() { |
| 619 var o = new api.JobGetQueryResultsResponse(); |
| 620 buildCounterJobGetQueryResultsResponse++; |
| 621 if (buildCounterJobGetQueryResultsResponse < 3) { |
| 622 o.job = buildJob(); |
| 623 o.totalResults = "foo"; |
| 624 } |
| 625 buildCounterJobGetQueryResultsResponse--; |
| 626 return o; |
| 627 } |
| 628 |
| 629 checkJobGetQueryResultsResponse(api.JobGetQueryResultsResponse o) { |
| 630 buildCounterJobGetQueryResultsResponse++; |
| 631 if (buildCounterJobGetQueryResultsResponse < 3) { |
| 632 checkJob(o.job); |
| 633 unittest.expect(o.totalResults, unittest.equals('foo')); |
| 634 } |
| 635 buildCounterJobGetQueryResultsResponse--; |
| 636 } |
| 637 |
| 638 core.int buildCounterJobInsertRequest = 0; |
| 639 buildJobInsertRequest() { |
| 640 var o = new api.JobInsertRequest(); |
| 641 buildCounterJobInsertRequest++; |
| 642 if (buildCounterJobInsertRequest < 3) { |
| 643 o.resource = buildJob(); |
| 644 } |
| 645 buildCounterJobInsertRequest--; |
| 646 return o; |
| 647 } |
| 648 |
| 649 checkJobInsertRequest(api.JobInsertRequest o) { |
| 650 buildCounterJobInsertRequest++; |
| 651 if (buildCounterJobInsertRequest < 3) { |
| 652 checkJob(o.resource); |
| 653 } |
| 654 buildCounterJobInsertRequest--; |
| 655 } |
| 656 |
| 657 core.int buildCounterJobName = 0; |
| 658 buildJobName() { |
| 659 var o = new api.JobName(); |
| 660 buildCounterJobName++; |
| 661 if (buildCounterJobName < 3) { |
| 662 o.jobId = "foo"; |
| 663 o.projectId = "foo"; |
| 664 } |
| 665 buildCounterJobName--; |
| 666 return o; |
| 667 } |
| 668 |
| 669 checkJobName(api.JobName o) { |
| 670 buildCounterJobName++; |
| 671 if (buildCounterJobName < 3) { |
| 672 unittest.expect(o.jobId, unittest.equals('foo')); |
| 673 unittest.expect(o.projectId, unittest.equals('foo')); |
| 674 } |
| 675 buildCounterJobName--; |
| 676 } |
| 677 |
| 678 core.int buildCounterJobQueryDoneResponse = 0; |
| 679 buildJobQueryDoneResponse() { |
| 680 var o = new api.JobQueryDoneResponse(); |
| 681 buildCounterJobQueryDoneResponse++; |
| 682 if (buildCounterJobQueryDoneResponse < 3) { |
| 683 o.job = buildJob(); |
| 684 } |
| 685 buildCounterJobQueryDoneResponse--; |
| 686 return o; |
| 687 } |
| 688 |
| 689 checkJobQueryDoneResponse(api.JobQueryDoneResponse o) { |
| 690 buildCounterJobQueryDoneResponse++; |
| 691 if (buildCounterJobQueryDoneResponse < 3) { |
| 692 checkJob(o.job); |
| 693 } |
| 694 buildCounterJobQueryDoneResponse--; |
| 695 } |
| 696 |
| 697 core.int buildCounterJobQueryRequest = 0; |
| 698 buildJobQueryRequest() { |
| 699 var o = new api.JobQueryRequest(); |
| 700 buildCounterJobQueryRequest++; |
| 701 if (buildCounterJobQueryRequest < 3) { |
| 702 o.defaultDataset = buildDatasetName(); |
| 703 o.dryRun = true; |
| 704 o.maxResults = 42; |
| 705 o.projectId = "foo"; |
| 706 o.query = "foo"; |
| 707 } |
| 708 buildCounterJobQueryRequest--; |
| 709 return o; |
| 710 } |
| 711 |
| 712 checkJobQueryRequest(api.JobQueryRequest o) { |
| 713 buildCounterJobQueryRequest++; |
| 714 if (buildCounterJobQueryRequest < 3) { |
| 715 checkDatasetName(o.defaultDataset); |
| 716 unittest.expect(o.dryRun, unittest.isTrue); |
| 717 unittest.expect(o.maxResults, unittest.equals(42)); |
| 718 unittest.expect(o.projectId, unittest.equals('foo')); |
| 719 unittest.expect(o.query, unittest.equals('foo')); |
| 720 } |
| 721 buildCounterJobQueryRequest--; |
| 722 } |
| 723 |
| 724 core.int buildCounterJobQueryResponse = 0; |
| 725 buildJobQueryResponse() { |
| 726 var o = new api.JobQueryResponse(); |
| 727 buildCounterJobQueryResponse++; |
| 728 if (buildCounterJobQueryResponse < 3) { |
| 729 o.job = buildJob(); |
| 730 o.totalResults = "foo"; |
| 731 } |
| 732 buildCounterJobQueryResponse--; |
| 733 return o; |
| 734 } |
| 735 |
| 736 checkJobQueryResponse(api.JobQueryResponse o) { |
| 737 buildCounterJobQueryResponse++; |
| 738 if (buildCounterJobQueryResponse < 3) { |
| 739 checkJob(o.job); |
| 740 unittest.expect(o.totalResults, unittest.equals('foo')); |
| 741 } |
| 742 buildCounterJobQueryResponse--; |
| 743 } |
| 744 |
| 745 core.int buildCounterJobStatistics = 0; |
| 746 buildJobStatistics() { |
| 747 var o = new api.JobStatistics(); |
| 748 buildCounterJobStatistics++; |
| 749 if (buildCounterJobStatistics < 3) { |
| 750 o.createTime = "foo"; |
| 751 o.endTime = "foo"; |
| 752 o.startTime = "foo"; |
| 753 o.totalProcessedBytes = "foo"; |
| 754 } |
| 755 buildCounterJobStatistics--; |
| 756 return o; |
| 757 } |
| 758 |
| 759 checkJobStatistics(api.JobStatistics o) { |
| 760 buildCounterJobStatistics++; |
| 761 if (buildCounterJobStatistics < 3) { |
| 762 unittest.expect(o.createTime, unittest.equals('foo')); |
| 763 unittest.expect(o.endTime, unittest.equals('foo')); |
| 764 unittest.expect(o.startTime, unittest.equals('foo')); |
| 765 unittest.expect(o.totalProcessedBytes, unittest.equals('foo')); |
| 766 } |
| 767 buildCounterJobStatistics--; |
| 768 } |
| 769 |
| 770 core.int buildCounterJobStatus = 0; |
| 771 buildJobStatus() { |
| 772 var o = new api.JobStatus(); |
| 773 buildCounterJobStatus++; |
| 774 if (buildCounterJobStatus < 3) { |
| 775 o.error = buildStatus(); |
| 776 o.state = "foo"; |
| 777 } |
| 778 buildCounterJobStatus--; |
| 779 return o; |
| 780 } |
| 781 |
| 782 checkJobStatus(api.JobStatus o) { |
| 783 buildCounterJobStatus++; |
| 784 if (buildCounterJobStatus < 3) { |
| 785 checkStatus(o.error); |
| 786 unittest.expect(o.state, unittest.equals('foo')); |
| 787 } |
| 788 buildCounterJobStatus--; |
| 789 } |
| 790 |
| 791 buildUnnamed2464() { |
| 792 var o = new core.List<core.String>(); |
| 793 o.add("foo"); |
| 794 o.add("foo"); |
| 795 return o; |
| 796 } |
| 797 |
| 798 checkUnnamed2464(core.List<core.String> o) { |
| 799 unittest.expect(o, unittest.hasLength(2)); |
| 800 unittest.expect(o[0], unittest.equals('foo')); |
| 801 unittest.expect(o[1], unittest.equals('foo')); |
82 } | 802 } |
83 | 803 |
84 core.int buildCounterListLogServiceIndexesResponse = 0; | 804 core.int buildCounterListLogServiceIndexesResponse = 0; |
85 buildListLogServiceIndexesResponse() { | 805 buildListLogServiceIndexesResponse() { |
86 var o = new api.ListLogServiceIndexesResponse(); | 806 var o = new api.ListLogServiceIndexesResponse(); |
87 buildCounterListLogServiceIndexesResponse++; | 807 buildCounterListLogServiceIndexesResponse++; |
88 if (buildCounterListLogServiceIndexesResponse < 3) { | 808 if (buildCounterListLogServiceIndexesResponse < 3) { |
89 o.nextPageToken = "foo"; | 809 o.nextPageToken = "foo"; |
90 o.serviceIndexPrefixes = buildUnnamed1594(); | 810 o.serviceIndexPrefixes = buildUnnamed2464(); |
91 } | 811 } |
92 buildCounterListLogServiceIndexesResponse--; | 812 buildCounterListLogServiceIndexesResponse--; |
93 return o; | 813 return o; |
94 } | 814 } |
95 | 815 |
96 checkListLogServiceIndexesResponse(api.ListLogServiceIndexesResponse o) { | 816 checkListLogServiceIndexesResponse(api.ListLogServiceIndexesResponse o) { |
97 buildCounterListLogServiceIndexesResponse++; | 817 buildCounterListLogServiceIndexesResponse++; |
98 if (buildCounterListLogServiceIndexesResponse < 3) { | 818 if (buildCounterListLogServiceIndexesResponse < 3) { |
99 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 819 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
100 checkUnnamed1594(o.serviceIndexPrefixes); | 820 checkUnnamed2464(o.serviceIndexPrefixes); |
101 } | 821 } |
102 buildCounterListLogServiceIndexesResponse--; | 822 buildCounterListLogServiceIndexesResponse--; |
103 } | 823 } |
104 | 824 |
105 buildUnnamed1595() { | 825 buildUnnamed2465() { |
106 var o = new core.List<api.LogSink>(); | 826 var o = new core.List<api.LogSink>(); |
107 o.add(buildLogSink()); | 827 o.add(buildLogSink()); |
108 o.add(buildLogSink()); | 828 o.add(buildLogSink()); |
109 return o; | 829 return o; |
110 } | 830 } |
111 | 831 |
112 checkUnnamed1595(core.List<api.LogSink> o) { | 832 checkUnnamed2465(core.List<api.LogSink> o) { |
113 unittest.expect(o, unittest.hasLength(2)); | 833 unittest.expect(o, unittest.hasLength(2)); |
114 checkLogSink(o[0]); | 834 checkLogSink(o[0]); |
115 checkLogSink(o[1]); | 835 checkLogSink(o[1]); |
116 } | 836 } |
117 | 837 |
118 core.int buildCounterListLogServiceSinksResponse = 0; | 838 core.int buildCounterListLogServiceSinksResponse = 0; |
119 buildListLogServiceSinksResponse() { | 839 buildListLogServiceSinksResponse() { |
120 var o = new api.ListLogServiceSinksResponse(); | 840 var o = new api.ListLogServiceSinksResponse(); |
121 buildCounterListLogServiceSinksResponse++; | 841 buildCounterListLogServiceSinksResponse++; |
122 if (buildCounterListLogServiceSinksResponse < 3) { | 842 if (buildCounterListLogServiceSinksResponse < 3) { |
123 o.sinks = buildUnnamed1595(); | 843 o.sinks = buildUnnamed2465(); |
124 } | 844 } |
125 buildCounterListLogServiceSinksResponse--; | 845 buildCounterListLogServiceSinksResponse--; |
126 return o; | 846 return o; |
127 } | 847 } |
128 | 848 |
129 checkListLogServiceSinksResponse(api.ListLogServiceSinksResponse o) { | 849 checkListLogServiceSinksResponse(api.ListLogServiceSinksResponse o) { |
130 buildCounterListLogServiceSinksResponse++; | 850 buildCounterListLogServiceSinksResponse++; |
131 if (buildCounterListLogServiceSinksResponse < 3) { | 851 if (buildCounterListLogServiceSinksResponse < 3) { |
132 checkUnnamed1595(o.sinks); | 852 checkUnnamed2465(o.sinks); |
133 } | 853 } |
134 buildCounterListLogServiceSinksResponse--; | 854 buildCounterListLogServiceSinksResponse--; |
135 } | 855 } |
136 | 856 |
137 buildUnnamed1596() { | 857 buildUnnamed2466() { |
138 var o = new core.List<api.LogService>(); | 858 var o = new core.List<api.LogService>(); |
139 o.add(buildLogService()); | 859 o.add(buildLogService()); |
140 o.add(buildLogService()); | 860 o.add(buildLogService()); |
141 return o; | 861 return o; |
142 } | 862 } |
143 | 863 |
144 checkUnnamed1596(core.List<api.LogService> o) { | 864 checkUnnamed2466(core.List<api.LogService> o) { |
145 unittest.expect(o, unittest.hasLength(2)); | 865 unittest.expect(o, unittest.hasLength(2)); |
146 checkLogService(o[0]); | 866 checkLogService(o[0]); |
147 checkLogService(o[1]); | 867 checkLogService(o[1]); |
148 } | 868 } |
149 | 869 |
150 core.int buildCounterListLogServicesResponse = 0; | 870 core.int buildCounterListLogServicesResponse = 0; |
151 buildListLogServicesResponse() { | 871 buildListLogServicesResponse() { |
152 var o = new api.ListLogServicesResponse(); | 872 var o = new api.ListLogServicesResponse(); |
153 buildCounterListLogServicesResponse++; | 873 buildCounterListLogServicesResponse++; |
154 if (buildCounterListLogServicesResponse < 3) { | 874 if (buildCounterListLogServicesResponse < 3) { |
155 o.logServices = buildUnnamed1596(); | 875 o.logServices = buildUnnamed2466(); |
156 o.nextPageToken = "foo"; | 876 o.nextPageToken = "foo"; |
157 } | 877 } |
158 buildCounterListLogServicesResponse--; | 878 buildCounterListLogServicesResponse--; |
159 return o; | 879 return o; |
160 } | 880 } |
161 | 881 |
162 checkListLogServicesResponse(api.ListLogServicesResponse o) { | 882 checkListLogServicesResponse(api.ListLogServicesResponse o) { |
163 buildCounterListLogServicesResponse++; | 883 buildCounterListLogServicesResponse++; |
164 if (buildCounterListLogServicesResponse < 3) { | 884 if (buildCounterListLogServicesResponse < 3) { |
165 checkUnnamed1596(o.logServices); | 885 checkUnnamed2466(o.logServices); |
166 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 886 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
167 } | 887 } |
168 buildCounterListLogServicesResponse--; | 888 buildCounterListLogServicesResponse--; |
169 } | 889 } |
170 | 890 |
171 buildUnnamed1597() { | 891 buildUnnamed2467() { |
172 var o = new core.List<api.LogSink>(); | 892 var o = new core.List<api.LogSink>(); |
173 o.add(buildLogSink()); | 893 o.add(buildLogSink()); |
174 o.add(buildLogSink()); | 894 o.add(buildLogSink()); |
175 return o; | 895 return o; |
176 } | 896 } |
177 | 897 |
178 checkUnnamed1597(core.List<api.LogSink> o) { | 898 checkUnnamed2467(core.List<api.LogSink> o) { |
179 unittest.expect(o, unittest.hasLength(2)); | 899 unittest.expect(o, unittest.hasLength(2)); |
180 checkLogSink(o[0]); | 900 checkLogSink(o[0]); |
181 checkLogSink(o[1]); | 901 checkLogSink(o[1]); |
182 } | 902 } |
183 | 903 |
184 core.int buildCounterListLogSinksResponse = 0; | 904 core.int buildCounterListLogSinksResponse = 0; |
185 buildListLogSinksResponse() { | 905 buildListLogSinksResponse() { |
186 var o = new api.ListLogSinksResponse(); | 906 var o = new api.ListLogSinksResponse(); |
187 buildCounterListLogSinksResponse++; | 907 buildCounterListLogSinksResponse++; |
188 if (buildCounterListLogSinksResponse < 3) { | 908 if (buildCounterListLogSinksResponse < 3) { |
189 o.sinks = buildUnnamed1597(); | 909 o.sinks = buildUnnamed2467(); |
190 } | 910 } |
191 buildCounterListLogSinksResponse--; | 911 buildCounterListLogSinksResponse--; |
192 return o; | 912 return o; |
193 } | 913 } |
194 | 914 |
195 checkListLogSinksResponse(api.ListLogSinksResponse o) { | 915 checkListLogSinksResponse(api.ListLogSinksResponse o) { |
196 buildCounterListLogSinksResponse++; | 916 buildCounterListLogSinksResponse++; |
197 if (buildCounterListLogSinksResponse < 3) { | 917 if (buildCounterListLogSinksResponse < 3) { |
198 checkUnnamed1597(o.sinks); | 918 checkUnnamed2467(o.sinks); |
199 } | 919 } |
200 buildCounterListLogSinksResponse--; | 920 buildCounterListLogSinksResponse--; |
201 } | 921 } |
202 | 922 |
203 buildUnnamed1598() { | 923 buildUnnamed2468() { |
204 var o = new core.List<api.Log>(); | 924 var o = new core.List<api.Log>(); |
205 o.add(buildLog()); | 925 o.add(buildLog()); |
206 o.add(buildLog()); | 926 o.add(buildLog()); |
207 return o; | 927 return o; |
208 } | 928 } |
209 | 929 |
210 checkUnnamed1598(core.List<api.Log> o) { | 930 checkUnnamed2468(core.List<api.Log> o) { |
211 unittest.expect(o, unittest.hasLength(2)); | 931 unittest.expect(o, unittest.hasLength(2)); |
212 checkLog(o[0]); | 932 checkLog(o[0]); |
213 checkLog(o[1]); | 933 checkLog(o[1]); |
214 } | 934 } |
215 | 935 |
216 core.int buildCounterListLogsResponse = 0; | 936 core.int buildCounterListLogsResponse = 0; |
217 buildListLogsResponse() { | 937 buildListLogsResponse() { |
218 var o = new api.ListLogsResponse(); | 938 var o = new api.ListLogsResponse(); |
219 buildCounterListLogsResponse++; | 939 buildCounterListLogsResponse++; |
220 if (buildCounterListLogsResponse < 3) { | 940 if (buildCounterListLogsResponse < 3) { |
221 o.logs = buildUnnamed1598(); | 941 o.logs = buildUnnamed2468(); |
222 o.nextPageToken = "foo"; | 942 o.nextPageToken = "foo"; |
223 } | 943 } |
224 buildCounterListLogsResponse--; | 944 buildCounterListLogsResponse--; |
225 return o; | 945 return o; |
226 } | 946 } |
227 | 947 |
228 checkListLogsResponse(api.ListLogsResponse o) { | 948 checkListLogsResponse(api.ListLogsResponse o) { |
229 buildCounterListLogsResponse++; | 949 buildCounterListLogsResponse++; |
230 if (buildCounterListLogsResponse < 3) { | 950 if (buildCounterListLogsResponse < 3) { |
231 checkUnnamed1598(o.logs); | 951 checkUnnamed2468(o.logs); |
232 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 952 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
233 } | 953 } |
234 buildCounterListLogsResponse--; | 954 buildCounterListLogsResponse--; |
235 } | 955 } |
236 | 956 |
| 957 buildUnnamed2469() { |
| 958 var o = new core.List<api.LogSink>(); |
| 959 o.add(buildLogSink()); |
| 960 o.add(buildLogSink()); |
| 961 return o; |
| 962 } |
| 963 |
| 964 checkUnnamed2469(core.List<api.LogSink> o) { |
| 965 unittest.expect(o, unittest.hasLength(2)); |
| 966 checkLogSink(o[0]); |
| 967 checkLogSink(o[1]); |
| 968 } |
| 969 |
| 970 core.int buildCounterListSinksResponse = 0; |
| 971 buildListSinksResponse() { |
| 972 var o = new api.ListSinksResponse(); |
| 973 buildCounterListSinksResponse++; |
| 974 if (buildCounterListSinksResponse < 3) { |
| 975 o.sinks = buildUnnamed2469(); |
| 976 } |
| 977 buildCounterListSinksResponse--; |
| 978 return o; |
| 979 } |
| 980 |
| 981 checkListSinksResponse(api.ListSinksResponse o) { |
| 982 buildCounterListSinksResponse++; |
| 983 if (buildCounterListSinksResponse < 3) { |
| 984 checkUnnamed2469(o.sinks); |
| 985 } |
| 986 buildCounterListSinksResponse--; |
| 987 } |
| 988 |
| 989 buildUnnamed2470() { |
| 990 var o = new core.List<core.String>(); |
| 991 o.add("foo"); |
| 992 o.add("foo"); |
| 993 return o; |
| 994 } |
| 995 |
| 996 checkUnnamed2470(core.List<core.String> o) { |
| 997 unittest.expect(o, unittest.hasLength(2)); |
| 998 unittest.expect(o[0], unittest.equals('foo')); |
| 999 unittest.expect(o[1], unittest.equals('foo')); |
| 1000 } |
| 1001 |
| 1002 core.int buildCounterLoad = 0; |
| 1003 buildLoad() { |
| 1004 var o = new api.Load(); |
| 1005 buildCounterLoad++; |
| 1006 if (buildCounterLoad < 3) { |
| 1007 o.createDisposition = "foo"; |
| 1008 o.destinationTable = buildTableName(); |
| 1009 o.schema = buildTableSchema(); |
| 1010 o.sourceUris = buildUnnamed2470(); |
| 1011 o.writeDisposition = "foo"; |
| 1012 } |
| 1013 buildCounterLoad--; |
| 1014 return o; |
| 1015 } |
| 1016 |
| 1017 checkLoad(api.Load o) { |
| 1018 buildCounterLoad++; |
| 1019 if (buildCounterLoad < 3) { |
| 1020 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 1021 checkTableName(o.destinationTable); |
| 1022 checkTableSchema(o.schema); |
| 1023 checkUnnamed2470(o.sourceUris); |
| 1024 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 1025 } |
| 1026 buildCounterLoad--; |
| 1027 } |
| 1028 |
237 core.int buildCounterLog = 0; | 1029 core.int buildCounterLog = 0; |
238 buildLog() { | 1030 buildLog() { |
239 var o = new api.Log(); | 1031 var o = new api.Log(); |
240 buildCounterLog++; | 1032 buildCounterLog++; |
241 if (buildCounterLog < 3) { | 1033 if (buildCounterLog < 3) { |
242 o.displayName = "foo"; | 1034 o.displayName = "foo"; |
243 o.name = "foo"; | 1035 o.name = "foo"; |
244 o.payloadType = "foo"; | 1036 o.payloadType = "foo"; |
245 } | 1037 } |
246 buildCounterLog--; | 1038 buildCounterLog--; |
247 return o; | 1039 return o; |
248 } | 1040 } |
249 | 1041 |
250 checkLog(api.Log o) { | 1042 checkLog(api.Log o) { |
251 buildCounterLog++; | 1043 buildCounterLog++; |
252 if (buildCounterLog < 3) { | 1044 if (buildCounterLog < 3) { |
253 unittest.expect(o.displayName, unittest.equals('foo')); | 1045 unittest.expect(o.displayName, unittest.equals('foo')); |
254 unittest.expect(o.name, unittest.equals('foo')); | 1046 unittest.expect(o.name, unittest.equals('foo')); |
255 unittest.expect(o.payloadType, unittest.equals('foo')); | 1047 unittest.expect(o.payloadType, unittest.equals('foo')); |
256 } | 1048 } |
257 buildCounterLog--; | 1049 buildCounterLog--; |
258 } | 1050 } |
259 | 1051 |
260 buildUnnamed1599() { | 1052 buildUnnamed2471() { |
261 var o = new core.Map<core.String, core.Object>(); | 1053 var o = new core.Map<core.String, core.Object>(); |
262 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1054 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
263 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1055 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
264 return o; | 1056 return o; |
265 } | 1057 } |
266 | 1058 |
267 checkUnnamed1599(core.Map<core.String, core.Object> o) { | 1059 checkUnnamed2471(core.Map<core.String, core.Object> o) { |
268 unittest.expect(o, unittest.hasLength(2)); | 1060 unittest.expect(o, unittest.hasLength(2)); |
269 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')); | 1061 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
270 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')); | 1062 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
271 } | 1063 } |
272 | 1064 |
273 buildUnnamed1600() { | 1065 buildUnnamed2472() { |
274 var o = new core.Map<core.String, core.Object>(); | 1066 var o = new core.Map<core.String, core.Object>(); |
275 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1067 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
276 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1068 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
277 return o; | 1069 return o; |
278 } | 1070 } |
279 | 1071 |
280 checkUnnamed1600(core.Map<core.String, core.Object> o) { | 1072 checkUnnamed2472(core.Map<core.String, core.Object> o) { |
281 unittest.expect(o, unittest.hasLength(2)); | 1073 unittest.expect(o, unittest.hasLength(2)); |
282 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); | 1074 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')); |
283 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); | 1075 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')); |
284 } | 1076 } |
285 | 1077 |
286 core.int buildCounterLogEntry = 0; | 1078 core.int buildCounterLogEntry = 0; |
287 buildLogEntry() { | 1079 buildLogEntry() { |
288 var o = new api.LogEntry(); | 1080 var o = new api.LogEntry(); |
289 buildCounterLogEntry++; | 1081 buildCounterLogEntry++; |
290 if (buildCounterLogEntry < 3) { | 1082 if (buildCounterLogEntry < 3) { |
| 1083 o.httpRequest = buildHttpRequest(); |
291 o.insertId = "foo"; | 1084 o.insertId = "foo"; |
292 o.log = "foo"; | 1085 o.log = "foo"; |
293 o.metadata = buildLogEntryMetadata(); | 1086 o.metadata = buildLogEntryMetadata(); |
294 o.protoPayload = buildUnnamed1599(); | 1087 o.protoPayload = buildUnnamed2471(); |
295 o.structPayload = buildUnnamed1600(); | 1088 o.structPayload = buildUnnamed2472(); |
296 o.textPayload = "foo"; | 1089 o.textPayload = "foo"; |
297 } | 1090 } |
298 buildCounterLogEntry--; | 1091 buildCounterLogEntry--; |
299 return o; | 1092 return o; |
300 } | 1093 } |
301 | 1094 |
302 checkLogEntry(api.LogEntry o) { | 1095 checkLogEntry(api.LogEntry o) { |
303 buildCounterLogEntry++; | 1096 buildCounterLogEntry++; |
304 if (buildCounterLogEntry < 3) { | 1097 if (buildCounterLogEntry < 3) { |
| 1098 checkHttpRequest(o.httpRequest); |
305 unittest.expect(o.insertId, unittest.equals('foo')); | 1099 unittest.expect(o.insertId, unittest.equals('foo')); |
306 unittest.expect(o.log, unittest.equals('foo')); | 1100 unittest.expect(o.log, unittest.equals('foo')); |
307 checkLogEntryMetadata(o.metadata); | 1101 checkLogEntryMetadata(o.metadata); |
308 checkUnnamed1599(o.protoPayload); | 1102 checkUnnamed2471(o.protoPayload); |
309 checkUnnamed1600(o.structPayload); | 1103 checkUnnamed2472(o.structPayload); |
310 unittest.expect(o.textPayload, unittest.equals('foo')); | 1104 unittest.expect(o.textPayload, unittest.equals('foo')); |
311 } | 1105 } |
312 buildCounterLogEntry--; | 1106 buildCounterLogEntry--; |
313 } | 1107 } |
314 | 1108 |
315 buildUnnamed1601() { | 1109 buildUnnamed2473() { |
316 var o = new core.Map<core.String, core.String>(); | 1110 var o = new core.Map<core.String, core.String>(); |
317 o["x"] = "foo"; | 1111 o["x"] = "foo"; |
318 o["y"] = "foo"; | 1112 o["y"] = "foo"; |
319 return o; | 1113 return o; |
320 } | 1114 } |
321 | 1115 |
322 checkUnnamed1601(core.Map<core.String, core.String> o) { | 1116 checkUnnamed2473(core.Map<core.String, core.String> o) { |
323 unittest.expect(o, unittest.hasLength(2)); | 1117 unittest.expect(o, unittest.hasLength(2)); |
324 unittest.expect(o["x"], unittest.equals('foo')); | 1118 unittest.expect(o["x"], unittest.equals('foo')); |
325 unittest.expect(o["y"], unittest.equals('foo')); | 1119 unittest.expect(o["y"], unittest.equals('foo')); |
326 } | 1120 } |
327 | 1121 |
328 core.int buildCounterLogEntryMetadata = 0; | 1122 core.int buildCounterLogEntryMetadata = 0; |
329 buildLogEntryMetadata() { | 1123 buildLogEntryMetadata() { |
330 var o = new api.LogEntryMetadata(); | 1124 var o = new api.LogEntryMetadata(); |
331 buildCounterLogEntryMetadata++; | 1125 buildCounterLogEntryMetadata++; |
332 if (buildCounterLogEntryMetadata < 3) { | 1126 if (buildCounterLogEntryMetadata < 3) { |
333 o.labels = buildUnnamed1601(); | 1127 o.labels = buildUnnamed2473(); |
334 o.projectId = "foo"; | 1128 o.projectId = "foo"; |
335 o.region = "foo"; | 1129 o.region = "foo"; |
336 o.serviceName = "foo"; | 1130 o.serviceName = "foo"; |
337 o.severity = "foo"; | 1131 o.severity = "foo"; |
338 o.timestamp = "foo"; | 1132 o.timestamp = "foo"; |
339 o.userId = "foo"; | 1133 o.userId = "foo"; |
340 o.zone = "foo"; | 1134 o.zone = "foo"; |
341 } | 1135 } |
342 buildCounterLogEntryMetadata--; | 1136 buildCounterLogEntryMetadata--; |
343 return o; | 1137 return o; |
344 } | 1138 } |
345 | 1139 |
346 checkLogEntryMetadata(api.LogEntryMetadata o) { | 1140 checkLogEntryMetadata(api.LogEntryMetadata o) { |
347 buildCounterLogEntryMetadata++; | 1141 buildCounterLogEntryMetadata++; |
348 if (buildCounterLogEntryMetadata < 3) { | 1142 if (buildCounterLogEntryMetadata < 3) { |
349 checkUnnamed1601(o.labels); | 1143 checkUnnamed2473(o.labels); |
350 unittest.expect(o.projectId, unittest.equals('foo')); | 1144 unittest.expect(o.projectId, unittest.equals('foo')); |
351 unittest.expect(o.region, unittest.equals('foo')); | 1145 unittest.expect(o.region, unittest.equals('foo')); |
352 unittest.expect(o.serviceName, unittest.equals('foo')); | 1146 unittest.expect(o.serviceName, unittest.equals('foo')); |
353 unittest.expect(o.severity, unittest.equals('foo')); | 1147 unittest.expect(o.severity, unittest.equals('foo')); |
354 unittest.expect(o.timestamp, unittest.equals('foo')); | 1148 unittest.expect(o.timestamp, unittest.equals('foo')); |
355 unittest.expect(o.userId, unittest.equals('foo')); | 1149 unittest.expect(o.userId, unittest.equals('foo')); |
356 unittest.expect(o.zone, unittest.equals('foo')); | 1150 unittest.expect(o.zone, unittest.equals('foo')); |
357 } | 1151 } |
358 buildCounterLogEntryMetadata--; | 1152 buildCounterLogEntryMetadata--; |
359 } | 1153 } |
(...skipping 14 matching lines...) Expand all Loading... |
374 checkLogError(api.LogError o) { | 1168 checkLogError(api.LogError o) { |
375 buildCounterLogError++; | 1169 buildCounterLogError++; |
376 if (buildCounterLogError < 3) { | 1170 if (buildCounterLogError < 3) { |
377 unittest.expect(o.resource, unittest.equals('foo')); | 1171 unittest.expect(o.resource, unittest.equals('foo')); |
378 checkStatus(o.status); | 1172 checkStatus(o.status); |
379 unittest.expect(o.timeNanos, unittest.equals('foo')); | 1173 unittest.expect(o.timeNanos, unittest.equals('foo')); |
380 } | 1174 } |
381 buildCounterLogError--; | 1175 buildCounterLogError--; |
382 } | 1176 } |
383 | 1177 |
384 buildUnnamed1602() { | 1178 core.int buildCounterLogLine = 0; |
| 1179 buildLogLine() { |
| 1180 var o = new api.LogLine(); |
| 1181 buildCounterLogLine++; |
| 1182 if (buildCounterLogLine < 3) { |
| 1183 o.logMessage = "foo"; |
| 1184 o.severity = "foo"; |
| 1185 o.sourceLocation = buildSourceLocation(); |
| 1186 o.time = "foo"; |
| 1187 } |
| 1188 buildCounterLogLine--; |
| 1189 return o; |
| 1190 } |
| 1191 |
| 1192 checkLogLine(api.LogLine o) { |
| 1193 buildCounterLogLine++; |
| 1194 if (buildCounterLogLine < 3) { |
| 1195 unittest.expect(o.logMessage, unittest.equals('foo')); |
| 1196 unittest.expect(o.severity, unittest.equals('foo')); |
| 1197 checkSourceLocation(o.sourceLocation); |
| 1198 unittest.expect(o.time, unittest.equals('foo')); |
| 1199 } |
| 1200 buildCounterLogLine--; |
| 1201 } |
| 1202 |
| 1203 buildUnnamed2474() { |
385 var o = new core.List<core.String>(); | 1204 var o = new core.List<core.String>(); |
386 o.add("foo"); | 1205 o.add("foo"); |
387 o.add("foo"); | 1206 o.add("foo"); |
388 return o; | 1207 return o; |
389 } | 1208 } |
390 | 1209 |
391 checkUnnamed1602(core.List<core.String> o) { | 1210 checkUnnamed2474(core.List<core.String> o) { |
392 unittest.expect(o, unittest.hasLength(2)); | 1211 unittest.expect(o, unittest.hasLength(2)); |
393 unittest.expect(o[0], unittest.equals('foo')); | 1212 unittest.expect(o[0], unittest.equals('foo')); |
394 unittest.expect(o[1], unittest.equals('foo')); | 1213 unittest.expect(o[1], unittest.equals('foo')); |
395 } | 1214 } |
396 | 1215 |
397 core.int buildCounterLogService = 0; | 1216 core.int buildCounterLogService = 0; |
398 buildLogService() { | 1217 buildLogService() { |
399 var o = new api.LogService(); | 1218 var o = new api.LogService(); |
400 buildCounterLogService++; | 1219 buildCounterLogService++; |
401 if (buildCounterLogService < 3) { | 1220 if (buildCounterLogService < 3) { |
402 o.indexKeys = buildUnnamed1602(); | 1221 o.indexKeys = buildUnnamed2474(); |
403 o.name = "foo"; | 1222 o.name = "foo"; |
404 } | 1223 } |
405 buildCounterLogService--; | 1224 buildCounterLogService--; |
406 return o; | 1225 return o; |
407 } | 1226 } |
408 | 1227 |
409 checkLogService(api.LogService o) { | 1228 checkLogService(api.LogService o) { |
410 buildCounterLogService++; | 1229 buildCounterLogService++; |
411 if (buildCounterLogService < 3) { | 1230 if (buildCounterLogService < 3) { |
412 checkUnnamed1602(o.indexKeys); | 1231 checkUnnamed2474(o.indexKeys); |
413 unittest.expect(o.name, unittest.equals('foo')); | 1232 unittest.expect(o.name, unittest.equals('foo')); |
414 } | 1233 } |
415 buildCounterLogService--; | 1234 buildCounterLogService--; |
416 } | 1235 } |
417 | 1236 |
418 buildUnnamed1603() { | 1237 buildUnnamed2475() { |
419 var o = new core.List<api.LogError>(); | 1238 var o = new core.List<api.LogError>(); |
420 o.add(buildLogError()); | 1239 o.add(buildLogError()); |
421 o.add(buildLogError()); | 1240 o.add(buildLogError()); |
422 return o; | 1241 return o; |
423 } | 1242 } |
424 | 1243 |
425 checkUnnamed1603(core.List<api.LogError> o) { | 1244 checkUnnamed2475(core.List<api.LogError> o) { |
426 unittest.expect(o, unittest.hasLength(2)); | 1245 unittest.expect(o, unittest.hasLength(2)); |
427 checkLogError(o[0]); | 1246 checkLogError(o[0]); |
428 checkLogError(o[1]); | 1247 checkLogError(o[1]); |
429 } | 1248 } |
430 | 1249 |
431 core.int buildCounterLogSink = 0; | 1250 core.int buildCounterLogSink = 0; |
432 buildLogSink() { | 1251 buildLogSink() { |
433 var o = new api.LogSink(); | 1252 var o = new api.LogSink(); |
434 buildCounterLogSink++; | 1253 buildCounterLogSink++; |
435 if (buildCounterLogSink < 3) { | 1254 if (buildCounterLogSink < 3) { |
436 o.destination = "foo"; | 1255 o.destination = "foo"; |
437 o.errors = buildUnnamed1603(); | 1256 o.errors = buildUnnamed2475(); |
| 1257 o.filter = "foo"; |
438 o.name = "foo"; | 1258 o.name = "foo"; |
439 } | 1259 } |
440 buildCounterLogSink--; | 1260 buildCounterLogSink--; |
441 return o; | 1261 return o; |
442 } | 1262 } |
443 | 1263 |
444 checkLogSink(api.LogSink o) { | 1264 checkLogSink(api.LogSink o) { |
445 buildCounterLogSink++; | 1265 buildCounterLogSink++; |
446 if (buildCounterLogSink < 3) { | 1266 if (buildCounterLogSink < 3) { |
447 unittest.expect(o.destination, unittest.equals('foo')); | 1267 unittest.expect(o.destination, unittest.equals('foo')); |
448 checkUnnamed1603(o.errors); | 1268 checkUnnamed2475(o.errors); |
| 1269 unittest.expect(o.filter, unittest.equals('foo')); |
449 unittest.expect(o.name, unittest.equals('foo')); | 1270 unittest.expect(o.name, unittest.equals('foo')); |
450 } | 1271 } |
451 buildCounterLogSink--; | 1272 buildCounterLogSink--; |
452 } | 1273 } |
453 | 1274 |
454 buildUnnamed1604() { | 1275 core.int buildCounterMoney = 0; |
| 1276 buildMoney() { |
| 1277 var o = new api.Money(); |
| 1278 buildCounterMoney++; |
| 1279 if (buildCounterMoney < 3) { |
| 1280 o.currencyCode = "foo"; |
| 1281 o.nanos = 42; |
| 1282 o.units = "foo"; |
| 1283 } |
| 1284 buildCounterMoney--; |
| 1285 return o; |
| 1286 } |
| 1287 |
| 1288 checkMoney(api.Money o) { |
| 1289 buildCounterMoney++; |
| 1290 if (buildCounterMoney < 3) { |
| 1291 unittest.expect(o.currencyCode, unittest.equals('foo')); |
| 1292 unittest.expect(o.nanos, unittest.equals(42)); |
| 1293 unittest.expect(o.units, unittest.equals('foo')); |
| 1294 } |
| 1295 buildCounterMoney--; |
| 1296 } |
| 1297 |
| 1298 buildUnnamed2476() { |
| 1299 var o = new core.List<api.TableDefinition>(); |
| 1300 o.add(buildTableDefinition()); |
| 1301 o.add(buildTableDefinition()); |
| 1302 return o; |
| 1303 } |
| 1304 |
| 1305 checkUnnamed2476(core.List<api.TableDefinition> o) { |
| 1306 unittest.expect(o, unittest.hasLength(2)); |
| 1307 checkTableDefinition(o[0]); |
| 1308 checkTableDefinition(o[1]); |
| 1309 } |
| 1310 |
| 1311 core.int buildCounterQuery = 0; |
| 1312 buildQuery() { |
| 1313 var o = new api.Query(); |
| 1314 buildCounterQuery++; |
| 1315 if (buildCounterQuery < 3) { |
| 1316 o.createDisposition = "foo"; |
| 1317 o.defaultDataset = buildDatasetName(); |
| 1318 o.destinationTable = buildTableName(); |
| 1319 o.query = "foo"; |
| 1320 o.tableDefinitions = buildUnnamed2476(); |
| 1321 o.writeDisposition = "foo"; |
| 1322 } |
| 1323 buildCounterQuery--; |
| 1324 return o; |
| 1325 } |
| 1326 |
| 1327 checkQuery(api.Query o) { |
| 1328 buildCounterQuery++; |
| 1329 if (buildCounterQuery < 3) { |
| 1330 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 1331 checkDatasetName(o.defaultDataset); |
| 1332 checkTableName(o.destinationTable); |
| 1333 unittest.expect(o.query, unittest.equals('foo')); |
| 1334 checkUnnamed2476(o.tableDefinitions); |
| 1335 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 1336 } |
| 1337 buildCounterQuery--; |
| 1338 } |
| 1339 |
| 1340 buildUnnamed2477() { |
| 1341 var o = new core.List<api.LogLine>(); |
| 1342 o.add(buildLogLine()); |
| 1343 o.add(buildLogLine()); |
| 1344 return o; |
| 1345 } |
| 1346 |
| 1347 checkUnnamed2477(core.List<api.LogLine> o) { |
| 1348 unittest.expect(o, unittest.hasLength(2)); |
| 1349 checkLogLine(o[0]); |
| 1350 checkLogLine(o[1]); |
| 1351 } |
| 1352 |
| 1353 buildUnnamed2478() { |
| 1354 var o = new core.List<api.SourceReference>(); |
| 1355 o.add(buildSourceReference()); |
| 1356 o.add(buildSourceReference()); |
| 1357 return o; |
| 1358 } |
| 1359 |
| 1360 checkUnnamed2478(core.List<api.SourceReference> o) { |
| 1361 unittest.expect(o, unittest.hasLength(2)); |
| 1362 checkSourceReference(o[0]); |
| 1363 checkSourceReference(o[1]); |
| 1364 } |
| 1365 |
| 1366 core.int buildCounterRequestLog = 0; |
| 1367 buildRequestLog() { |
| 1368 var o = new api.RequestLog(); |
| 1369 buildCounterRequestLog++; |
| 1370 if (buildCounterRequestLog < 3) { |
| 1371 o.appEngineRelease = "foo"; |
| 1372 o.appId = "foo"; |
| 1373 o.cost = 42.0; |
| 1374 o.endTime = "foo"; |
| 1375 o.finished = true; |
| 1376 o.host = "foo"; |
| 1377 o.httpVersion = "foo"; |
| 1378 o.instanceId = "foo"; |
| 1379 o.instanceIndex = 42; |
| 1380 o.ip = "foo"; |
| 1381 o.latency = "foo"; |
| 1382 o.line = buildUnnamed2477(); |
| 1383 o.megaCycles = "foo"; |
| 1384 o.method = "foo"; |
| 1385 o.moduleId = "foo"; |
| 1386 o.nickname = "foo"; |
| 1387 o.pendingTime = "foo"; |
| 1388 o.referrer = "foo"; |
| 1389 o.requestId = "foo"; |
| 1390 o.resource = "foo"; |
| 1391 o.responseSize = "foo"; |
| 1392 o.sourceReference = buildUnnamed2478(); |
| 1393 o.startTime = "foo"; |
| 1394 o.status = 42; |
| 1395 o.taskName = "foo"; |
| 1396 o.taskQueueName = "foo"; |
| 1397 o.traceId = "foo"; |
| 1398 o.urlMapEntry = "foo"; |
| 1399 o.userAgent = "foo"; |
| 1400 o.versionId = "foo"; |
| 1401 o.wasLoadingRequest = true; |
| 1402 } |
| 1403 buildCounterRequestLog--; |
| 1404 return o; |
| 1405 } |
| 1406 |
| 1407 checkRequestLog(api.RequestLog o) { |
| 1408 buildCounterRequestLog++; |
| 1409 if (buildCounterRequestLog < 3) { |
| 1410 unittest.expect(o.appEngineRelease, unittest.equals('foo')); |
| 1411 unittest.expect(o.appId, unittest.equals('foo')); |
| 1412 unittest.expect(o.cost, unittest.equals(42.0)); |
| 1413 unittest.expect(o.endTime, unittest.equals('foo')); |
| 1414 unittest.expect(o.finished, unittest.isTrue); |
| 1415 unittest.expect(o.host, unittest.equals('foo')); |
| 1416 unittest.expect(o.httpVersion, unittest.equals('foo')); |
| 1417 unittest.expect(o.instanceId, unittest.equals('foo')); |
| 1418 unittest.expect(o.instanceIndex, unittest.equals(42)); |
| 1419 unittest.expect(o.ip, unittest.equals('foo')); |
| 1420 unittest.expect(o.latency, unittest.equals('foo')); |
| 1421 checkUnnamed2477(o.line); |
| 1422 unittest.expect(o.megaCycles, unittest.equals('foo')); |
| 1423 unittest.expect(o.method, unittest.equals('foo')); |
| 1424 unittest.expect(o.moduleId, unittest.equals('foo')); |
| 1425 unittest.expect(o.nickname, unittest.equals('foo')); |
| 1426 unittest.expect(o.pendingTime, unittest.equals('foo')); |
| 1427 unittest.expect(o.referrer, unittest.equals('foo')); |
| 1428 unittest.expect(o.requestId, unittest.equals('foo')); |
| 1429 unittest.expect(o.resource, unittest.equals('foo')); |
| 1430 unittest.expect(o.responseSize, unittest.equals('foo')); |
| 1431 checkUnnamed2478(o.sourceReference); |
| 1432 unittest.expect(o.startTime, unittest.equals('foo')); |
| 1433 unittest.expect(o.status, unittest.equals(42)); |
| 1434 unittest.expect(o.taskName, unittest.equals('foo')); |
| 1435 unittest.expect(o.taskQueueName, unittest.equals('foo')); |
| 1436 unittest.expect(o.traceId, unittest.equals('foo')); |
| 1437 unittest.expect(o.urlMapEntry, unittest.equals('foo')); |
| 1438 unittest.expect(o.userAgent, unittest.equals('foo')); |
| 1439 unittest.expect(o.versionId, unittest.equals('foo')); |
| 1440 unittest.expect(o.wasLoadingRequest, unittest.isTrue); |
| 1441 } |
| 1442 buildCounterRequestLog--; |
| 1443 } |
| 1444 |
| 1445 core.int buildCounterRequestMetadata = 0; |
| 1446 buildRequestMetadata() { |
| 1447 var o = new api.RequestMetadata(); |
| 1448 buildCounterRequestMetadata++; |
| 1449 if (buildCounterRequestMetadata < 3) { |
| 1450 o.callerIp = "foo"; |
| 1451 o.callerSuppliedUserAgent = "foo"; |
| 1452 } |
| 1453 buildCounterRequestMetadata--; |
| 1454 return o; |
| 1455 } |
| 1456 |
| 1457 checkRequestMetadata(api.RequestMetadata o) { |
| 1458 buildCounterRequestMetadata++; |
| 1459 if (buildCounterRequestMetadata < 3) { |
| 1460 unittest.expect(o.callerIp, unittest.equals('foo')); |
| 1461 unittest.expect(o.callerSuppliedUserAgent, unittest.equals('foo')); |
| 1462 } |
| 1463 buildCounterRequestMetadata--; |
| 1464 } |
| 1465 |
| 1466 core.int buildCounterSourceLocation = 0; |
| 1467 buildSourceLocation() { |
| 1468 var o = new api.SourceLocation(); |
| 1469 buildCounterSourceLocation++; |
| 1470 if (buildCounterSourceLocation < 3) { |
| 1471 o.file = "foo"; |
| 1472 o.functionName = "foo"; |
| 1473 o.line = "foo"; |
| 1474 } |
| 1475 buildCounterSourceLocation--; |
| 1476 return o; |
| 1477 } |
| 1478 |
| 1479 checkSourceLocation(api.SourceLocation o) { |
| 1480 buildCounterSourceLocation++; |
| 1481 if (buildCounterSourceLocation < 3) { |
| 1482 unittest.expect(o.file, unittest.equals('foo')); |
| 1483 unittest.expect(o.functionName, unittest.equals('foo')); |
| 1484 unittest.expect(o.line, unittest.equals('foo')); |
| 1485 } |
| 1486 buildCounterSourceLocation--; |
| 1487 } |
| 1488 |
| 1489 core.int buildCounterSourceReference = 0; |
| 1490 buildSourceReference() { |
| 1491 var o = new api.SourceReference(); |
| 1492 buildCounterSourceReference++; |
| 1493 if (buildCounterSourceReference < 3) { |
| 1494 o.repository = "foo"; |
| 1495 o.revisionId = "foo"; |
| 1496 } |
| 1497 buildCounterSourceReference--; |
| 1498 return o; |
| 1499 } |
| 1500 |
| 1501 checkSourceReference(api.SourceReference o) { |
| 1502 buildCounterSourceReference++; |
| 1503 if (buildCounterSourceReference < 3) { |
| 1504 unittest.expect(o.repository, unittest.equals('foo')); |
| 1505 unittest.expect(o.revisionId, unittest.equals('foo')); |
| 1506 } |
| 1507 buildCounterSourceReference--; |
| 1508 } |
| 1509 |
| 1510 buildUnnamed2479() { |
455 var o = new core.Map<core.String, core.Object>(); | 1511 var o = new core.Map<core.String, core.Object>(); |
456 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1512 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
457 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; | 1513 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
458 return o; | 1514 return o; |
459 } | 1515 } |
460 | 1516 |
461 checkUnnamed1604(core.Map<core.String, core.Object> o) { | 1517 checkUnnamed2479(core.Map<core.String, core.Object> o) { |
462 unittest.expect(o, unittest.hasLength(2)); | 1518 unittest.expect(o, unittest.hasLength(2)); |
463 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')); | 1519 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')); |
464 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')); | 1520 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')); |
465 } | 1521 } |
466 | 1522 |
467 buildUnnamed1605() { | 1523 buildUnnamed2480() { |
468 var o = new core.List<core.Map<core.String, core.Object>>(); | 1524 var o = new core.List<core.Map<core.String, core.Object>>(); |
469 o.add(buildUnnamed1604()); | 1525 o.add(buildUnnamed2479()); |
470 o.add(buildUnnamed1604()); | 1526 o.add(buildUnnamed2479()); |
471 return o; | 1527 return o; |
472 } | 1528 } |
473 | 1529 |
474 checkUnnamed1605(core.List<core.Map<core.String, core.Object>> o) { | 1530 checkUnnamed2480(core.List<core.Map<core.String, core.Object>> o) { |
475 unittest.expect(o, unittest.hasLength(2)); | 1531 unittest.expect(o, unittest.hasLength(2)); |
476 checkUnnamed1604(o[0]); | 1532 checkUnnamed2479(o[0]); |
477 checkUnnamed1604(o[1]); | 1533 checkUnnamed2479(o[1]); |
478 } | 1534 } |
479 | 1535 |
480 core.int buildCounterStatus = 0; | 1536 core.int buildCounterStatus = 0; |
481 buildStatus() { | 1537 buildStatus() { |
482 var o = new api.Status(); | 1538 var o = new api.Status(); |
483 buildCounterStatus++; | 1539 buildCounterStatus++; |
484 if (buildCounterStatus < 3) { | 1540 if (buildCounterStatus < 3) { |
485 o.code = 42; | 1541 o.code = 42; |
486 o.details = buildUnnamed1605(); | 1542 o.details = buildUnnamed2480(); |
487 o.message = "foo"; | 1543 o.message = "foo"; |
488 } | 1544 } |
489 buildCounterStatus--; | 1545 buildCounterStatus--; |
490 return o; | 1546 return o; |
491 } | 1547 } |
492 | 1548 |
493 checkStatus(api.Status o) { | 1549 checkStatus(api.Status o) { |
494 buildCounterStatus++; | 1550 buildCounterStatus++; |
495 if (buildCounterStatus < 3) { | 1551 if (buildCounterStatus < 3) { |
496 unittest.expect(o.code, unittest.equals(42)); | 1552 unittest.expect(o.code, unittest.equals(42)); |
497 checkUnnamed1605(o.details); | 1553 checkUnnamed2480(o.details); |
498 unittest.expect(o.message, unittest.equals('foo')); | 1554 unittest.expect(o.message, unittest.equals('foo')); |
499 } | 1555 } |
500 buildCounterStatus--; | 1556 buildCounterStatus--; |
501 } | 1557 } |
502 | 1558 |
503 buildUnnamed1606() { | 1559 core.int buildCounterTable = 0; |
| 1560 buildTable() { |
| 1561 var o = new api.Table(); |
| 1562 buildCounterTable++; |
| 1563 if (buildCounterTable < 3) { |
| 1564 o.createTime = "foo"; |
| 1565 o.expireTime = "foo"; |
| 1566 o.info = buildTableInfo(); |
| 1567 o.schema = buildTableSchema(); |
| 1568 o.tableName = buildTableName(); |
| 1569 o.truncateTime = "foo"; |
| 1570 o.view = buildTableViewDefinition(); |
| 1571 } |
| 1572 buildCounterTable--; |
| 1573 return o; |
| 1574 } |
| 1575 |
| 1576 checkTable(api.Table o) { |
| 1577 buildCounterTable++; |
| 1578 if (buildCounterTable < 3) { |
| 1579 unittest.expect(o.createTime, unittest.equals('foo')); |
| 1580 unittest.expect(o.expireTime, unittest.equals('foo')); |
| 1581 checkTableInfo(o.info); |
| 1582 checkTableSchema(o.schema); |
| 1583 checkTableName(o.tableName); |
| 1584 unittest.expect(o.truncateTime, unittest.equals('foo')); |
| 1585 checkTableViewDefinition(o.view); |
| 1586 } |
| 1587 buildCounterTable--; |
| 1588 } |
| 1589 |
| 1590 buildUnnamed2481() { |
| 1591 var o = new core.List<api.TableName>(); |
| 1592 o.add(buildTableName()); |
| 1593 o.add(buildTableName()); |
| 1594 return o; |
| 1595 } |
| 1596 |
| 1597 checkUnnamed2481(core.List<api.TableName> o) { |
| 1598 unittest.expect(o, unittest.hasLength(2)); |
| 1599 checkTableName(o[0]); |
| 1600 checkTableName(o[1]); |
| 1601 } |
| 1602 |
| 1603 core.int buildCounterTableCopy = 0; |
| 1604 buildTableCopy() { |
| 1605 var o = new api.TableCopy(); |
| 1606 buildCounterTableCopy++; |
| 1607 if (buildCounterTableCopy < 3) { |
| 1608 o.createDisposition = "foo"; |
| 1609 o.destinationTable = buildTableName(); |
| 1610 o.sourceTables = buildUnnamed2481(); |
| 1611 o.writeDisposition = "foo"; |
| 1612 } |
| 1613 buildCounterTableCopy--; |
| 1614 return o; |
| 1615 } |
| 1616 |
| 1617 checkTableCopy(api.TableCopy o) { |
| 1618 buildCounterTableCopy++; |
| 1619 if (buildCounterTableCopy < 3) { |
| 1620 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 1621 checkTableName(o.destinationTable); |
| 1622 checkUnnamed2481(o.sourceTables); |
| 1623 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 1624 } |
| 1625 buildCounterTableCopy--; |
| 1626 } |
| 1627 |
| 1628 core.int buildCounterTableDataListRequest = 0; |
| 1629 buildTableDataListRequest() { |
| 1630 var o = new api.TableDataListRequest(); |
| 1631 buildCounterTableDataListRequest++; |
| 1632 if (buildCounterTableDataListRequest < 3) { |
| 1633 o.maxResults = 42; |
| 1634 o.startRow = "foo"; |
| 1635 } |
| 1636 buildCounterTableDataListRequest--; |
| 1637 return o; |
| 1638 } |
| 1639 |
| 1640 checkTableDataListRequest(api.TableDataListRequest o) { |
| 1641 buildCounterTableDataListRequest++; |
| 1642 if (buildCounterTableDataListRequest < 3) { |
| 1643 unittest.expect(o.maxResults, unittest.equals(42)); |
| 1644 unittest.expect(o.startRow, unittest.equals('foo')); |
| 1645 } |
| 1646 buildCounterTableDataListRequest--; |
| 1647 } |
| 1648 |
| 1649 buildUnnamed2482() { |
| 1650 var o = new core.List<core.String>(); |
| 1651 o.add("foo"); |
| 1652 o.add("foo"); |
| 1653 return o; |
| 1654 } |
| 1655 |
| 1656 checkUnnamed2482(core.List<core.String> o) { |
| 1657 unittest.expect(o, unittest.hasLength(2)); |
| 1658 unittest.expect(o[0], unittest.equals('foo')); |
| 1659 unittest.expect(o[1], unittest.equals('foo')); |
| 1660 } |
| 1661 |
| 1662 core.int buildCounterTableDefinition = 0; |
| 1663 buildTableDefinition() { |
| 1664 var o = new api.TableDefinition(); |
| 1665 buildCounterTableDefinition++; |
| 1666 if (buildCounterTableDefinition < 3) { |
| 1667 o.name = "foo"; |
| 1668 o.sourceUris = buildUnnamed2482(); |
| 1669 } |
| 1670 buildCounterTableDefinition--; |
| 1671 return o; |
| 1672 } |
| 1673 |
| 1674 checkTableDefinition(api.TableDefinition o) { |
| 1675 buildCounterTableDefinition++; |
| 1676 if (buildCounterTableDefinition < 3) { |
| 1677 unittest.expect(o.name, unittest.equals('foo')); |
| 1678 checkUnnamed2482(o.sourceUris); |
| 1679 } |
| 1680 buildCounterTableDefinition--; |
| 1681 } |
| 1682 |
| 1683 core.int buildCounterTableInfo = 0; |
| 1684 buildTableInfo() { |
| 1685 var o = new api.TableInfo(); |
| 1686 buildCounterTableInfo++; |
| 1687 if (buildCounterTableInfo < 3) { |
| 1688 o.description = "foo"; |
| 1689 o.friendlyName = "foo"; |
| 1690 } |
| 1691 buildCounterTableInfo--; |
| 1692 return o; |
| 1693 } |
| 1694 |
| 1695 checkTableInfo(api.TableInfo o) { |
| 1696 buildCounterTableInfo++; |
| 1697 if (buildCounterTableInfo < 3) { |
| 1698 unittest.expect(o.description, unittest.equals('foo')); |
| 1699 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 1700 } |
| 1701 buildCounterTableInfo--; |
| 1702 } |
| 1703 |
| 1704 core.int buildCounterTableInsertRequest = 0; |
| 1705 buildTableInsertRequest() { |
| 1706 var o = new api.TableInsertRequest(); |
| 1707 buildCounterTableInsertRequest++; |
| 1708 if (buildCounterTableInsertRequest < 3) { |
| 1709 o.resource = buildTable(); |
| 1710 } |
| 1711 buildCounterTableInsertRequest--; |
| 1712 return o; |
| 1713 } |
| 1714 |
| 1715 checkTableInsertRequest(api.TableInsertRequest o) { |
| 1716 buildCounterTableInsertRequest++; |
| 1717 if (buildCounterTableInsertRequest < 3) { |
| 1718 checkTable(o.resource); |
| 1719 } |
| 1720 buildCounterTableInsertRequest--; |
| 1721 } |
| 1722 |
| 1723 core.int buildCounterTableInsertResponse = 0; |
| 1724 buildTableInsertResponse() { |
| 1725 var o = new api.TableInsertResponse(); |
| 1726 buildCounterTableInsertResponse++; |
| 1727 if (buildCounterTableInsertResponse < 3) { |
| 1728 o.resource = buildTable(); |
| 1729 } |
| 1730 buildCounterTableInsertResponse--; |
| 1731 return o; |
| 1732 } |
| 1733 |
| 1734 checkTableInsertResponse(api.TableInsertResponse o) { |
| 1735 buildCounterTableInsertResponse++; |
| 1736 if (buildCounterTableInsertResponse < 3) { |
| 1737 checkTable(o.resource); |
| 1738 } |
| 1739 buildCounterTableInsertResponse--; |
| 1740 } |
| 1741 |
| 1742 core.int buildCounterTableName = 0; |
| 1743 buildTableName() { |
| 1744 var o = new api.TableName(); |
| 1745 buildCounterTableName++; |
| 1746 if (buildCounterTableName < 3) { |
| 1747 o.datasetId = "foo"; |
| 1748 o.projectId = "foo"; |
| 1749 o.tableId = "foo"; |
| 1750 } |
| 1751 buildCounterTableName--; |
| 1752 return o; |
| 1753 } |
| 1754 |
| 1755 checkTableName(api.TableName o) { |
| 1756 buildCounterTableName++; |
| 1757 if (buildCounterTableName < 3) { |
| 1758 unittest.expect(o.datasetId, unittest.equals('foo')); |
| 1759 unittest.expect(o.projectId, unittest.equals('foo')); |
| 1760 unittest.expect(o.tableId, unittest.equals('foo')); |
| 1761 } |
| 1762 buildCounterTableName--; |
| 1763 } |
| 1764 |
| 1765 buildUnnamed2483() { |
| 1766 var o = new core.List<api.FieldSchema>(); |
| 1767 o.add(buildFieldSchema()); |
| 1768 o.add(buildFieldSchema()); |
| 1769 return o; |
| 1770 } |
| 1771 |
| 1772 checkUnnamed2483(core.List<api.FieldSchema> o) { |
| 1773 unittest.expect(o, unittest.hasLength(2)); |
| 1774 checkFieldSchema(o[0]); |
| 1775 checkFieldSchema(o[1]); |
| 1776 } |
| 1777 |
| 1778 core.int buildCounterTableSchema = 0; |
| 1779 buildTableSchema() { |
| 1780 var o = new api.TableSchema(); |
| 1781 buildCounterTableSchema++; |
| 1782 if (buildCounterTableSchema < 3) { |
| 1783 o.fields = buildUnnamed2483(); |
| 1784 } |
| 1785 buildCounterTableSchema--; |
| 1786 return o; |
| 1787 } |
| 1788 |
| 1789 checkTableSchema(api.TableSchema o) { |
| 1790 buildCounterTableSchema++; |
| 1791 if (buildCounterTableSchema < 3) { |
| 1792 checkUnnamed2483(o.fields); |
| 1793 } |
| 1794 buildCounterTableSchema--; |
| 1795 } |
| 1796 |
| 1797 core.int buildCounterTableUpdateRequest = 0; |
| 1798 buildTableUpdateRequest() { |
| 1799 var o = new api.TableUpdateRequest(); |
| 1800 buildCounterTableUpdateRequest++; |
| 1801 if (buildCounterTableUpdateRequest < 3) { |
| 1802 o.resource = buildTable(); |
| 1803 } |
| 1804 buildCounterTableUpdateRequest--; |
| 1805 return o; |
| 1806 } |
| 1807 |
| 1808 checkTableUpdateRequest(api.TableUpdateRequest o) { |
| 1809 buildCounterTableUpdateRequest++; |
| 1810 if (buildCounterTableUpdateRequest < 3) { |
| 1811 checkTable(o.resource); |
| 1812 } |
| 1813 buildCounterTableUpdateRequest--; |
| 1814 } |
| 1815 |
| 1816 core.int buildCounterTableUpdateResponse = 0; |
| 1817 buildTableUpdateResponse() { |
| 1818 var o = new api.TableUpdateResponse(); |
| 1819 buildCounterTableUpdateResponse++; |
| 1820 if (buildCounterTableUpdateResponse < 3) { |
| 1821 o.resource = buildTable(); |
| 1822 } |
| 1823 buildCounterTableUpdateResponse--; |
| 1824 return o; |
| 1825 } |
| 1826 |
| 1827 checkTableUpdateResponse(api.TableUpdateResponse o) { |
| 1828 buildCounterTableUpdateResponse++; |
| 1829 if (buildCounterTableUpdateResponse < 3) { |
| 1830 checkTable(o.resource); |
| 1831 } |
| 1832 buildCounterTableUpdateResponse--; |
| 1833 } |
| 1834 |
| 1835 core.int buildCounterTableViewDefinition = 0; |
| 1836 buildTableViewDefinition() { |
| 1837 var o = new api.TableViewDefinition(); |
| 1838 buildCounterTableViewDefinition++; |
| 1839 if (buildCounterTableViewDefinition < 3) { |
| 1840 o.query = "foo"; |
| 1841 } |
| 1842 buildCounterTableViewDefinition--; |
| 1843 return o; |
| 1844 } |
| 1845 |
| 1846 checkTableViewDefinition(api.TableViewDefinition o) { |
| 1847 buildCounterTableViewDefinition++; |
| 1848 if (buildCounterTableViewDefinition < 3) { |
| 1849 unittest.expect(o.query, unittest.equals('foo')); |
| 1850 } |
| 1851 buildCounterTableViewDefinition--; |
| 1852 } |
| 1853 |
| 1854 buildUnnamed2484() { |
504 var o = new core.Map<core.String, core.String>(); | 1855 var o = new core.Map<core.String, core.String>(); |
505 o["x"] = "foo"; | 1856 o["x"] = "foo"; |
506 o["y"] = "foo"; | 1857 o["y"] = "foo"; |
507 return o; | 1858 return o; |
508 } | 1859 } |
509 | 1860 |
510 checkUnnamed1606(core.Map<core.String, core.String> o) { | 1861 checkUnnamed2484(core.Map<core.String, core.String> o) { |
511 unittest.expect(o, unittest.hasLength(2)); | 1862 unittest.expect(o, unittest.hasLength(2)); |
512 unittest.expect(o["x"], unittest.equals('foo')); | 1863 unittest.expect(o["x"], unittest.equals('foo')); |
513 unittest.expect(o["y"], unittest.equals('foo')); | 1864 unittest.expect(o["y"], unittest.equals('foo')); |
514 } | 1865 } |
515 | 1866 |
516 buildUnnamed1607() { | 1867 buildUnnamed2485() { |
517 var o = new core.List<api.LogEntry>(); | 1868 var o = new core.List<api.LogEntry>(); |
518 o.add(buildLogEntry()); | 1869 o.add(buildLogEntry()); |
519 o.add(buildLogEntry()); | 1870 o.add(buildLogEntry()); |
520 return o; | 1871 return o; |
521 } | 1872 } |
522 | 1873 |
523 checkUnnamed1607(core.List<api.LogEntry> o) { | 1874 checkUnnamed2485(core.List<api.LogEntry> o) { |
524 unittest.expect(o, unittest.hasLength(2)); | 1875 unittest.expect(o, unittest.hasLength(2)); |
525 checkLogEntry(o[0]); | 1876 checkLogEntry(o[0]); |
526 checkLogEntry(o[1]); | 1877 checkLogEntry(o[1]); |
527 } | 1878 } |
528 | 1879 |
529 core.int buildCounterWriteLogEntriesRequest = 0; | 1880 core.int buildCounterWriteLogEntriesRequest = 0; |
530 buildWriteLogEntriesRequest() { | 1881 buildWriteLogEntriesRequest() { |
531 var o = new api.WriteLogEntriesRequest(); | 1882 var o = new api.WriteLogEntriesRequest(); |
532 buildCounterWriteLogEntriesRequest++; | 1883 buildCounterWriteLogEntriesRequest++; |
533 if (buildCounterWriteLogEntriesRequest < 3) { | 1884 if (buildCounterWriteLogEntriesRequest < 3) { |
534 o.commonLabels = buildUnnamed1606(); | 1885 o.commonLabels = buildUnnamed2484(); |
535 o.entries = buildUnnamed1607(); | 1886 o.entries = buildUnnamed2485(); |
536 } | 1887 } |
537 buildCounterWriteLogEntriesRequest--; | 1888 buildCounterWriteLogEntriesRequest--; |
538 return o; | 1889 return o; |
539 } | 1890 } |
540 | 1891 |
541 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { | 1892 checkWriteLogEntriesRequest(api.WriteLogEntriesRequest o) { |
542 buildCounterWriteLogEntriesRequest++; | 1893 buildCounterWriteLogEntriesRequest++; |
543 if (buildCounterWriteLogEntriesRequest < 3) { | 1894 if (buildCounterWriteLogEntriesRequest < 3) { |
544 checkUnnamed1606(o.commonLabels); | 1895 checkUnnamed2484(o.commonLabels); |
545 checkUnnamed1607(o.entries); | 1896 checkUnnamed2485(o.entries); |
546 } | 1897 } |
547 buildCounterWriteLogEntriesRequest--; | 1898 buildCounterWriteLogEntriesRequest--; |
548 } | 1899 } |
549 | 1900 |
550 core.int buildCounterWriteLogEntriesResponse = 0; | 1901 core.int buildCounterWriteLogEntriesResponse = 0; |
551 buildWriteLogEntriesResponse() { | 1902 buildWriteLogEntriesResponse() { |
552 var o = new api.WriteLogEntriesResponse(); | 1903 var o = new api.WriteLogEntriesResponse(); |
553 buildCounterWriteLogEntriesResponse++; | 1904 buildCounterWriteLogEntriesResponse++; |
554 if (buildCounterWriteLogEntriesResponse < 3) { | 1905 if (buildCounterWriteLogEntriesResponse < 3) { |
555 } | 1906 } |
556 buildCounterWriteLogEntriesResponse--; | 1907 buildCounterWriteLogEntriesResponse--; |
557 return o; | 1908 return o; |
558 } | 1909 } |
559 | 1910 |
560 checkWriteLogEntriesResponse(api.WriteLogEntriesResponse o) { | 1911 checkWriteLogEntriesResponse(api.WriteLogEntriesResponse o) { |
561 buildCounterWriteLogEntriesResponse++; | 1912 buildCounterWriteLogEntriesResponse++; |
562 if (buildCounterWriteLogEntriesResponse < 3) { | 1913 if (buildCounterWriteLogEntriesResponse < 3) { |
563 } | 1914 } |
564 buildCounterWriteLogEntriesResponse--; | 1915 buildCounterWriteLogEntriesResponse--; |
565 } | 1916 } |
566 | 1917 |
567 | 1918 |
568 main() { | 1919 main() { |
| 1920 unittest.group("obj-schema-AuditData", () { |
| 1921 unittest.test("to-json--from-json", () { |
| 1922 var o = buildAuditData(); |
| 1923 var od = new api.AuditData.fromJson(o.toJson()); |
| 1924 checkAuditData(od); |
| 1925 }); |
| 1926 }); |
| 1927 |
| 1928 |
| 1929 unittest.group("obj-schema-AuditLog", () { |
| 1930 unittest.test("to-json--from-json", () { |
| 1931 var o = buildAuditLog(); |
| 1932 var od = new api.AuditLog.fromJson(o.toJson()); |
| 1933 checkAuditLog(od); |
| 1934 }); |
| 1935 }); |
| 1936 |
| 1937 |
| 1938 unittest.group("obj-schema-AuthenticationInfo", () { |
| 1939 unittest.test("to-json--from-json", () { |
| 1940 var o = buildAuthenticationInfo(); |
| 1941 var od = new api.AuthenticationInfo.fromJson(o.toJson()); |
| 1942 checkAuthenticationInfo(od); |
| 1943 }); |
| 1944 }); |
| 1945 |
| 1946 |
| 1947 unittest.group("obj-schema-AuthorizationInfo", () { |
| 1948 unittest.test("to-json--from-json", () { |
| 1949 var o = buildAuthorizationInfo(); |
| 1950 var od = new api.AuthorizationInfo.fromJson(o.toJson()); |
| 1951 checkAuthorizationInfo(od); |
| 1952 }); |
| 1953 }); |
| 1954 |
| 1955 |
| 1956 unittest.group("obj-schema-BigQueryAcl", () { |
| 1957 unittest.test("to-json--from-json", () { |
| 1958 var o = buildBigQueryAcl(); |
| 1959 var od = new api.BigQueryAcl.fromJson(o.toJson()); |
| 1960 checkBigQueryAcl(od); |
| 1961 }); |
| 1962 }); |
| 1963 |
| 1964 |
| 1965 unittest.group("obj-schema-Dataset", () { |
| 1966 unittest.test("to-json--from-json", () { |
| 1967 var o = buildDataset(); |
| 1968 var od = new api.Dataset.fromJson(o.toJson()); |
| 1969 checkDataset(od); |
| 1970 }); |
| 1971 }); |
| 1972 |
| 1973 |
| 1974 unittest.group("obj-schema-DatasetInfo", () { |
| 1975 unittest.test("to-json--from-json", () { |
| 1976 var o = buildDatasetInfo(); |
| 1977 var od = new api.DatasetInfo.fromJson(o.toJson()); |
| 1978 checkDatasetInfo(od); |
| 1979 }); |
| 1980 }); |
| 1981 |
| 1982 |
| 1983 unittest.group("obj-schema-DatasetInsertRequest", () { |
| 1984 unittest.test("to-json--from-json", () { |
| 1985 var o = buildDatasetInsertRequest(); |
| 1986 var od = new api.DatasetInsertRequest.fromJson(o.toJson()); |
| 1987 checkDatasetInsertRequest(od); |
| 1988 }); |
| 1989 }); |
| 1990 |
| 1991 |
| 1992 unittest.group("obj-schema-DatasetInsertResponse", () { |
| 1993 unittest.test("to-json--from-json", () { |
| 1994 var o = buildDatasetInsertResponse(); |
| 1995 var od = new api.DatasetInsertResponse.fromJson(o.toJson()); |
| 1996 checkDatasetInsertResponse(od); |
| 1997 }); |
| 1998 }); |
| 1999 |
| 2000 |
| 2001 unittest.group("obj-schema-DatasetListRequest", () { |
| 2002 unittest.test("to-json--from-json", () { |
| 2003 var o = buildDatasetListRequest(); |
| 2004 var od = new api.DatasetListRequest.fromJson(o.toJson()); |
| 2005 checkDatasetListRequest(od); |
| 2006 }); |
| 2007 }); |
| 2008 |
| 2009 |
| 2010 unittest.group("obj-schema-DatasetName", () { |
| 2011 unittest.test("to-json--from-json", () { |
| 2012 var o = buildDatasetName(); |
| 2013 var od = new api.DatasetName.fromJson(o.toJson()); |
| 2014 checkDatasetName(od); |
| 2015 }); |
| 2016 }); |
| 2017 |
| 2018 |
| 2019 unittest.group("obj-schema-DatasetUpdateRequest", () { |
| 2020 unittest.test("to-json--from-json", () { |
| 2021 var o = buildDatasetUpdateRequest(); |
| 2022 var od = new api.DatasetUpdateRequest.fromJson(o.toJson()); |
| 2023 checkDatasetUpdateRequest(od); |
| 2024 }); |
| 2025 }); |
| 2026 |
| 2027 |
| 2028 unittest.group("obj-schema-DatasetUpdateResponse", () { |
| 2029 unittest.test("to-json--from-json", () { |
| 2030 var o = buildDatasetUpdateResponse(); |
| 2031 var od = new api.DatasetUpdateResponse.fromJson(o.toJson()); |
| 2032 checkDatasetUpdateResponse(od); |
| 2033 }); |
| 2034 }); |
| 2035 |
| 2036 |
569 unittest.group("obj-schema-Empty", () { | 2037 unittest.group("obj-schema-Empty", () { |
570 unittest.test("to-json--from-json", () { | 2038 unittest.test("to-json--from-json", () { |
571 var o = buildEmpty(); | 2039 var o = buildEmpty(); |
572 var od = new api.Empty.fromJson(o.toJson()); | 2040 var od = new api.Empty.fromJson(o.toJson()); |
573 checkEmpty(od); | 2041 checkEmpty(od); |
574 }); | 2042 }); |
575 }); | 2043 }); |
576 | 2044 |
577 | 2045 |
| 2046 unittest.group("obj-schema-Entry", () { |
| 2047 unittest.test("to-json--from-json", () { |
| 2048 var o = buildEntry(); |
| 2049 var od = new api.Entry.fromJson(o.toJson()); |
| 2050 checkEntry(od); |
| 2051 }); |
| 2052 }); |
| 2053 |
| 2054 |
| 2055 unittest.group("obj-schema-Extract", () { |
| 2056 unittest.test("to-json--from-json", () { |
| 2057 var o = buildExtract(); |
| 2058 var od = new api.Extract.fromJson(o.toJson()); |
| 2059 checkExtract(od); |
| 2060 }); |
| 2061 }); |
| 2062 |
| 2063 |
| 2064 unittest.group("obj-schema-FieldSchema", () { |
| 2065 unittest.test("to-json--from-json", () { |
| 2066 var o = buildFieldSchema(); |
| 2067 var od = new api.FieldSchema.fromJson(o.toJson()); |
| 2068 checkFieldSchema(od); |
| 2069 }); |
| 2070 }); |
| 2071 |
| 2072 |
| 2073 unittest.group("obj-schema-HttpRequest", () { |
| 2074 unittest.test("to-json--from-json", () { |
| 2075 var o = buildHttpRequest(); |
| 2076 var od = new api.HttpRequest.fromJson(o.toJson()); |
| 2077 checkHttpRequest(od); |
| 2078 }); |
| 2079 }); |
| 2080 |
| 2081 |
| 2082 unittest.group("obj-schema-Job", () { |
| 2083 unittest.test("to-json--from-json", () { |
| 2084 var o = buildJob(); |
| 2085 var od = new api.Job.fromJson(o.toJson()); |
| 2086 checkJob(od); |
| 2087 }); |
| 2088 }); |
| 2089 |
| 2090 |
| 2091 unittest.group("obj-schema-JobConfiguration", () { |
| 2092 unittest.test("to-json--from-json", () { |
| 2093 var o = buildJobConfiguration(); |
| 2094 var od = new api.JobConfiguration.fromJson(o.toJson()); |
| 2095 checkJobConfiguration(od); |
| 2096 }); |
| 2097 }); |
| 2098 |
| 2099 |
| 2100 unittest.group("obj-schema-JobGetQueryResultsRequest", () { |
| 2101 unittest.test("to-json--from-json", () { |
| 2102 var o = buildJobGetQueryResultsRequest(); |
| 2103 var od = new api.JobGetQueryResultsRequest.fromJson(o.toJson()); |
| 2104 checkJobGetQueryResultsRequest(od); |
| 2105 }); |
| 2106 }); |
| 2107 |
| 2108 |
| 2109 unittest.group("obj-schema-JobGetQueryResultsResponse", () { |
| 2110 unittest.test("to-json--from-json", () { |
| 2111 var o = buildJobGetQueryResultsResponse(); |
| 2112 var od = new api.JobGetQueryResultsResponse.fromJson(o.toJson()); |
| 2113 checkJobGetQueryResultsResponse(od); |
| 2114 }); |
| 2115 }); |
| 2116 |
| 2117 |
| 2118 unittest.group("obj-schema-JobInsertRequest", () { |
| 2119 unittest.test("to-json--from-json", () { |
| 2120 var o = buildJobInsertRequest(); |
| 2121 var od = new api.JobInsertRequest.fromJson(o.toJson()); |
| 2122 checkJobInsertRequest(od); |
| 2123 }); |
| 2124 }); |
| 2125 |
| 2126 |
| 2127 unittest.group("obj-schema-JobName", () { |
| 2128 unittest.test("to-json--from-json", () { |
| 2129 var o = buildJobName(); |
| 2130 var od = new api.JobName.fromJson(o.toJson()); |
| 2131 checkJobName(od); |
| 2132 }); |
| 2133 }); |
| 2134 |
| 2135 |
| 2136 unittest.group("obj-schema-JobQueryDoneResponse", () { |
| 2137 unittest.test("to-json--from-json", () { |
| 2138 var o = buildJobQueryDoneResponse(); |
| 2139 var od = new api.JobQueryDoneResponse.fromJson(o.toJson()); |
| 2140 checkJobQueryDoneResponse(od); |
| 2141 }); |
| 2142 }); |
| 2143 |
| 2144 |
| 2145 unittest.group("obj-schema-JobQueryRequest", () { |
| 2146 unittest.test("to-json--from-json", () { |
| 2147 var o = buildJobQueryRequest(); |
| 2148 var od = new api.JobQueryRequest.fromJson(o.toJson()); |
| 2149 checkJobQueryRequest(od); |
| 2150 }); |
| 2151 }); |
| 2152 |
| 2153 |
| 2154 unittest.group("obj-schema-JobQueryResponse", () { |
| 2155 unittest.test("to-json--from-json", () { |
| 2156 var o = buildJobQueryResponse(); |
| 2157 var od = new api.JobQueryResponse.fromJson(o.toJson()); |
| 2158 checkJobQueryResponse(od); |
| 2159 }); |
| 2160 }); |
| 2161 |
| 2162 |
| 2163 unittest.group("obj-schema-JobStatistics", () { |
| 2164 unittest.test("to-json--from-json", () { |
| 2165 var o = buildJobStatistics(); |
| 2166 var od = new api.JobStatistics.fromJson(o.toJson()); |
| 2167 checkJobStatistics(od); |
| 2168 }); |
| 2169 }); |
| 2170 |
| 2171 |
| 2172 unittest.group("obj-schema-JobStatus", () { |
| 2173 unittest.test("to-json--from-json", () { |
| 2174 var o = buildJobStatus(); |
| 2175 var od = new api.JobStatus.fromJson(o.toJson()); |
| 2176 checkJobStatus(od); |
| 2177 }); |
| 2178 }); |
| 2179 |
| 2180 |
578 unittest.group("obj-schema-ListLogServiceIndexesResponse", () { | 2181 unittest.group("obj-schema-ListLogServiceIndexesResponse", () { |
579 unittest.test("to-json--from-json", () { | 2182 unittest.test("to-json--from-json", () { |
580 var o = buildListLogServiceIndexesResponse(); | 2183 var o = buildListLogServiceIndexesResponse(); |
581 var od = new api.ListLogServiceIndexesResponse.fromJson(o.toJson()); | 2184 var od = new api.ListLogServiceIndexesResponse.fromJson(o.toJson()); |
582 checkListLogServiceIndexesResponse(od); | 2185 checkListLogServiceIndexesResponse(od); |
583 }); | 2186 }); |
584 }); | 2187 }); |
585 | 2188 |
586 | 2189 |
587 unittest.group("obj-schema-ListLogServiceSinksResponse", () { | 2190 unittest.group("obj-schema-ListLogServiceSinksResponse", () { |
(...skipping 25 matching lines...) Expand all Loading... |
613 | 2216 |
614 unittest.group("obj-schema-ListLogsResponse", () { | 2217 unittest.group("obj-schema-ListLogsResponse", () { |
615 unittest.test("to-json--from-json", () { | 2218 unittest.test("to-json--from-json", () { |
616 var o = buildListLogsResponse(); | 2219 var o = buildListLogsResponse(); |
617 var od = new api.ListLogsResponse.fromJson(o.toJson()); | 2220 var od = new api.ListLogsResponse.fromJson(o.toJson()); |
618 checkListLogsResponse(od); | 2221 checkListLogsResponse(od); |
619 }); | 2222 }); |
620 }); | 2223 }); |
621 | 2224 |
622 | 2225 |
| 2226 unittest.group("obj-schema-ListSinksResponse", () { |
| 2227 unittest.test("to-json--from-json", () { |
| 2228 var o = buildListSinksResponse(); |
| 2229 var od = new api.ListSinksResponse.fromJson(o.toJson()); |
| 2230 checkListSinksResponse(od); |
| 2231 }); |
| 2232 }); |
| 2233 |
| 2234 |
| 2235 unittest.group("obj-schema-Load", () { |
| 2236 unittest.test("to-json--from-json", () { |
| 2237 var o = buildLoad(); |
| 2238 var od = new api.Load.fromJson(o.toJson()); |
| 2239 checkLoad(od); |
| 2240 }); |
| 2241 }); |
| 2242 |
| 2243 |
623 unittest.group("obj-schema-Log", () { | 2244 unittest.group("obj-schema-Log", () { |
624 unittest.test("to-json--from-json", () { | 2245 unittest.test("to-json--from-json", () { |
625 var o = buildLog(); | 2246 var o = buildLog(); |
626 var od = new api.Log.fromJson(o.toJson()); | 2247 var od = new api.Log.fromJson(o.toJson()); |
627 checkLog(od); | 2248 checkLog(od); |
628 }); | 2249 }); |
629 }); | 2250 }); |
630 | 2251 |
631 | 2252 |
632 unittest.group("obj-schema-LogEntry", () { | 2253 unittest.group("obj-schema-LogEntry", () { |
(...skipping 16 matching lines...) Expand all Loading... |
649 | 2270 |
650 unittest.group("obj-schema-LogError", () { | 2271 unittest.group("obj-schema-LogError", () { |
651 unittest.test("to-json--from-json", () { | 2272 unittest.test("to-json--from-json", () { |
652 var o = buildLogError(); | 2273 var o = buildLogError(); |
653 var od = new api.LogError.fromJson(o.toJson()); | 2274 var od = new api.LogError.fromJson(o.toJson()); |
654 checkLogError(od); | 2275 checkLogError(od); |
655 }); | 2276 }); |
656 }); | 2277 }); |
657 | 2278 |
658 | 2279 |
| 2280 unittest.group("obj-schema-LogLine", () { |
| 2281 unittest.test("to-json--from-json", () { |
| 2282 var o = buildLogLine(); |
| 2283 var od = new api.LogLine.fromJson(o.toJson()); |
| 2284 checkLogLine(od); |
| 2285 }); |
| 2286 }); |
| 2287 |
| 2288 |
659 unittest.group("obj-schema-LogService", () { | 2289 unittest.group("obj-schema-LogService", () { |
660 unittest.test("to-json--from-json", () { | 2290 unittest.test("to-json--from-json", () { |
661 var o = buildLogService(); | 2291 var o = buildLogService(); |
662 var od = new api.LogService.fromJson(o.toJson()); | 2292 var od = new api.LogService.fromJson(o.toJson()); |
663 checkLogService(od); | 2293 checkLogService(od); |
664 }); | 2294 }); |
665 }); | 2295 }); |
666 | 2296 |
667 | 2297 |
668 unittest.group("obj-schema-LogSink", () { | 2298 unittest.group("obj-schema-LogSink", () { |
669 unittest.test("to-json--from-json", () { | 2299 unittest.test("to-json--from-json", () { |
670 var o = buildLogSink(); | 2300 var o = buildLogSink(); |
671 var od = new api.LogSink.fromJson(o.toJson()); | 2301 var od = new api.LogSink.fromJson(o.toJson()); |
672 checkLogSink(od); | 2302 checkLogSink(od); |
673 }); | 2303 }); |
674 }); | 2304 }); |
675 | 2305 |
676 | 2306 |
| 2307 unittest.group("obj-schema-Money", () { |
| 2308 unittest.test("to-json--from-json", () { |
| 2309 var o = buildMoney(); |
| 2310 var od = new api.Money.fromJson(o.toJson()); |
| 2311 checkMoney(od); |
| 2312 }); |
| 2313 }); |
| 2314 |
| 2315 |
| 2316 unittest.group("obj-schema-Query", () { |
| 2317 unittest.test("to-json--from-json", () { |
| 2318 var o = buildQuery(); |
| 2319 var od = new api.Query.fromJson(o.toJson()); |
| 2320 checkQuery(od); |
| 2321 }); |
| 2322 }); |
| 2323 |
| 2324 |
| 2325 unittest.group("obj-schema-RequestLog", () { |
| 2326 unittest.test("to-json--from-json", () { |
| 2327 var o = buildRequestLog(); |
| 2328 var od = new api.RequestLog.fromJson(o.toJson()); |
| 2329 checkRequestLog(od); |
| 2330 }); |
| 2331 }); |
| 2332 |
| 2333 |
| 2334 unittest.group("obj-schema-RequestMetadata", () { |
| 2335 unittest.test("to-json--from-json", () { |
| 2336 var o = buildRequestMetadata(); |
| 2337 var od = new api.RequestMetadata.fromJson(o.toJson()); |
| 2338 checkRequestMetadata(od); |
| 2339 }); |
| 2340 }); |
| 2341 |
| 2342 |
| 2343 unittest.group("obj-schema-SourceLocation", () { |
| 2344 unittest.test("to-json--from-json", () { |
| 2345 var o = buildSourceLocation(); |
| 2346 var od = new api.SourceLocation.fromJson(o.toJson()); |
| 2347 checkSourceLocation(od); |
| 2348 }); |
| 2349 }); |
| 2350 |
| 2351 |
| 2352 unittest.group("obj-schema-SourceReference", () { |
| 2353 unittest.test("to-json--from-json", () { |
| 2354 var o = buildSourceReference(); |
| 2355 var od = new api.SourceReference.fromJson(o.toJson()); |
| 2356 checkSourceReference(od); |
| 2357 }); |
| 2358 }); |
| 2359 |
| 2360 |
677 unittest.group("obj-schema-Status", () { | 2361 unittest.group("obj-schema-Status", () { |
678 unittest.test("to-json--from-json", () { | 2362 unittest.test("to-json--from-json", () { |
679 var o = buildStatus(); | 2363 var o = buildStatus(); |
680 var od = new api.Status.fromJson(o.toJson()); | 2364 var od = new api.Status.fromJson(o.toJson()); |
681 checkStatus(od); | 2365 checkStatus(od); |
682 }); | 2366 }); |
683 }); | 2367 }); |
684 | 2368 |
685 | 2369 |
| 2370 unittest.group("obj-schema-Table", () { |
| 2371 unittest.test("to-json--from-json", () { |
| 2372 var o = buildTable(); |
| 2373 var od = new api.Table.fromJson(o.toJson()); |
| 2374 checkTable(od); |
| 2375 }); |
| 2376 }); |
| 2377 |
| 2378 |
| 2379 unittest.group("obj-schema-TableCopy", () { |
| 2380 unittest.test("to-json--from-json", () { |
| 2381 var o = buildTableCopy(); |
| 2382 var od = new api.TableCopy.fromJson(o.toJson()); |
| 2383 checkTableCopy(od); |
| 2384 }); |
| 2385 }); |
| 2386 |
| 2387 |
| 2388 unittest.group("obj-schema-TableDataListRequest", () { |
| 2389 unittest.test("to-json--from-json", () { |
| 2390 var o = buildTableDataListRequest(); |
| 2391 var od = new api.TableDataListRequest.fromJson(o.toJson()); |
| 2392 checkTableDataListRequest(od); |
| 2393 }); |
| 2394 }); |
| 2395 |
| 2396 |
| 2397 unittest.group("obj-schema-TableDefinition", () { |
| 2398 unittest.test("to-json--from-json", () { |
| 2399 var o = buildTableDefinition(); |
| 2400 var od = new api.TableDefinition.fromJson(o.toJson()); |
| 2401 checkTableDefinition(od); |
| 2402 }); |
| 2403 }); |
| 2404 |
| 2405 |
| 2406 unittest.group("obj-schema-TableInfo", () { |
| 2407 unittest.test("to-json--from-json", () { |
| 2408 var o = buildTableInfo(); |
| 2409 var od = new api.TableInfo.fromJson(o.toJson()); |
| 2410 checkTableInfo(od); |
| 2411 }); |
| 2412 }); |
| 2413 |
| 2414 |
| 2415 unittest.group("obj-schema-TableInsertRequest", () { |
| 2416 unittest.test("to-json--from-json", () { |
| 2417 var o = buildTableInsertRequest(); |
| 2418 var od = new api.TableInsertRequest.fromJson(o.toJson()); |
| 2419 checkTableInsertRequest(od); |
| 2420 }); |
| 2421 }); |
| 2422 |
| 2423 |
| 2424 unittest.group("obj-schema-TableInsertResponse", () { |
| 2425 unittest.test("to-json--from-json", () { |
| 2426 var o = buildTableInsertResponse(); |
| 2427 var od = new api.TableInsertResponse.fromJson(o.toJson()); |
| 2428 checkTableInsertResponse(od); |
| 2429 }); |
| 2430 }); |
| 2431 |
| 2432 |
| 2433 unittest.group("obj-schema-TableName", () { |
| 2434 unittest.test("to-json--from-json", () { |
| 2435 var o = buildTableName(); |
| 2436 var od = new api.TableName.fromJson(o.toJson()); |
| 2437 checkTableName(od); |
| 2438 }); |
| 2439 }); |
| 2440 |
| 2441 |
| 2442 unittest.group("obj-schema-TableSchema", () { |
| 2443 unittest.test("to-json--from-json", () { |
| 2444 var o = buildTableSchema(); |
| 2445 var od = new api.TableSchema.fromJson(o.toJson()); |
| 2446 checkTableSchema(od); |
| 2447 }); |
| 2448 }); |
| 2449 |
| 2450 |
| 2451 unittest.group("obj-schema-TableUpdateRequest", () { |
| 2452 unittest.test("to-json--from-json", () { |
| 2453 var o = buildTableUpdateRequest(); |
| 2454 var od = new api.TableUpdateRequest.fromJson(o.toJson()); |
| 2455 checkTableUpdateRequest(od); |
| 2456 }); |
| 2457 }); |
| 2458 |
| 2459 |
| 2460 unittest.group("obj-schema-TableUpdateResponse", () { |
| 2461 unittest.test("to-json--from-json", () { |
| 2462 var o = buildTableUpdateResponse(); |
| 2463 var od = new api.TableUpdateResponse.fromJson(o.toJson()); |
| 2464 checkTableUpdateResponse(od); |
| 2465 }); |
| 2466 }); |
| 2467 |
| 2468 |
| 2469 unittest.group("obj-schema-TableViewDefinition", () { |
| 2470 unittest.test("to-json--from-json", () { |
| 2471 var o = buildTableViewDefinition(); |
| 2472 var od = new api.TableViewDefinition.fromJson(o.toJson()); |
| 2473 checkTableViewDefinition(od); |
| 2474 }); |
| 2475 }); |
| 2476 |
| 2477 |
686 unittest.group("obj-schema-WriteLogEntriesRequest", () { | 2478 unittest.group("obj-schema-WriteLogEntriesRequest", () { |
687 unittest.test("to-json--from-json", () { | 2479 unittest.test("to-json--from-json", () { |
688 var o = buildWriteLogEntriesRequest(); | 2480 var o = buildWriteLogEntriesRequest(); |
689 var od = new api.WriteLogEntriesRequest.fromJson(o.toJson()); | 2481 var od = new api.WriteLogEntriesRequest.fromJson(o.toJson()); |
690 checkWriteLogEntriesRequest(od); | 2482 checkWriteLogEntriesRequest(od); |
691 }); | 2483 }); |
692 }); | 2484 }); |
693 | 2485 |
694 | 2486 |
695 unittest.group("obj-schema-WriteLogEntriesResponse", () { | 2487 unittest.group("obj-schema-WriteLogEntriesResponse", () { |
(...skipping 10 matching lines...) Expand all Loading... |
706 | 2498 |
707 var mock = new HttpServerMock(); | 2499 var mock = new HttpServerMock(); |
708 api.ProjectsLogServicesResourceApi res = new api.LoggingApi(mock).projects
.logServices; | 2500 api.ProjectsLogServicesResourceApi res = new api.LoggingApi(mock).projects
.logServices; |
709 var arg_projectsId = "foo"; | 2501 var arg_projectsId = "foo"; |
710 var arg_log = "foo"; | 2502 var arg_log = "foo"; |
711 var arg_pageSize = 42; | 2503 var arg_pageSize = 42; |
712 var arg_pageToken = "foo"; | 2504 var arg_pageToken = "foo"; |
713 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2505 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
714 var path = (req.url).path; | 2506 var path = (req.url).path; |
715 var pathOffset = 0; | 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 + 17), unittest.eq
uals("v1beta3/projects/")); |
| 2513 pathOffset += 17; |
| 2514 index = path.indexOf("/logServices", pathOffset); |
| 2515 unittest.expect(index >= 0, unittest.isTrue); |
| 2516 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2517 pathOffset = index; |
| 2518 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
| 2519 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/logServices")); |
| 2520 pathOffset += 12; |
| 2521 |
| 2522 var query = (req.url).query; |
| 2523 var queryOffset = 0; |
| 2524 var queryMap = {}; |
| 2525 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2526 parseBool(n) { |
| 2527 if (n == "true") return true; |
| 2528 if (n == "false") return false; |
| 2529 if (n == null) return null; |
| 2530 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2531 } |
| 2532 if (query.length > 0) { |
| 2533 for (var part in query.split("&")) { |
| 2534 var keyvalue = part.split("="); |
| 2535 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2536 } |
| 2537 } |
| 2538 unittest.expect(queryMap["log"].first, unittest.equals(arg_log)); |
| 2539 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2540 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2541 |
| 2542 |
| 2543 var h = { |
| 2544 "content-type" : "application/json; charset=utf-8", |
| 2545 }; |
| 2546 var resp = convert.JSON.encode(buildListLogServicesResponse()); |
| 2547 return new async.Future.value(stringResponse(200, h, resp)); |
| 2548 }), true); |
| 2549 res.list(arg_projectsId, log: arg_log, pageSize: arg_pageSize, pageToken:
arg_pageToken).then(unittest.expectAsync(((api.ListLogServicesResponse response)
{ |
| 2550 checkListLogServicesResponse(response); |
| 2551 }))); |
| 2552 }); |
| 2553 |
| 2554 }); |
| 2555 |
| 2556 |
| 2557 unittest.group("resource-ProjectsLogServicesIndexesResourceApi", () { |
| 2558 unittest.test("method--list", () { |
| 2559 |
| 2560 var mock = new HttpServerMock(); |
| 2561 api.ProjectsLogServicesIndexesResourceApi res = new api.LoggingApi(mock).p
rojects.logServices.indexes; |
| 2562 var arg_projectsId = "foo"; |
| 2563 var arg_logServicesId = "foo"; |
| 2564 var arg_indexPrefix = "foo"; |
| 2565 var arg_depth = 42; |
| 2566 var arg_log = "foo"; |
| 2567 var arg_pageSize = 42; |
| 2568 var arg_pageToken = "foo"; |
| 2569 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2570 var path = (req.url).path; |
| 2571 var pathOffset = 0; |
| 2572 var index; |
| 2573 var subPart; |
| 2574 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2575 pathOffset += 1; |
| 2576 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
| 2577 pathOffset += 17; |
| 2578 index = path.indexOf("/logServices/", pathOffset); |
| 2579 unittest.expect(index >= 0, unittest.isTrue); |
| 2580 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2581 pathOffset = index; |
| 2582 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
| 2583 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
| 2584 pathOffset += 13; |
| 2585 index = path.indexOf("/indexes", pathOffset); |
| 2586 unittest.expect(index >= 0, unittest.isTrue); |
| 2587 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2588 pathOffset = index; |
| 2589 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
| 2590 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/indexes")); |
| 2591 pathOffset += 8; |
| 2592 |
| 2593 var query = (req.url).query; |
| 2594 var queryOffset = 0; |
| 2595 var queryMap = {}; |
| 2596 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2597 parseBool(n) { |
| 2598 if (n == "true") return true; |
| 2599 if (n == "false") return false; |
| 2600 if (n == null) return null; |
| 2601 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2602 } |
| 2603 if (query.length > 0) { |
| 2604 for (var part in query.split("&")) { |
| 2605 var keyvalue = part.split("="); |
| 2606 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2607 } |
| 2608 } |
| 2609 unittest.expect(queryMap["indexPrefix"].first, unittest.equals(arg_index
Prefix)); |
| 2610 unittest.expect(core.int.parse(queryMap["depth"].first), unittest.equals
(arg_depth)); |
| 2611 unittest.expect(queryMap["log"].first, unittest.equals(arg_log)); |
| 2612 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2613 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2614 |
| 2615 |
| 2616 var h = { |
| 2617 "content-type" : "application/json; charset=utf-8", |
| 2618 }; |
| 2619 var resp = convert.JSON.encode(buildListLogServiceIndexesResponse()); |
| 2620 return new async.Future.value(stringResponse(200, h, resp)); |
| 2621 }), true); |
| 2622 res.list(arg_projectsId, arg_logServicesId, indexPrefix: arg_indexPrefix,
depth: arg_depth, log: arg_log, pageSize: arg_pageSize, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.ListLogServiceIndexesResponse response) { |
| 2623 checkListLogServiceIndexesResponse(response); |
| 2624 }))); |
| 2625 }); |
| 2626 |
| 2627 }); |
| 2628 |
| 2629 |
| 2630 unittest.group("resource-ProjectsLogServicesSinksResourceApi", () { |
| 2631 unittest.test("method--create", () { |
| 2632 |
| 2633 var mock = new HttpServerMock(); |
| 2634 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; |
| 2635 var arg_request = buildLogSink(); |
| 2636 var arg_projectsId = "foo"; |
| 2637 var arg_logServicesId = "foo"; |
| 2638 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2639 var obj = new api.LogSink.fromJson(json); |
| 2640 checkLogSink(obj); |
| 2641 |
| 2642 var path = (req.url).path; |
| 2643 var pathOffset = 0; |
| 2644 var index; |
| 2645 var subPart; |
| 2646 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2647 pathOffset += 1; |
| 2648 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
| 2649 pathOffset += 17; |
| 2650 index = path.indexOf("/logServices/", pathOffset); |
| 2651 unittest.expect(index >= 0, unittest.isTrue); |
| 2652 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2653 pathOffset = index; |
| 2654 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
| 2655 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
| 2656 pathOffset += 13; |
| 2657 index = path.indexOf("/sinks", pathOffset); |
| 2658 unittest.expect(index >= 0, unittest.isTrue); |
| 2659 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2660 pathOffset = index; |
| 2661 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
| 2662 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
| 2663 pathOffset += 6; |
| 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(buildLogSink()); |
| 2687 return new async.Future.value(stringResponse(200, h, resp)); |
| 2688 }), true); |
| 2689 res.create(arg_request, arg_projectsId, arg_logServicesId).then(unittest.e
xpectAsync(((api.LogSink response) { |
| 2690 checkLogSink(response); |
| 2691 }))); |
| 2692 }); |
| 2693 |
| 2694 unittest.test("method--delete", () { |
| 2695 |
| 2696 var mock = new HttpServerMock(); |
| 2697 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; |
| 2698 var arg_projectsId = "foo"; |
| 2699 var arg_logServicesId = "foo"; |
| 2700 var arg_sinksId = "foo"; |
| 2701 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2702 var path = (req.url).path; |
| 2703 var pathOffset = 0; |
| 2704 var index; |
| 2705 var subPart; |
| 2706 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2707 pathOffset += 1; |
| 2708 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
| 2709 pathOffset += 17; |
| 2710 index = path.indexOf("/logServices/", pathOffset); |
| 2711 unittest.expect(index >= 0, unittest.isTrue); |
| 2712 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2713 pathOffset = index; |
| 2714 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
| 2715 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
| 2716 pathOffset += 13; |
| 2717 index = path.indexOf("/sinks/", pathOffset); |
| 2718 unittest.expect(index >= 0, unittest.isTrue); |
| 2719 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2720 pathOffset = index; |
| 2721 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
| 2722 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
| 2723 pathOffset += 7; |
| 2724 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2725 pathOffset = path.length; |
| 2726 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
| 2727 |
| 2728 var query = (req.url).query; |
| 2729 var queryOffset = 0; |
| 2730 var queryMap = {}; |
| 2731 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2732 parseBool(n) { |
| 2733 if (n == "true") return true; |
| 2734 if (n == "false") return false; |
| 2735 if (n == null) return null; |
| 2736 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2737 } |
| 2738 if (query.length > 0) { |
| 2739 for (var part in query.split("&")) { |
| 2740 var keyvalue = part.split("="); |
| 2741 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2742 } |
| 2743 } |
| 2744 |
| 2745 |
| 2746 var h = { |
| 2747 "content-type" : "application/json; charset=utf-8", |
| 2748 }; |
| 2749 var resp = convert.JSON.encode(buildEmpty()); |
| 2750 return new async.Future.value(stringResponse(200, h, resp)); |
| 2751 }), true); |
| 2752 res.delete(arg_projectsId, arg_logServicesId, arg_sinksId).then(unittest.e
xpectAsync(((api.Empty response) { |
| 2753 checkEmpty(response); |
| 2754 }))); |
| 2755 }); |
| 2756 |
| 2757 unittest.test("method--get", () { |
| 2758 |
| 2759 var mock = new HttpServerMock(); |
| 2760 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; |
| 2761 var arg_projectsId = "foo"; |
| 2762 var arg_logServicesId = "foo"; |
| 2763 var arg_sinksId = "foo"; |
| 2764 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2765 var path = (req.url).path; |
| 2766 var pathOffset = 0; |
716 var index; | 2767 var index; |
717 var subPart; | 2768 var subPart; |
718 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2769 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
719 pathOffset += 1; | 2770 pathOffset += 1; |
720 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 2771 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
721 pathOffset += 17; | 2772 pathOffset += 17; |
722 index = path.indexOf("/logServices", pathOffset); | 2773 index = path.indexOf("/logServices/", pathOffset); |
723 unittest.expect(index >= 0, unittest.isTrue); | 2774 unittest.expect(index >= 0, unittest.isTrue); |
724 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2775 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
725 pathOffset = index; | 2776 pathOffset = index; |
726 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 2777 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
727 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/logServices")); | 2778 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
728 pathOffset += 12; | 2779 pathOffset += 13; |
| 2780 index = path.indexOf("/sinks/", pathOffset); |
| 2781 unittest.expect(index >= 0, unittest.isTrue); |
| 2782 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2783 pathOffset = index; |
| 2784 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
| 2785 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
| 2786 pathOffset += 7; |
| 2787 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2788 pathOffset = path.length; |
| 2789 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
729 | 2790 |
730 var query = (req.url).query; | 2791 var query = (req.url).query; |
731 var queryOffset = 0; | 2792 var queryOffset = 0; |
732 var queryMap = {}; | 2793 var queryMap = {}; |
733 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2794 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
734 parseBool(n) { | 2795 parseBool(n) { |
735 if (n == "true") return true; | 2796 if (n == "true") return true; |
736 if (n == "false") return false; | 2797 if (n == "false") return false; |
737 if (n == null) return null; | 2798 if (n == null) return null; |
738 throw new core.ArgumentError("Invalid boolean: $n"); | 2799 throw new core.ArgumentError("Invalid boolean: $n"); |
739 } | 2800 } |
740 if (query.length > 0) { | 2801 if (query.length > 0) { |
741 for (var part in query.split("&")) { | 2802 for (var part in query.split("&")) { |
742 var keyvalue = part.split("="); | 2803 var keyvalue = part.split("="); |
743 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2804 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
744 } | 2805 } |
745 } | 2806 } |
746 unittest.expect(queryMap["log"].first, unittest.equals(arg_log)); | |
747 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
748 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
749 | 2807 |
750 | 2808 |
751 var h = { | 2809 var h = { |
752 "content-type" : "application/json; charset=utf-8", | 2810 "content-type" : "application/json; charset=utf-8", |
753 }; | 2811 }; |
754 var resp = convert.JSON.encode(buildListLogServicesResponse()); | 2812 var resp = convert.JSON.encode(buildLogSink()); |
755 return new async.Future.value(stringResponse(200, h, resp)); | 2813 return new async.Future.value(stringResponse(200, h, resp)); |
756 }), true); | 2814 }), true); |
757 res.list(arg_projectsId, log: arg_log, pageSize: arg_pageSize, pageToken:
arg_pageToken).then(unittest.expectAsync(((api.ListLogServicesResponse response)
{ | 2815 res.get(arg_projectsId, arg_logServicesId, arg_sinksId).then(unittest.expe
ctAsync(((api.LogSink response) { |
758 checkListLogServicesResponse(response); | 2816 checkLogSink(response); |
759 }))); | 2817 }))); |
760 }); | 2818 }); |
761 | 2819 |
762 }); | |
763 | |
764 | |
765 unittest.group("resource-ProjectsLogServicesIndexesResourceApi", () { | |
766 unittest.test("method--list", () { | 2820 unittest.test("method--list", () { |
767 | 2821 |
768 var mock = new HttpServerMock(); | 2822 var mock = new HttpServerMock(); |
769 api.ProjectsLogServicesIndexesResourceApi res = new api.LoggingApi(mock).p
rojects.logServices.indexes; | 2823 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; |
770 var arg_projectsId = "foo"; | 2824 var arg_projectsId = "foo"; |
771 var arg_logServicesId = "foo"; | 2825 var arg_logServicesId = "foo"; |
772 var arg_indexPrefix = "foo"; | |
773 var arg_depth = 42; | |
774 var arg_log = "foo"; | |
775 var arg_pageSize = 42; | |
776 var arg_pageToken = "foo"; | |
777 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2826 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
778 var path = (req.url).path; | 2827 var path = (req.url).path; |
779 var pathOffset = 0; | 2828 var pathOffset = 0; |
780 var index; | 2829 var index; |
781 var subPart; | 2830 var subPart; |
782 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2831 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
783 pathOffset += 1; | 2832 pathOffset += 1; |
784 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 2833 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
785 pathOffset += 17; | 2834 pathOffset += 17; |
786 index = path.indexOf("/logServices/", pathOffset); | 2835 index = path.indexOf("/logServices/", pathOffset); |
787 unittest.expect(index >= 0, unittest.isTrue); | 2836 unittest.expect(index >= 0, unittest.isTrue); |
788 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2837 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
789 pathOffset = index; | 2838 pathOffset = index; |
790 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 2839 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
791 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 2840 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
792 pathOffset += 13; | 2841 pathOffset += 13; |
793 index = path.indexOf("/indexes", pathOffset); | 2842 index = path.indexOf("/sinks", pathOffset); |
794 unittest.expect(index >= 0, unittest.isTrue); | 2843 unittest.expect(index >= 0, unittest.isTrue); |
795 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2844 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
796 pathOffset = index; | 2845 pathOffset = index; |
797 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 2846 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
798 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/indexes")); | 2847 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
799 pathOffset += 8; | 2848 pathOffset += 6; |
800 | 2849 |
801 var query = (req.url).query; | 2850 var query = (req.url).query; |
802 var queryOffset = 0; | 2851 var queryOffset = 0; |
803 var queryMap = {}; | 2852 var queryMap = {}; |
804 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2853 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
805 parseBool(n) { | 2854 parseBool(n) { |
806 if (n == "true") return true; | 2855 if (n == "true") return true; |
807 if (n == "false") return false; | 2856 if (n == "false") return false; |
808 if (n == null) return null; | 2857 if (n == null) return null; |
809 throw new core.ArgumentError("Invalid boolean: $n"); | 2858 throw new core.ArgumentError("Invalid boolean: $n"); |
810 } | 2859 } |
811 if (query.length > 0) { | 2860 if (query.length > 0) { |
812 for (var part in query.split("&")) { | 2861 for (var part in query.split("&")) { |
813 var keyvalue = part.split("="); | 2862 var keyvalue = part.split("="); |
814 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2863 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
815 } | 2864 } |
816 } | 2865 } |
817 unittest.expect(queryMap["indexPrefix"].first, unittest.equals(arg_index
Prefix)); | |
818 unittest.expect(core.int.parse(queryMap["depth"].first), unittest.equals
(arg_depth)); | |
819 unittest.expect(queryMap["log"].first, unittest.equals(arg_log)); | |
820 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
821 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
822 | 2866 |
823 | 2867 |
824 var h = { | 2868 var h = { |
825 "content-type" : "application/json; charset=utf-8", | 2869 "content-type" : "application/json; charset=utf-8", |
826 }; | 2870 }; |
827 var resp = convert.JSON.encode(buildListLogServiceIndexesResponse()); | 2871 var resp = convert.JSON.encode(buildListLogServiceSinksResponse()); |
828 return new async.Future.value(stringResponse(200, h, resp)); | 2872 return new async.Future.value(stringResponse(200, h, resp)); |
829 }), true); | 2873 }), true); |
830 res.list(arg_projectsId, arg_logServicesId, indexPrefix: arg_indexPrefix,
depth: arg_depth, log: arg_log, pageSize: arg_pageSize, pageToken: arg_pageToken
).then(unittest.expectAsync(((api.ListLogServiceIndexesResponse response) { | 2874 res.list(arg_projectsId, arg_logServicesId).then(unittest.expectAsync(((ap
i.ListLogServiceSinksResponse response) { |
831 checkListLogServiceIndexesResponse(response); | 2875 checkListLogServiceSinksResponse(response); |
832 }))); | 2876 }))); |
833 }); | 2877 }); |
834 | 2878 |
835 }); | 2879 unittest.test("method--update", () { |
836 | |
837 | |
838 unittest.group("resource-ProjectsLogServicesSinksResourceApi", () { | |
839 unittest.test("method--create", () { | |
840 | 2880 |
841 var mock = new HttpServerMock(); | 2881 var mock = new HttpServerMock(); |
842 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; | 2882 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; |
843 var arg_request = buildLogSink(); | 2883 var arg_request = buildLogSink(); |
844 var arg_projectsId = "foo"; | 2884 var arg_projectsId = "foo"; |
845 var arg_logServicesId = "foo"; | 2885 var arg_logServicesId = "foo"; |
| 2886 var arg_sinksId = "foo"; |
846 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2887 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
847 var obj = new api.LogSink.fromJson(json); | 2888 var obj = new api.LogSink.fromJson(json); |
848 checkLogSink(obj); | 2889 checkLogSink(obj); |
849 | 2890 |
850 var path = (req.url).path; | 2891 var path = (req.url).path; |
851 var pathOffset = 0; | 2892 var pathOffset = 0; |
852 var index; | 2893 var index; |
853 var subPart; | 2894 var subPart; |
854 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2895 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
855 pathOffset += 1; | 2896 pathOffset += 1; |
856 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 2897 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
857 pathOffset += 17; | 2898 pathOffset += 17; |
858 index = path.indexOf("/logServices/", pathOffset); | 2899 index = path.indexOf("/logServices/", pathOffset); |
859 unittest.expect(index >= 0, unittest.isTrue); | 2900 unittest.expect(index >= 0, unittest.isTrue); |
860 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2901 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
861 pathOffset = index; | 2902 pathOffset = index; |
862 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 2903 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
863 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 2904 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); |
864 pathOffset += 13; | 2905 pathOffset += 13; |
865 index = path.indexOf("/sinks", pathOffset); | 2906 index = path.indexOf("/sinks/", pathOffset); |
866 unittest.expect(index >= 0, unittest.isTrue); | 2907 unittest.expect(index >= 0, unittest.isTrue); |
867 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2908 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
868 pathOffset = index; | 2909 pathOffset = index; |
869 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 2910 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); |
870 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); | 2911 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
871 pathOffset += 6; | 2912 pathOffset += 7; |
| 2913 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2914 pathOffset = path.length; |
| 2915 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
872 | 2916 |
873 var query = (req.url).query; | 2917 var query = (req.url).query; |
874 var queryOffset = 0; | 2918 var queryOffset = 0; |
875 var queryMap = {}; | 2919 var queryMap = {}; |
876 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2920 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
877 parseBool(n) { | 2921 parseBool(n) { |
878 if (n == "true") return true; | 2922 if (n == "true") return true; |
879 if (n == "false") return false; | 2923 if (n == "false") return false; |
880 if (n == null) return null; | 2924 if (n == null) return null; |
881 throw new core.ArgumentError("Invalid boolean: $n"); | 2925 throw new core.ArgumentError("Invalid boolean: $n"); |
882 } | 2926 } |
883 if (query.length > 0) { | 2927 if (query.length > 0) { |
884 for (var part in query.split("&")) { | 2928 for (var part in query.split("&")) { |
885 var keyvalue = part.split("="); | 2929 var keyvalue = part.split("="); |
886 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2930 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
887 } | 2931 } |
888 } | 2932 } |
889 | 2933 |
890 | 2934 |
891 var h = { | 2935 var h = { |
892 "content-type" : "application/json; charset=utf-8", | 2936 "content-type" : "application/json; charset=utf-8", |
893 }; | 2937 }; |
894 var resp = convert.JSON.encode(buildLogSink()); | 2938 var resp = convert.JSON.encode(buildLogSink()); |
895 return new async.Future.value(stringResponse(200, h, resp)); | 2939 return new async.Future.value(stringResponse(200, h, resp)); |
896 }), true); | 2940 }), true); |
897 res.create(arg_request, arg_projectsId, arg_logServicesId).then(unittest.e
xpectAsync(((api.LogSink response) { | 2941 res.update(arg_request, arg_projectsId, arg_logServicesId, arg_sinksId).th
en(unittest.expectAsync(((api.LogSink response) { |
898 checkLogSink(response); | 2942 checkLogSink(response); |
899 }))); | 2943 }))); |
900 }); | 2944 }); |
901 | 2945 |
| 2946 }); |
| 2947 |
| 2948 |
| 2949 unittest.group("resource-ProjectsLogsResourceApi", () { |
902 unittest.test("method--delete", () { | 2950 unittest.test("method--delete", () { |
903 | 2951 |
904 var mock = new HttpServerMock(); | 2952 var mock = new HttpServerMock(); |
905 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; | 2953 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
906 var arg_projectsId = "foo"; | 2954 var arg_projectsId = "foo"; |
907 var arg_logServicesId = "foo"; | 2955 var arg_logsId = "foo"; |
908 var arg_sinksId = "foo"; | |
909 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2956 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
910 var path = (req.url).path; | 2957 var path = (req.url).path; |
911 var pathOffset = 0; | 2958 var pathOffset = 0; |
912 var index; | 2959 var index; |
913 var subPart; | 2960 var subPart; |
914 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2961 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
915 pathOffset += 1; | 2962 pathOffset += 1; |
916 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 2963 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
917 pathOffset += 17; | 2964 pathOffset += 17; |
918 index = path.indexOf("/logServices/", pathOffset); | 2965 index = path.indexOf("/logs/", pathOffset); |
919 unittest.expect(index >= 0, unittest.isTrue); | 2966 unittest.expect(index >= 0, unittest.isTrue); |
920 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2967 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
921 pathOffset = index; | 2968 pathOffset = index; |
922 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 2969 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
923 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 2970 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
924 pathOffset += 13; | 2971 pathOffset += 6; |
925 index = path.indexOf("/sinks/", pathOffset); | 2972 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2973 pathOffset = path.length; |
| 2974 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
| 2975 |
| 2976 var query = (req.url).query; |
| 2977 var queryOffset = 0; |
| 2978 var queryMap = {}; |
| 2979 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2980 parseBool(n) { |
| 2981 if (n == "true") return true; |
| 2982 if (n == "false") return false; |
| 2983 if (n == null) return null; |
| 2984 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2985 } |
| 2986 if (query.length > 0) { |
| 2987 for (var part in query.split("&")) { |
| 2988 var keyvalue = part.split("="); |
| 2989 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2990 } |
| 2991 } |
| 2992 |
| 2993 |
| 2994 var h = { |
| 2995 "content-type" : "application/json; charset=utf-8", |
| 2996 }; |
| 2997 var resp = convert.JSON.encode(buildEmpty()); |
| 2998 return new async.Future.value(stringResponse(200, h, resp)); |
| 2999 }), true); |
| 3000 res.delete(arg_projectsId, arg_logsId).then(unittest.expectAsync(((api.Emp
ty response) { |
| 3001 checkEmpty(response); |
| 3002 }))); |
| 3003 }); |
| 3004 |
| 3005 unittest.test("method--list", () { |
| 3006 |
| 3007 var mock = new HttpServerMock(); |
| 3008 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; |
| 3009 var arg_projectsId = "foo"; |
| 3010 var arg_serviceName = "foo"; |
| 3011 var arg_serviceIndexPrefix = "foo"; |
| 3012 var arg_pageSize = 42; |
| 3013 var arg_pageToken = "foo"; |
| 3014 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3015 var path = (req.url).path; |
| 3016 var pathOffset = 0; |
| 3017 var index; |
| 3018 var subPart; |
| 3019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3020 pathOffset += 1; |
| 3021 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
| 3022 pathOffset += 17; |
| 3023 index = path.indexOf("/logs", pathOffset); |
926 unittest.expect(index >= 0, unittest.isTrue); | 3024 unittest.expect(index >= 0, unittest.isTrue); |
927 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3025 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
928 pathOffset = index; | 3026 pathOffset = index; |
929 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 3027 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
930 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3028 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/logs")); |
931 pathOffset += 7; | 3029 pathOffset += 5; |
932 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
933 pathOffset = path.length; | |
934 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | |
935 | 3030 |
936 var query = (req.url).query; | 3031 var query = (req.url).query; |
937 var queryOffset = 0; | 3032 var queryOffset = 0; |
938 var queryMap = {}; | 3033 var queryMap = {}; |
939 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3034 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
940 parseBool(n) { | 3035 parseBool(n) { |
941 if (n == "true") return true; | 3036 if (n == "true") return true; |
942 if (n == "false") return false; | 3037 if (n == "false") return false; |
943 if (n == null) return null; | 3038 if (n == null) return null; |
944 throw new core.ArgumentError("Invalid boolean: $n"); | 3039 throw new core.ArgumentError("Invalid boolean: $n"); |
945 } | 3040 } |
946 if (query.length > 0) { | 3041 if (query.length > 0) { |
947 for (var part in query.split("&")) { | 3042 for (var part in query.split("&")) { |
948 var keyvalue = part.split("="); | 3043 var keyvalue = part.split("="); |
949 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3044 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
950 } | 3045 } |
951 } | 3046 } |
| 3047 unittest.expect(queryMap["serviceName"].first, unittest.equals(arg_servi
ceName)); |
| 3048 unittest.expect(queryMap["serviceIndexPrefix"].first, unittest.equals(ar
g_serviceIndexPrefix)); |
| 3049 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 3050 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
952 | 3051 |
953 | 3052 |
954 var h = { | 3053 var h = { |
955 "content-type" : "application/json; charset=utf-8", | 3054 "content-type" : "application/json; charset=utf-8", |
956 }; | 3055 }; |
957 var resp = convert.JSON.encode(buildEmpty()); | 3056 var resp = convert.JSON.encode(buildListLogsResponse()); |
958 return new async.Future.value(stringResponse(200, h, resp)); | 3057 return new async.Future.value(stringResponse(200, h, resp)); |
959 }), true); | 3058 }), true); |
960 res.delete(arg_projectsId, arg_logServicesId, arg_sinksId).then(unittest.e
xpectAsync(((api.Empty response) { | 3059 res.list(arg_projectsId, serviceName: arg_serviceName, serviceIndexPrefix:
arg_serviceIndexPrefix, pageSize: arg_pageSize, pageToken: arg_pageToken).then(
unittest.expectAsync(((api.ListLogsResponse response) { |
961 checkEmpty(response); | 3060 checkListLogsResponse(response); |
962 }))); | 3061 }))); |
963 }); | 3062 }); |
964 | 3063 |
965 unittest.test("method--get", () { | 3064 }); |
| 3065 |
| 3066 |
| 3067 unittest.group("resource-ProjectsLogsEntriesResourceApi", () { |
| 3068 unittest.test("method--write", () { |
966 | 3069 |
967 var mock = new HttpServerMock(); | 3070 var mock = new HttpServerMock(); |
968 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; | 3071 api.ProjectsLogsEntriesResourceApi res = new api.LoggingApi(mock).projects
.logs.entries; |
| 3072 var arg_request = buildWriteLogEntriesRequest(); |
969 var arg_projectsId = "foo"; | 3073 var arg_projectsId = "foo"; |
970 var arg_logServicesId = "foo"; | 3074 var arg_logsId = "foo"; |
971 var arg_sinksId = "foo"; | |
972 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3075 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3076 var obj = new api.WriteLogEntriesRequest.fromJson(json); |
| 3077 checkWriteLogEntriesRequest(obj); |
| 3078 |
973 var path = (req.url).path; | 3079 var path = (req.url).path; |
974 var pathOffset = 0; | 3080 var pathOffset = 0; |
975 var index; | 3081 var index; |
976 var subPart; | 3082 var subPart; |
977 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3083 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
978 pathOffset += 1; | 3084 pathOffset += 1; |
979 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3085 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
980 pathOffset += 17; | 3086 pathOffset += 17; |
981 index = path.indexOf("/logServices/", pathOffset); | 3087 index = path.indexOf("/logs/", pathOffset); |
982 unittest.expect(index >= 0, unittest.isTrue); | 3088 unittest.expect(index >= 0, unittest.isTrue); |
983 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3089 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
984 pathOffset = index; | 3090 pathOffset = index; |
985 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3091 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
986 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 3092 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
987 pathOffset += 13; | 3093 pathOffset += 6; |
988 index = path.indexOf("/sinks/", pathOffset); | 3094 index = path.indexOf("/entries:write", pathOffset); |
989 unittest.expect(index >= 0, unittest.isTrue); | 3095 unittest.expect(index >= 0, unittest.isTrue); |
990 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3096 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
991 pathOffset = index; | 3097 pathOffset = index; |
992 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 3098 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
993 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3099 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/entries:write")); |
994 pathOffset += 7; | 3100 pathOffset += 14; |
995 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
996 pathOffset = path.length; | |
997 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | |
998 | 3101 |
999 var query = (req.url).query; | 3102 var query = (req.url).query; |
1000 var queryOffset = 0; | 3103 var queryOffset = 0; |
1001 var queryMap = {}; | 3104 var queryMap = {}; |
1002 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3105 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1003 parseBool(n) { | 3106 parseBool(n) { |
1004 if (n == "true") return true; | 3107 if (n == "true") return true; |
1005 if (n == "false") return false; | 3108 if (n == "false") return false; |
1006 if (n == null) return null; | 3109 if (n == null) return null; |
1007 throw new core.ArgumentError("Invalid boolean: $n"); | 3110 throw new core.ArgumentError("Invalid boolean: $n"); |
1008 } | 3111 } |
1009 if (query.length > 0) { | 3112 if (query.length > 0) { |
1010 for (var part in query.split("&")) { | 3113 for (var part in query.split("&")) { |
1011 var keyvalue = part.split("="); | 3114 var keyvalue = part.split("="); |
1012 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3115 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1013 } | 3116 } |
1014 } | 3117 } |
1015 | 3118 |
1016 | 3119 |
1017 var h = { | 3120 var h = { |
1018 "content-type" : "application/json; charset=utf-8", | 3121 "content-type" : "application/json; charset=utf-8", |
1019 }; | 3122 }; |
1020 var resp = convert.JSON.encode(buildLogSink()); | 3123 var resp = convert.JSON.encode(buildWriteLogEntriesResponse()); |
1021 return new async.Future.value(stringResponse(200, h, resp)); | 3124 return new async.Future.value(stringResponse(200, h, resp)); |
1022 }), true); | 3125 }), true); |
1023 res.get(arg_projectsId, arg_logServicesId, arg_sinksId).then(unittest.expe
ctAsync(((api.LogSink response) { | 3126 res.write(arg_request, arg_projectsId, arg_logsId).then(unittest.expectAsy
nc(((api.WriteLogEntriesResponse response) { |
1024 checkLogSink(response); | 3127 checkWriteLogEntriesResponse(response); |
1025 }))); | 3128 }))); |
1026 }); | 3129 }); |
1027 | 3130 |
1028 unittest.test("method--list", () { | 3131 }); |
| 3132 |
| 3133 |
| 3134 unittest.group("resource-ProjectsLogsSinksResourceApi", () { |
| 3135 unittest.test("method--create", () { |
1029 | 3136 |
1030 var mock = new HttpServerMock(); | 3137 var mock = new HttpServerMock(); |
1031 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; | 3138 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; |
| 3139 var arg_request = buildLogSink(); |
1032 var arg_projectsId = "foo"; | 3140 var arg_projectsId = "foo"; |
1033 var arg_logServicesId = "foo"; | 3141 var arg_logsId = "foo"; |
1034 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3142 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3143 var obj = new api.LogSink.fromJson(json); |
| 3144 checkLogSink(obj); |
| 3145 |
1035 var path = (req.url).path; | 3146 var path = (req.url).path; |
1036 var pathOffset = 0; | 3147 var pathOffset = 0; |
1037 var index; | 3148 var index; |
1038 var subPart; | 3149 var subPart; |
1039 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3150 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1040 pathOffset += 1; | 3151 pathOffset += 1; |
1041 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3152 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1042 pathOffset += 17; | 3153 pathOffset += 17; |
1043 index = path.indexOf("/logServices/", pathOffset); | 3154 index = path.indexOf("/logs/", pathOffset); |
1044 unittest.expect(index >= 0, unittest.isTrue); | 3155 unittest.expect(index >= 0, unittest.isTrue); |
1045 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3156 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1046 pathOffset = index; | 3157 pathOffset = index; |
1047 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3158 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1048 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 3159 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
1049 pathOffset += 13; | 3160 pathOffset += 6; |
1050 index = path.indexOf("/sinks", pathOffset); | 3161 index = path.indexOf("/sinks", pathOffset); |
1051 unittest.expect(index >= 0, unittest.isTrue); | 3162 unittest.expect(index >= 0, unittest.isTrue); |
1052 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3163 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1053 pathOffset = index; | 3164 pathOffset = index; |
1054 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 3165 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
1055 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); | 3166 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
1056 pathOffset += 6; | 3167 pathOffset += 6; |
1057 | 3168 |
1058 var query = (req.url).query; | 3169 var query = (req.url).query; |
1059 var queryOffset = 0; | 3170 var queryOffset = 0; |
1060 var queryMap = {}; | 3171 var queryMap = {}; |
1061 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3172 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1062 parseBool(n) { | 3173 parseBool(n) { |
1063 if (n == "true") return true; | 3174 if (n == "true") return true; |
1064 if (n == "false") return false; | 3175 if (n == "false") return false; |
1065 if (n == null) return null; | 3176 if (n == null) return null; |
1066 throw new core.ArgumentError("Invalid boolean: $n"); | 3177 throw new core.ArgumentError("Invalid boolean: $n"); |
1067 } | 3178 } |
1068 if (query.length > 0) { | 3179 if (query.length > 0) { |
1069 for (var part in query.split("&")) { | 3180 for (var part in query.split("&")) { |
1070 var keyvalue = part.split("="); | 3181 var keyvalue = part.split("="); |
1071 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3182 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1072 } | 3183 } |
1073 } | 3184 } |
1074 | 3185 |
1075 | 3186 |
1076 var h = { | 3187 var h = { |
1077 "content-type" : "application/json; charset=utf-8", | 3188 "content-type" : "application/json; charset=utf-8", |
1078 }; | 3189 }; |
1079 var resp = convert.JSON.encode(buildListLogServiceSinksResponse()); | 3190 var resp = convert.JSON.encode(buildLogSink()); |
1080 return new async.Future.value(stringResponse(200, h, resp)); | 3191 return new async.Future.value(stringResponse(200, h, resp)); |
1081 }), true); | 3192 }), true); |
1082 res.list(arg_projectsId, arg_logServicesId).then(unittest.expectAsync(((ap
i.ListLogServiceSinksResponse response) { | 3193 res.create(arg_request, arg_projectsId, arg_logsId).then(unittest.expectAs
ync(((api.LogSink response) { |
1083 checkListLogServiceSinksResponse(response); | 3194 checkLogSink(response); |
1084 }))); | 3195 }))); |
1085 }); | 3196 }); |
1086 | 3197 |
1087 unittest.test("method--update", () { | 3198 unittest.test("method--delete", () { |
1088 | 3199 |
1089 var mock = new HttpServerMock(); | 3200 var mock = new HttpServerMock(); |
1090 api.ProjectsLogServicesSinksResourceApi res = new api.LoggingApi(mock).pro
jects.logServices.sinks; | 3201 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; |
1091 var arg_request = buildLogSink(); | |
1092 var arg_projectsId = "foo"; | 3202 var arg_projectsId = "foo"; |
1093 var arg_logServicesId = "foo"; | 3203 var arg_logsId = "foo"; |
1094 var arg_sinksId = "foo"; | 3204 var arg_sinksId = "foo"; |
1095 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3205 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1096 var obj = new api.LogSink.fromJson(json); | |
1097 checkLogSink(obj); | |
1098 | |
1099 var path = (req.url).path; | 3206 var path = (req.url).path; |
1100 var pathOffset = 0; | 3207 var pathOffset = 0; |
1101 var index; | 3208 var index; |
1102 var subPart; | 3209 var subPart; |
1103 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3210 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1104 pathOffset += 1; | 3211 pathOffset += 1; |
1105 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3212 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1106 pathOffset += 17; | 3213 pathOffset += 17; |
1107 index = path.indexOf("/logServices/", pathOffset); | 3214 index = path.indexOf("/logs/", pathOffset); |
1108 unittest.expect(index >= 0, unittest.isTrue); | 3215 unittest.expect(index >= 0, unittest.isTrue); |
1109 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3216 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1110 pathOffset = index; | 3217 pathOffset = index; |
1111 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3218 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1112 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/logServices/")); | 3219 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
1113 pathOffset += 13; | 3220 pathOffset += 6; |
1114 index = path.indexOf("/sinks/", pathOffset); | 3221 index = path.indexOf("/sinks/", pathOffset); |
1115 unittest.expect(index >= 0, unittest.isTrue); | 3222 unittest.expect(index >= 0, unittest.isTrue); |
1116 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3223 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1117 pathOffset = index; | 3224 pathOffset = index; |
1118 unittest.expect(subPart, unittest.equals("$arg_logServicesId")); | 3225 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
1119 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3226 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
1120 pathOffset += 7; | 3227 pathOffset += 7; |
1121 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3228 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1122 pathOffset = path.length; | 3229 pathOffset = path.length; |
1123 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | 3230 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1124 | 3231 |
1125 var query = (req.url).query; | 3232 var query = (req.url).query; |
1126 var queryOffset = 0; | 3233 var queryOffset = 0; |
1127 var queryMap = {}; | 3234 var queryMap = {}; |
1128 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3235 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1129 parseBool(n) { | 3236 parseBool(n) { |
1130 if (n == "true") return true; | 3237 if (n == "true") return true; |
1131 if (n == "false") return false; | 3238 if (n == "false") return false; |
1132 if (n == null) return null; | 3239 if (n == null) return null; |
1133 throw new core.ArgumentError("Invalid boolean: $n"); | 3240 throw new core.ArgumentError("Invalid boolean: $n"); |
1134 } | 3241 } |
1135 if (query.length > 0) { | 3242 if (query.length > 0) { |
1136 for (var part in query.split("&")) { | 3243 for (var part in query.split("&")) { |
1137 var keyvalue = part.split("="); | 3244 var keyvalue = part.split("="); |
1138 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3245 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1139 } | 3246 } |
1140 } | 3247 } |
1141 | 3248 |
1142 | 3249 |
1143 var h = { | 3250 var h = { |
1144 "content-type" : "application/json; charset=utf-8", | 3251 "content-type" : "application/json; charset=utf-8", |
1145 }; | 3252 }; |
1146 var resp = convert.JSON.encode(buildLogSink()); | 3253 var resp = convert.JSON.encode(buildEmpty()); |
1147 return new async.Future.value(stringResponse(200, h, resp)); | 3254 return new async.Future.value(stringResponse(200, h, resp)); |
1148 }), true); | 3255 }), true); |
1149 res.update(arg_request, arg_projectsId, arg_logServicesId, arg_sinksId).th
en(unittest.expectAsync(((api.LogSink response) { | 3256 res.delete(arg_projectsId, arg_logsId, arg_sinksId).then(unittest.expectAs
ync(((api.Empty response) { |
1150 checkLogSink(response); | 3257 checkEmpty(response); |
1151 }))); | 3258 }))); |
1152 }); | 3259 }); |
1153 | 3260 |
1154 }); | 3261 unittest.test("method--get", () { |
1155 | |
1156 | |
1157 unittest.group("resource-ProjectsLogsResourceApi", () { | |
1158 unittest.test("method--delete", () { | |
1159 | 3262 |
1160 var mock = new HttpServerMock(); | 3263 var mock = new HttpServerMock(); |
1161 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; | 3264 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; |
1162 var arg_projectsId = "foo"; | 3265 var arg_projectsId = "foo"; |
1163 var arg_logsId = "foo"; | 3266 var arg_logsId = "foo"; |
| 3267 var arg_sinksId = "foo"; |
1164 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3268 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1165 var path = (req.url).path; | 3269 var path = (req.url).path; |
1166 var pathOffset = 0; | 3270 var pathOffset = 0; |
1167 var index; | 3271 var index; |
1168 var subPart; | 3272 var subPart; |
1169 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3273 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1170 pathOffset += 1; | 3274 pathOffset += 1; |
1171 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3275 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1172 pathOffset += 17; | 3276 pathOffset += 17; |
1173 index = path.indexOf("/logs/", pathOffset); | 3277 index = path.indexOf("/logs/", pathOffset); |
1174 unittest.expect(index >= 0, unittest.isTrue); | 3278 unittest.expect(index >= 0, unittest.isTrue); |
1175 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3279 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1176 pathOffset = index; | 3280 pathOffset = index; |
1177 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3281 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1178 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | 3282 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
1179 pathOffset += 6; | 3283 pathOffset += 6; |
| 3284 index = path.indexOf("/sinks/", pathOffset); |
| 3285 unittest.expect(index >= 0, unittest.isTrue); |
| 3286 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3287 pathOffset = index; |
| 3288 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
| 3289 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
| 3290 pathOffset += 7; |
1180 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3291 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1181 pathOffset = path.length; | 3292 pathOffset = path.length; |
1182 unittest.expect(subPart, unittest.equals("$arg_logsId")); | 3293 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1183 | 3294 |
1184 var query = (req.url).query; | 3295 var query = (req.url).query; |
1185 var queryOffset = 0; | 3296 var queryOffset = 0; |
1186 var queryMap = {}; | 3297 var queryMap = {}; |
1187 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3298 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1188 parseBool(n) { | 3299 parseBool(n) { |
1189 if (n == "true") return true; | 3300 if (n == "true") return true; |
1190 if (n == "false") return false; | 3301 if (n == "false") return false; |
1191 if (n == null) return null; | 3302 if (n == null) return null; |
1192 throw new core.ArgumentError("Invalid boolean: $n"); | 3303 throw new core.ArgumentError("Invalid boolean: $n"); |
1193 } | 3304 } |
1194 if (query.length > 0) { | 3305 if (query.length > 0) { |
1195 for (var part in query.split("&")) { | 3306 for (var part in query.split("&")) { |
1196 var keyvalue = part.split("="); | 3307 var keyvalue = part.split("="); |
1197 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3308 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1198 } | 3309 } |
1199 } | 3310 } |
1200 | 3311 |
1201 | 3312 |
1202 var h = { | 3313 var h = { |
1203 "content-type" : "application/json; charset=utf-8", | 3314 "content-type" : "application/json; charset=utf-8", |
1204 }; | 3315 }; |
1205 var resp = convert.JSON.encode(buildEmpty()); | 3316 var resp = convert.JSON.encode(buildLogSink()); |
1206 return new async.Future.value(stringResponse(200, h, resp)); | 3317 return new async.Future.value(stringResponse(200, h, resp)); |
1207 }), true); | 3318 }), true); |
1208 res.delete(arg_projectsId, arg_logsId).then(unittest.expectAsync(((api.Emp
ty response) { | 3319 res.get(arg_projectsId, arg_logsId, arg_sinksId).then(unittest.expectAsync
(((api.LogSink response) { |
1209 checkEmpty(response); | 3320 checkLogSink(response); |
1210 }))); | 3321 }))); |
1211 }); | 3322 }); |
1212 | 3323 |
1213 unittest.test("method--list", () { | 3324 unittest.test("method--list", () { |
1214 | 3325 |
1215 var mock = new HttpServerMock(); | 3326 var mock = new HttpServerMock(); |
1216 api.ProjectsLogsResourceApi res = new api.LoggingApi(mock).projects.logs; | 3327 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; |
1217 var arg_projectsId = "foo"; | 3328 var arg_projectsId = "foo"; |
1218 var arg_serviceName = "foo"; | 3329 var arg_logsId = "foo"; |
1219 var arg_serviceIndexPrefix = "foo"; | |
1220 var arg_pageSize = 42; | |
1221 var arg_pageToken = "foo"; | |
1222 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3330 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1223 var path = (req.url).path; | 3331 var path = (req.url).path; |
1224 var pathOffset = 0; | 3332 var pathOffset = 0; |
1225 var index; | 3333 var index; |
1226 var subPart; | 3334 var subPart; |
1227 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3335 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1228 pathOffset += 1; | 3336 pathOffset += 1; |
1229 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3337 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1230 pathOffset += 17; | 3338 pathOffset += 17; |
1231 index = path.indexOf("/logs", pathOffset); | 3339 index = path.indexOf("/logs/", pathOffset); |
1232 unittest.expect(index >= 0, unittest.isTrue); | 3340 unittest.expect(index >= 0, unittest.isTrue); |
1233 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3341 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1234 pathOffset = index; | 3342 pathOffset = index; |
1235 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3343 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1236 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/logs")); | 3344 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
1237 pathOffset += 5; | 3345 pathOffset += 6; |
| 3346 index = path.indexOf("/sinks", pathOffset); |
| 3347 unittest.expect(index >= 0, unittest.isTrue); |
| 3348 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3349 pathOffset = index; |
| 3350 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
| 3351 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
| 3352 pathOffset += 6; |
1238 | 3353 |
1239 var query = (req.url).query; | 3354 var query = (req.url).query; |
1240 var queryOffset = 0; | 3355 var queryOffset = 0; |
1241 var queryMap = {}; | 3356 var queryMap = {}; |
1242 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3357 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1243 parseBool(n) { | 3358 parseBool(n) { |
1244 if (n == "true") return true; | 3359 if (n == "true") return true; |
1245 if (n == "false") return false; | 3360 if (n == "false") return false; |
1246 if (n == null) return null; | 3361 if (n == null) return null; |
1247 throw new core.ArgumentError("Invalid boolean: $n"); | 3362 throw new core.ArgumentError("Invalid boolean: $n"); |
1248 } | 3363 } |
1249 if (query.length > 0) { | 3364 if (query.length > 0) { |
1250 for (var part in query.split("&")) { | 3365 for (var part in query.split("&")) { |
1251 var keyvalue = part.split("="); | 3366 var keyvalue = part.split("="); |
1252 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3367 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1253 } | 3368 } |
1254 } | 3369 } |
1255 unittest.expect(queryMap["serviceName"].first, unittest.equals(arg_servi
ceName)); | |
1256 unittest.expect(queryMap["serviceIndexPrefix"].first, unittest.equals(ar
g_serviceIndexPrefix)); | |
1257 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
1258 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
1259 | 3370 |
1260 | 3371 |
1261 var h = { | 3372 var h = { |
1262 "content-type" : "application/json; charset=utf-8", | 3373 "content-type" : "application/json; charset=utf-8", |
1263 }; | 3374 }; |
1264 var resp = convert.JSON.encode(buildListLogsResponse()); | 3375 var resp = convert.JSON.encode(buildListLogSinksResponse()); |
1265 return new async.Future.value(stringResponse(200, h, resp)); | 3376 return new async.Future.value(stringResponse(200, h, resp)); |
1266 }), true); | 3377 }), true); |
1267 res.list(arg_projectsId, serviceName: arg_serviceName, serviceIndexPrefix:
arg_serviceIndexPrefix, pageSize: arg_pageSize, pageToken: arg_pageToken).then(
unittest.expectAsync(((api.ListLogsResponse response) { | 3378 res.list(arg_projectsId, arg_logsId).then(unittest.expectAsync(((api.ListL
ogSinksResponse response) { |
1268 checkListLogsResponse(response); | 3379 checkListLogSinksResponse(response); |
1269 }))); | 3380 }))); |
1270 }); | 3381 }); |
1271 | 3382 |
1272 }); | 3383 unittest.test("method--update", () { |
1273 | |
1274 | |
1275 unittest.group("resource-ProjectsLogsEntriesResourceApi", () { | |
1276 unittest.test("method--write", () { | |
1277 | 3384 |
1278 var mock = new HttpServerMock(); | 3385 var mock = new HttpServerMock(); |
1279 api.ProjectsLogsEntriesResourceApi res = new api.LoggingApi(mock).projects
.logs.entries; | 3386 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; |
1280 var arg_request = buildWriteLogEntriesRequest(); | 3387 var arg_request = buildLogSink(); |
1281 var arg_projectsId = "foo"; | 3388 var arg_projectsId = "foo"; |
1282 var arg_logsId = "foo"; | 3389 var arg_logsId = "foo"; |
| 3390 var arg_sinksId = "foo"; |
1283 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3391 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1284 var obj = new api.WriteLogEntriesRequest.fromJson(json); | 3392 var obj = new api.LogSink.fromJson(json); |
1285 checkWriteLogEntriesRequest(obj); | 3393 checkLogSink(obj); |
1286 | 3394 |
1287 var path = (req.url).path; | 3395 var path = (req.url).path; |
1288 var pathOffset = 0; | 3396 var pathOffset = 0; |
1289 var index; | 3397 var index; |
1290 var subPart; | 3398 var subPart; |
1291 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3399 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1292 pathOffset += 1; | 3400 pathOffset += 1; |
1293 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3401 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1294 pathOffset += 17; | 3402 pathOffset += 17; |
1295 index = path.indexOf("/logs/", pathOffset); | 3403 index = path.indexOf("/logs/", pathOffset); |
1296 unittest.expect(index >= 0, unittest.isTrue); | 3404 unittest.expect(index >= 0, unittest.isTrue); |
1297 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3405 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1298 pathOffset = index; | 3406 pathOffset = index; |
1299 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3407 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1300 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | 3408 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); |
1301 pathOffset += 6; | 3409 pathOffset += 6; |
1302 index = path.indexOf("/entries:write", pathOffset); | 3410 index = path.indexOf("/sinks/", pathOffset); |
1303 unittest.expect(index >= 0, unittest.isTrue); | 3411 unittest.expect(index >= 0, unittest.isTrue); |
1304 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3412 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1305 pathOffset = index; | 3413 pathOffset = index; |
1306 unittest.expect(subPart, unittest.equals("$arg_logsId")); | 3414 unittest.expect(subPart, unittest.equals("$arg_logsId")); |
1307 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/entries:write")); | 3415 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
1308 pathOffset += 14; | 3416 pathOffset += 7; |
| 3417 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3418 pathOffset = path.length; |
| 3419 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1309 | 3420 |
1310 var query = (req.url).query; | 3421 var query = (req.url).query; |
1311 var queryOffset = 0; | 3422 var queryOffset = 0; |
1312 var queryMap = {}; | 3423 var queryMap = {}; |
1313 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3424 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1314 parseBool(n) { | 3425 parseBool(n) { |
1315 if (n == "true") return true; | 3426 if (n == "true") return true; |
1316 if (n == "false") return false; | 3427 if (n == "false") return false; |
1317 if (n == null) return null; | 3428 if (n == null) return null; |
1318 throw new core.ArgumentError("Invalid boolean: $n"); | 3429 throw new core.ArgumentError("Invalid boolean: $n"); |
1319 } | 3430 } |
1320 if (query.length > 0) { | 3431 if (query.length > 0) { |
1321 for (var part in query.split("&")) { | 3432 for (var part in query.split("&")) { |
1322 var keyvalue = part.split("="); | 3433 var keyvalue = part.split("="); |
1323 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3434 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1324 } | 3435 } |
1325 } | 3436 } |
1326 | 3437 |
1327 | 3438 |
1328 var h = { | 3439 var h = { |
1329 "content-type" : "application/json; charset=utf-8", | 3440 "content-type" : "application/json; charset=utf-8", |
1330 }; | 3441 }; |
1331 var resp = convert.JSON.encode(buildWriteLogEntriesResponse()); | 3442 var resp = convert.JSON.encode(buildLogSink()); |
1332 return new async.Future.value(stringResponse(200, h, resp)); | 3443 return new async.Future.value(stringResponse(200, h, resp)); |
1333 }), true); | 3444 }), true); |
1334 res.write(arg_request, arg_projectsId, arg_logsId).then(unittest.expectAsy
nc(((api.WriteLogEntriesResponse response) { | 3445 res.update(arg_request, arg_projectsId, arg_logsId, arg_sinksId).then(unit
test.expectAsync(((api.LogSink response) { |
1335 checkWriteLogEntriesResponse(response); | 3446 checkLogSink(response); |
1336 }))); | 3447 }))); |
1337 }); | 3448 }); |
1338 | 3449 |
1339 }); | 3450 }); |
1340 | 3451 |
1341 | 3452 |
1342 unittest.group("resource-ProjectsLogsSinksResourceApi", () { | 3453 unittest.group("resource-ProjectsSinksResourceApi", () { |
1343 unittest.test("method--create", () { | 3454 unittest.test("method--create", () { |
1344 | 3455 |
1345 var mock = new HttpServerMock(); | 3456 var mock = new HttpServerMock(); |
1346 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; | 3457 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
1347 var arg_request = buildLogSink(); | 3458 var arg_request = buildLogSink(); |
1348 var arg_projectsId = "foo"; | 3459 var arg_projectsId = "foo"; |
1349 var arg_logsId = "foo"; | |
1350 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3460 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1351 var obj = new api.LogSink.fromJson(json); | 3461 var obj = new api.LogSink.fromJson(json); |
1352 checkLogSink(obj); | 3462 checkLogSink(obj); |
1353 | 3463 |
1354 var path = (req.url).path; | 3464 var path = (req.url).path; |
1355 var pathOffset = 0; | 3465 var pathOffset = 0; |
1356 var index; | 3466 var index; |
1357 var subPart; | 3467 var subPart; |
1358 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3468 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1359 pathOffset += 1; | 3469 pathOffset += 1; |
1360 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3470 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1361 pathOffset += 17; | 3471 pathOffset += 17; |
1362 index = path.indexOf("/logs/", pathOffset); | 3472 index = path.indexOf("/sinks", pathOffset); |
1363 unittest.expect(index >= 0, unittest.isTrue); | 3473 unittest.expect(index >= 0, unittest.isTrue); |
1364 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3474 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1365 pathOffset = index; | 3475 pathOffset = index; |
1366 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3476 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1367 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | |
1368 pathOffset += 6; | |
1369 index = path.indexOf("/sinks", pathOffset); | |
1370 unittest.expect(index >= 0, unittest.isTrue); | |
1371 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1372 pathOffset = index; | |
1373 unittest.expect(subPart, unittest.equals("$arg_logsId")); | |
1374 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); | 3477 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
1375 pathOffset += 6; | 3478 pathOffset += 6; |
1376 | 3479 |
1377 var query = (req.url).query; | 3480 var query = (req.url).query; |
1378 var queryOffset = 0; | 3481 var queryOffset = 0; |
1379 var queryMap = {}; | 3482 var queryMap = {}; |
1380 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3483 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1381 parseBool(n) { | 3484 parseBool(n) { |
1382 if (n == "true") return true; | 3485 if (n == "true") return true; |
1383 if (n == "false") return false; | 3486 if (n == "false") return false; |
1384 if (n == null) return null; | 3487 if (n == null) return null; |
1385 throw new core.ArgumentError("Invalid boolean: $n"); | 3488 throw new core.ArgumentError("Invalid boolean: $n"); |
1386 } | 3489 } |
1387 if (query.length > 0) { | 3490 if (query.length > 0) { |
1388 for (var part in query.split("&")) { | 3491 for (var part in query.split("&")) { |
1389 var keyvalue = part.split("="); | 3492 var keyvalue = part.split("="); |
1390 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3493 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1391 } | 3494 } |
1392 } | 3495 } |
1393 | 3496 |
1394 | 3497 |
1395 var h = { | 3498 var h = { |
1396 "content-type" : "application/json; charset=utf-8", | 3499 "content-type" : "application/json; charset=utf-8", |
1397 }; | 3500 }; |
1398 var resp = convert.JSON.encode(buildLogSink()); | 3501 var resp = convert.JSON.encode(buildLogSink()); |
1399 return new async.Future.value(stringResponse(200, h, resp)); | 3502 return new async.Future.value(stringResponse(200, h, resp)); |
1400 }), true); | 3503 }), true); |
1401 res.create(arg_request, arg_projectsId, arg_logsId).then(unittest.expectAs
ync(((api.LogSink response) { | 3504 res.create(arg_request, arg_projectsId).then(unittest.expectAsync(((api.Lo
gSink response) { |
1402 checkLogSink(response); | 3505 checkLogSink(response); |
1403 }))); | 3506 }))); |
1404 }); | 3507 }); |
1405 | 3508 |
1406 unittest.test("method--delete", () { | 3509 unittest.test("method--delete", () { |
1407 | 3510 |
1408 var mock = new HttpServerMock(); | 3511 var mock = new HttpServerMock(); |
1409 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; | 3512 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
1410 var arg_projectsId = "foo"; | 3513 var arg_projectsId = "foo"; |
1411 var arg_logsId = "foo"; | |
1412 var arg_sinksId = "foo"; | 3514 var arg_sinksId = "foo"; |
1413 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3515 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1414 var path = (req.url).path; | 3516 var path = (req.url).path; |
1415 var pathOffset = 0; | 3517 var pathOffset = 0; |
1416 var index; | 3518 var index; |
1417 var subPart; | 3519 var subPart; |
1418 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3520 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1419 pathOffset += 1; | 3521 pathOffset += 1; |
1420 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3522 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1421 pathOffset += 17; | 3523 pathOffset += 17; |
1422 index = path.indexOf("/logs/", pathOffset); | 3524 index = path.indexOf("/sinks/", pathOffset); |
1423 unittest.expect(index >= 0, unittest.isTrue); | 3525 unittest.expect(index >= 0, unittest.isTrue); |
1424 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3526 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1425 pathOffset = index; | 3527 pathOffset = index; |
1426 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3528 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1427 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | |
1428 pathOffset += 6; | |
1429 index = path.indexOf("/sinks/", pathOffset); | |
1430 unittest.expect(index >= 0, unittest.isTrue); | |
1431 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1432 pathOffset = index; | |
1433 unittest.expect(subPart, unittest.equals("$arg_logsId")); | |
1434 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3529 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
1435 pathOffset += 7; | 3530 pathOffset += 7; |
1436 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3531 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1437 pathOffset = path.length; | 3532 pathOffset = path.length; |
1438 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | 3533 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1439 | 3534 |
1440 var query = (req.url).query; | 3535 var query = (req.url).query; |
1441 var queryOffset = 0; | 3536 var queryOffset = 0; |
1442 var queryMap = {}; | 3537 var queryMap = {}; |
1443 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3538 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 10 matching lines...) Expand all Loading... |
1454 } | 3549 } |
1455 } | 3550 } |
1456 | 3551 |
1457 | 3552 |
1458 var h = { | 3553 var h = { |
1459 "content-type" : "application/json; charset=utf-8", | 3554 "content-type" : "application/json; charset=utf-8", |
1460 }; | 3555 }; |
1461 var resp = convert.JSON.encode(buildEmpty()); | 3556 var resp = convert.JSON.encode(buildEmpty()); |
1462 return new async.Future.value(stringResponse(200, h, resp)); | 3557 return new async.Future.value(stringResponse(200, h, resp)); |
1463 }), true); | 3558 }), true); |
1464 res.delete(arg_projectsId, arg_logsId, arg_sinksId).then(unittest.expectAs
ync(((api.Empty response) { | 3559 res.delete(arg_projectsId, arg_sinksId).then(unittest.expectAsync(((api.Em
pty response) { |
1465 checkEmpty(response); | 3560 checkEmpty(response); |
1466 }))); | 3561 }))); |
1467 }); | 3562 }); |
1468 | 3563 |
1469 unittest.test("method--get", () { | 3564 unittest.test("method--get", () { |
1470 | 3565 |
1471 var mock = new HttpServerMock(); | 3566 var mock = new HttpServerMock(); |
1472 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; | 3567 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
1473 var arg_projectsId = "foo"; | 3568 var arg_projectsId = "foo"; |
1474 var arg_logsId = "foo"; | |
1475 var arg_sinksId = "foo"; | 3569 var arg_sinksId = "foo"; |
1476 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3570 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1477 var path = (req.url).path; | 3571 var path = (req.url).path; |
1478 var pathOffset = 0; | 3572 var pathOffset = 0; |
1479 var index; | 3573 var index; |
1480 var subPart; | 3574 var subPart; |
1481 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3575 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1482 pathOffset += 1; | 3576 pathOffset += 1; |
1483 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3577 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1484 pathOffset += 17; | 3578 pathOffset += 17; |
1485 index = path.indexOf("/logs/", pathOffset); | 3579 index = path.indexOf("/sinks/", pathOffset); |
1486 unittest.expect(index >= 0, unittest.isTrue); | 3580 unittest.expect(index >= 0, unittest.isTrue); |
1487 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3581 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1488 pathOffset = index; | 3582 pathOffset = index; |
1489 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3583 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1490 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | |
1491 pathOffset += 6; | |
1492 index = path.indexOf("/sinks/", pathOffset); | |
1493 unittest.expect(index >= 0, unittest.isTrue); | |
1494 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1495 pathOffset = index; | |
1496 unittest.expect(subPart, unittest.equals("$arg_logsId")); | |
1497 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3584 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
1498 pathOffset += 7; | 3585 pathOffset += 7; |
1499 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3586 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1500 pathOffset = path.length; | 3587 pathOffset = path.length; |
1501 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | 3588 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1502 | 3589 |
1503 var query = (req.url).query; | 3590 var query = (req.url).query; |
1504 var queryOffset = 0; | 3591 var queryOffset = 0; |
1505 var queryMap = {}; | 3592 var queryMap = {}; |
1506 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3593 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 10 matching lines...) Expand all Loading... |
1517 } | 3604 } |
1518 } | 3605 } |
1519 | 3606 |
1520 | 3607 |
1521 var h = { | 3608 var h = { |
1522 "content-type" : "application/json; charset=utf-8", | 3609 "content-type" : "application/json; charset=utf-8", |
1523 }; | 3610 }; |
1524 var resp = convert.JSON.encode(buildLogSink()); | 3611 var resp = convert.JSON.encode(buildLogSink()); |
1525 return new async.Future.value(stringResponse(200, h, resp)); | 3612 return new async.Future.value(stringResponse(200, h, resp)); |
1526 }), true); | 3613 }), true); |
1527 res.get(arg_projectsId, arg_logsId, arg_sinksId).then(unittest.expectAsync
(((api.LogSink response) { | 3614 res.get(arg_projectsId, arg_sinksId).then(unittest.expectAsync(((api.LogSi
nk response) { |
1528 checkLogSink(response); | 3615 checkLogSink(response); |
1529 }))); | 3616 }))); |
1530 }); | 3617 }); |
1531 | 3618 |
1532 unittest.test("method--list", () { | 3619 unittest.test("method--list", () { |
1533 | 3620 |
1534 var mock = new HttpServerMock(); | 3621 var mock = new HttpServerMock(); |
1535 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; | 3622 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
1536 var arg_projectsId = "foo"; | 3623 var arg_projectsId = "foo"; |
1537 var arg_logsId = "foo"; | |
1538 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3624 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1539 var path = (req.url).path; | 3625 var path = (req.url).path; |
1540 var pathOffset = 0; | 3626 var pathOffset = 0; |
1541 var index; | 3627 var index; |
1542 var subPart; | 3628 var subPart; |
1543 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3629 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1544 pathOffset += 1; | 3630 pathOffset += 1; |
1545 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3631 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1546 pathOffset += 17; | 3632 pathOffset += 17; |
1547 index = path.indexOf("/logs/", pathOffset); | 3633 index = path.indexOf("/sinks", pathOffset); |
1548 unittest.expect(index >= 0, unittest.isTrue); | 3634 unittest.expect(index >= 0, unittest.isTrue); |
1549 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3635 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1550 pathOffset = index; | 3636 pathOffset = index; |
1551 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3637 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1552 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | |
1553 pathOffset += 6; | |
1554 index = path.indexOf("/sinks", pathOffset); | |
1555 unittest.expect(index >= 0, unittest.isTrue); | |
1556 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1557 pathOffset = index; | |
1558 unittest.expect(subPart, unittest.equals("$arg_logsId")); | |
1559 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); | 3638 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/sinks")); |
1560 pathOffset += 6; | 3639 pathOffset += 6; |
1561 | 3640 |
1562 var query = (req.url).query; | 3641 var query = (req.url).query; |
1563 var queryOffset = 0; | 3642 var queryOffset = 0; |
1564 var queryMap = {}; | 3643 var queryMap = {}; |
1565 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3644 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
1566 parseBool(n) { | 3645 parseBool(n) { |
1567 if (n == "true") return true; | 3646 if (n == "true") return true; |
1568 if (n == "false") return false; | 3647 if (n == "false") return false; |
1569 if (n == null) return null; | 3648 if (n == null) return null; |
1570 throw new core.ArgumentError("Invalid boolean: $n"); | 3649 throw new core.ArgumentError("Invalid boolean: $n"); |
1571 } | 3650 } |
1572 if (query.length > 0) { | 3651 if (query.length > 0) { |
1573 for (var part in query.split("&")) { | 3652 for (var part in query.split("&")) { |
1574 var keyvalue = part.split("="); | 3653 var keyvalue = part.split("="); |
1575 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 3654 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
1576 } | 3655 } |
1577 } | 3656 } |
1578 | 3657 |
1579 | 3658 |
1580 var h = { | 3659 var h = { |
1581 "content-type" : "application/json; charset=utf-8", | 3660 "content-type" : "application/json; charset=utf-8", |
1582 }; | 3661 }; |
1583 var resp = convert.JSON.encode(buildListLogSinksResponse()); | 3662 var resp = convert.JSON.encode(buildListSinksResponse()); |
1584 return new async.Future.value(stringResponse(200, h, resp)); | 3663 return new async.Future.value(stringResponse(200, h, resp)); |
1585 }), true); | 3664 }), true); |
1586 res.list(arg_projectsId, arg_logsId).then(unittest.expectAsync(((api.ListL
ogSinksResponse response) { | 3665 res.list(arg_projectsId).then(unittest.expectAsync(((api.ListSinksResponse
response) { |
1587 checkListLogSinksResponse(response); | 3666 checkListSinksResponse(response); |
1588 }))); | 3667 }))); |
1589 }); | 3668 }); |
1590 | 3669 |
1591 unittest.test("method--update", () { | 3670 unittest.test("method--update", () { |
1592 | 3671 |
1593 var mock = new HttpServerMock(); | 3672 var mock = new HttpServerMock(); |
1594 api.ProjectsLogsSinksResourceApi res = new api.LoggingApi(mock).projects.l
ogs.sinks; | 3673 api.ProjectsSinksResourceApi res = new api.LoggingApi(mock).projects.sinks
; |
1595 var arg_request = buildLogSink(); | 3674 var arg_request = buildLogSink(); |
1596 var arg_projectsId = "foo"; | 3675 var arg_projectsId = "foo"; |
1597 var arg_logsId = "foo"; | |
1598 var arg_sinksId = "foo"; | 3676 var arg_sinksId = "foo"; |
1599 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 3677 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
1600 var obj = new api.LogSink.fromJson(json); | 3678 var obj = new api.LogSink.fromJson(json); |
1601 checkLogSink(obj); | 3679 checkLogSink(obj); |
1602 | 3680 |
1603 var path = (req.url).path; | 3681 var path = (req.url).path; |
1604 var pathOffset = 0; | 3682 var pathOffset = 0; |
1605 var index; | 3683 var index; |
1606 var subPart; | 3684 var subPart; |
1607 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 3685 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
1608 pathOffset += 1; | 3686 pathOffset += 1; |
1609 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); | 3687 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v1beta3/projects/")); |
1610 pathOffset += 17; | 3688 pathOffset += 17; |
1611 index = path.indexOf("/logs/", pathOffset); | 3689 index = path.indexOf("/sinks/", pathOffset); |
1612 unittest.expect(index >= 0, unittest.isTrue); | 3690 unittest.expect(index >= 0, unittest.isTrue); |
1613 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 3691 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
1614 pathOffset = index; | 3692 pathOffset = index; |
1615 unittest.expect(subPart, unittest.equals("$arg_projectsId")); | 3693 unittest.expect(subPart, unittest.equals("$arg_projectsId")); |
1616 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/logs/")); | |
1617 pathOffset += 6; | |
1618 index = path.indexOf("/sinks/", pathOffset); | |
1619 unittest.expect(index >= 0, unittest.isTrue); | |
1620 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
1621 pathOffset = index; | |
1622 unittest.expect(subPart, unittest.equals("$arg_logsId")); | |
1623 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); | 3694 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/sinks/")); |
1624 pathOffset += 7; | 3695 pathOffset += 7; |
1625 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 3696 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
1626 pathOffset = path.length; | 3697 pathOffset = path.length; |
1627 unittest.expect(subPart, unittest.equals("$arg_sinksId")); | 3698 unittest.expect(subPart, unittest.equals("$arg_sinksId")); |
1628 | 3699 |
1629 var query = (req.url).query; | 3700 var query = (req.url).query; |
1630 var queryOffset = 0; | 3701 var queryOffset = 0; |
1631 var queryMap = {}; | 3702 var queryMap = {}; |
1632 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 3703 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
(...skipping 10 matching lines...) Expand all Loading... |
1643 } | 3714 } |
1644 } | 3715 } |
1645 | 3716 |
1646 | 3717 |
1647 var h = { | 3718 var h = { |
1648 "content-type" : "application/json; charset=utf-8", | 3719 "content-type" : "application/json; charset=utf-8", |
1649 }; | 3720 }; |
1650 var resp = convert.JSON.encode(buildLogSink()); | 3721 var resp = convert.JSON.encode(buildLogSink()); |
1651 return new async.Future.value(stringResponse(200, h, resp)); | 3722 return new async.Future.value(stringResponse(200, h, resp)); |
1652 }), true); | 3723 }), true); |
1653 res.update(arg_request, arg_projectsId, arg_logsId, arg_sinksId).then(unit
test.expectAsync(((api.LogSink response) { | 3724 res.update(arg_request, arg_projectsId, arg_sinksId).then(unittest.expectA
sync(((api.LogSink response) { |
1654 checkLogSink(response); | 3725 checkLogSink(response); |
1655 }))); | 3726 }))); |
1656 }); | 3727 }); |
1657 | 3728 |
1658 }); | 3729 }); |
1659 | 3730 |
1660 | 3731 |
1661 } | 3732 } |
1662 | 3733 |
OLD | NEW |