@azure/arm-consumption 9.2.1-alpha.20250717.1 → 9.2.1-alpha.20250718.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/dist/browser/consumptionManagementClient.js +30 -5
- package/dist/browser/consumptionManagementClient.js.map +1 -1
- package/dist/browser/models/mappers.js +798 -385
- package/dist/browser/models/mappers.js.map +1 -1
- package/dist/browser/operations/aggregatedCost.js +1 -0
- package/dist/browser/operations/aggregatedCost.js.map +1 -1
- package/dist/browser/operations/balances.js +1 -0
- package/dist/browser/operations/balances.js.map +1 -1
- package/dist/browser/operations/budgets.js +23 -40
- package/dist/browser/operations/budgets.js.map +1 -1
- package/dist/browser/operations/charges.js +1 -0
- package/dist/browser/operations/charges.js.map +1 -1
- package/dist/browser/operations/credits.js +1 -0
- package/dist/browser/operations/credits.js.map +1 -1
- package/dist/browser/operations/eventsOperations.js +45 -79
- package/dist/browser/operations/eventsOperations.js.map +1 -1
- package/dist/browser/operations/lotsOperations.js +45 -79
- package/dist/browser/operations/lotsOperations.js.map +1 -1
- package/dist/browser/operations/marketplaces.js +23 -40
- package/dist/browser/operations/marketplaces.js.map +1 -1
- package/dist/browser/operations/operations.js +23 -40
- package/dist/browser/operations/operations.js.map +1 -1
- package/dist/browser/operations/priceSheet.js +1 -0
- package/dist/browser/operations/priceSheet.js.map +1 -1
- package/dist/browser/operations/reservationRecommendationDetails.js +1 -0
- package/dist/browser/operations/reservationRecommendationDetails.js.map +1 -1
- package/dist/browser/operations/reservationRecommendations.js +23 -40
- package/dist/browser/operations/reservationRecommendations.js.map +1 -1
- package/dist/browser/operations/reservationTransactions.js +45 -79
- package/dist/browser/operations/reservationTransactions.js.map +1 -1
- package/dist/browser/operations/reservationsDetails.js +67 -118
- package/dist/browser/operations/reservationsDetails.js.map +1 -1
- package/dist/browser/operations/reservationsSummaries.js +67 -118
- package/dist/browser/operations/reservationsSummaries.js.map +1 -1
- package/dist/browser/operations/tags.js +1 -0
- package/dist/browser/operations/tags.js.map +1 -1
- package/dist/browser/operations/usageDetails.js +23 -40
- package/dist/browser/operations/usageDetails.js.map +1 -1
- package/dist/browser/pagingHelper.js +2 -4
- package/dist/browser/pagingHelper.js.map +1 -1
- package/dist/commonjs/consumptionManagementClient.js +30 -5
- package/dist/commonjs/consumptionManagementClient.js.map +1 -1
- package/dist/commonjs/models/mappers.js +798 -385
- package/dist/commonjs/models/mappers.js.map +1 -1
- package/dist/commonjs/operations/aggregatedCost.js +1 -0
- package/dist/commonjs/operations/aggregatedCost.js.map +1 -1
- package/dist/commonjs/operations/balances.js +1 -0
- package/dist/commonjs/operations/balances.js.map +1 -1
- package/dist/commonjs/operations/budgets.js +23 -39
- package/dist/commonjs/operations/budgets.js.map +1 -1
- package/dist/commonjs/operations/charges.js +1 -0
- package/dist/commonjs/operations/charges.js.map +1 -1
- package/dist/commonjs/operations/credits.js +1 -0
- package/dist/commonjs/operations/credits.js.map +1 -1
- package/dist/commonjs/operations/eventsOperations.js +45 -78
- package/dist/commonjs/operations/eventsOperations.js.map +1 -1
- package/dist/commonjs/operations/lotsOperations.js +45 -78
- package/dist/commonjs/operations/lotsOperations.js.map +1 -1
- package/dist/commonjs/operations/marketplaces.js +23 -39
- package/dist/commonjs/operations/marketplaces.js.map +1 -1
- package/dist/commonjs/operations/operations.js +23 -39
- package/dist/commonjs/operations/operations.js.map +1 -1
- package/dist/commonjs/operations/priceSheet.js +1 -0
- package/dist/commonjs/operations/priceSheet.js.map +1 -1
- package/dist/commonjs/operations/reservationRecommendationDetails.js +1 -0
- package/dist/commonjs/operations/reservationRecommendationDetails.js.map +1 -1
- package/dist/commonjs/operations/reservationRecommendations.js +23 -39
- package/dist/commonjs/operations/reservationRecommendations.js.map +1 -1
- package/dist/commonjs/operations/reservationTransactions.js +45 -78
- package/dist/commonjs/operations/reservationTransactions.js.map +1 -1
- package/dist/commonjs/operations/reservationsDetails.js +67 -117
- package/dist/commonjs/operations/reservationsDetails.js.map +1 -1
- package/dist/commonjs/operations/reservationsSummaries.js +67 -117
- package/dist/commonjs/operations/reservationsSummaries.js.map +1 -1
- package/dist/commonjs/operations/tags.js +1 -0
- package/dist/commonjs/operations/tags.js.map +1 -1
- package/dist/commonjs/operations/usageDetails.js +23 -39
- package/dist/commonjs/operations/usageDetails.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/consumptionManagementClient.js +30 -5
- package/dist/esm/consumptionManagementClient.js.map +1 -1
- package/dist/esm/models/mappers.js +798 -385
- package/dist/esm/models/mappers.js.map +1 -1
- package/dist/esm/operations/aggregatedCost.js +1 -0
- package/dist/esm/operations/aggregatedCost.js.map +1 -1
- package/dist/esm/operations/balances.js +1 -0
- package/dist/esm/operations/balances.js.map +1 -1
- package/dist/esm/operations/budgets.js +23 -40
- package/dist/esm/operations/budgets.js.map +1 -1
- package/dist/esm/operations/charges.js +1 -0
- package/dist/esm/operations/charges.js.map +1 -1
- package/dist/esm/operations/credits.js +1 -0
- package/dist/esm/operations/credits.js.map +1 -1
- package/dist/esm/operations/eventsOperations.js +45 -79
- package/dist/esm/operations/eventsOperations.js.map +1 -1
- package/dist/esm/operations/lotsOperations.js +45 -79
- package/dist/esm/operations/lotsOperations.js.map +1 -1
- package/dist/esm/operations/marketplaces.js +23 -40
- package/dist/esm/operations/marketplaces.js.map +1 -1
- package/dist/esm/operations/operations.js +23 -40
- package/dist/esm/operations/operations.js.map +1 -1
- package/dist/esm/operations/priceSheet.js +1 -0
- package/dist/esm/operations/priceSheet.js.map +1 -1
- package/dist/esm/operations/reservationRecommendationDetails.js +1 -0
- package/dist/esm/operations/reservationRecommendationDetails.js.map +1 -1
- package/dist/esm/operations/reservationRecommendations.js +23 -40
- package/dist/esm/operations/reservationRecommendations.js.map +1 -1
- package/dist/esm/operations/reservationTransactions.js +45 -79
- package/dist/esm/operations/reservationTransactions.js.map +1 -1
- package/dist/esm/operations/reservationsDetails.js +67 -118
- package/dist/esm/operations/reservationsDetails.js.map +1 -1
- package/dist/esm/operations/reservationsSummaries.js +67 -118
- package/dist/esm/operations/reservationsSummaries.js.map +1 -1
- package/dist/esm/operations/tags.js +1 -0
- package/dist/esm/operations/tags.js.map +1 -1
- package/dist/esm/operations/usageDetails.js +23 -40
- package/dist/esm/operations/usageDetails.js.map +1 -1
- package/dist/esm/pagingHelper.js +2 -4
- package/dist/esm/pagingHelper.js.map +1 -1
- package/dist/react-native/consumptionManagementClient.js +30 -5
- package/dist/react-native/consumptionManagementClient.js.map +1 -1
- package/dist/react-native/models/mappers.js +798 -385
- package/dist/react-native/models/mappers.js.map +1 -1
- package/dist/react-native/operations/aggregatedCost.js +1 -0
- package/dist/react-native/operations/aggregatedCost.js.map +1 -1
- package/dist/react-native/operations/balances.js +1 -0
- package/dist/react-native/operations/balances.js.map +1 -1
- package/dist/react-native/operations/budgets.js +23 -40
- package/dist/react-native/operations/budgets.js.map +1 -1
- package/dist/react-native/operations/charges.js +1 -0
- package/dist/react-native/operations/charges.js.map +1 -1
- package/dist/react-native/operations/credits.js +1 -0
- package/dist/react-native/operations/credits.js.map +1 -1
- package/dist/react-native/operations/eventsOperations.js +45 -79
- package/dist/react-native/operations/eventsOperations.js.map +1 -1
- package/dist/react-native/operations/lotsOperations.js +45 -79
- package/dist/react-native/operations/lotsOperations.js.map +1 -1
- package/dist/react-native/operations/marketplaces.js +23 -40
- package/dist/react-native/operations/marketplaces.js.map +1 -1
- package/dist/react-native/operations/operations.js +23 -40
- package/dist/react-native/operations/operations.js.map +1 -1
- package/dist/react-native/operations/priceSheet.js +1 -0
- package/dist/react-native/operations/priceSheet.js.map +1 -1
- package/dist/react-native/operations/reservationRecommendationDetails.js +1 -0
- package/dist/react-native/operations/reservationRecommendationDetails.js.map +1 -1
- package/dist/react-native/operations/reservationRecommendations.js +23 -40
- package/dist/react-native/operations/reservationRecommendations.js.map +1 -1
- package/dist/react-native/operations/reservationTransactions.js +45 -79
- package/dist/react-native/operations/reservationTransactions.js.map +1 -1
- package/dist/react-native/operations/reservationsDetails.js +67 -118
- package/dist/react-native/operations/reservationsDetails.js.map +1 -1
- package/dist/react-native/operations/reservationsSummaries.js +67 -118
- package/dist/react-native/operations/reservationsSummaries.js.map +1 -1
- package/dist/react-native/operations/tags.js +1 -0
- package/dist/react-native/operations/tags.js.map +1 -1
- package/dist/react-native/operations/usageDetails.js +23 -40
- package/dist/react-native/operations/usageDetails.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-consumption-node.api.md +1559 -1559
|
@@ -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 { setContinuationToken } from "../pagingHelper.js";
|
|
10
9
|
import * as coreClient from "@azure/core-client";
|
|
11
10
|
import * as Mappers from "../models/mappers.js";
|
|
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
13
12
|
/// <reference lib="esnext.asynciterable" />
|
|
14
13
|
/** Class containing UsageDetails operations. */
|
|
15
14
|
export class UsageDetailsImpl {
|
|
15
|
+
client;
|
|
16
16
|
/**
|
|
17
17
|
* Initialize a new instance of the class UsageDetails class.
|
|
18
18
|
* @param client Reference to the service client
|
|
@@ -54,52 +54,35 @@ export class UsageDetailsImpl {
|
|
|
54
54
|
return this;
|
|
55
55
|
},
|
|
56
56
|
byPage: (settings) => {
|
|
57
|
-
if (settings
|
|
57
|
+
if (settings?.maxPageSize) {
|
|
58
58
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
59
59
|
}
|
|
60
60
|
return this.listPagingPage(scope, options, settings);
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
listPagingPage(scope, options, settings) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
});
|
|
64
|
+
async *listPagingPage(scope, options, settings) {
|
|
65
|
+
let result;
|
|
66
|
+
let continuationToken = settings?.continuationToken;
|
|
67
|
+
if (!continuationToken) {
|
|
68
|
+
result = await this._list(scope, options);
|
|
69
|
+
let page = result.value || [];
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
setContinuationToken(page, continuationToken);
|
|
72
|
+
yield page;
|
|
73
|
+
}
|
|
74
|
+
while (continuationToken) {
|
|
75
|
+
result = await this._listNext(scope, continuationToken, options);
|
|
76
|
+
continuationToken = result.nextLink;
|
|
77
|
+
let page = result.value || [];
|
|
78
|
+
setContinuationToken(page, continuationToken);
|
|
79
|
+
yield page;
|
|
80
|
+
}
|
|
83
81
|
}
|
|
84
|
-
listPagingAll(scope, options) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
for (var _d = true, _e = __asyncValues(this.listPagingPage(scope, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
89
|
-
_c = _f.value;
|
|
90
|
-
_d = false;
|
|
91
|
-
const page = _c;
|
|
92
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
96
|
-
finally {
|
|
97
|
-
try {
|
|
98
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
99
|
-
}
|
|
100
|
-
finally { if (e_1) throw e_1.error; }
|
|
101
|
-
}
|
|
102
|
-
});
|
|
82
|
+
async *listPagingAll(scope, options) {
|
|
83
|
+
for await (const page of this.listPagingPage(scope, options)) {
|
|
84
|
+
yield* page;
|
|
85
|
+
}
|
|
103
86
|
}
|
|
104
87
|
/**
|
|
105
88
|
* Lists the usage details for the defined scope. Usage details are available via this API only for May
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usageDetails.js","sourceRoot":"","sources":["../../../src/operations/usageDetails.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,OAAO,gBAAgB;IAG3B;;;OAGG;IACH,YAAY,MAAmC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,IAAI,CACT,KAAa,EACb,OAAwC;QAExC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,cA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,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;IACxE,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 { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { UsageDetails } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { ConsumptionManagementClient } from \"../consumptionManagementClient.js\";\nimport {\n UsageDetailUnion,\n UsageDetailsListNextOptionalParams,\n UsageDetailsListOptionalParams,\n UsageDetailsListResponse,\n UsageDetailsListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing UsageDetails operations. */\nexport class UsageDetailsImpl implements UsageDetails {\n private readonly client: ConsumptionManagementClient;\n\n /**\n * Initialize a new instance of the class UsageDetails class.\n * @param client Reference to the service client\n */\n constructor(client: ConsumptionManagementClient) {\n this.client = client;\n }\n\n /**\n * Lists the usage details for the defined scope. Usage details are available via this API only for May\n * 1, 2014 or later.\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): PagedAsyncIterableIterator<UsageDetailUnion> {\n const iter = this.listPagingAll(scope, 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.listPagingPage(scope, options, settings);\n }\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: UsageDetailsListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<UsageDetailUnion[]> {\n let result: UsageDetailsListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, 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._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): AsyncIterableIterator<UsageDetailUnion> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the usage details for the defined scope. Usage details are available via this API only for May\n * 1, 2014 or later.\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): Promise<UsageDetailsListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec\n );\n }\n\n /**\n * ListNext\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: UsageDetailsListNextOptionalParams\n ): Promise<UsageDetailsListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Consumption/usageDetails\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageDetailsListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.expand,\n Parameters.filter,\n Parameters.skiptoken,\n Parameters.top,\n Parameters.apiVersion,\n Parameters.metric\n ],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageDetailsListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
1
|
+
{"version":3,"file":"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U,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,uDAAuD;IAC7D,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sBAAsB;SAC3C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,MAAM;QACjB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,MAAM;KAClB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,sBAAsB;SAC3C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;IACxE,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 { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { UsageDetails } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { ConsumptionManagementClient } from \"../consumptionManagementClient.js\";\nimport {\n UsageDetailUnion,\n UsageDetailsListNextOptionalParams,\n UsageDetailsListOptionalParams,\n UsageDetailsListResponse,\n UsageDetailsListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing UsageDetails operations. */\nexport class UsageDetailsImpl implements UsageDetails {\n private readonly client: ConsumptionManagementClient;\n\n /**\n * Initialize a new instance of the class UsageDetails class.\n * @param client Reference to the service client\n */\n constructor(client: ConsumptionManagementClient) {\n this.client = client;\n }\n\n /**\n * Lists the usage details for the defined scope. Usage details are available via this API only for May\n * 1, 2014 or later.\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): PagedAsyncIterableIterator<UsageDetailUnion> {\n const iter = this.listPagingAll(scope, 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.listPagingPage(scope, options, settings);\n }\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: UsageDetailsListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<UsageDetailUnion[]> {\n let result: UsageDetailsListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, 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._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): AsyncIterableIterator<UsageDetailUnion> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Lists the usage details for the defined scope. Usage details are available via this API only for May\n * 1, 2014 or later.\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: UsageDetailsListOptionalParams\n ): Promise<UsageDetailsListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec\n );\n }\n\n /**\n * ListNext\n * @param scope The scope associated with usage details operations. This includes\n * '/subscriptions/{subscriptionId}/' for subscription scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope,\n * '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope,\n * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n * and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group\n * scope. For subscription, billing account, department, enrollment account and management group, you\n * can also add billing period to the scope using\n * '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing\n * period at department scope use\n * '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'.\n * Also, Modern Commerce Account scopes are\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope,\n * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'\n * for billingProfile scope,\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}'\n * for invoiceSection scope, and\n * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for\n * partners.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: UsageDetailsListNextOptionalParams\n ): Promise<UsageDetailsListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Consumption/usageDetails\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageDetailsListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.expand,\n Parameters.filter,\n Parameters.skiptoken,\n Parameters.top,\n Parameters.apiVersion,\n Parameters.metric\n ],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsageDetailsListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -14,18 +14,16 @@ const pageMap = new WeakMap();
|
|
|
14
14
|
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
15
15
|
*/
|
|
16
16
|
export function getContinuationToken(page) {
|
|
17
|
-
var _a;
|
|
18
17
|
if (typeof page !== "object" || page === null) {
|
|
19
18
|
return undefined;
|
|
20
19
|
}
|
|
21
|
-
return
|
|
20
|
+
return pageMap.get(page)?.continuationToken;
|
|
22
21
|
}
|
|
23
22
|
export function setContinuationToken(page, continuationToken) {
|
|
24
|
-
var _a;
|
|
25
23
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
|
-
const pageInfo =
|
|
26
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
29
27
|
pageInfo.continuationToken = continuationToken;
|
|
30
28
|
pageMap.set(page, pageInfo);
|
|
31
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa
|
|
1
|
+
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAa,EACb,iBAAqC;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,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\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(\n page: unknown,\n continuationToken: string | undefined\n): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
|
|
@@ -13,6 +13,9 @@ const coreClient = tslib_1.__importStar(require("@azure/core-client"));
|
|
|
13
13
|
const coreRestPipeline = tslib_1.__importStar(require("@azure/core-rest-pipeline"));
|
|
14
14
|
const index_js_1 = require("./operations/index.js");
|
|
15
15
|
class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
16
|
+
$host;
|
|
17
|
+
apiVersion;
|
|
18
|
+
subscriptionId;
|
|
16
19
|
/**
|
|
17
20
|
* Initializes a new instance of the ConsumptionManagementClient class.
|
|
18
21
|
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
@@ -20,7 +23,6 @@ class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
|
20
23
|
* @param options The parameter options
|
|
21
24
|
*/
|
|
22
25
|
constructor(credentials, subscriptionId, options) {
|
|
23
|
-
var _a, _b, _c;
|
|
24
26
|
if (credentials === undefined) {
|
|
25
27
|
throw new Error("'credentials' cannot be null");
|
|
26
28
|
}
|
|
@@ -39,12 +41,17 @@ class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
|
39
41
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
40
42
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
41
43
|
: `${packageDetails}`;
|
|
42
|
-
const optionsWithDefaults =
|
|
44
|
+
const optionsWithDefaults = {
|
|
45
|
+
...defaults,
|
|
46
|
+
...options,
|
|
47
|
+
userAgentOptions: {
|
|
43
48
|
userAgentPrefix
|
|
44
|
-
},
|
|
49
|
+
},
|
|
50
|
+
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
51
|
+
};
|
|
45
52
|
super(optionsWithDefaults);
|
|
46
53
|
let bearerTokenAuthenticationPolicyFound = false;
|
|
47
|
-
if (
|
|
54
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
48
55
|
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
49
56
|
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
50
57
|
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
@@ -58,7 +65,8 @@ class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
|
58
65
|
});
|
|
59
66
|
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
60
67
|
credential: credentials,
|
|
61
|
-
scopes:
|
|
68
|
+
scopes: optionsWithDefaults.credentialScopes ??
|
|
69
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
62
70
|
challengeCallbacks: {
|
|
63
71
|
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
64
72
|
}
|
|
@@ -113,6 +121,23 @@ class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
|
113
121
|
};
|
|
114
122
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
115
123
|
}
|
|
124
|
+
usageDetails;
|
|
125
|
+
marketplaces;
|
|
126
|
+
budgets;
|
|
127
|
+
tags;
|
|
128
|
+
charges;
|
|
129
|
+
balances;
|
|
130
|
+
reservationsSummaries;
|
|
131
|
+
reservationsDetails;
|
|
132
|
+
reservationRecommendations;
|
|
133
|
+
reservationRecommendationDetails;
|
|
134
|
+
reservationTransactions;
|
|
135
|
+
priceSheet;
|
|
136
|
+
operations;
|
|
137
|
+
aggregatedCost;
|
|
138
|
+
eventsOperations;
|
|
139
|
+
lotsOperations;
|
|
140
|
+
credits;
|
|
116
141
|
}
|
|
117
142
|
exports.ConsumptionManagementClient = ConsumptionManagementClient;
|
|
118
143
|
//# sourceMappingURL=consumptionManagementClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumptionManagementClient.js","sourceRoot":"","sources":["../../src/consumptionManagementClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAO9D,oDAkB+B;AAsB/B,MAAa,2BAA4B,SAAQ,UAAU,CAAC,aAAa;IAKvE;;;;;OAKG;IACH,YACE,WAAqC,EACrC,cAAsB,EACtB,OAAmD;;QAEnD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA8C;YAC1D,kBAAkB,EAAE,iCAAiC;YACrD,UAAU,EAAE,WAAW;SACxB,CAAC;QAEF,MAAM,cAAc,GAAG,gCAAgC,CAAC;QACxD,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,MAAM,mBAAmB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AC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAmBF;AAzJD,kEAyJC","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 {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport {\n UsageDetailsImpl,\n MarketplacesImpl,\n BudgetsImpl,\n TagsImpl,\n ChargesImpl,\n BalancesImpl,\n ReservationsSummariesImpl,\n ReservationsDetailsImpl,\n ReservationRecommendationsImpl,\n ReservationRecommendationDetailsImpl,\n ReservationTransactionsImpl,\n PriceSheetImpl,\n OperationsImpl,\n AggregatedCostImpl,\n EventsOperationsImpl,\n LotsOperationsImpl,\n CreditsImpl\n} from \"./operations/index.js\";\nimport {\n UsageDetails,\n Marketplaces,\n Budgets,\n Tags,\n Charges,\n Balances,\n ReservationsSummaries,\n ReservationsDetails,\n ReservationRecommendations,\n ReservationRecommendationDetails,\n ReservationTransactions,\n PriceSheet,\n Operations,\n AggregatedCost,\n EventsOperations,\n LotsOperations,\n Credits\n} from \"./operationsInterfaces/index.js\";\nimport { ConsumptionManagementClientOptionalParams } from \"./models/index.js\";\n\nexport class ConsumptionManagementClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the ConsumptionManagementClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId Azure Subscription ID.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: ConsumptionManagementClientOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConsumptionManagementClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-consumption/9.2.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 // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n this.usageDetails = new UsageDetailsImpl(this);\n this.marketplaces = new MarketplacesImpl(this);\n this.budgets = new BudgetsImpl(this);\n this.tags = new TagsImpl(this);\n this.charges = new ChargesImpl(this);\n this.balances = new BalancesImpl(this);\n this.reservationsSummaries = new ReservationsSummariesImpl(this);\n this.reservationsDetails = new ReservationsDetailsImpl(this);\n this.reservationRecommendations = new ReservationRecommendationsImpl(this);\n this.reservationRecommendationDetails = new ReservationRecommendationDetailsImpl(\n this\n );\n this.reservationTransactions = new ReservationTransactionsImpl(this);\n this.priceSheet = new PriceSheetImpl(this);\n this.operations = new OperationsImpl(this);\n this.aggregatedCost = new AggregatedCostImpl(this);\n this.eventsOperations = new EventsOperationsImpl(this);\n this.lotsOperations = new LotsOperationsImpl(this);\n this.credits = new CreditsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n usageDetails: UsageDetails;\n marketplaces: Marketplaces;\n budgets: Budgets;\n tags: Tags;\n charges: Charges;\n balances: Balances;\n reservationsSummaries: ReservationsSummaries;\n reservationsDetails: ReservationsDetails;\n reservationRecommendations: ReservationRecommendations;\n reservationRecommendationDetails: ReservationRecommendationDetails;\n reservationTransactions: ReservationTransactions;\n priceSheet: PriceSheet;\n operations: Operations;\n aggregatedCost: AggregatedCost;\n eventsOperations: EventsOperations;\n lotsOperations: LotsOperations;\n credits: Credits;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"consumptionManagementClient.js","sourceRoot":"","sources":["../../src/consumptionManagementClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAO9D,oDAkB+B;AAsB/B,MAAa,2BAA4B,SAAQ,UAAU,CAAC,aAAa;IACvE,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,cAAc,CAAS;I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C,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAe;IAC3B,YAAY,CAAe;IAC3B,OAAO,CAAU;IACjB,IAAI,CAAO;IACX,OAAO,CAAU;IACjB,QAAQ,CAAW;IACnB,qBAAqB,CAAwB;IAC7C,mBAAmB,CAAsB;IACzC,0BAA0B,CAA6B;IACvD,gCAAgC,CAAmC;IACnE,uBAAuB,CAA0B;IACjD,UAAU,CAAa;IACvB,UAAU,CAAa;IACvB,cAAc,CAAiB;IAC/B,gBAAgB,CAAmB;IACnC,cAAc,CAAiB;IAC/B,OAAO,CAAU;CAClB;AAzJD,kEAyJC","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 {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport {\n UsageDetailsImpl,\n MarketplacesImpl,\n BudgetsImpl,\n TagsImpl,\n ChargesImpl,\n BalancesImpl,\n ReservationsSummariesImpl,\n ReservationsDetailsImpl,\n ReservationRecommendationsImpl,\n ReservationRecommendationDetailsImpl,\n ReservationTransactionsImpl,\n PriceSheetImpl,\n OperationsImpl,\n AggregatedCostImpl,\n EventsOperationsImpl,\n LotsOperationsImpl,\n CreditsImpl\n} from \"./operations/index.js\";\nimport {\n UsageDetails,\n Marketplaces,\n Budgets,\n Tags,\n Charges,\n Balances,\n ReservationsSummaries,\n ReservationsDetails,\n ReservationRecommendations,\n ReservationRecommendationDetails,\n ReservationTransactions,\n PriceSheet,\n Operations,\n AggregatedCost,\n EventsOperations,\n LotsOperations,\n Credits\n} from \"./operationsInterfaces/index.js\";\nimport { ConsumptionManagementClientOptionalParams } from \"./models/index.js\";\n\nexport class ConsumptionManagementClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the ConsumptionManagementClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId Azure Subscription ID.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: ConsumptionManagementClientOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ConsumptionManagementClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-consumption/9.2.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 // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2021-10-01\";\n this.usageDetails = new UsageDetailsImpl(this);\n this.marketplaces = new MarketplacesImpl(this);\n this.budgets = new BudgetsImpl(this);\n this.tags = new TagsImpl(this);\n this.charges = new ChargesImpl(this);\n this.balances = new BalancesImpl(this);\n this.reservationsSummaries = new ReservationsSummariesImpl(this);\n this.reservationsDetails = new ReservationsDetailsImpl(this);\n this.reservationRecommendations = new ReservationRecommendationsImpl(this);\n this.reservationRecommendationDetails = new ReservationRecommendationDetailsImpl(\n this\n );\n this.reservationTransactions = new ReservationTransactionsImpl(this);\n this.priceSheet = new PriceSheetImpl(this);\n this.operations = new OperationsImpl(this);\n this.aggregatedCost = new AggregatedCostImpl(this);\n this.eventsOperations = new EventsOperationsImpl(this);\n this.lotsOperations = new LotsOperationsImpl(this);\n this.credits = new CreditsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n usageDetails: UsageDetails;\n marketplaces: Marketplaces;\n budgets: Budgets;\n tags: Tags;\n charges: Charges;\n balances: Balances;\n reservationsSummaries: ReservationsSummaries;\n reservationsDetails: ReservationsDetails;\n reservationRecommendations: ReservationRecommendations;\n reservationRecommendationDetails: ReservationRecommendationDetails;\n reservationTransactions: ReservationTransactions;\n priceSheet: PriceSheet;\n operations: Operations;\n aggregatedCost: AggregatedCost;\n eventsOperations: EventsOperations;\n lotsOperations: LotsOperations;\n credits: Credits;\n}\n"]}
|