@azure/arm-reservations 9.0.1-alpha.20250718.1 → 9.0.1-alpha.20250721.1
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/dist/browser/azureReservationAPI.js +42 -45
- package/dist/browser/azureReservationAPI.js.map +1 -1
- package/dist/browser/lroImpl.js +7 -3
- package/dist/browser/lroImpl.js.map +1 -1
- package/dist/browser/models/mappers.js +21 -9
- package/dist/browser/models/mappers.js.map +1 -1
- package/dist/browser/operations/calculateExchange.js +12 -6
- package/dist/browser/operations/calculateExchange.js.map +1 -1
- package/dist/browser/operations/calculateRefund.js +1 -0
- package/dist/browser/operations/calculateRefund.js.map +1 -1
- package/dist/browser/operations/exchange.js +12 -6
- package/dist/browser/operations/exchange.js.map +1 -1
- package/dist/browser/operations/operation.js +23 -40
- package/dist/browser/operations/operation.js.map +1 -1
- package/dist/browser/operations/quota.js +45 -52
- package/dist/browser/operations/quota.js.map +1 -1
- package/dist/browser/operations/quotaRequestStatus.js +23 -40
- package/dist/browser/operations/quotaRequestStatus.js.map +1 -1
- package/dist/browser/operations/reservation.js +111 -142
- package/dist/browser/operations/reservation.js.map +1 -1
- package/dist/browser/operations/reservationOrder.js +34 -46
- package/dist/browser/operations/reservationOrder.js.map +1 -1
- package/dist/browser/operations/return.js +12 -6
- package/dist/browser/operations/return.js.map +1 -1
- package/dist/browser/pagingHelper.js +2 -4
- package/dist/browser/pagingHelper.js.map +1 -1
- package/dist/commonjs/azureReservationAPI.js +42 -44
- package/dist/commonjs/azureReservationAPI.js.map +1 -1
- package/dist/commonjs/lroImpl.js +7 -3
- package/dist/commonjs/lroImpl.js.map +1 -1
- package/dist/commonjs/models/mappers.js +21 -9
- package/dist/commonjs/models/mappers.js.map +1 -1
- package/dist/commonjs/operations/calculateExchange.js +12 -6
- package/dist/commonjs/operations/calculateExchange.js.map +1 -1
- package/dist/commonjs/operations/calculateRefund.js +1 -0
- package/dist/commonjs/operations/calculateRefund.js.map +1 -1
- package/dist/commonjs/operations/exchange.js +12 -6
- package/dist/commonjs/operations/exchange.js.map +1 -1
- package/dist/commonjs/operations/operation.js +23 -39
- package/dist/commonjs/operations/operation.js.map +1 -1
- package/dist/commonjs/operations/quota.js +45 -51
- package/dist/commonjs/operations/quota.js.map +1 -1
- package/dist/commonjs/operations/quotaRequestStatus.js +23 -39
- package/dist/commonjs/operations/quotaRequestStatus.js.map +1 -1
- package/dist/commonjs/operations/reservation.js +111 -141
- package/dist/commonjs/operations/reservation.js.map +1 -1
- package/dist/commonjs/operations/reservationOrder.js +34 -45
- package/dist/commonjs/operations/reservationOrder.js.map +1 -1
- package/dist/commonjs/operations/return.js +12 -6
- package/dist/commonjs/operations/return.js.map +1 -1
- package/dist/commonjs/pagingHelper.js +2 -4
- package/dist/commonjs/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/azureReservationAPI.js +42 -45
- package/dist/esm/azureReservationAPI.js.map +1 -1
- package/dist/esm/lroImpl.js +7 -3
- package/dist/esm/lroImpl.js.map +1 -1
- package/dist/esm/models/mappers.js +21 -9
- package/dist/esm/models/mappers.js.map +1 -1
- package/dist/esm/operations/calculateExchange.js +12 -6
- package/dist/esm/operations/calculateExchange.js.map +1 -1
- package/dist/esm/operations/calculateRefund.js +1 -0
- package/dist/esm/operations/calculateRefund.js.map +1 -1
- package/dist/esm/operations/exchange.js +12 -6
- package/dist/esm/operations/exchange.js.map +1 -1
- package/dist/esm/operations/operation.js +23 -40
- package/dist/esm/operations/operation.js.map +1 -1
- package/dist/esm/operations/quota.js +45 -52
- package/dist/esm/operations/quota.js.map +1 -1
- package/dist/esm/operations/quotaRequestStatus.js +23 -40
- package/dist/esm/operations/quotaRequestStatus.js.map +1 -1
- package/dist/esm/operations/reservation.js +111 -142
- package/dist/esm/operations/reservation.js.map +1 -1
- package/dist/esm/operations/reservationOrder.js +34 -46
- package/dist/esm/operations/reservationOrder.js.map +1 -1
- package/dist/esm/operations/return.js +12 -6
- package/dist/esm/operations/return.js.map +1 -1
- package/dist/esm/pagingHelper.js +2 -4
- package/dist/esm/pagingHelper.js.map +1 -1
- package/dist/react-native/azureReservationAPI.js +42 -45
- package/dist/react-native/azureReservationAPI.js.map +1 -1
- package/dist/react-native/lroImpl.js +7 -3
- package/dist/react-native/lroImpl.js.map +1 -1
- package/dist/react-native/models/mappers.js +21 -9
- package/dist/react-native/models/mappers.js.map +1 -1
- package/dist/react-native/operations/calculateExchange.js +12 -6
- package/dist/react-native/operations/calculateExchange.js.map +1 -1
- package/dist/react-native/operations/calculateRefund.js +1 -0
- package/dist/react-native/operations/calculateRefund.js.map +1 -1
- package/dist/react-native/operations/exchange.js +12 -6
- package/dist/react-native/operations/exchange.js.map +1 -1
- package/dist/react-native/operations/operation.js +23 -40
- package/dist/react-native/operations/operation.js.map +1 -1
- package/dist/react-native/operations/quota.js +45 -52
- package/dist/react-native/operations/quota.js.map +1 -1
- package/dist/react-native/operations/quotaRequestStatus.js +23 -40
- package/dist/react-native/operations/quotaRequestStatus.js.map +1 -1
- package/dist/react-native/operations/reservation.js +111 -142
- package/dist/react-native/operations/reservation.js.map +1 -1
- package/dist/react-native/operations/reservationOrder.js +34 -46
- package/dist/react-native/operations/reservationOrder.js.map +1 -1
- package/dist/react-native/operations/return.js +12 -6
- package/dist/react-native/operations/return.js.map +1 -1
- package/dist/react-native/pagingHelper.js +2 -4
- package/dist/react-native/pagingHelper.js.map +1 -1
- package/package.json +2 -2
- package/review/arm-reservations-node.api.md +1675 -1675
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
9
8
|
import * as coreClient from "@azure/core-client";
|
|
10
9
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
10
|
import { setContinuationToken } from "./pagingHelper.js";
|
|
@@ -14,13 +13,13 @@ import * as Parameters from "./models/parameters.js";
|
|
|
14
13
|
import * as Mappers from "./models/mappers.js";
|
|
15
14
|
/// <reference lib="esnext.asynciterable" />
|
|
16
15
|
export class AzureReservationAPI extends coreClient.ServiceClient {
|
|
16
|
+
$host;
|
|
17
17
|
/**
|
|
18
18
|
* Initializes a new instance of the AzureReservationAPI class.
|
|
19
19
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
20
20
|
* @param options The parameter options
|
|
21
21
|
*/
|
|
22
22
|
constructor(credentials, options) {
|
|
23
|
-
var _a, _b, _c;
|
|
24
23
|
if (credentials === undefined) {
|
|
25
24
|
throw new Error("'credentials' cannot be null");
|
|
26
25
|
}
|
|
@@ -36,12 +35,17 @@ export class AzureReservationAPI extends coreClient.ServiceClient {
|
|
|
36
35
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
37
36
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
38
37
|
: `${packageDetails}`;
|
|
39
|
-
const optionsWithDefaults =
|
|
38
|
+
const optionsWithDefaults = {
|
|
39
|
+
...defaults,
|
|
40
|
+
...options,
|
|
41
|
+
userAgentOptions: {
|
|
40
42
|
userAgentPrefix
|
|
41
|
-
},
|
|
43
|
+
},
|
|
44
|
+
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
45
|
+
};
|
|
42
46
|
super(optionsWithDefaults);
|
|
43
47
|
let bearerTokenAuthenticationPolicyFound = false;
|
|
44
|
-
if (
|
|
48
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
45
49
|
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
46
50
|
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
47
51
|
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
@@ -55,7 +59,8 @@ export class AzureReservationAPI extends coreClient.ServiceClient {
|
|
|
55
59
|
});
|
|
56
60
|
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
57
61
|
credential: credentials,
|
|
58
|
-
scopes:
|
|
62
|
+
scopes: optionsWithDefaults.credentialScopes ??
|
|
63
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
59
64
|
challengeCallbacks: {
|
|
60
65
|
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
61
66
|
}
|
|
@@ -88,52 +93,35 @@ export class AzureReservationAPI extends coreClient.ServiceClient {
|
|
|
88
93
|
return this;
|
|
89
94
|
},
|
|
90
95
|
byPage: (settings) => {
|
|
91
|
-
if (settings
|
|
96
|
+
if (settings?.maxPageSize) {
|
|
92
97
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
93
98
|
}
|
|
94
99
|
return this.getCatalogPagingPage(subscriptionId, options, settings);
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
}
|
|
98
|
-
getCatalogPagingPage(subscriptionId, options, settings) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
});
|
|
103
|
+
async *getCatalogPagingPage(subscriptionId, options, settings) {
|
|
104
|
+
let result;
|
|
105
|
+
let continuationToken = settings?.continuationToken;
|
|
106
|
+
if (!continuationToken) {
|
|
107
|
+
result = await this._getCatalog(subscriptionId, options);
|
|
108
|
+
let page = result.value || [];
|
|
109
|
+
continuationToken = result.nextLink;
|
|
110
|
+
setContinuationToken(page, continuationToken);
|
|
111
|
+
yield page;
|
|
112
|
+
}
|
|
113
|
+
while (continuationToken) {
|
|
114
|
+
result = await this._getCatalogNext(subscriptionId, continuationToken, options);
|
|
115
|
+
continuationToken = result.nextLink;
|
|
116
|
+
let page = result.value || [];
|
|
117
|
+
setContinuationToken(page, continuationToken);
|
|
118
|
+
yield page;
|
|
119
|
+
}
|
|
117
120
|
}
|
|
118
|
-
getCatalogPagingAll(subscriptionId, options) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
for (var _d = true, _e = __asyncValues(this.getCatalogPagingPage(subscriptionId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
123
|
-
_c = _f.value;
|
|
124
|
-
_d = false;
|
|
125
|
-
const page = _c;
|
|
126
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
130
|
-
finally {
|
|
131
|
-
try {
|
|
132
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_1) throw e_1.error; }
|
|
135
|
-
}
|
|
136
|
-
});
|
|
121
|
+
async *getCatalogPagingAll(subscriptionId, options) {
|
|
122
|
+
for await (const page of this.getCatalogPagingPage(subscriptionId, options)) {
|
|
123
|
+
yield* page;
|
|
124
|
+
}
|
|
137
125
|
}
|
|
138
126
|
/**
|
|
139
127
|
* Get the regions and skus that are available for RI purchase for the specified Azure subscription.
|
|
@@ -161,6 +149,15 @@ export class AzureReservationAPI extends coreClient.ServiceClient {
|
|
|
161
149
|
_getCatalogNext(subscriptionId, nextLink, options) {
|
|
162
150
|
return this.sendOperationRequest({ subscriptionId, nextLink, options }, getCatalogNextOperationSpec);
|
|
163
151
|
}
|
|
152
|
+
reservation;
|
|
153
|
+
reservationOrder;
|
|
154
|
+
operation;
|
|
155
|
+
calculateRefund;
|
|
156
|
+
return;
|
|
157
|
+
calculateExchange;
|
|
158
|
+
exchange;
|
|
159
|
+
quota;
|
|
160
|
+
quotaRequestStatus;
|
|
164
161
|
}
|
|
165
162
|
// Operation Specifications
|
|
166
163
|
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureReservationAPI.js","sourceRoot":"","sources":["../../src/azureReservationAPI.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAY/C,4CAA4C;AAC5C,MAAM,OAAO,mBAAoB,SAAQ,UAAU,CAAC,aAAa;IAG/D;;;;OAIG;IACH,YACE,WAAqC,EACrC,OAA2C;;QAE3C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAsC;YAClD,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,iCAAiC,CAAC;QACzD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,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AAkF;IACpF,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC;IAC5D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,2BAA2B,GAA6B;IAC5D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,cAAc;SACnC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,cAAc;KAC1B;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"./pagingHelper.js\";\nimport {\n ReservationImpl,\n ReservationOrderImpl,\n OperationImpl,\n CalculateRefundImpl,\n ReturnImpl,\n CalculateExchangeImpl,\n ExchangeImpl,\n QuotaImpl,\n QuotaRequestStatusImpl\n} from \"./operations/index.js\";\nimport {\n Reservation,\n ReservationOrder,\n Operation,\n CalculateRefund,\n Return,\n CalculateExchange,\n Exchange,\n Quota,\n QuotaRequestStatus\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n AzureReservationAPIOptionalParams,\n Catalog,\n GetCatalogNextOptionalParams,\n GetCatalogOptionalParams,\n GetCatalogResponse,\n GetAppliedReservationListOptionalParams,\n GetAppliedReservationListResponse,\n GetCatalogNextResponse\n} from \"./models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\nexport class AzureReservationAPI extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the AzureReservationAPI class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n options?: AzureReservationAPIOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: AzureReservationAPIOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-reservations/9.0.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://management.azure.com\"\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ??\n `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.reservation = new ReservationImpl(this);\n this.reservationOrder = new ReservationOrderImpl(this);\n this.operation = new OperationImpl(this);\n this.calculateRefund = new CalculateRefundImpl(this);\n this.return = new ReturnImpl(this);\n this.calculateExchange = new CalculateExchangeImpl(this);\n this.exchange = new ExchangeImpl(this);\n this.quota = new QuotaImpl(this);\n this.quotaRequestStatus = new QuotaRequestStatusImpl(this);\n }\n\n /**\n * Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n public listCatalog(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): PagedAsyncIterableIterator<Catalog> {\n const iter = this.getCatalogPagingAll(subscriptionId, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.getCatalogPagingPage(subscriptionId, options, settings);\n }\n };\n }\n\n private async *getCatalogPagingPage(\n subscriptionId: string,\n options?: GetCatalogOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<Catalog[]> {\n let result: GetCatalogResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getCatalog(subscriptionId, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getCatalogNext(\n subscriptionId,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getCatalogPagingAll(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): AsyncIterableIterator<Catalog> {\n for await (const page of this.getCatalogPagingPage(\n subscriptionId,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n private _getCatalog(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): Promise<GetCatalogResponse> {\n return this.sendOperationRequest(\n { subscriptionId, options },\n getCatalogOperationSpec\n );\n }\n\n /**\n * Get applicable `Reservation`s that are applied to this subscription or a resource group under this\n * subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n getAppliedReservationList(\n subscriptionId: string,\n options?: GetAppliedReservationListOptionalParams\n ): Promise<GetAppliedReservationListResponse> {\n return this.sendOperationRequest(\n { subscriptionId, options },\n getAppliedReservationListOperationSpec\n );\n }\n\n /**\n * GetCatalogNext\n * @param subscriptionId Id of the subscription\n * @param nextLink The nextLink from the previous successful call to the GetCatalog method.\n * @param options The options parameters.\n */\n private _getCatalogNext(\n subscriptionId: string,\n nextLink: string,\n options?: GetCatalogNextOptionalParams\n ): Promise<GetCatalogNextResponse> {\n return this.sendOperationRequest(\n { subscriptionId, nextLink, options },\n getCatalogNextOperationSpec\n );\n }\n\n reservation: Reservation;\n reservationOrder: ReservationOrder;\n operation: Operation;\n calculateRefund: CalculateRefund;\n return: Return;\n calculateExchange: CalculateExchange;\n exchange: Exchange;\n quota: Quota;\n quotaRequestStatus: QuotaRequestStatus;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getCatalogOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CatalogsResult\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.filter,\n Parameters.reservedResourceType,\n Parameters.location,\n Parameters.publisherId,\n Parameters.offerId,\n Parameters.planId,\n Parameters.skip,\n Parameters.take1\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAppliedReservationListOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AppliedReservations\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCatalogNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CatalogsResult\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n urlParameters: [\n Parameters.$host,\n Parameters.nextLink,\n Parameters.subscriptionId\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
1
|
+
{"version":3,"file":"azureReservationAPI.js","sourceRoot":"","sources":["../../src/azureReservationAPI.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;A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EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,cAAc;KAC1B;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"./pagingHelper.js\";\nimport {\n ReservationImpl,\n ReservationOrderImpl,\n OperationImpl,\n CalculateRefundImpl,\n ReturnImpl,\n CalculateExchangeImpl,\n ExchangeImpl,\n QuotaImpl,\n QuotaRequestStatusImpl\n} from \"./operations/index.js\";\nimport {\n Reservation,\n ReservationOrder,\n Operation,\n CalculateRefund,\n Return,\n CalculateExchange,\n Exchange,\n Quota,\n QuotaRequestStatus\n} from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n AzureReservationAPIOptionalParams,\n Catalog,\n GetCatalogNextOptionalParams,\n GetCatalogOptionalParams,\n GetCatalogResponse,\n GetAppliedReservationListOptionalParams,\n GetAppliedReservationListResponse,\n GetCatalogNextResponse\n} from \"./models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\nexport class AzureReservationAPI extends coreClient.ServiceClient {\n $host: string;\n\n /**\n * Initializes a new instance of the AzureReservationAPI class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n options?: AzureReservationAPIOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: AzureReservationAPIOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-reservations/9.0.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://management.azure.com\"\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ??\n `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.reservation = new ReservationImpl(this);\n this.reservationOrder = new ReservationOrderImpl(this);\n this.operation = new OperationImpl(this);\n this.calculateRefund = new CalculateRefundImpl(this);\n this.return = new ReturnImpl(this);\n this.calculateExchange = new CalculateExchangeImpl(this);\n this.exchange = new ExchangeImpl(this);\n this.quota = new QuotaImpl(this);\n this.quotaRequestStatus = new QuotaRequestStatusImpl(this);\n }\n\n /**\n * Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n public listCatalog(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): PagedAsyncIterableIterator<Catalog> {\n const iter = this.getCatalogPagingAll(subscriptionId, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.getCatalogPagingPage(subscriptionId, options, settings);\n }\n };\n }\n\n private async *getCatalogPagingPage(\n subscriptionId: string,\n options?: GetCatalogOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<Catalog[]> {\n let result: GetCatalogResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getCatalog(subscriptionId, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getCatalogNext(\n subscriptionId,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getCatalogPagingAll(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): AsyncIterableIterator<Catalog> {\n for await (const page of this.getCatalogPagingPage(\n subscriptionId,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * Get the regions and skus that are available for RI purchase for the specified Azure subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n private _getCatalog(\n subscriptionId: string,\n options?: GetCatalogOptionalParams\n ): Promise<GetCatalogResponse> {\n return this.sendOperationRequest(\n { subscriptionId, options },\n getCatalogOperationSpec\n );\n }\n\n /**\n * Get applicable `Reservation`s that are applied to this subscription or a resource group under this\n * subscription.\n * @param subscriptionId Id of the subscription\n * @param options The options parameters.\n */\n getAppliedReservationList(\n subscriptionId: string,\n options?: GetAppliedReservationListOptionalParams\n ): Promise<GetAppliedReservationListResponse> {\n return this.sendOperationRequest(\n { subscriptionId, options },\n getAppliedReservationListOperationSpec\n );\n }\n\n /**\n * GetCatalogNext\n * @param subscriptionId Id of the subscription\n * @param nextLink The nextLink from the previous successful call to the GetCatalog method.\n * @param options The options parameters.\n */\n private _getCatalogNext(\n subscriptionId: string,\n nextLink: string,\n options?: GetCatalogNextOptionalParams\n ): Promise<GetCatalogNextResponse> {\n return this.sendOperationRequest(\n { subscriptionId, nextLink, options },\n getCatalogNextOperationSpec\n );\n }\n\n reservation: Reservation;\n reservationOrder: ReservationOrder;\n operation: Operation;\n calculateRefund: CalculateRefund;\n return: Return;\n calculateExchange: CalculateExchange;\n exchange: Exchange;\n quota: Quota;\n quotaRequestStatus: QuotaRequestStatus;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getCatalogOperationSpec: coreClient.OperationSpec = {\n path: \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CatalogsResult\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.filter,\n Parameters.reservedResourceType,\n Parameters.location,\n Parameters.publisherId,\n Parameters.offerId,\n Parameters.planId,\n Parameters.skip,\n Parameters.take1\n ],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAppliedReservationListOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AppliedReservations\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.subscriptionId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getCatalogNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CatalogsResult\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n urlParameters: [\n Parameters.$host,\n Parameters.nextLink,\n Parameters.subscriptionId\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
package/dist/browser/lroImpl.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
export function createLroSpec(inputs) {
|
|
3
2
|
const { args, spec, sendOperationFn } = inputs;
|
|
4
3
|
return {
|
|
@@ -6,8 +5,13 @@ export function createLroSpec(inputs) {
|
|
|
6
5
|
requestPath: spec.path,
|
|
7
6
|
sendInitialRequest: () => sendOperationFn(args, spec),
|
|
8
7
|
sendPollRequest: (path, options) => {
|
|
9
|
-
const { requestBody
|
|
10
|
-
return sendOperationFn(args,
|
|
8
|
+
const { requestBody, ...restSpec } = spec;
|
|
9
|
+
return sendOperationFn(args, {
|
|
10
|
+
...restSpec,
|
|
11
|
+
httpMethod: "GET",
|
|
12
|
+
path,
|
|
13
|
+
abortSignal: options?.abortSignal
|
|
14
|
+
});
|
|
11
15
|
}
|
|
12
16
|
};
|
|
13
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lroImpl.js","sourceRoot":"","sources":["../../src/lroImpl.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,aAAa,CAAI,MAQhC;IACC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IAC/C,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,UAAU;QAC9B,WAAW,EAAE,IAAI,CAAC,IAAK;QACvB,kBAAkB,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;QACrD,eAAe,EAAE,CACf,IAAY,EACZ,OAA2C,EAC3C,EAAE;YACF,MAAM,EAAE,WAAW,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;YAC1C,OAAO,eAAe,CAAC,IAAI,EAAE;gBAC3B,GAAG,QAAQ;gBACX,UAAU,EAAE,KAAK;gBACjB,IAAI;gBACJ,WAAW,EAAE,OAAO,EAAE,WAAW;aAClC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { LongRunningOperation, LroResponse } from \"@azure/core-lro\";\n\nexport function createLroSpec<T>(inputs: {\n sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;\n args: Record<string, unknown>;\n spec: {\n readonly requestBody?: unknown;\n readonly path?: string;\n readonly httpMethod: string;\n } & Record<string, any>;\n}): LongRunningOperation<T> {\n const { args, spec, sendOperationFn } = inputs;\n return {\n requestMethod: spec.httpMethod,\n requestPath: spec.path!,\n sendInitialRequest: () => sendOperationFn(args, spec),\n sendPollRequest: (\n path: string,\n options?: { abortSignal?: AbortSignalLike }\n ) => {\n const { requestBody, ...restSpec } = spec;\n return sendOperationFn(args, {\n ...restSpec,\n httpMethod: \"GET\",\n path,\n abortSignal: options?.abortSignal\n });\n }\n };\n}\n"]}
|
|
@@ -3648,55 +3648,67 @@ export const Commitment = {
|
|
|
3648
3648
|
type: {
|
|
3649
3649
|
name: "Composite",
|
|
3650
3650
|
className: "Commitment",
|
|
3651
|
-
modelProperties:
|
|
3651
|
+
modelProperties: {
|
|
3652
|
+
...Price.type.modelProperties,
|
|
3653
|
+
grain: {
|
|
3652
3654
|
serializedName: "grain",
|
|
3653
3655
|
type: {
|
|
3654
3656
|
name: "String"
|
|
3655
3657
|
}
|
|
3656
|
-
}
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3657
3660
|
}
|
|
3658
3661
|
};
|
|
3659
3662
|
export const ProxyResource = {
|
|
3660
3663
|
type: {
|
|
3661
3664
|
name: "Composite",
|
|
3662
3665
|
className: "ProxyResource",
|
|
3663
|
-
modelProperties:
|
|
3666
|
+
modelProperties: {
|
|
3667
|
+
...Resource.type.modelProperties
|
|
3668
|
+
}
|
|
3664
3669
|
}
|
|
3665
3670
|
};
|
|
3666
3671
|
export const ReservationResponse = {
|
|
3667
3672
|
type: {
|
|
3668
3673
|
name: "Composite",
|
|
3669
3674
|
className: "ReservationResponse",
|
|
3670
|
-
modelProperties:
|
|
3675
|
+
modelProperties: {
|
|
3676
|
+
...ProxyResource.type.modelProperties,
|
|
3677
|
+
location: {
|
|
3671
3678
|
serializedName: "location",
|
|
3672
3679
|
type: {
|
|
3673
3680
|
name: "String"
|
|
3674
3681
|
}
|
|
3675
|
-
},
|
|
3682
|
+
},
|
|
3683
|
+
etag: {
|
|
3676
3684
|
serializedName: "etag",
|
|
3677
3685
|
type: {
|
|
3678
3686
|
name: "Number"
|
|
3679
3687
|
}
|
|
3680
|
-
},
|
|
3688
|
+
},
|
|
3689
|
+
sku: {
|
|
3681
3690
|
serializedName: "sku",
|
|
3682
3691
|
type: {
|
|
3683
3692
|
name: "Composite",
|
|
3684
3693
|
className: "SkuName"
|
|
3685
3694
|
}
|
|
3686
|
-
},
|
|
3695
|
+
},
|
|
3696
|
+
properties: {
|
|
3687
3697
|
serializedName: "properties",
|
|
3688
3698
|
type: {
|
|
3689
3699
|
name: "Composite",
|
|
3690
3700
|
className: "ReservationsProperties"
|
|
3691
3701
|
}
|
|
3692
|
-
},
|
|
3702
|
+
},
|
|
3703
|
+
kind: {
|
|
3693
3704
|
defaultValue: "Microsoft.Compute",
|
|
3694
3705
|
isConstant: true,
|
|
3695
3706
|
serializedName: "kind",
|
|
3696
3707
|
type: {
|
|
3697
3708
|
name: "String"
|
|
3698
3709
|
}
|
|
3699
|
-
}
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3700
3712
|
}
|
|
3701
3713
|
};
|
|
3702
3714
|
export const ReservationSplitHeaders = {
|