@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
@@ -91,7 +91,7 @@ export const reservationId: OperationURLParameter = {
91
91
  export const apiVersion: OperationQueryParameter = {
92
92
  parameterPath: "apiVersion",
93
93
  mapper: {
94
- defaultValue: "2022-03-01",
94
+ defaultValue: "2022-11-01",
95
95
  isConstant: true,
96
96
  serializedName: "api-version",
97
97
  type: {
@@ -113,7 +113,7 @@ export const body2: OperationParameter = {
113
113
  export const expand: OperationQueryParameter = {
114
114
  parameterPath: ["options", "expand"],
115
115
  mapper: {
116
- serializedName: "expand",
116
+ serializedName: "$expand",
117
117
  type: {
118
118
  name: "String"
119
119
  }
@@ -258,21 +258,31 @@ export const planId: OperationQueryParameter = {
258
258
  }
259
259
  };
260
260
 
261
- export const body3: OperationParameter = {
262
- parameterPath: "body",
263
- mapper: PurchaseRequestMapper
261
+ export const skip: OperationQueryParameter = {
262
+ parameterPath: ["options", "skip"],
263
+ mapper: {
264
+ serializedName: "$skip",
265
+ type: {
266
+ name: "Number"
267
+ }
268
+ }
264
269
  };
265
270
 
266
- export const expand1: OperationQueryParameter = {
267
- parameterPath: ["options", "expand"],
271
+ export const take1: OperationQueryParameter = {
272
+ parameterPath: ["options", "take"],
268
273
  mapper: {
269
- serializedName: "$expand",
274
+ serializedName: "$take",
270
275
  type: {
271
- name: "String"
276
+ name: "Number"
272
277
  }
273
278
  }
274
279
  };
275
280
 
281
+ export const body3: OperationParameter = {
282
+ parameterPath: "body",
283
+ mapper: PurchaseRequestMapper
284
+ };
285
+
276
286
  export const body4: OperationParameter = {
277
287
  parameterPath: "body",
278
288
  mapper: ChangeDirectoryRequestMapper
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operation } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class OperationImpl implements Operation {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationListOptionalParams
62
+ options?: OperationListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<OperationResponse[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
130
143
  bodyMapper: Mappers.ErrorModel
131
144
  }
132
145
  },
133
- queryParameters: [Parameters.apiVersion],
134
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
135
147
  headerParameters: [Parameters.accept],
136
148
  serializer
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Quota } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,13 +19,13 @@ import {
18
19
  CurrentQuotaLimitBase,
19
20
  QuotaListNextOptionalParams,
20
21
  QuotaListOptionalParams,
22
+ QuotaListResponse,
21
23
  QuotaGetOptionalParams,
22
24
  QuotaGetResponse,
23
25
  QuotaCreateOrUpdateOptionalParams,
24
26
  QuotaCreateOrUpdateResponse,
25
27
  QuotaUpdateOptionalParams,
26
28
  QuotaUpdateResponse,
27
- QuotaListResponse,
28
29
  QuotaListNextResponse
29
30
  } from "../models";
30
31
 
@@ -68,12 +69,16 @@ export class QuotaImpl implements Quota {
68
69
  [Symbol.asyncIterator]() {
69
70
  return this;
70
71
  },
71
- byPage: () => {
72
+ byPage: (settings?: PageSettings) => {
73
+ if (settings?.maxPageSize) {
74
+ throw new Error("maxPageSize is not supported by this operation.");
75
+ }
72
76
  return this.listPagingPage(
73
77
  subscriptionId,
74
78
  providerId,
75
79
  location,
76
- options
80
+ options,
81
+ settings
77
82
  );
78
83
  }
79
84
  };
@@ -83,16 +88,18 @@ export class QuotaImpl implements Quota {
83
88
  subscriptionId: string,
84
89
  providerId: string,
85
90
  location: string,
86
- options?: QuotaListOptionalParams
91
+ options?: QuotaListOptionalParams,
92
+ settings?: PageSettings
87
93
  ): AsyncIterableIterator<CurrentQuotaLimitBase[]> {
88
- let result = await this._list(
89
- subscriptionId,
90
- providerId,
91
- location,
92
- options
93
- );
94
- yield result.value || [];
95
- let continuationToken = result.nextLink;
94
+ let result: QuotaListResponse;
95
+ let continuationToken = settings?.continuationToken;
96
+ if (!continuationToken) {
97
+ result = await this._list(subscriptionId, providerId, location, options);
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
96
103
  while (continuationToken) {
97
104
  result = await this._listNext(
98
105
  subscriptionId,
@@ -102,7 +109,9 @@ export class QuotaImpl implements Quota {
102
109
  options
103
110
  );
104
111
  continuationToken = result.nextLink;
105
- yield result.value || [];
112
+ let page = result.value || [];
113
+ setContinuationToken(page, continuationToken);
114
+ yield page;
106
115
  }
107
116
  }
108
117
 
@@ -559,7 +568,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
559
568
  bodyMapper: Mappers.ExceptionResponse
560
569
  }
561
570
  },
562
- queryParameters: [Parameters.apiVersion1],
563
571
  urlParameters: [
564
572
  Parameters.$host,
565
573
  Parameters.nextLink,
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { QuotaRequestStatus } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -16,9 +17,9 @@ import {
16
17
  QuotaRequestDetails,
17
18
  QuotaRequestStatusListNextOptionalParams,
18
19
  QuotaRequestStatusListOptionalParams,
20
+ QuotaRequestStatusListResponse,
19
21
  QuotaRequestStatusGetOptionalParams,
20
22
  QuotaRequestStatusGetResponse,
21
- QuotaRequestStatusListResponse,
22
23
  QuotaRequestStatusListNextResponse
23
24
  } from "../models";
24
25
 
@@ -62,12 +63,16 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
66
70
  return this.listPagingPage(
67
71
  subscriptionId,
68
72
  providerId,
69
73
  location,
70
- options
74
+ options,
75
+ settings
71
76
  );
72
77
  }
73
78
  };
@@ -77,16 +82,18 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus {
77
82
  subscriptionId: string,
78
83
  providerId: string,
79
84
  location: string,
80
- options?: QuotaRequestStatusListOptionalParams
85
+ options?: QuotaRequestStatusListOptionalParams,
86
+ settings?: PageSettings
81
87
  ): AsyncIterableIterator<QuotaRequestDetails[]> {
82
- let result = await this._list(
83
- subscriptionId,
84
- providerId,
85
- location,
86
- options
87
- );
88
- yield result.value || [];
89
- let continuationToken = result.nextLink;
88
+ let result: QuotaRequestStatusListResponse;
89
+ let continuationToken = settings?.continuationToken;
90
+ if (!continuationToken) {
91
+ result = await this._list(subscriptionId, providerId, location, options);
92
+ let page = result.value || [];
93
+ continuationToken = result.nextLink;
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
96
+ }
90
97
  while (continuationToken) {
91
98
  result = await this._listNext(
92
99
  subscriptionId,
@@ -96,7 +103,9 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus {
96
103
  options
97
104
  );
98
105
  continuationToken = result.nextLink;
99
- yield result.value || [];
106
+ let page = result.value || [];
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
100
109
  }
101
110
  }
102
111
 
@@ -244,12 +253,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
244
253
  bodyMapper: Mappers.ExceptionResponse
245
254
  }
246
255
  },
247
- queryParameters: [
248
- Parameters.filter,
249
- Parameters.apiVersion1,
250
- Parameters.top,
251
- Parameters.skiptoken1
252
- ],
253
256
  urlParameters: [
254
257
  Parameters.$host,
255
258
  Parameters.nextLink,