@azure/arm-reservations 7.2.1-alpha.20230202.1 → 8.0.0-alpha.20230210.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +71 -8
  2. package/LICENSE +1 -1
  3. package/dist/index.js +942 -224
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/calculateExchangePostSample.js +22 -2
  8. package/dist-esm/samples-dev/calculateExchangePostSample.js.map +1 -1
  9. package/dist-esm/samples-dev/calculateRefundPostSample.js +10 -3
  10. package/dist-esm/samples-dev/calculateRefundPostSample.js.map +1 -1
  11. package/dist-esm/samples-dev/exchangePostSample.js +9 -2
  12. package/dist-esm/samples-dev/exchangePostSample.js.map +1 -1
  13. package/dist-esm/samples-dev/getAppliedReservationListSample.js +9 -2
  14. package/dist-esm/samples-dev/getAppliedReservationListSample.js.map +1 -1
  15. package/dist-esm/samples-dev/getCatalogSample.js +26 -5
  16. package/dist-esm/samples-dev/getCatalogSample.js.map +1 -1
  17. package/dist-esm/samples-dev/operationListSample.js +9 -2
  18. package/dist-esm/samples-dev/operationListSample.js.map +1 -1
  19. package/dist-esm/samples-dev/quotaCreateOrUpdateSample.js +10 -3
  20. package/dist-esm/samples-dev/quotaCreateOrUpdateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/quotaGetSample.js +8 -1
  22. package/dist-esm/samples-dev/quotaGetSample.js.map +1 -1
  23. package/dist-esm/samples-dev/quotaListSample.js +9 -2
  24. package/dist-esm/samples-dev/quotaListSample.js.map +1 -1
  25. package/dist-esm/samples-dev/quotaRequestStatusGetSample.js +10 -3
  26. package/dist-esm/samples-dev/quotaRequestStatusGetSample.js.map +1 -1
  27. package/dist-esm/samples-dev/quotaRequestStatusListSample.js +8 -1
  28. package/dist-esm/samples-dev/quotaRequestStatusListSample.js.map +1 -1
  29. package/dist-esm/samples-dev/quotaUpdateSample.js +8 -1
  30. package/dist-esm/samples-dev/quotaUpdateSample.js.map +1 -1
  31. package/dist-esm/samples-dev/reservationArchiveSample.js +9 -2
  32. package/dist-esm/samples-dev/reservationArchiveSample.js.map +1 -1
  33. package/dist-esm/samples-dev/reservationAvailableScopesSample.js +11 -4
  34. package/dist-esm/samples-dev/reservationAvailableScopesSample.js.map +1 -1
  35. package/dist-esm/samples-dev/reservationGetSample.js +11 -4
  36. package/dist-esm/samples-dev/reservationGetSample.js.map +1 -1
  37. package/dist-esm/samples-dev/reservationListAllSample.js +10 -3
  38. package/dist-esm/samples-dev/reservationListAllSample.js.map +1 -1
  39. package/dist-esm/samples-dev/reservationListRevisionsSample.js +11 -4
  40. package/dist-esm/samples-dev/reservationListRevisionsSample.js.map +1 -1
  41. package/dist-esm/samples-dev/reservationListSample.js +9 -2
  42. package/dist-esm/samples-dev/reservationListSample.js.map +1 -1
  43. package/dist-esm/samples-dev/reservationMergeSample.js +9 -2
  44. package/dist-esm/samples-dev/reservationMergeSample.js.map +1 -1
  45. package/dist-esm/samples-dev/reservationOrderCalculateSample.js +10 -3
  46. package/dist-esm/samples-dev/reservationOrderCalculateSample.js.map +1 -1
  47. package/dist-esm/samples-dev/reservationOrderChangeDirectorySample.js +9 -2
  48. package/dist-esm/samples-dev/reservationOrderChangeDirectorySample.js.map +1 -1
  49. package/dist-esm/samples-dev/reservationOrderGetSample.js +12 -5
  50. package/dist-esm/samples-dev/reservationOrderGetSample.js.map +1 -1
  51. package/dist-esm/samples-dev/reservationOrderListSample.js +9 -2
  52. package/dist-esm/samples-dev/reservationOrderListSample.js.map +1 -1
  53. package/dist-esm/samples-dev/reservationOrderPurchaseSample.js +9 -2
  54. package/dist-esm/samples-dev/reservationOrderPurchaseSample.js.map +1 -1
  55. package/dist-esm/samples-dev/reservationSplitSample.js +9 -2
  56. package/dist-esm/samples-dev/reservationSplitSample.js.map +1 -1
  57. package/dist-esm/samples-dev/reservationUnarchiveSample.js +11 -4
  58. package/dist-esm/samples-dev/reservationUnarchiveSample.js.map +1 -1
  59. package/dist-esm/samples-dev/reservationUpdateSample.js +9 -2
  60. package/dist-esm/samples-dev/reservationUpdateSample.js.map +1 -1
  61. package/dist-esm/samples-dev/returnPostSample.js +14 -7
  62. package/dist-esm/samples-dev/returnPostSample.js.map +1 -1
  63. package/dist-esm/src/azureReservationAPI.d.ts +18 -2
  64. package/dist-esm/src/azureReservationAPI.d.ts.map +1 -1
  65. package/dist-esm/src/azureReservationAPI.js +101 -15
  66. package/dist-esm/src/azureReservationAPI.js.map +1 -1
  67. package/dist-esm/src/index.d.ts +1 -0
  68. package/dist-esm/src/index.d.ts.map +1 -1
  69. package/dist-esm/src/index.js +1 -0
  70. package/dist-esm/src/index.js.map +1 -1
  71. package/dist-esm/src/models/index.d.ts +372 -101
  72. package/dist-esm/src/models/index.d.ts.map +1 -1
  73. package/dist-esm/src/models/index.js +26 -0
  74. package/dist-esm/src/models/index.js.map +1 -1
  75. package/dist-esm/src/models/mappers.d.ts +14 -1
  76. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  77. package/dist-esm/src/models/mappers.js +510 -70
  78. package/dist-esm/src/models/mappers.js.map +1 -1
  79. package/dist-esm/src/models/parameters.d.ts +2 -1
  80. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  81. package/dist-esm/src/models/parameters.js +18 -9
  82. package/dist-esm/src/models/parameters.js.map +1 -1
  83. package/dist-esm/src/operations/operation.d.ts.map +1 -1
  84. package/dist-esm/src/operations/operation.js +19 -8
  85. package/dist-esm/src/operations/operation.js.map +1 -1
  86. package/dist-esm/src/operations/quota.d.ts.map +1 -1
  87. package/dist-esm/src/operations/quota.js +19 -8
  88. package/dist-esm/src/operations/quota.js.map +1 -1
  89. package/dist-esm/src/operations/quotaRequestStatus.d.ts.map +1 -1
  90. package/dist-esm/src/operations/quotaRequestStatus.js +19 -13
  91. package/dist-esm/src/operations/quotaRequestStatus.js.map +1 -1
  92. package/dist-esm/src/operations/reservation.d.ts +17 -17
  93. package/dist-esm/src/operations/reservation.d.ts.map +1 -1
  94. package/dist-esm/src/operations/reservation.js +83 -59
  95. package/dist-esm/src/operations/reservation.js.map +1 -1
  96. package/dist-esm/src/operations/reservationOrder.d.ts.map +1 -1
  97. package/dist-esm/src/operations/reservationOrder.js +20 -9
  98. package/dist-esm/src/operations/reservationOrder.js.map +1 -1
  99. package/dist-esm/src/operations/return.d.ts +10 -2
  100. package/dist-esm/src/operations/return.d.ts.map +1 -1
  101. package/dist-esm/src/operations/return.js +61 -3
  102. package/dist-esm/src/operations/return.js.map +1 -1
  103. package/dist-esm/src/operationsInterfaces/reservation.d.ts +15 -15
  104. package/dist-esm/src/operationsInterfaces/reservation.d.ts.map +1 -1
  105. package/dist-esm/src/operationsInterfaces/return.d.ts +10 -2
  106. package/dist-esm/src/operationsInterfaces/return.d.ts.map +1 -1
  107. package/dist-esm/src/pagingHelper.d.ts +13 -0
  108. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  109. package/dist-esm/src/pagingHelper.js +32 -0
  110. package/dist-esm/src/pagingHelper.js.map +1 -0
  111. package/package.json +6 -4
  112. package/review/arm-reservations.api.md +194 -94
  113. package/src/azureReservationAPI.ts +119 -15
  114. package/src/index.ts +1 -0
  115. package/src/models/index.ts +397 -107
  116. package/src/models/mappers.ts +536 -71
  117. package/src/models/parameters.ts +19 -9
  118. package/src/operations/operation.ts +21 -9
  119. package/src/operations/quota.ts +23 -15
  120. package/src/operations/quotaRequestStatus.ts +23 -20
  121. package/src/operations/reservation.ts +97 -69
  122. package/src/operations/reservationOrder.ts +23 -11
  123. package/src/operations/return.ts +82 -4
  124. package/src/operationsInterfaces/reservation.ts +15 -15
  125. package/src/operationsInterfaces/return.ts +16 -2
  126. package/src/pagingHelper.ts +39 -0
  127. package/types/arm-reservations.d.ts +432 -109
  128. package/types/tsdoc-metadata.json +1 -1
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
28
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
29
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
30
 
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
31
63
  /*
32
64
  * Copyright (c) Microsoft Corporation.
33
65
  * Licensed under the MIT License.
@@ -236,6 +268,8 @@ exports.KnownAppliedScopeType = void 0;
236
268
  KnownAppliedScopeType["Single"] = "Single";
237
269
  /** Shared */
238
270
  KnownAppliedScopeType["Shared"] = "Shared";
271
+ /** ManagementGroup */
272
+ KnownAppliedScopeType["ManagementGroup"] = "ManagementGroup";
239
273
  })(exports.KnownAppliedScopeType || (exports.KnownAppliedScopeType = {}));
240
274
  /** Known values of {@link InstanceFlexibility} that the service accepts. */
241
275
  exports.KnownInstanceFlexibility = void 0;
@@ -323,6 +357,26 @@ exports.KnownCreatedByType = void 0;
323
357
  /** Key */
324
358
  KnownCreatedByType["Key"] = "Key";
325
359
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
360
+ /** Known values of {@link SavingsPlanTerm} that the service accepts. */
361
+ exports.KnownSavingsPlanTerm = void 0;
362
+ (function (KnownSavingsPlanTerm) {
363
+ /** P1Y */
364
+ KnownSavingsPlanTerm["P1Y"] = "P1Y";
365
+ /** P3Y */
366
+ KnownSavingsPlanTerm["P3Y"] = "P3Y";
367
+ })(exports.KnownSavingsPlanTerm || (exports.KnownSavingsPlanTerm = {}));
368
+ /** Known values of {@link BillingPlan} that the service accepts. */
369
+ exports.KnownBillingPlan = void 0;
370
+ (function (KnownBillingPlan) {
371
+ /** P1M */
372
+ KnownBillingPlan["P1M"] = "P1M";
373
+ })(exports.KnownBillingPlan || (exports.KnownBillingPlan = {}));
374
+ /** Known values of {@link CommitmentGrain} that the service accepts. */
375
+ exports.KnownCommitmentGrain = void 0;
376
+ (function (KnownCommitmentGrain) {
377
+ /** Hourly */
378
+ KnownCommitmentGrain["Hourly"] = "Hourly";
379
+ })(exports.KnownCommitmentGrain || (exports.KnownCommitmentGrain = {}));
326
380
  /** Known values of {@link CalculateExchangeOperationResultStatus} that the service accepts. */
327
381
  exports.KnownCalculateExchangeOperationResultStatus = void 0;
328
382
  (function (KnownCalculateExchangeOperationResultStatus) {
@@ -458,6 +512,10 @@ exports.KnownDisplayProvisioningState = void 0;
458
512
  KnownDisplayProvisioningState["Cancelled"] = "Cancelled";
459
513
  /** Failed */
460
514
  KnownDisplayProvisioningState["Failed"] = "Failed";
515
+ /** Warning */
516
+ KnownDisplayProvisioningState["Warning"] = "Warning";
517
+ /** NoBenefit */
518
+ KnownDisplayProvisioningState["NoBenefit"] = "NoBenefit";
461
519
  })(exports.KnownDisplayProvisioningState || (exports.KnownDisplayProvisioningState = {}));
462
520
  /** Known values of {@link UserFriendlyAppliedScopeType} that the service accepts. */
463
521
  exports.KnownUserFriendlyAppliedScopeType = void 0;
@@ -619,6 +677,40 @@ const ExtendedErrorInfo = {
619
677
  }
620
678
  }
621
679
  };
680
+ const CatalogsResult = {
681
+ type: {
682
+ name: "Composite",
683
+ className: "CatalogsResult",
684
+ modelProperties: {
685
+ value: {
686
+ serializedName: "value",
687
+ readOnly: true,
688
+ type: {
689
+ name: "Sequence",
690
+ element: {
691
+ type: {
692
+ name: "Composite",
693
+ className: "Catalog"
694
+ }
695
+ }
696
+ }
697
+ },
698
+ nextLink: {
699
+ serializedName: "nextLink",
700
+ readOnly: true,
701
+ type: {
702
+ name: "String"
703
+ }
704
+ },
705
+ totalItems: {
706
+ serializedName: "totalItems",
707
+ type: {
708
+ name: "Number"
709
+ }
710
+ }
711
+ }
712
+ }
713
+ };
622
714
  const Catalog = {
623
715
  type: {
624
716
  name: "Composite",
@@ -972,6 +1064,13 @@ const PurchaseRequest = {
972
1064
  }
973
1065
  }
974
1066
  },
1067
+ appliedScopeProperties: {
1068
+ serializedName: "properties.appliedScopeProperties",
1069
+ type: {
1070
+ name: "Composite",
1071
+ className: "AppliedScopeProperties"
1072
+ }
1073
+ },
975
1074
  renew: {
976
1075
  defaultValue: false,
977
1076
  serializedName: "properties.renew",
@@ -985,6 +1084,12 @@ const PurchaseRequest = {
985
1084
  name: "Composite",
986
1085
  className: "PurchaseRequestPropertiesReservedResourceProperties"
987
1086
  }
1087
+ },
1088
+ reviewDateTime: {
1089
+ serializedName: "properties.reviewDateTime",
1090
+ type: {
1091
+ name: "DateTime"
1092
+ }
988
1093
  }
989
1094
  }
990
1095
  }
@@ -1003,6 +1108,44 @@ const SkuName = {
1003
1108
  }
1004
1109
  }
1005
1110
  };
1111
+ const AppliedScopeProperties = {
1112
+ type: {
1113
+ name: "Composite",
1114
+ className: "AppliedScopeProperties",
1115
+ modelProperties: {
1116
+ tenantId: {
1117
+ serializedName: "tenantId",
1118
+ type: {
1119
+ name: "String"
1120
+ }
1121
+ },
1122
+ managementGroupId: {
1123
+ serializedName: "managementGroupId",
1124
+ type: {
1125
+ name: "String"
1126
+ }
1127
+ },
1128
+ subscriptionId: {
1129
+ serializedName: "subscriptionId",
1130
+ type: {
1131
+ name: "String"
1132
+ }
1133
+ },
1134
+ resourceGroupId: {
1135
+ serializedName: "resourceGroupId",
1136
+ type: {
1137
+ name: "String"
1138
+ }
1139
+ },
1140
+ displayName: {
1141
+ serializedName: "displayName",
1142
+ type: {
1143
+ name: "String"
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ };
1006
1149
  const PurchaseRequestPropertiesReservedResourceProperties = {
1007
1150
  type: {
1008
1151
  name: "Composite",
@@ -1316,6 +1459,12 @@ const ReservationOrderResponse = {
1316
1459
  name: "Date"
1317
1460
  }
1318
1461
  },
1462
+ expiryDateTime: {
1463
+ serializedName: "properties.expiryDateTime",
1464
+ type: {
1465
+ name: "DateTime"
1466
+ }
1467
+ },
1319
1468
  benefitStartTime: {
1320
1469
  serializedName: "properties.benefitStartTime",
1321
1470
  type: {
@@ -1364,6 +1513,12 @@ const ReservationOrderResponse = {
1364
1513
  }
1365
1514
  }
1366
1515
  }
1516
+ },
1517
+ reviewDateTime: {
1518
+ serializedName: "properties.reviewDateTime",
1519
+ type: {
1520
+ name: "DateTime"
1521
+ }
1367
1522
  }
1368
1523
  }
1369
1524
  }
@@ -1407,76 +1562,6 @@ const ReservationOrderBillingPlanInformation = {
1407
1562
  }
1408
1563
  }
1409
1564
  };
1410
- const ReservationResponse = {
1411
- type: {
1412
- name: "Composite",
1413
- className: "ReservationResponse",
1414
- modelProperties: {
1415
- location: {
1416
- serializedName: "location",
1417
- type: {
1418
- name: "String"
1419
- }
1420
- },
1421
- etag: {
1422
- serializedName: "etag",
1423
- type: {
1424
- name: "Number"
1425
- }
1426
- },
1427
- id: {
1428
- serializedName: "id",
1429
- readOnly: true,
1430
- type: {
1431
- name: "String"
1432
- }
1433
- },
1434
- name: {
1435
- serializedName: "name",
1436
- readOnly: true,
1437
- type: {
1438
- name: "String"
1439
- }
1440
- },
1441
- sku: {
1442
- serializedName: "sku",
1443
- type: {
1444
- name: "Composite",
1445
- className: "SkuName"
1446
- }
1447
- },
1448
- properties: {
1449
- serializedName: "properties",
1450
- type: {
1451
- name: "Composite",
1452
- className: "ReservationsProperties"
1453
- }
1454
- },
1455
- type: {
1456
- serializedName: "type",
1457
- readOnly: true,
1458
- type: {
1459
- name: "String"
1460
- }
1461
- },
1462
- kind: {
1463
- defaultValue: "Microsoft.Compute",
1464
- isConstant: true,
1465
- serializedName: "kind",
1466
- type: {
1467
- name: "String"
1468
- }
1469
- },
1470
- systemData: {
1471
- serializedName: "systemData",
1472
- type: {
1473
- name: "Composite",
1474
- className: "SystemData"
1475
- }
1476
- }
1477
- }
1478
- }
1479
- };
1480
1565
  const ReservationsProperties = {
1481
1566
  type: {
1482
1567
  name: "Composite",
@@ -1566,6 +1651,18 @@ const ReservationsProperties = {
1566
1651
  name: "Date"
1567
1652
  }
1568
1653
  },
1654
+ expiryDateTime: {
1655
+ serializedName: "expiryDateTime",
1656
+ type: {
1657
+ name: "DateTime"
1658
+ }
1659
+ },
1660
+ reviewDateTime: {
1661
+ serializedName: "reviewDateTime",
1662
+ type: {
1663
+ name: "DateTime"
1664
+ }
1665
+ },
1569
1666
  skuDescription: {
1570
1667
  serializedName: "skuDescription",
1571
1668
  type: {
@@ -1605,6 +1702,12 @@ const ReservationsProperties = {
1605
1702
  name: "Date"
1606
1703
  }
1607
1704
  },
1705
+ purchaseDateTime: {
1706
+ serializedName: "purchaseDateTime",
1707
+ type: {
1708
+ name: "DateTime"
1709
+ }
1710
+ },
1608
1711
  splitProperties: {
1609
1712
  serializedName: "splitProperties",
1610
1713
  type: {
@@ -1619,6 +1722,20 @@ const ReservationsProperties = {
1619
1722
  className: "ReservationMergeProperties"
1620
1723
  }
1621
1724
  },
1725
+ swapProperties: {
1726
+ serializedName: "swapProperties",
1727
+ type: {
1728
+ name: "Composite",
1729
+ className: "ReservationSwapProperties"
1730
+ }
1731
+ },
1732
+ appliedScopeProperties: {
1733
+ serializedName: "appliedScopeProperties",
1734
+ type: {
1735
+ name: "Composite",
1736
+ className: "AppliedScopeProperties"
1737
+ }
1738
+ },
1622
1739
  billingScopeId: {
1623
1740
  serializedName: "billingScopeId",
1624
1741
  type: {
@@ -1731,6 +1848,26 @@ const ReservationMergeProperties = {
1731
1848
  }
1732
1849
  }
1733
1850
  };
1851
+ const ReservationSwapProperties = {
1852
+ type: {
1853
+ name: "Composite",
1854
+ className: "ReservationSwapProperties",
1855
+ modelProperties: {
1856
+ swapSource: {
1857
+ serializedName: "swapSource",
1858
+ type: {
1859
+ name: "String"
1860
+ }
1861
+ },
1862
+ swapDestination: {
1863
+ serializedName: "swapDestination",
1864
+ type: {
1865
+ name: "String"
1866
+ }
1867
+ }
1868
+ }
1869
+ }
1870
+ };
1734
1871
  const RenewPropertiesResponse = {
1735
1872
  type: {
1736
1873
  name: "Composite",
@@ -1863,6 +2000,42 @@ const ReservationUtilizationAggregates = {
1863
2000
  }
1864
2001
  }
1865
2002
  };
2003
+ const Resource = {
2004
+ type: {
2005
+ name: "Composite",
2006
+ className: "Resource",
2007
+ modelProperties: {
2008
+ id: {
2009
+ serializedName: "id",
2010
+ readOnly: true,
2011
+ type: {
2012
+ name: "String"
2013
+ }
2014
+ },
2015
+ name: {
2016
+ serializedName: "name",
2017
+ readOnly: true,
2018
+ type: {
2019
+ name: "String"
2020
+ }
2021
+ },
2022
+ type: {
2023
+ serializedName: "type",
2024
+ readOnly: true,
2025
+ type: {
2026
+ name: "String"
2027
+ }
2028
+ },
2029
+ systemData: {
2030
+ serializedName: "systemData",
2031
+ type: {
2032
+ name: "Composite",
2033
+ className: "SystemData"
2034
+ }
2035
+ }
2036
+ }
2037
+ }
2038
+ };
1866
2039
  const SystemData = {
1867
2040
  type: {
1868
2041
  name: "Composite",
@@ -1999,6 +2172,13 @@ const Patch = {
1999
2172
  }
2000
2173
  }
2001
2174
  },
2175
+ appliedScopeProperties: {
2176
+ serializedName: "properties.appliedScopeProperties",
2177
+ type: {
2178
+ name: "Composite",
2179
+ className: "AppliedScopeProperties"
2180
+ }
2181
+ },
2002
2182
  instanceFlexibility: {
2003
2183
  serializedName: "properties.instanceFlexibility",
2004
2184
  type: {
@@ -2024,6 +2204,12 @@ const Patch = {
2024
2204
  name: "Composite",
2025
2205
  className: "PatchPropertiesRenewProperties"
2026
2206
  }
2207
+ },
2208
+ reviewDateTime: {
2209
+ serializedName: "properties.reviewDateTime",
2210
+ type: {
2211
+ name: "DateTime"
2212
+ }
2027
2213
  }
2028
2214
  }
2029
2215
  }
@@ -2489,6 +2675,18 @@ const CalculateExchangeRequestProperties = {
2489
2675
  }
2490
2676
  }
2491
2677
  },
2678
+ savingsPlansToPurchase: {
2679
+ serializedName: "savingsPlansToPurchase",
2680
+ type: {
2681
+ name: "Sequence",
2682
+ element: {
2683
+ type: {
2684
+ name: "Composite",
2685
+ className: "SavingsPlanPurchaseRequest"
2686
+ }
2687
+ }
2688
+ }
2689
+ },
2492
2690
  reservationsToExchange: {
2493
2691
  serializedName: "reservationsToExchange",
2494
2692
  type: {
@@ -2504,6 +2702,65 @@ const CalculateExchangeRequestProperties = {
2504
2702
  }
2505
2703
  }
2506
2704
  };
2705
+ const SavingsPlanPurchaseRequest = {
2706
+ type: {
2707
+ name: "Composite",
2708
+ className: "SavingsPlanPurchaseRequest",
2709
+ modelProperties: {
2710
+ sku: {
2711
+ serializedName: "sku",
2712
+ type: {
2713
+ name: "Composite",
2714
+ className: "SkuName"
2715
+ }
2716
+ },
2717
+ displayName: {
2718
+ serializedName: "properties.displayName",
2719
+ type: {
2720
+ name: "String"
2721
+ }
2722
+ },
2723
+ billingScopeId: {
2724
+ serializedName: "properties.billingScopeId",
2725
+ type: {
2726
+ name: "String"
2727
+ }
2728
+ },
2729
+ term: {
2730
+ serializedName: "properties.term",
2731
+ type: {
2732
+ name: "String"
2733
+ }
2734
+ },
2735
+ billingPlan: {
2736
+ serializedName: "properties.billingPlan",
2737
+ type: {
2738
+ name: "String"
2739
+ }
2740
+ },
2741
+ appliedScopeType: {
2742
+ serializedName: "properties.appliedScopeType",
2743
+ type: {
2744
+ name: "String"
2745
+ }
2746
+ },
2747
+ appliedScopeProperties: {
2748
+ serializedName: "properties.appliedScopeProperties",
2749
+ type: {
2750
+ name: "Composite",
2751
+ className: "AppliedScopeProperties"
2752
+ }
2753
+ },
2754
+ commitment: {
2755
+ serializedName: "properties.commitment",
2756
+ type: {
2757
+ name: "Composite",
2758
+ className: "Commitment"
2759
+ }
2760
+ }
2761
+ }
2762
+ }
2763
+ };
2507
2764
  const CalculateExchangeOperationResultResponse = {
2508
2765
  type: {
2509
2766
  name: "Composite",
@@ -2588,6 +2845,18 @@ const CalculateExchangeResponseProperties = {
2588
2845
  }
2589
2846
  }
2590
2847
  },
2848
+ savingsPlansToPurchase: {
2849
+ serializedName: "savingsPlansToPurchase",
2850
+ type: {
2851
+ name: "Sequence",
2852
+ element: {
2853
+ type: {
2854
+ name: "Composite",
2855
+ className: "SavingsPlanToPurchaseCalculateExchange"
2856
+ }
2857
+ }
2858
+ }
2859
+ },
2591
2860
  reservationsToExchange: {
2592
2861
  serializedName: "reservationsToExchange",
2593
2862
  type: {
@@ -2632,6 +2901,28 @@ const ReservationToPurchaseCalculateExchange = {
2632
2901
  }
2633
2902
  }
2634
2903
  };
2904
+ const SavingsPlanToPurchaseCalculateExchange = {
2905
+ type: {
2906
+ name: "Composite",
2907
+ className: "SavingsPlanToPurchaseCalculateExchange",
2908
+ modelProperties: {
2909
+ properties: {
2910
+ serializedName: "properties",
2911
+ type: {
2912
+ name: "Composite",
2913
+ className: "SavingsPlanPurchaseRequest"
2914
+ }
2915
+ },
2916
+ billingCurrencyTotal: {
2917
+ serializedName: "billingCurrencyTotal",
2918
+ type: {
2919
+ name: "Composite",
2920
+ className: "Price"
2921
+ }
2922
+ }
2923
+ }
2924
+ }
2925
+ };
2635
2926
  const ReservationToExchange = {
2636
2927
  type: {
2637
2928
  name: "Composite",
@@ -2868,6 +3159,18 @@ const ExchangeResponseProperties = {
2868
3159
  }
2869
3160
  }
2870
3161
  },
3162
+ savingsPlansToPurchase: {
3163
+ serializedName: "savingsPlansToPurchase",
3164
+ type: {
3165
+ name: "Sequence",
3166
+ element: {
3167
+ type: {
3168
+ name: "Composite",
3169
+ className: "SavingsPlanToPurchaseExchange"
3170
+ }
3171
+ }
3172
+ }
3173
+ },
2871
3174
  reservationsToExchange: {
2872
3175
  serializedName: "reservationsToExchange",
2873
3176
  type: {
@@ -2930,6 +3233,46 @@ const ReservationToPurchaseExchange = {
2930
3233
  }
2931
3234
  }
2932
3235
  };
3236
+ const SavingsPlanToPurchaseExchange = {
3237
+ type: {
3238
+ name: "Composite",
3239
+ className: "SavingsPlanToPurchaseExchange",
3240
+ modelProperties: {
3241
+ savingsPlanOrderId: {
3242
+ serializedName: "savingsPlanOrderId",
3243
+ type: {
3244
+ name: "String"
3245
+ }
3246
+ },
3247
+ savingsPlanId: {
3248
+ serializedName: "savingsPlanId",
3249
+ type: {
3250
+ name: "String"
3251
+ }
3252
+ },
3253
+ properties: {
3254
+ serializedName: "properties",
3255
+ type: {
3256
+ name: "Composite",
3257
+ className: "SavingsPlanPurchaseRequest"
3258
+ }
3259
+ },
3260
+ billingCurrencyTotal: {
3261
+ serializedName: "billingCurrencyTotal",
3262
+ type: {
3263
+ name: "Composite",
3264
+ className: "Price"
3265
+ }
3266
+ },
3267
+ status: {
3268
+ serializedName: "status",
3269
+ type: {
3270
+ name: "String"
3271
+ }
3272
+ }
3273
+ }
3274
+ }
3275
+ };
2933
3276
  const ReservationToReturnForExchange = {
2934
3277
  type: {
2935
3278
  name: "Composite",
@@ -3058,6 +3401,20 @@ const ReservationSummary = {
3058
3401
  type: {
3059
3402
  name: "Number"
3060
3403
  }
3404
+ },
3405
+ warningCount: {
3406
+ serializedName: "warningCount",
3407
+ readOnly: true,
3408
+ type: {
3409
+ name: "Number"
3410
+ }
3411
+ },
3412
+ noBenefitCount: {
3413
+ serializedName: "noBenefitCount",
3414
+ readOnly: true,
3415
+ type: {
3416
+ name: "Number"
3417
+ }
3061
3418
  }
3062
3419
  }
3063
3420
  }
@@ -3761,62 +4118,203 @@ const QuotaRequestOneResourceSubmitResponse = {
3761
4118
  name: "String"
3762
4119
  }
3763
4120
  },
3764
- namePropertiesName: {
3765
- serializedName: "properties.properties.name",
3766
- readOnly: true,
4121
+ namePropertiesName: {
4122
+ serializedName: "properties.properties.name",
4123
+ readOnly: true,
4124
+ type: {
4125
+ name: "String"
4126
+ }
4127
+ },
4128
+ typePropertiesType: {
4129
+ serializedName: "properties.properties.type",
4130
+ readOnly: true,
4131
+ type: {
4132
+ name: "String"
4133
+ }
4134
+ },
4135
+ properties: {
4136
+ serializedName: "properties.properties.properties",
4137
+ type: {
4138
+ name: "Composite",
4139
+ className: "QuotaProperties"
4140
+ }
4141
+ }
4142
+ }
4143
+ }
4144
+ };
4145
+ const QuotaRequestSubmitResponse = {
4146
+ type: {
4147
+ name: "Composite",
4148
+ className: "QuotaRequestSubmitResponse",
4149
+ modelProperties: {
4150
+ id: {
4151
+ serializedName: "id",
4152
+ readOnly: true,
4153
+ type: {
4154
+ name: "String"
4155
+ }
4156
+ },
4157
+ name: {
4158
+ serializedName: "name",
4159
+ readOnly: true,
4160
+ type: {
4161
+ name: "String"
4162
+ }
4163
+ },
4164
+ properties: {
4165
+ serializedName: "properties",
4166
+ type: {
4167
+ name: "Composite",
4168
+ className: "QuotaRequestProperties"
4169
+ }
4170
+ },
4171
+ type: {
4172
+ serializedName: "type",
4173
+ readOnly: true,
4174
+ type: {
4175
+ name: "String"
4176
+ }
4177
+ }
4178
+ }
4179
+ }
4180
+ };
4181
+ const Commitment = {
4182
+ type: {
4183
+ name: "Composite",
4184
+ className: "Commitment",
4185
+ modelProperties: Object.assign(Object.assign({}, Price.type.modelProperties), { grain: {
4186
+ serializedName: "grain",
4187
+ type: {
4188
+ name: "String"
4189
+ }
4190
+ } })
4191
+ }
4192
+ };
4193
+ const ProxyResource = {
4194
+ type: {
4195
+ name: "Composite",
4196
+ className: "ProxyResource",
4197
+ modelProperties: Object.assign({}, Resource.type.modelProperties)
4198
+ }
4199
+ };
4200
+ const ReservationResponse = {
4201
+ type: {
4202
+ name: "Composite",
4203
+ className: "ReservationResponse",
4204
+ modelProperties: Object.assign(Object.assign({}, ProxyResource.type.modelProperties), { location: {
4205
+ serializedName: "location",
4206
+ type: {
4207
+ name: "String"
4208
+ }
4209
+ }, etag: {
4210
+ serializedName: "etag",
4211
+ type: {
4212
+ name: "Number"
4213
+ }
4214
+ }, sku: {
4215
+ serializedName: "sku",
4216
+ type: {
4217
+ name: "Composite",
4218
+ className: "SkuName"
4219
+ }
4220
+ }, properties: {
4221
+ serializedName: "properties",
4222
+ type: {
4223
+ name: "Composite",
4224
+ className: "ReservationsProperties"
4225
+ }
4226
+ }, kind: {
4227
+ defaultValue: "Microsoft.Compute",
4228
+ isConstant: true,
4229
+ serializedName: "kind",
4230
+ type: {
4231
+ name: "String"
4232
+ }
4233
+ } })
4234
+ }
4235
+ };
4236
+ const ReservationSplitHeaders = {
4237
+ type: {
4238
+ name: "Composite",
4239
+ className: "ReservationSplitHeaders",
4240
+ modelProperties: {
4241
+ location: {
4242
+ serializedName: "location",
4243
+ type: {
4244
+ name: "String"
4245
+ }
4246
+ },
4247
+ retryAfter: {
4248
+ serializedName: "retry-after",
3767
4249
  type: {
3768
- name: "String"
4250
+ name: "Number"
3769
4251
  }
3770
- },
3771
- typePropertiesType: {
3772
- serializedName: "properties.properties.type",
3773
- readOnly: true,
4252
+ }
4253
+ }
4254
+ }
4255
+ };
4256
+ const ReservationMergeHeaders = {
4257
+ type: {
4258
+ name: "Composite",
4259
+ className: "ReservationMergeHeaders",
4260
+ modelProperties: {
4261
+ location: {
4262
+ serializedName: "location",
3774
4263
  type: {
3775
4264
  name: "String"
3776
4265
  }
3777
4266
  },
3778
- properties: {
3779
- serializedName: "properties.properties.properties",
4267
+ retryAfter: {
4268
+ serializedName: "retry-after",
3780
4269
  type: {
3781
- name: "Composite",
3782
- className: "QuotaProperties"
4270
+ name: "Number"
3783
4271
  }
3784
4272
  }
3785
4273
  }
3786
4274
  }
3787
4275
  };
3788
- const QuotaRequestSubmitResponse = {
4276
+ const ReservationUpdateHeaders = {
3789
4277
  type: {
3790
4278
  name: "Composite",
3791
- className: "QuotaRequestSubmitResponse",
4279
+ className: "ReservationUpdateHeaders",
3792
4280
  modelProperties: {
3793
- id: {
3794
- serializedName: "id",
3795
- readOnly: true,
4281
+ azureAsyncOperation: {
4282
+ serializedName: "azure-asyncoperation",
3796
4283
  type: {
3797
4284
  name: "String"
3798
4285
  }
3799
4286
  },
3800
- name: {
3801
- serializedName: "name",
3802
- readOnly: true,
4287
+ location: {
4288
+ serializedName: "location",
3803
4289
  type: {
3804
4290
  name: "String"
3805
4291
  }
3806
4292
  },
3807
- properties: {
3808
- serializedName: "properties",
4293
+ retryAfter: {
4294
+ serializedName: "retry-after",
3809
4295
  type: {
3810
- name: "Composite",
3811
- className: "QuotaRequestProperties"
4296
+ name: "Number"
3812
4297
  }
3813
- },
3814
- type: {
3815
- serializedName: "type",
3816
- readOnly: true,
4298
+ }
4299
+ }
4300
+ }
4301
+ };
4302
+ const ReservationOrderPurchaseHeaders = {
4303
+ type: {
4304
+ name: "Composite",
4305
+ className: "ReservationOrderPurchaseHeaders",
4306
+ modelProperties: {
4307
+ location: {
4308
+ serializedName: "location",
3817
4309
  type: {
3818
4310
  name: "String"
3819
4311
  }
4312
+ },
4313
+ retryAfter: {
4314
+ serializedName: "retry-after",
4315
+ type: {
4316
+ name: "Number"
4317
+ }
3820
4318
  }
3821
4319
  }
3822
4320
  }
@@ -3939,6 +4437,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
3939
4437
  ScopeProperties: ScopeProperties,
3940
4438
  ErrorModel: ErrorModel,
3941
4439
  ExtendedErrorInfo: ExtendedErrorInfo,
4440
+ CatalogsResult: CatalogsResult,
3942
4441
  Catalog: Catalog,
3943
4442
  SkuProperty: SkuProperty,
3944
4443
  CatalogMsrp: CatalogMsrp,
@@ -3949,6 +4448,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
3949
4448
  AppliedReservationList: AppliedReservationList,
3950
4449
  PurchaseRequest: PurchaseRequest,
3951
4450
  SkuName: SkuName,
4451
+ AppliedScopeProperties: AppliedScopeProperties,
3952
4452
  PurchaseRequestPropertiesReservedResourceProperties: PurchaseRequestPropertiesReservedResourceProperties,
3953
4453
  CalculatePriceResponse: CalculatePriceResponse,
3954
4454
  CalculatePriceResponseProperties: CalculatePriceResponseProperties,
@@ -3959,15 +4459,16 @@ var Mappers = /*#__PURE__*/Object.freeze({
3959
4459
  ReservationOrderList: ReservationOrderList,
3960
4460
  ReservationOrderResponse: ReservationOrderResponse,
3961
4461
  ReservationOrderBillingPlanInformation: ReservationOrderBillingPlanInformation,
3962
- ReservationResponse: ReservationResponse,
3963
4462
  ReservationsProperties: ReservationsProperties,
3964
4463
  ReservationSplitProperties: ReservationSplitProperties,
3965
4464
  ReservationMergeProperties: ReservationMergeProperties,
4465
+ ReservationSwapProperties: ReservationSwapProperties,
3966
4466
  RenewPropertiesResponse: RenewPropertiesResponse,
3967
4467
  RenewPropertiesResponsePricingCurrencyTotal: RenewPropertiesResponsePricingCurrencyTotal,
3968
4468
  RenewPropertiesResponseBillingCurrencyTotal: RenewPropertiesResponseBillingCurrencyTotal,
3969
4469
  ReservationsPropertiesUtilization: ReservationsPropertiesUtilization,
3970
4470
  ReservationUtilizationAggregates: ReservationUtilizationAggregates,
4471
+ Resource: Resource,
3971
4472
  SystemData: SystemData,
3972
4473
  SplitRequest: SplitRequest,
3973
4474
  MergeRequest: MergeRequest,
@@ -3991,9 +4492,11 @@ var Mappers = /*#__PURE__*/Object.freeze({
3991
4492
  RefundResponse: RefundResponse,
3992
4493
  CalculateExchangeRequest: CalculateExchangeRequest,
3993
4494
  CalculateExchangeRequestProperties: CalculateExchangeRequestProperties,
4495
+ SavingsPlanPurchaseRequest: SavingsPlanPurchaseRequest,
3994
4496
  CalculateExchangeOperationResultResponse: CalculateExchangeOperationResultResponse,
3995
4497
  CalculateExchangeResponseProperties: CalculateExchangeResponseProperties,
3996
4498
  ReservationToPurchaseCalculateExchange: ReservationToPurchaseCalculateExchange,
4499
+ SavingsPlanToPurchaseCalculateExchange: SavingsPlanToPurchaseCalculateExchange,
3997
4500
  ReservationToExchange: ReservationToExchange,
3998
4501
  BillingInformation: BillingInformation,
3999
4502
  ExchangePolicyErrors: ExchangePolicyErrors,
@@ -4004,6 +4507,7 @@ var Mappers = /*#__PURE__*/Object.freeze({
4004
4507
  ExchangeOperationResultResponse: ExchangeOperationResultResponse,
4005
4508
  ExchangeResponseProperties: ExchangeResponseProperties,
4006
4509
  ReservationToPurchaseExchange: ReservationToPurchaseExchange,
4510
+ SavingsPlanToPurchaseExchange: SavingsPlanToPurchaseExchange,
4007
4511
  ReservationToReturnForExchange: ReservationToReturnForExchange,
4008
4512
  ReservationsListResult: ReservationsListResult,
4009
4513
  ReservationSummary: ReservationSummary,
@@ -4029,6 +4533,13 @@ var Mappers = /*#__PURE__*/Object.freeze({
4029
4533
  CreateGenericQuotaRequestParameters: CreateGenericQuotaRequestParameters,
4030
4534
  QuotaRequestOneResourceSubmitResponse: QuotaRequestOneResourceSubmitResponse,
4031
4535
  QuotaRequestSubmitResponse: QuotaRequestSubmitResponse,
4536
+ Commitment: Commitment,
4537
+ ProxyResource: ProxyResource,
4538
+ ReservationResponse: ReservationResponse,
4539
+ ReservationSplitHeaders: ReservationSplitHeaders,
4540
+ ReservationMergeHeaders: ReservationMergeHeaders,
4541
+ ReservationUpdateHeaders: ReservationUpdateHeaders,
4542
+ ReservationOrderPurchaseHeaders: ReservationOrderPurchaseHeaders,
4032
4543
  ReturnPostHeaders: ReturnPostHeaders,
4033
4544
  CalculateExchangePostHeaders: CalculateExchangePostHeaders,
4034
4545
  ExchangePostHeaders: ExchangePostHeaders,
@@ -4104,7 +4615,7 @@ const reservationId = {
4104
4615
  const apiVersion = {
4105
4616
  parameterPath: "apiVersion",
4106
4617
  mapper: {
4107
- defaultValue: "2022-03-01",
4618
+ defaultValue: "2022-11-01",
4108
4619
  isConstant: true,
4109
4620
  serializedName: "api-version",
4110
4621
  type: {
@@ -4123,7 +4634,7 @@ const body2 = {
4123
4634
  const expand = {
4124
4635
  parameterPath: ["options", "expand"],
4125
4636
  mapper: {
4126
- serializedName: "expand",
4637
+ serializedName: "$expand",
4127
4638
  type: {
4128
4639
  name: "String"
4129
4640
  }
@@ -4253,19 +4764,28 @@ const planId = {
4253
4764
  }
4254
4765
  }
4255
4766
  };
4256
- const body3 = {
4257
- parameterPath: "body",
4258
- mapper: PurchaseRequest
4767
+ const skip = {
4768
+ parameterPath: ["options", "skip"],
4769
+ mapper: {
4770
+ serializedName: "$skip",
4771
+ type: {
4772
+ name: "Number"
4773
+ }
4774
+ }
4259
4775
  };
4260
- const expand1 = {
4261
- parameterPath: ["options", "expand"],
4776
+ const take1 = {
4777
+ parameterPath: ["options", "take"],
4262
4778
  mapper: {
4263
- serializedName: "$expand",
4779
+ serializedName: "$take",
4264
4780
  type: {
4265
- name: "String"
4781
+ name: "Number"
4266
4782
  }
4267
4783
  }
4268
4784
  };
4785
+ const body3 = {
4786
+ parameterPath: "body",
4787
+ mapper: PurchaseRequest
4788
+ };
4269
4789
  const body4 = {
4270
4790
  parameterPath: "body",
4271
4791
  mapper: ChangeDirectoryRequest
@@ -4422,20 +4942,31 @@ class ReservationImpl {
4422
4942
  [Symbol.asyncIterator]() {
4423
4943
  return this;
4424
4944
  },
4425
- byPage: () => {
4426
- return this.listPagingPage(reservationOrderId, options);
4945
+ byPage: (settings) => {
4946
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
4947
+ throw new Error("maxPageSize is not supported by this operation.");
4948
+ }
4949
+ return this.listPagingPage(reservationOrderId, options, settings);
4427
4950
  }
4428
4951
  };
4429
4952
  }
4430
- listPagingPage(reservationOrderId, options) {
4953
+ listPagingPage(reservationOrderId, options, settings) {
4431
4954
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
4432
- let result = yield tslib.__await(this._list(reservationOrderId, options));
4433
- yield yield tslib.__await(result.value || []);
4434
- let continuationToken = result.nextLink;
4955
+ let result;
4956
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
4957
+ if (!continuationToken) {
4958
+ result = yield tslib.__await(this._list(reservationOrderId, options));
4959
+ let page = result.value || [];
4960
+ continuationToken = result.nextLink;
4961
+ setContinuationToken(page, continuationToken);
4962
+ yield yield tslib.__await(page);
4963
+ }
4435
4964
  while (continuationToken) {
4436
4965
  result = yield tslib.__await(this._listNext(reservationOrderId, continuationToken, options));
4437
4966
  continuationToken = result.nextLink;
4438
- yield yield tslib.__await(result.value || []);
4967
+ let page = result.value || [];
4968
+ setContinuationToken(page, continuationToken);
4969
+ yield yield tslib.__await(page);
4439
4970
  }
4440
4971
  });
4441
4972
  }
@@ -4459,12 +4990,12 @@ class ReservationImpl {
4459
4990
  }
4460
4991
  /**
4461
4992
  * List of all the revisions for the `Reservation`.
4462
- * @param reservationId Id of the Reservation Item
4463
4993
  * @param reservationOrderId Order Id of the reservation
4994
+ * @param reservationId Id of the reservation item
4464
4995
  * @param options The options parameters.
4465
4996
  */
4466
- listRevisions(reservationId, reservationOrderId, options) {
4467
- const iter = this.listRevisionsPagingAll(reservationId, reservationOrderId, options);
4997
+ listRevisions(reservationOrderId, reservationId, options) {
4998
+ const iter = this.listRevisionsPagingAll(reservationOrderId, reservationId, options);
4468
4999
  return {
4469
5000
  next() {
4470
5001
  return iter.next();
@@ -4472,28 +5003,39 @@ class ReservationImpl {
4472
5003
  [Symbol.asyncIterator]() {
4473
5004
  return this;
4474
5005
  },
4475
- byPage: () => {
4476
- return this.listRevisionsPagingPage(reservationId, reservationOrderId, options);
5006
+ byPage: (settings) => {
5007
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
5008
+ throw new Error("maxPageSize is not supported by this operation.");
5009
+ }
5010
+ return this.listRevisionsPagingPage(reservationOrderId, reservationId, options, settings);
4477
5011
  }
4478
5012
  };
4479
5013
  }
4480
- listRevisionsPagingPage(reservationId, reservationOrderId, options) {
5014
+ listRevisionsPagingPage(reservationOrderId, reservationId, options, settings) {
4481
5015
  return tslib.__asyncGenerator(this, arguments, function* listRevisionsPagingPage_1() {
4482
- let result = yield tslib.__await(this._listRevisions(reservationId, reservationOrderId, options));
4483
- yield yield tslib.__await(result.value || []);
4484
- let continuationToken = result.nextLink;
5016
+ let result;
5017
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
5018
+ if (!continuationToken) {
5019
+ result = yield tslib.__await(this._listRevisions(reservationOrderId, reservationId, options));
5020
+ let page = result.value || [];
5021
+ continuationToken = result.nextLink;
5022
+ setContinuationToken(page, continuationToken);
5023
+ yield yield tslib.__await(page);
5024
+ }
4485
5025
  while (continuationToken) {
4486
- result = yield tslib.__await(this._listRevisionsNext(reservationId, reservationOrderId, continuationToken, options));
5026
+ result = yield tslib.__await(this._listRevisionsNext(reservationOrderId, reservationId, continuationToken, options));
4487
5027
  continuationToken = result.nextLink;
4488
- yield yield tslib.__await(result.value || []);
5028
+ let page = result.value || [];
5029
+ setContinuationToken(page, continuationToken);
5030
+ yield yield tslib.__await(page);
4489
5031
  }
4490
5032
  });
4491
5033
  }
4492
- listRevisionsPagingAll(reservationId, reservationOrderId, options) {
5034
+ listRevisionsPagingAll(reservationOrderId, reservationId, options) {
4493
5035
  return tslib.__asyncGenerator(this, arguments, function* listRevisionsPagingAll_1() {
4494
5036
  var e_2, _a;
4495
5037
  try {
4496
- for (var _b = tslib.__asyncValues(this.listRevisionsPagingPage(reservationId, reservationOrderId, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
5038
+ for (var _b = tslib.__asyncValues(this.listRevisionsPagingPage(reservationOrderId, reservationId, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
4497
5039
  const page = _c.value;
4498
5040
  yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
4499
5041
  }
@@ -4521,20 +5063,31 @@ class ReservationImpl {
4521
5063
  [Symbol.asyncIterator]() {
4522
5064
  return this;
4523
5065
  },
4524
- byPage: () => {
4525
- return this.listAllPagingPage(options);
5066
+ byPage: (settings) => {
5067
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
5068
+ throw new Error("maxPageSize is not supported by this operation.");
5069
+ }
5070
+ return this.listAllPagingPage(options, settings);
4526
5071
  }
4527
5072
  };
4528
5073
  }
4529
- listAllPagingPage(options) {
5074
+ listAllPagingPage(options, settings) {
4530
5075
  return tslib.__asyncGenerator(this, arguments, function* listAllPagingPage_1() {
4531
- let result = yield tslib.__await(this._listAll(options));
4532
- yield yield tslib.__await(result.value || []);
4533
- let continuationToken = result.nextLink;
5076
+ let result;
5077
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
5078
+ if (!continuationToken) {
5079
+ result = yield tslib.__await(this._listAll(options));
5080
+ let page = result.value || [];
5081
+ continuationToken = result.nextLink;
5082
+ setContinuationToken(page, continuationToken);
5083
+ yield yield tslib.__await(page);
5084
+ }
4534
5085
  while (continuationToken) {
4535
5086
  result = yield tslib.__await(this._listAllNext(continuationToken, options));
4536
5087
  continuationToken = result.nextLink;
4537
- yield yield tslib.__await(result.value || []);
5088
+ let page = result.value || [];
5089
+ setContinuationToken(page, continuationToken);
5090
+ yield yield tslib.__await(page);
4538
5091
  }
4539
5092
  });
4540
5093
  }
@@ -4557,11 +5110,11 @@ class ReservationImpl {
4557
5110
  });
4558
5111
  }
4559
5112
  /**
4560
- * Get Available Scopes for `Reservation`.
5113
+ * Check whether the scopes from request is valid for `Reservation`.
4561
5114
  *
4562
5115
  * @param reservationOrderId Order Id of the reservation
4563
- * @param reservationId Id of the Reservation Item
4564
- * @param body Available scope
5116
+ * @param reservationId Id of the reservation item
5117
+ * @param body Scopes to be checked for eligibility.
4565
5118
  * @param options The options parameters.
4566
5119
  */
4567
5120
  beginAvailableScopes(reservationOrderId, reservationId, body, options) {
@@ -4598,11 +5151,11 @@ class ReservationImpl {
4598
5151
  });
4599
5152
  }
4600
5153
  /**
4601
- * Get Available Scopes for `Reservation`.
5154
+ * Check whether the scopes from request is valid for `Reservation`.
4602
5155
  *
4603
5156
  * @param reservationOrderId Order Id of the reservation
4604
- * @param reservationId Id of the Reservation Item
4605
- * @param body Available scope
5157
+ * @param reservationId Id of the reservation item
5158
+ * @param body Scopes to be checked for eligibility.
4606
5159
  * @param options The options parameters.
4607
5160
  */
4608
5161
  beginAvailableScopesAndWait(reservationOrderId, reservationId, body, options) {
@@ -4727,17 +5280,17 @@ class ReservationImpl {
4727
5280
  }
4728
5281
  /**
4729
5282
  * Get specific `Reservation` details.
4730
- * @param reservationId Id of the Reservation Item
4731
5283
  * @param reservationOrderId Order Id of the reservation
5284
+ * @param reservationId Id of the reservation item
4732
5285
  * @param options The options parameters.
4733
5286
  */
4734
- get(reservationId, reservationOrderId, options) {
4735
- return this.client.sendOperationRequest({ reservationId, reservationOrderId, options }, getOperationSpec$3);
5287
+ get(reservationOrderId, reservationId, options) {
5288
+ return this.client.sendOperationRequest({ reservationOrderId, reservationId, options }, getOperationSpec$3);
4736
5289
  }
4737
5290
  /**
4738
5291
  * Updates the applied scopes of the `Reservation`.
4739
5292
  * @param reservationOrderId Order Id of the reservation
4740
- * @param reservationId Id of the Reservation Item
5293
+ * @param reservationId Id of the reservation item
4741
5294
  * @param parameters Information needed to patch a reservation item
4742
5295
  * @param options The options parameters.
4743
5296
  */
@@ -4768,7 +5321,8 @@ class ReservationImpl {
4768
5321
  const lro = new LroImpl(sendOperation, { reservationOrderId, reservationId, parameters, options }, updateOperationSpec$1);
4769
5322
  const poller = new coreLro.LroEngine(lro, {
4770
5323
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
4771
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
5324
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
5325
+ lroResourceLocationConfig: "azure-async-operation"
4772
5326
  });
4773
5327
  yield poller.poll();
4774
5328
  return poller;
@@ -4777,7 +5331,7 @@ class ReservationImpl {
4777
5331
  /**
4778
5332
  * Updates the applied scopes of the `Reservation`.
4779
5333
  * @param reservationOrderId Order Id of the reservation
4780
- * @param reservationId Id of the Reservation Item
5334
+ * @param reservationId Id of the reservation item
4781
5335
  * @param parameters Information needed to patch a reservation item
4782
5336
  * @param options The options parameters.
4783
5337
  */
@@ -4790,17 +5344,17 @@ class ReservationImpl {
4790
5344
  /**
4791
5345
  * Archiving a `Reservation` moves it to `Archived` state.
4792
5346
  * @param reservationOrderId Order Id of the reservation
4793
- * @param reservationId Id of the Reservation Item
5347
+ * @param reservationId Id of the reservation item
4794
5348
  * @param options The options parameters.
4795
5349
  */
4796
5350
  archive(reservationOrderId, reservationId, options) {
4797
5351
  return this.client.sendOperationRequest({ reservationOrderId, reservationId, options }, archiveOperationSpec);
4798
5352
  }
4799
5353
  /**
4800
- * Unarchiving a `Reservation` moves it to the state it was before archiving.
5354
+ * Restores a `Reservation` to the state it was before archiving.
4801
5355
  *
4802
5356
  * @param reservationOrderId Order Id of the reservation
4803
- * @param reservationId Id of the Reservation Item
5357
+ * @param reservationId Id of the reservation item
4804
5358
  * @param options The options parameters.
4805
5359
  */
4806
5360
  unarchive(reservationOrderId, reservationId, options) {
@@ -4808,12 +5362,12 @@ class ReservationImpl {
4808
5362
  }
4809
5363
  /**
4810
5364
  * List of all the revisions for the `Reservation`.
4811
- * @param reservationId Id of the Reservation Item
4812
5365
  * @param reservationOrderId Order Id of the reservation
5366
+ * @param reservationId Id of the reservation item
4813
5367
  * @param options The options parameters.
4814
5368
  */
4815
- _listRevisions(reservationId, reservationOrderId, options) {
4816
- return this.client.sendOperationRequest({ reservationId, reservationOrderId, options }, listRevisionsOperationSpec);
5369
+ _listRevisions(reservationOrderId, reservationId, options) {
5370
+ return this.client.sendOperationRequest({ reservationOrderId, reservationId, options }, listRevisionsOperationSpec);
4817
5371
  }
4818
5372
  /**
4819
5373
  * List the reservations and the roll up counts of reservations group by provisioning states that the
@@ -4834,13 +5388,13 @@ class ReservationImpl {
4834
5388
  }
4835
5389
  /**
4836
5390
  * ListRevisionsNext
4837
- * @param reservationId Id of the Reservation Item
4838
5391
  * @param reservationOrderId Order Id of the reservation
5392
+ * @param reservationId Id of the reservation item
4839
5393
  * @param nextLink The nextLink from the previous successful call to the ListRevisions method.
4840
5394
  * @param options The options parameters.
4841
5395
  */
4842
- _listRevisionsNext(reservationId, reservationOrderId, nextLink, options) {
4843
- return this.client.sendOperationRequest({ reservationId, reservationOrderId, nextLink, options }, listRevisionsNextOperationSpec);
5396
+ _listRevisionsNext(reservationOrderId, reservationId, nextLink, options) {
5397
+ return this.client.sendOperationRequest({ reservationOrderId, reservationId, nextLink, options }, listRevisionsNextOperationSpec);
4844
5398
  }
4845
5399
  /**
4846
5400
  * ListAllNext
@@ -5152,7 +5706,6 @@ const listNextOperationSpec$4 = {
5152
5706
  bodyMapper: ErrorModel
5153
5707
  }
5154
5708
  },
5155
- queryParameters: [apiVersion],
5156
5709
  urlParameters: [
5157
5710
  $host,
5158
5711
  reservationOrderId,
@@ -5172,7 +5725,6 @@ const listRevisionsNextOperationSpec = {
5172
5725
  bodyMapper: ErrorModel
5173
5726
  }
5174
5727
  },
5175
- queryParameters: [apiVersion],
5176
5728
  urlParameters: [
5177
5729
  $host,
5178
5730
  reservationOrderId,
@@ -5193,15 +5745,6 @@ const listAllNextOperationSpec = {
5193
5745
  bodyMapper: ErrorResponse
5194
5746
  }
5195
5747
  },
5196
- queryParameters: [
5197
- apiVersion,
5198
- filter,
5199
- orderby,
5200
- refreshSummary,
5201
- skiptoken,
5202
- selectedState,
5203
- take
5204
- ],
5205
5748
  urlParameters: [$host, nextLink],
5206
5749
  headerParameters: [accept],
5207
5750
  serializer: serializer$9
@@ -5237,20 +5780,31 @@ class ReservationOrderImpl {
5237
5780
  [Symbol.asyncIterator]() {
5238
5781
  return this;
5239
5782
  },
5240
- byPage: () => {
5241
- return this.listPagingPage(options);
5783
+ byPage: (settings) => {
5784
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
5785
+ throw new Error("maxPageSize is not supported by this operation.");
5786
+ }
5787
+ return this.listPagingPage(options, settings);
5242
5788
  }
5243
5789
  };
5244
5790
  }
5245
- listPagingPage(options) {
5791
+ listPagingPage(options, settings) {
5246
5792
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
5247
- let result = yield tslib.__await(this._list(options));
5248
- yield yield tslib.__await(result.value || []);
5249
- let continuationToken = result.nextLink;
5793
+ let result;
5794
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
5795
+ if (!continuationToken) {
5796
+ result = yield tslib.__await(this._list(options));
5797
+ let page = result.value || [];
5798
+ continuationToken = result.nextLink;
5799
+ setContinuationToken(page, continuationToken);
5800
+ yield yield tslib.__await(page);
5801
+ }
5250
5802
  while (continuationToken) {
5251
5803
  result = yield tslib.__await(this._listNext(continuationToken, options));
5252
5804
  continuationToken = result.nextLink;
5253
- yield yield tslib.__await(result.value || []);
5805
+ let page = result.value || [];
5806
+ setContinuationToken(page, continuationToken);
5807
+ yield yield tslib.__await(page);
5254
5808
  }
5255
5809
  });
5256
5810
  }
@@ -5440,7 +5994,7 @@ const getOperationSpec$2 = {
5440
5994
  bodyMapper: ErrorModel
5441
5995
  }
5442
5996
  },
5443
- queryParameters: [apiVersion, expand1],
5997
+ queryParameters: [apiVersion, expand],
5444
5998
  urlParameters: [$host, reservationOrderId],
5445
5999
  headerParameters: [accept],
5446
6000
  serializer: serializer$8
@@ -5474,7 +6028,6 @@ const listNextOperationSpec$3 = {
5474
6028
  bodyMapper: ErrorModel
5475
6029
  }
5476
6030
  },
5477
- queryParameters: [apiVersion],
5478
6031
  urlParameters: [$host, nextLink],
5479
6032
  headerParameters: [accept],
5480
6033
  serializer: serializer$8
@@ -5510,20 +6063,31 @@ class OperationImpl {
5510
6063
  [Symbol.asyncIterator]() {
5511
6064
  return this;
5512
6065
  },
5513
- byPage: () => {
5514
- return this.listPagingPage(options);
6066
+ byPage: (settings) => {
6067
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
6068
+ throw new Error("maxPageSize is not supported by this operation.");
6069
+ }
6070
+ return this.listPagingPage(options, settings);
5515
6071
  }
5516
6072
  };
5517
6073
  }
5518
- listPagingPage(options) {
6074
+ listPagingPage(options, settings) {
5519
6075
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
5520
- let result = yield tslib.__await(this._list(options));
5521
- yield yield tslib.__await(result.value || []);
5522
- let continuationToken = result.nextLink;
6076
+ let result;
6077
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
6078
+ if (!continuationToken) {
6079
+ result = yield tslib.__await(this._list(options));
6080
+ let page = result.value || [];
6081
+ continuationToken = result.nextLink;
6082
+ setContinuationToken(page, continuationToken);
6083
+ yield yield tslib.__await(page);
6084
+ }
5523
6085
  while (continuationToken) {
5524
6086
  result = yield tslib.__await(this._listNext(continuationToken, options));
5525
6087
  continuationToken = result.nextLink;
5526
- yield yield tslib.__await(result.value || []);
6088
+ let page = result.value || [];
6089
+ setContinuationToken(page, continuationToken);
6090
+ yield yield tslib.__await(page);
5527
6091
  }
5528
6092
  });
5529
6093
  }
@@ -5590,7 +6154,6 @@ const listNextOperationSpec$2 = {
5590
6154
  bodyMapper: ErrorModel
5591
6155
  }
5592
6156
  },
5593
- queryParameters: [apiVersion],
5594
6157
  urlParameters: [$host, nextLink],
5595
6158
  headerParameters: [accept],
5596
6159
  serializer: serializer$7
@@ -5661,13 +6224,56 @@ class ReturnImpl {
5661
6224
  this.client = client;
5662
6225
  }
5663
6226
  /**
5664
- * Return a reservation.
6227
+ * Return a reservation and get refund information.
5665
6228
  * @param reservationOrderId Order Id of the reservation
5666
6229
  * @param body Information needed for returning reservation.
5667
6230
  * @param options The options parameters.
5668
6231
  */
5669
- post(reservationOrderId, body, options) {
5670
- return this.client.sendOperationRequest({ reservationOrderId, body, options }, postOperationSpec$2);
6232
+ beginPost(reservationOrderId, body, options) {
6233
+ return tslib.__awaiter(this, void 0, void 0, function* () {
6234
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
6235
+ return this.client.sendOperationRequest(args, spec);
6236
+ });
6237
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
6238
+ var _a;
6239
+ let currentRawResponse = undefined;
6240
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
6241
+ const callback = (rawResponse, flatResponse) => {
6242
+ currentRawResponse = rawResponse;
6243
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
6244
+ };
6245
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
6246
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
6247
+ return {
6248
+ flatResponse,
6249
+ rawResponse: {
6250
+ statusCode: currentRawResponse.status,
6251
+ body: currentRawResponse.parsedBody,
6252
+ headers: currentRawResponse.headers.toJSON()
6253
+ }
6254
+ };
6255
+ });
6256
+ const lro = new LroImpl(sendOperation, { reservationOrderId, body, options }, postOperationSpec$2);
6257
+ const poller = new coreLro.LroEngine(lro, {
6258
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
6259
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
6260
+ lroResourceLocationConfig: "location"
6261
+ });
6262
+ yield poller.poll();
6263
+ return poller;
6264
+ });
6265
+ }
6266
+ /**
6267
+ * Return a reservation and get refund information.
6268
+ * @param reservationOrderId Order Id of the reservation
6269
+ * @param body Information needed for returning reservation.
6270
+ * @param options The options parameters.
6271
+ */
6272
+ beginPostAndWait(reservationOrderId, body, options) {
6273
+ return tslib.__awaiter(this, void 0, void 0, function* () {
6274
+ const poller = yield this.beginPost(reservationOrderId, body, options);
6275
+ return poller.pollUntilDone();
6276
+ });
5671
6277
  }
5672
6278
  }
5673
6279
  // Operation Specifications
@@ -5676,10 +6282,22 @@ const postOperationSpec$2 = {
5676
6282
  path: "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return",
5677
6283
  httpMethod: "POST",
5678
6284
  responses: {
6285
+ 200: {
6286
+ bodyMapper: RefundResponse,
6287
+ headersMapper: ReturnPostHeaders
6288
+ },
6289
+ 201: {
6290
+ bodyMapper: RefundResponse,
6291
+ headersMapper: ReturnPostHeaders
6292
+ },
5679
6293
  202: {
5680
6294
  bodyMapper: RefundResponse,
5681
6295
  headersMapper: ReturnPostHeaders
5682
6296
  },
6297
+ 204: {
6298
+ bodyMapper: RefundResponse,
6299
+ headersMapper: ReturnPostHeaders
6300
+ },
5683
6301
  default: {
5684
6302
  bodyMapper: ErrorModel
5685
6303
  }
@@ -5924,20 +6542,31 @@ class QuotaImpl {
5924
6542
  [Symbol.asyncIterator]() {
5925
6543
  return this;
5926
6544
  },
5927
- byPage: () => {
5928
- return this.listPagingPage(subscriptionId, providerId, location, options);
6545
+ byPage: (settings) => {
6546
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
6547
+ throw new Error("maxPageSize is not supported by this operation.");
6548
+ }
6549
+ return this.listPagingPage(subscriptionId, providerId, location, options, settings);
5929
6550
  }
5930
6551
  };
5931
6552
  }
5932
- listPagingPage(subscriptionId, providerId, location, options) {
6553
+ listPagingPage(subscriptionId, providerId, location, options, settings) {
5933
6554
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
5934
- let result = yield tslib.__await(this._list(subscriptionId, providerId, location, options));
5935
- yield yield tslib.__await(result.value || []);
5936
- let continuationToken = result.nextLink;
6555
+ let result;
6556
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
6557
+ if (!continuationToken) {
6558
+ result = yield tslib.__await(this._list(subscriptionId, providerId, location, options));
6559
+ let page = result.value || [];
6560
+ continuationToken = result.nextLink;
6561
+ setContinuationToken(page, continuationToken);
6562
+ yield yield tslib.__await(page);
6563
+ }
5937
6564
  while (continuationToken) {
5938
6565
  result = yield tslib.__await(this._listNext(subscriptionId, providerId, location, continuationToken, options));
5939
6566
  continuationToken = result.nextLink;
5940
- yield yield tslib.__await(result.value || []);
6567
+ let page = result.value || [];
6568
+ setContinuationToken(page, continuationToken);
6569
+ yield yield tslib.__await(page);
5941
6570
  }
5942
6571
  });
5943
6572
  }
@@ -6276,7 +6905,6 @@ const listNextOperationSpec$1 = {
6276
6905
  bodyMapper: ExceptionResponse
6277
6906
  }
6278
6907
  },
6279
- queryParameters: [apiVersion1],
6280
6908
  urlParameters: [
6281
6909
  $host,
6282
6910
  nextLink,
@@ -6322,20 +6950,31 @@ class QuotaRequestStatusImpl {
6322
6950
  [Symbol.asyncIterator]() {
6323
6951
  return this;
6324
6952
  },
6325
- byPage: () => {
6326
- return this.listPagingPage(subscriptionId, providerId, location, options);
6953
+ byPage: (settings) => {
6954
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
6955
+ throw new Error("maxPageSize is not supported by this operation.");
6956
+ }
6957
+ return this.listPagingPage(subscriptionId, providerId, location, options, settings);
6327
6958
  }
6328
6959
  };
6329
6960
  }
6330
- listPagingPage(subscriptionId, providerId, location, options) {
6961
+ listPagingPage(subscriptionId, providerId, location, options, settings) {
6331
6962
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
6332
- let result = yield tslib.__await(this._list(subscriptionId, providerId, location, options));
6333
- yield yield tslib.__await(result.value || []);
6334
- let continuationToken = result.nextLink;
6963
+ let result;
6964
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
6965
+ if (!continuationToken) {
6966
+ result = yield tslib.__await(this._list(subscriptionId, providerId, location, options));
6967
+ let page = result.value || [];
6968
+ continuationToken = result.nextLink;
6969
+ setContinuationToken(page, continuationToken);
6970
+ yield yield tslib.__await(page);
6971
+ }
6335
6972
  while (continuationToken) {
6336
6973
  result = yield tslib.__await(this._listNext(subscriptionId, providerId, location, continuationToken, options));
6337
6974
  continuationToken = result.nextLink;
6338
- yield yield tslib.__await(result.value || []);
6975
+ let page = result.value || [];
6976
+ setContinuationToken(page, continuationToken);
6977
+ yield yield tslib.__await(page);
6339
6978
  }
6340
6979
  });
6341
6980
  }
@@ -6454,12 +7093,6 @@ const listNextOperationSpec = {
6454
7093
  bodyMapper: ExceptionResponse
6455
7094
  }
6456
7095
  },
6457
- queryParameters: [
6458
- filter,
6459
- apiVersion1,
6460
- top,
6461
- skiptoken1
6462
- ],
6463
7096
  urlParameters: [
6464
7097
  $host,
6465
7098
  nextLink,
@@ -6478,6 +7111,7 @@ const listNextOperationSpec = {
6478
7111
  * Code generated by Microsoft (R) AutoRest Code Generator.
6479
7112
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
6480
7113
  */
7114
+ /// <reference lib="esnext.asynciterable" />
6481
7115
  class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6482
7116
  /**
6483
7117
  * Initializes a new instance of the AzureReservationAPI class.
@@ -6485,7 +7119,7 @@ class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6485
7119
  * @param options The parameter options
6486
7120
  */
6487
7121
  constructor(credentials, options) {
6488
- var _a, _b;
7122
+ var _a, _b, _c;
6489
7123
  if (credentials === undefined) {
6490
7124
  throw new Error("'credentials' cannot be null");
6491
7125
  }
@@ -6497,16 +7131,13 @@ class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6497
7131
  requestContentType: "application/json; charset=utf-8",
6498
7132
  credential: credentials
6499
7133
  };
6500
- const packageDetails = `azsdk-js-arm-reservations/7.2.1`;
7134
+ const packageDetails = `azsdk-js-arm-reservations/8.0.0`;
6501
7135
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
6502
7136
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
6503
7137
  : `${packageDetails}`;
6504
- if (!options.credentialScopes) {
6505
- options.credentialScopes = ["https://management.azure.com/.default"];
6506
- }
6507
7138
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
6508
7139
  userAgentPrefix
6509
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
7140
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
6510
7141
  super(optionsWithDefaults);
6511
7142
  let bearerTokenAuthenticationPolicyFound = false;
6512
7143
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
@@ -6523,7 +7154,7 @@ class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6523
7154
  });
6524
7155
  this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
6525
7156
  credential: credentials,
6526
- scopes: `${optionsWithDefaults.credentialScopes}`,
7157
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
6527
7158
  challengeCallbacks: {
6528
7159
  authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
6529
7160
  }
@@ -6546,7 +7177,67 @@ class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6546
7177
  * @param subscriptionId Id of the subscription
6547
7178
  * @param options The options parameters.
6548
7179
  */
6549
- getCatalog(subscriptionId, options) {
7180
+ listCatalog(subscriptionId, options) {
7181
+ const iter = this.getCatalogPagingAll(subscriptionId, options);
7182
+ return {
7183
+ next() {
7184
+ return iter.next();
7185
+ },
7186
+ [Symbol.asyncIterator]() {
7187
+ return this;
7188
+ },
7189
+ byPage: (settings) => {
7190
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
7191
+ throw new Error("maxPageSize is not supported by this operation.");
7192
+ }
7193
+ return this.getCatalogPagingPage(subscriptionId, options, settings);
7194
+ }
7195
+ };
7196
+ }
7197
+ getCatalogPagingPage(subscriptionId, options, settings) {
7198
+ return tslib.__asyncGenerator(this, arguments, function* getCatalogPagingPage_1() {
7199
+ let result;
7200
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
7201
+ if (!continuationToken) {
7202
+ result = yield tslib.__await(this._getCatalog(subscriptionId, options));
7203
+ let page = result.value || [];
7204
+ continuationToken = result.nextLink;
7205
+ setContinuationToken(page, continuationToken);
7206
+ yield yield tslib.__await(page);
7207
+ }
7208
+ while (continuationToken) {
7209
+ result = yield tslib.__await(this._getCatalogNext(subscriptionId, continuationToken, options));
7210
+ continuationToken = result.nextLink;
7211
+ let page = result.value || [];
7212
+ setContinuationToken(page, continuationToken);
7213
+ yield yield tslib.__await(page);
7214
+ }
7215
+ });
7216
+ }
7217
+ getCatalogPagingAll(subscriptionId, options) {
7218
+ return tslib.__asyncGenerator(this, arguments, function* getCatalogPagingAll_1() {
7219
+ var e_1, _a;
7220
+ try {
7221
+ for (var _b = tslib.__asyncValues(this.getCatalogPagingPage(subscriptionId, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
7222
+ const page = _c.value;
7223
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
7224
+ }
7225
+ }
7226
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
7227
+ finally {
7228
+ try {
7229
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
7230
+ }
7231
+ finally { if (e_1) throw e_1.error; }
7232
+ }
7233
+ });
7234
+ }
7235
+ /**
7236
+ * Get the regions and skus that are available for RI purchase for the specified Azure subscription.
7237
+ * @param subscriptionId Id of the subscription
7238
+ * @param options The options parameters.
7239
+ */
7240
+ _getCatalog(subscriptionId, options) {
6550
7241
  return this.sendOperationRequest({ subscriptionId, options }, getCatalogOperationSpec);
6551
7242
  }
6552
7243
  /**
@@ -6558,6 +7249,15 @@ class AzureReservationAPI extends coreClient__namespace.ServiceClient {
6558
7249
  getAppliedReservationList(subscriptionId, options) {
6559
7250
  return this.sendOperationRequest({ subscriptionId, options }, getAppliedReservationListOperationSpec);
6560
7251
  }
7252
+ /**
7253
+ * GetCatalogNext
7254
+ * @param subscriptionId Id of the subscription
7255
+ * @param nextLink The nextLink from the previous successful call to the GetCatalog method.
7256
+ * @param options The options parameters.
7257
+ */
7258
+ _getCatalogNext(subscriptionId, nextLink, options) {
7259
+ return this.sendOperationRequest({ subscriptionId, nextLink, options }, getCatalogNextOperationSpec);
7260
+ }
6561
7261
  }
6562
7262
  // Operation Specifications
6563
7263
  const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
@@ -6566,12 +7266,7 @@ const getCatalogOperationSpec = {
6566
7266
  httpMethod: "GET",
6567
7267
  responses: {
6568
7268
  200: {
6569
- bodyMapper: {
6570
- type: {
6571
- name: "Sequence",
6572
- element: { type: { name: "Composite", className: "Catalog" } }
6573
- }
6574
- }
7269
+ bodyMapper: CatalogsResult
6575
7270
  },
6576
7271
  default: {
6577
7272
  bodyMapper: ErrorModel
@@ -6579,11 +7274,14 @@ const getCatalogOperationSpec = {
6579
7274
  },
6580
7275
  queryParameters: [
6581
7276
  apiVersion,
7277
+ filter,
6582
7278
  reservedResourceType,
6583
7279
  location,
6584
7280
  publisherId,
6585
7281
  offerId,
6586
- planId
7282
+ planId,
7283
+ skip,
7284
+ take1
6587
7285
  ],
6588
7286
  urlParameters: [$host, subscriptionId],
6589
7287
  headerParameters: [accept],
@@ -6605,6 +7303,26 @@ const getAppliedReservationListOperationSpec = {
6605
7303
  headerParameters: [accept],
6606
7304
  serializer
6607
7305
  };
7306
+ const getCatalogNextOperationSpec = {
7307
+ path: "{nextLink}",
7308
+ httpMethod: "GET",
7309
+ responses: {
7310
+ 200: {
7311
+ bodyMapper: CatalogsResult
7312
+ },
7313
+ default: {
7314
+ bodyMapper: ErrorModel
7315
+ }
7316
+ },
7317
+ urlParameters: [
7318
+ $host,
7319
+ nextLink,
7320
+ subscriptionId
7321
+ ],
7322
+ headerParameters: [accept],
7323
+ serializer
7324
+ };
6608
7325
 
6609
7326
  exports.AzureReservationAPI = AzureReservationAPI;
7327
+ exports.getContinuationToken = getContinuationToken;
6610
7328
  //# sourceMappingURL=index.js.map