@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.
- package/CHANGELOG.md +71 -8
- package/LICENSE +1 -1
- package/dist/index.js +942 -224
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/calculateExchangePostSample.js +22 -2
- package/dist-esm/samples-dev/calculateExchangePostSample.js.map +1 -1
- package/dist-esm/samples-dev/calculateRefundPostSample.js +10 -3
- package/dist-esm/samples-dev/calculateRefundPostSample.js.map +1 -1
- package/dist-esm/samples-dev/exchangePostSample.js +9 -2
- package/dist-esm/samples-dev/exchangePostSample.js.map +1 -1
- package/dist-esm/samples-dev/getAppliedReservationListSample.js +9 -2
- package/dist-esm/samples-dev/getAppliedReservationListSample.js.map +1 -1
- package/dist-esm/samples-dev/getCatalogSample.js +26 -5
- package/dist-esm/samples-dev/getCatalogSample.js.map +1 -1
- package/dist-esm/samples-dev/operationListSample.js +9 -2
- package/dist-esm/samples-dev/operationListSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaCreateOrUpdateSample.js +10 -3
- package/dist-esm/samples-dev/quotaCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaGetSample.js +8 -1
- package/dist-esm/samples-dev/quotaGetSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaListSample.js +9 -2
- package/dist-esm/samples-dev/quotaListSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaRequestStatusGetSample.js +10 -3
- package/dist-esm/samples-dev/quotaRequestStatusGetSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaRequestStatusListSample.js +8 -1
- package/dist-esm/samples-dev/quotaRequestStatusListSample.js.map +1 -1
- package/dist-esm/samples-dev/quotaUpdateSample.js +8 -1
- package/dist-esm/samples-dev/quotaUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationArchiveSample.js +9 -2
- package/dist-esm/samples-dev/reservationArchiveSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationAvailableScopesSample.js +11 -4
- package/dist-esm/samples-dev/reservationAvailableScopesSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationGetSample.js +11 -4
- package/dist-esm/samples-dev/reservationGetSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationListAllSample.js +10 -3
- package/dist-esm/samples-dev/reservationListAllSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationListRevisionsSample.js +11 -4
- package/dist-esm/samples-dev/reservationListRevisionsSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationListSample.js +9 -2
- package/dist-esm/samples-dev/reservationListSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationMergeSample.js +9 -2
- package/dist-esm/samples-dev/reservationMergeSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationOrderCalculateSample.js +10 -3
- package/dist-esm/samples-dev/reservationOrderCalculateSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationOrderChangeDirectorySample.js +9 -2
- package/dist-esm/samples-dev/reservationOrderChangeDirectorySample.js.map +1 -1
- package/dist-esm/samples-dev/reservationOrderGetSample.js +12 -5
- package/dist-esm/samples-dev/reservationOrderGetSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationOrderListSample.js +9 -2
- package/dist-esm/samples-dev/reservationOrderListSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationOrderPurchaseSample.js +9 -2
- package/dist-esm/samples-dev/reservationOrderPurchaseSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationSplitSample.js +9 -2
- package/dist-esm/samples-dev/reservationSplitSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationUnarchiveSample.js +11 -4
- package/dist-esm/samples-dev/reservationUnarchiveSample.js.map +1 -1
- package/dist-esm/samples-dev/reservationUpdateSample.js +9 -2
- package/dist-esm/samples-dev/reservationUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/returnPostSample.js +14 -7
- package/dist-esm/samples-dev/returnPostSample.js.map +1 -1
- package/dist-esm/src/azureReservationAPI.d.ts +18 -2
- package/dist-esm/src/azureReservationAPI.d.ts.map +1 -1
- package/dist-esm/src/azureReservationAPI.js +101 -15
- package/dist-esm/src/azureReservationAPI.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +372 -101
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +26 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +14 -1
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +510 -70
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.d.ts +2 -1
- package/dist-esm/src/models/parameters.d.ts.map +1 -1
- package/dist-esm/src/models/parameters.js +18 -9
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/operation.d.ts.map +1 -1
- package/dist-esm/src/operations/operation.js +19 -8
- package/dist-esm/src/operations/operation.js.map +1 -1
- package/dist-esm/src/operations/quota.d.ts.map +1 -1
- package/dist-esm/src/operations/quota.js +19 -8
- package/dist-esm/src/operations/quota.js.map +1 -1
- package/dist-esm/src/operations/quotaRequestStatus.d.ts.map +1 -1
- package/dist-esm/src/operations/quotaRequestStatus.js +19 -13
- package/dist-esm/src/operations/quotaRequestStatus.js.map +1 -1
- package/dist-esm/src/operations/reservation.d.ts +17 -17
- package/dist-esm/src/operations/reservation.d.ts.map +1 -1
- package/dist-esm/src/operations/reservation.js +83 -59
- package/dist-esm/src/operations/reservation.js.map +1 -1
- package/dist-esm/src/operations/reservationOrder.d.ts.map +1 -1
- package/dist-esm/src/operations/reservationOrder.js +20 -9
- package/dist-esm/src/operations/reservationOrder.js.map +1 -1
- package/dist-esm/src/operations/return.d.ts +10 -2
- package/dist-esm/src/operations/return.d.ts.map +1 -1
- package/dist-esm/src/operations/return.js +61 -3
- package/dist-esm/src/operations/return.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/reservation.d.ts +15 -15
- package/dist-esm/src/operationsInterfaces/reservation.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/return.d.ts +10 -2
- package/dist-esm/src/operationsInterfaces/return.d.ts.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/package.json +6 -4
- package/review/arm-reservations.api.md +194 -94
- package/src/azureReservationAPI.ts +119 -15
- package/src/index.ts +1 -0
- package/src/models/index.ts +397 -107
- package/src/models/mappers.ts +536 -71
- package/src/models/parameters.ts +19 -9
- package/src/operations/operation.ts +21 -9
- package/src/operations/quota.ts +23 -15
- package/src/operations/quotaRequestStatus.ts +23 -20
- package/src/operations/reservation.ts +97 -69
- package/src/operations/reservationOrder.ts +23 -11
- package/src/operations/return.ts +82 -4
- package/src/operationsInterfaces/reservation.ts +15 -15
- package/src/operationsInterfaces/return.ts +16 -2
- package/src/pagingHelper.ts +39 -0
- package/types/arm-reservations.d.ts +432 -109
- package/types/tsdoc-metadata.json +1 -1
package/src/models/parameters.ts
CHANGED
|
@@ -91,7 +91,7 @@ export const reservationId: OperationURLParameter = {
|
|
|
91
91
|
export const apiVersion: OperationQueryParameter = {
|
|
92
92
|
parameterPath: "apiVersion",
|
|
93
93
|
mapper: {
|
|
94
|
-
defaultValue: "2022-
|
|
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
|
|
262
|
-
parameterPath: "
|
|
263
|
-
mapper:
|
|
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
|
|
267
|
-
parameterPath: ["options", "
|
|
271
|
+
export const take1: OperationQueryParameter = {
|
|
272
|
+
parameterPath: ["options", "take"],
|
|
268
273
|
mapper: {
|
|
269
|
-
serializedName: "$
|
|
274
|
+
serializedName: "$take",
|
|
270
275
|
type: {
|
|
271
|
-
name: "
|
|
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
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
package/src/operations/quota.ts
CHANGED
|
@@ -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
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
location,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
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
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
location,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
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,
|