@azure/arm-consumption 9.2.2-alpha.20260302.1 → 9.2.2-alpha.20260303.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/commonjs/consumptionManagementClient.js +153 -139
- package/dist/commonjs/consumptionManagementClient.js.map +7 -1
- package/dist/commonjs/index.js +28 -19
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/models/index.js +171 -235
- package/dist/commonjs/models/index.js.map +7 -1
- package/dist/commonjs/models/mappers.js +4279 -4197
- package/dist/commonjs/models/mappers.js.map +7 -1
- package/dist/commonjs/models/parameters.js +378 -335
- package/dist/commonjs/models/parameters.js.map +7 -1
- package/dist/commonjs/operations/aggregatedCost.js +103 -76
- package/dist/commonjs/operations/aggregatedCost.js.map +7 -1
- package/dist/commonjs/operations/balances.js +103 -76
- package/dist/commonjs/operations/balances.js.map +7 -1
- package/dist/commonjs/operations/budgets.js +292 -257
- package/dist/commonjs/operations/budgets.js.map +7 -1
- package/dist/commonjs/operations/charges.js +93 -69
- package/dist/commonjs/operations/charges.js.map +7 -1
- package/dist/commonjs/operations/credits.js +78 -54
- package/dist/commonjs/operations/credits.js.map +7 -1
- package/dist/commonjs/operations/eventsOperations.js +296 -223
- package/dist/commonjs/operations/eventsOperations.js.map +7 -1
- package/dist/commonjs/operations/index.js +33 -28
- package/dist/commonjs/operations/index.js.map +7 -1
- package/dist/commonjs/operations/lotsOperations.js +284 -219
- package/dist/commonjs/operations/lotsOperations.js.map +7 -1
- package/dist/commonjs/operations/marketplaces.js +175 -149
- package/dist/commonjs/operations/marketplaces.js.map +7 -1
- package/dist/commonjs/operations/operations.js +132 -109
- package/dist/commonjs/operations/operations.js.map +7 -1
- package/dist/commonjs/operations/priceSheet.js +108 -84
- package/dist/commonjs/operations/priceSheet.js.map +7 -1
- package/dist/commonjs/operations/reservationRecommendationDetails.js +89 -65
- package/dist/commonjs/operations/reservationRecommendationDetails.js.map +7 -1
- package/dist/commonjs/operations/reservationRecommendations.js +155 -129
- package/dist/commonjs/operations/reservationRecommendations.js.map +7 -1
- package/dist/commonjs/operations/reservationTransactions.js +269 -211
- package/dist/commonjs/operations/reservationTransactions.js.map +7 -1
- package/dist/commonjs/operations/reservationsDetails.js +407 -322
- package/dist/commonjs/operations/reservationsDetails.js.map +7 -1
- package/dist/commonjs/operations/reservationsSummaries.js +406 -321
- package/dist/commonjs/operations/reservationsSummaries.js.map +7 -1
- package/dist/commonjs/operations/tags.js +81 -57
- package/dist/commonjs/operations/tags.js.map +7 -1
- package/dist/commonjs/operations/usageDetails.js +201 -175
- package/dist/commonjs/operations/usageDetails.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/aggregatedCost.js +15 -10
- package/dist/commonjs/operationsInterfaces/aggregatedCost.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/balances.js +15 -10
- package/dist/commonjs/operationsInterfaces/balances.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/budgets.js +15 -10
- package/dist/commonjs/operationsInterfaces/budgets.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/charges.js +15 -10
- package/dist/commonjs/operationsInterfaces/charges.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/credits.js +15 -10
- package/dist/commonjs/operationsInterfaces/credits.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/eventsOperations.js +15 -10
- package/dist/commonjs/operationsInterfaces/eventsOperations.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/index.js +33 -28
- package/dist/commonjs/operationsInterfaces/index.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/lotsOperations.js +15 -10
- package/dist/commonjs/operationsInterfaces/lotsOperations.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/marketplaces.js +15 -10
- package/dist/commonjs/operationsInterfaces/marketplaces.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/operations.js +15 -10
- package/dist/commonjs/operationsInterfaces/operations.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/priceSheet.js +15 -10
- package/dist/commonjs/operationsInterfaces/priceSheet.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/reservationRecommendationDetails.js +15 -10
- package/dist/commonjs/operationsInterfaces/reservationRecommendationDetails.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/reservationRecommendations.js +15 -10
- package/dist/commonjs/operationsInterfaces/reservationRecommendations.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/reservationTransactions.js +15 -10
- package/dist/commonjs/operationsInterfaces/reservationTransactions.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/reservationsDetails.js +15 -10
- package/dist/commonjs/operationsInterfaces/reservationsDetails.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/reservationsSummaries.js +15 -10
- package/dist/commonjs/operationsInterfaces/reservationsSummaries.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/tags.js +15 -10
- package/dist/commonjs/operationsInterfaces/tags.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/usageDetails.js +15 -10
- package/dist/commonjs/operationsInterfaces/usageDetails.js.map +7 -1
- package/dist/commonjs/pagingHelper.js +34 -30
- package/dist/commonjs/pagingHelper.js.map +7 -1
- package/dist/esm/consumptionManagementClient.js +141 -133
- package/dist/esm/consumptionManagementClient.js.map +7 -1
- package/dist/esm/index.js +6 -11
- package/dist/esm/index.js.map +7 -1
- package/dist/esm/models/index.js +152 -232
- package/dist/esm/models/index.js.map +7 -1
- package/dist/esm/models/mappers.js +4261 -4194
- package/dist/esm/models/mappers.js.map +7 -1
- package/dist/esm/models/parameters.js +358 -331
- package/dist/esm/models/parameters.js.map +7 -1
- package/dist/esm/operations/aggregatedCost.js +72 -69
- package/dist/esm/operations/aggregatedCost.js.map +7 -1
- package/dist/esm/operations/balances.js +72 -69
- package/dist/esm/operations/balances.js.map +7 -1
- package/dist/esm/operations/budgets.js +260 -249
- package/dist/esm/operations/budgets.js.map +7 -1
- package/dist/esm/operations/charges.js +62 -62
- package/dist/esm/operations/charges.js.map +7 -1
- package/dist/esm/operations/credits.js +47 -47
- package/dist/esm/operations/credits.js.map +7 -1
- package/dist/esm/operations/eventsOperations.js +264 -215
- package/dist/esm/operations/eventsOperations.js.map +7 -1
- package/dist/esm/operations/index.js +0 -8
- package/dist/esm/operations/index.js.map +7 -1
- package/dist/esm/operations/lotsOperations.js +252 -211
- package/dist/esm/operations/lotsOperations.js.map +7 -1
- package/dist/esm/operations/marketplaces.js +143 -141
- package/dist/esm/operations/marketplaces.js.map +7 -1
- package/dist/esm/operations/operations.js +100 -101
- package/dist/esm/operations/operations.js.map +7 -1
- package/dist/esm/operations/priceSheet.js +77 -77
- package/dist/esm/operations/priceSheet.js.map +7 -1
- package/dist/esm/operations/reservationRecommendationDetails.js +58 -58
- package/dist/esm/operations/reservationRecommendationDetails.js.map +7 -1
- package/dist/esm/operations/reservationRecommendations.js +123 -121
- package/dist/esm/operations/reservationRecommendations.js.map +7 -1
- package/dist/esm/operations/reservationTransactions.js +237 -203
- package/dist/esm/operations/reservationTransactions.js.map +7 -1
- package/dist/esm/operations/reservationsDetails.js +375 -314
- package/dist/esm/operations/reservationsDetails.js.map +7 -1
- package/dist/esm/operations/reservationsSummaries.js +374 -313
- package/dist/esm/operations/reservationsSummaries.js.map +7 -1
- package/dist/esm/operations/tags.js +50 -50
- package/dist/esm/operations/tags.js.map +7 -1
- package/dist/esm/operations/usageDetails.js +169 -167
- package/dist/esm/operations/usageDetails.js.map +7 -1
- package/dist/esm/operationsInterfaces/aggregatedCost.js +0 -9
- package/dist/esm/operationsInterfaces/aggregatedCost.js.map +7 -1
- package/dist/esm/operationsInterfaces/balances.js +0 -9
- package/dist/esm/operationsInterfaces/balances.js.map +7 -1
- package/dist/esm/operationsInterfaces/budgets.js +0 -9
- package/dist/esm/operationsInterfaces/budgets.js.map +7 -1
- package/dist/esm/operationsInterfaces/charges.js +0 -9
- package/dist/esm/operationsInterfaces/charges.js.map +7 -1
- package/dist/esm/operationsInterfaces/credits.js +0 -9
- package/dist/esm/operationsInterfaces/credits.js.map +7 -1
- package/dist/esm/operationsInterfaces/eventsOperations.js +0 -9
- package/dist/esm/operationsInterfaces/eventsOperations.js.map +7 -1
- package/dist/esm/operationsInterfaces/index.js +0 -8
- package/dist/esm/operationsInterfaces/index.js.map +7 -1
- package/dist/esm/operationsInterfaces/lotsOperations.js +0 -9
- package/dist/esm/operationsInterfaces/lotsOperations.js.map +7 -1
- package/dist/esm/operationsInterfaces/marketplaces.js +0 -9
- package/dist/esm/operationsInterfaces/marketplaces.js.map +7 -1
- package/dist/esm/operationsInterfaces/operations.js +0 -9
- package/dist/esm/operationsInterfaces/operations.js.map +7 -1
- package/dist/esm/operationsInterfaces/priceSheet.js +0 -9
- package/dist/esm/operationsInterfaces/priceSheet.js.map +7 -1
- package/dist/esm/operationsInterfaces/reservationRecommendationDetails.js +0 -9
- package/dist/esm/operationsInterfaces/reservationRecommendationDetails.js.map +7 -1
- package/dist/esm/operationsInterfaces/reservationRecommendations.js +0 -9
- package/dist/esm/operationsInterfaces/reservationRecommendations.js.map +7 -1
- package/dist/esm/operationsInterfaces/reservationTransactions.js +0 -9
- package/dist/esm/operationsInterfaces/reservationTransactions.js.map +7 -1
- package/dist/esm/operationsInterfaces/reservationsDetails.js +0 -9
- package/dist/esm/operationsInterfaces/reservationsDetails.js.map +7 -1
- package/dist/esm/operationsInterfaces/reservationsSummaries.js +0 -9
- package/dist/esm/operationsInterfaces/reservationsSummaries.js.map +7 -1
- package/dist/esm/operationsInterfaces/tags.js +0 -9
- package/dist/esm/operationsInterfaces/tags.js.map +7 -1
- package/dist/esm/operationsInterfaces/usageDetails.js +0 -9
- package/dist/esm/operationsInterfaces/usageDetails.js.map +7 -1
- package/dist/esm/pagingHelper.js +17 -28
- package/dist/esm/pagingHelper.js.map +7 -1
- package/package.json +3 -20
|
@@ -1,143 +1,157 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var consumptionManagementClient_exports = {};
|
|
29
|
+
__export(consumptionManagementClient_exports, {
|
|
30
|
+
ConsumptionManagementClient: () => ConsumptionManagementClient
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(consumptionManagementClient_exports);
|
|
33
|
+
var coreClient = __toESM(require("@azure/core-client"));
|
|
34
|
+
var coreRestPipeline = __toESM(require("@azure/core-rest-pipeline"));
|
|
35
|
+
var import_operations = require("./operations/index.js");
|
|
15
36
|
class ConsumptionManagementClient extends coreClient.ServiceClient {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
if (subscriptionId === undefined) {
|
|
30
|
-
throw new Error("'subscriptionId' cannot be null");
|
|
31
|
-
}
|
|
32
|
-
// Initializing default values for options
|
|
33
|
-
if (!options) {
|
|
34
|
-
options = {};
|
|
35
|
-
}
|
|
36
|
-
const defaults = {
|
|
37
|
-
requestContentType: "application/json; charset=utf-8",
|
|
38
|
-
credential: credentials
|
|
39
|
-
};
|
|
40
|
-
const packageDetails = `azsdk-js-arm-consumption/9.2.2`;
|
|
41
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
42
|
-
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
43
|
-
: `${packageDetails}`;
|
|
44
|
-
const optionsWithDefaults = {
|
|
45
|
-
...defaults,
|
|
46
|
-
...options,
|
|
47
|
-
userAgentOptions: {
|
|
48
|
-
userAgentPrefix
|
|
49
|
-
},
|
|
50
|
-
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
51
|
-
};
|
|
52
|
-
super(optionsWithDefaults);
|
|
53
|
-
let bearerTokenAuthenticationPolicyFound = false;
|
|
54
|
-
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
55
|
-
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
56
|
-
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
57
|
-
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
58
|
-
}
|
|
59
|
-
if (!options ||
|
|
60
|
-
!options.pipeline ||
|
|
61
|
-
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
62
|
-
!bearerTokenAuthenticationPolicyFound) {
|
|
63
|
-
this.pipeline.removePolicy({
|
|
64
|
-
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
65
|
-
});
|
|
66
|
-
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
67
|
-
credential: credentials,
|
|
68
|
-
scopes: optionsWithDefaults.credentialScopes ??
|
|
69
|
-
`${optionsWithDefaults.endpoint}/.default`,
|
|
70
|
-
challengeCallbacks: {
|
|
71
|
-
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
// Parameter assignments
|
|
76
|
-
this.subscriptionId = subscriptionId;
|
|
77
|
-
// Assigning values to Constant parameters
|
|
78
|
-
this.$host = options.$host || "https://management.azure.com";
|
|
79
|
-
this.apiVersion = options.apiVersion || "2021-10-01";
|
|
80
|
-
this.usageDetails = new index_js_1.UsageDetailsImpl(this);
|
|
81
|
-
this.marketplaces = new index_js_1.MarketplacesImpl(this);
|
|
82
|
-
this.budgets = new index_js_1.BudgetsImpl(this);
|
|
83
|
-
this.tags = new index_js_1.TagsImpl(this);
|
|
84
|
-
this.charges = new index_js_1.ChargesImpl(this);
|
|
85
|
-
this.balances = new index_js_1.BalancesImpl(this);
|
|
86
|
-
this.reservationsSummaries = new index_js_1.ReservationsSummariesImpl(this);
|
|
87
|
-
this.reservationsDetails = new index_js_1.ReservationsDetailsImpl(this);
|
|
88
|
-
this.reservationRecommendations = new index_js_1.ReservationRecommendationsImpl(this);
|
|
89
|
-
this.reservationRecommendationDetails = new index_js_1.ReservationRecommendationDetailsImpl(this);
|
|
90
|
-
this.reservationTransactions = new index_js_1.ReservationTransactionsImpl(this);
|
|
91
|
-
this.priceSheet = new index_js_1.PriceSheetImpl(this);
|
|
92
|
-
this.operations = new index_js_1.OperationsImpl(this);
|
|
93
|
-
this.aggregatedCost = new index_js_1.AggregatedCostImpl(this);
|
|
94
|
-
this.eventsOperations = new index_js_1.EventsOperationsImpl(this);
|
|
95
|
-
this.lotsOperations = new index_js_1.LotsOperationsImpl(this);
|
|
96
|
-
this.credits = new index_js_1.CreditsImpl(this);
|
|
97
|
-
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
37
|
+
$host;
|
|
38
|
+
apiVersion;
|
|
39
|
+
subscriptionId;
|
|
40
|
+
/**
|
|
41
|
+
* Initializes a new instance of the ConsumptionManagementClient class.
|
|
42
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
43
|
+
* @param subscriptionId Azure Subscription ID.
|
|
44
|
+
* @param options The parameter options
|
|
45
|
+
*/
|
|
46
|
+
constructor(credentials, subscriptionId, options) {
|
|
47
|
+
if (credentials === void 0) {
|
|
48
|
+
throw new Error("'credentials' cannot be null");
|
|
98
49
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (!apiVersion) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const apiVersionPolicy = {
|
|
105
|
-
name: "CustomApiVersionPolicy",
|
|
106
|
-
async sendRequest(request, next) {
|
|
107
|
-
const param = request.url.split("?");
|
|
108
|
-
if (param.length > 1) {
|
|
109
|
-
const newParams = param[1].split("&").map((item) => {
|
|
110
|
-
if (item.indexOf("api-version") > -1) {
|
|
111
|
-
return "api-version=" + apiVersion;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return item;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
request.url = param[0] + "?" + newParams.join("&");
|
|
118
|
-
}
|
|
119
|
-
return next(request);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
this.pipeline.addPolicy(apiVersionPolicy);
|
|
50
|
+
if (subscriptionId === void 0) {
|
|
51
|
+
throw new Error("'subscriptionId' cannot be null");
|
|
123
52
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
53
|
+
if (!options) {
|
|
54
|
+
options = {};
|
|
55
|
+
}
|
|
56
|
+
const defaults = {
|
|
57
|
+
requestContentType: "application/json; charset=utf-8",
|
|
58
|
+
credential: credentials
|
|
59
|
+
};
|
|
60
|
+
const packageDetails = `azsdk-js-arm-consumption/9.2.2`;
|
|
61
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
|
|
62
|
+
const optionsWithDefaults = {
|
|
63
|
+
...defaults,
|
|
64
|
+
...options,
|
|
65
|
+
userAgentOptions: {
|
|
66
|
+
userAgentPrefix
|
|
67
|
+
},
|
|
68
|
+
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
69
|
+
};
|
|
70
|
+
super(optionsWithDefaults);
|
|
71
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
72
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
73
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
74
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
75
|
+
(pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (!options || !options.pipeline || options.pipeline.getOrderedPolicies().length == 0 || !bearerTokenAuthenticationPolicyFound) {
|
|
79
|
+
this.pipeline.removePolicy({
|
|
80
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
81
|
+
});
|
|
82
|
+
this.pipeline.addPolicy(
|
|
83
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
84
|
+
credential: credentials,
|
|
85
|
+
scopes: optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,
|
|
86
|
+
challengeCallbacks: {
|
|
87
|
+
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
this.subscriptionId = subscriptionId;
|
|
93
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
94
|
+
this.apiVersion = options.apiVersion || "2021-10-01";
|
|
95
|
+
this.usageDetails = new import_operations.UsageDetailsImpl(this);
|
|
96
|
+
this.marketplaces = new import_operations.MarketplacesImpl(this);
|
|
97
|
+
this.budgets = new import_operations.BudgetsImpl(this);
|
|
98
|
+
this.tags = new import_operations.TagsImpl(this);
|
|
99
|
+
this.charges = new import_operations.ChargesImpl(this);
|
|
100
|
+
this.balances = new import_operations.BalancesImpl(this);
|
|
101
|
+
this.reservationsSummaries = new import_operations.ReservationsSummariesImpl(this);
|
|
102
|
+
this.reservationsDetails = new import_operations.ReservationsDetailsImpl(this);
|
|
103
|
+
this.reservationRecommendations = new import_operations.ReservationRecommendationsImpl(this);
|
|
104
|
+
this.reservationRecommendationDetails = new import_operations.ReservationRecommendationDetailsImpl(
|
|
105
|
+
this
|
|
106
|
+
);
|
|
107
|
+
this.reservationTransactions = new import_operations.ReservationTransactionsImpl(this);
|
|
108
|
+
this.priceSheet = new import_operations.PriceSheetImpl(this);
|
|
109
|
+
this.operations = new import_operations.OperationsImpl(this);
|
|
110
|
+
this.aggregatedCost = new import_operations.AggregatedCostImpl(this);
|
|
111
|
+
this.eventsOperations = new import_operations.EventsOperationsImpl(this);
|
|
112
|
+
this.lotsOperations = new import_operations.LotsOperationsImpl(this);
|
|
113
|
+
this.credits = new import_operations.CreditsImpl(this);
|
|
114
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
115
|
+
}
|
|
116
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
117
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
118
|
+
if (!apiVersion) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const apiVersionPolicy = {
|
|
122
|
+
name: "CustomApiVersionPolicy",
|
|
123
|
+
async sendRequest(request, next) {
|
|
124
|
+
const param = request.url.split("?");
|
|
125
|
+
if (param.length > 1) {
|
|
126
|
+
const newParams = param[1].split("&").map((item) => {
|
|
127
|
+
if (item.indexOf("api-version") > -1) {
|
|
128
|
+
return "api-version=" + apiVersion;
|
|
129
|
+
} else {
|
|
130
|
+
return item;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
134
|
+
}
|
|
135
|
+
return next(request);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
139
|
+
}
|
|
140
|
+
usageDetails;
|
|
141
|
+
marketplaces;
|
|
142
|
+
budgets;
|
|
143
|
+
tags;
|
|
144
|
+
charges;
|
|
145
|
+
balances;
|
|
146
|
+
reservationsSummaries;
|
|
147
|
+
reservationsDetails;
|
|
148
|
+
reservationRecommendations;
|
|
149
|
+
reservationRecommendationDetails;
|
|
150
|
+
reservationTransactions;
|
|
151
|
+
priceSheet;
|
|
152
|
+
operations;
|
|
153
|
+
aggregatedCost;
|
|
154
|
+
eventsOperations;
|
|
155
|
+
lotsOperations;
|
|
156
|
+
credits;
|
|
141
157
|
}
|
|
142
|
-
exports.ConsumptionManagementClient = ConsumptionManagementClient;
|
|
143
|
-
//# sourceMappingURL=consumptionManagementClient.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"file":"consumptionManagementClient.js","sourceRoot":"","sources":["../../src/consumptionManagementClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;A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G,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;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.2`;\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
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts"],
|
|
4
|
+
"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.2`;\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,iBAA4B;AAC5B,uBAAkC;AAOlC,wBAkBO;AAsBA,MAAM,oCAAoC,WAAW,cAAc;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YACE,aACA,gBACA,SACA;AACA,QAAI,gBAAgB,QAAW;AAC7B,YAAM,IAAI,MAAM,8BAA8B;AAAA,IAChD;AACA,QAAI,mBAAmB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AC1C;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var src_exports = {};
|
|
20
|
+
__export(src_exports, {
|
|
21
|
+
ConsumptionManagementClient: () => import_consumptionManagementClient.ConsumptionManagementClient,
|
|
22
|
+
getContinuationToken: () => import_pagingHelper.getContinuationToken
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(src_exports);
|
|
25
|
+
var import_pagingHelper = require("./pagingHelper.js");
|
|
26
|
+
__reExport(src_exports, require("./models/index.js"), module.exports);
|
|
27
|
+
var import_consumptionManagementClient = require("./consumptionManagementClient.js");
|
|
28
|
+
__reExport(src_exports, require("./operationsInterfaces/index.js"), module.exports);
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/consumption/arm-consumption/src/index.ts"],
|
|
4
|
+
"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\n/// <reference lib=\"esnext.asynciterable\" />\nexport { getContinuationToken } from \"./pagingHelper.js\";\nexport * from \"./models/index.js\";\nexport { ConsumptionManagementClient } from \"./consumptionManagementClient.js\";\nexport * from \"./operationsInterfaces/index.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,0BAAqC;AACrC,wBAAc,8BAVd;AAWA,yCAA4C;AAC5C,wBAAc,4CAZd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|