@azure/arm-consumption 9.0.1 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Release History
2
-
2
+
3
+ ## 9.1.0 (2022-09-05)
4
+
5
+ **Features**
6
+
7
+ - Added Interface AmountWithExchangeRate
8
+ - Added Interface Balance
9
+ - Added Interface Budget
10
+ - Added Interface ChargeSummary
11
+ - Added Interface CreditSummary
12
+ - Added Interface EventSummary
13
+ - Added Interface LegacyChargeSummary
14
+ - Added Interface LegacyReservationRecommendation
15
+ - Added Interface LegacyReservationTransaction
16
+ - Added Interface LegacySharedScopeReservationRecommendationProperties
17
+ - Added Interface LegacySingleScopeReservationRecommendationProperties
18
+ - Added Interface LegacyUsageDetail
19
+ - Added Interface LotSummary
20
+ - Added Interface ManagementGroupAggregatedCostResult
21
+ - Added Interface Marketplace
22
+ - Added Interface ModernChargeSummary
23
+ - Added Interface ModernReservationRecommendation
24
+ - Added Interface ModernReservationTransaction
25
+ - Added Interface ModernUsageDetail
26
+ - Added Interface PriceSheetResult
27
+ - Added Interface ReservationDetail
28
+ - Added Interface ReservationRecommendation
29
+ - Added Interface ReservationRecommendationDetailsModel
30
+ - Added Interface ReservationSummary
31
+ - Added Interface ReservationTransaction
32
+ - Added Interface TagsResult
33
+ - Added Interface UsageDetail
34
+
3
35
  ## 9.0.1 (2022-04-11)
4
36
 
5
37
  **features**
package/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var coreClient = require('@azure/core-client');
6
5
  var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
7
8
 
8
9
  function _interopNamespace(e) {
9
10
  if (e && e.__esModule) return e;
@@ -24,6 +25,7 @@ function _interopNamespace(e) {
24
25
  }
25
26
 
26
27
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
27
29
 
28
30
  /*
29
31
  * Copyright (c) Microsoft Corporation.
@@ -45,78 +47,119 @@ exports.KnownMetrictype = void 0;
45
47
  /** Known values of {@link UsageDetailsKind} that the service accepts. */
46
48
  exports.KnownUsageDetailsKind = void 0;
47
49
  (function (KnownUsageDetailsKind) {
50
+ /** Legacy */
48
51
  KnownUsageDetailsKind["Legacy"] = "legacy";
52
+ /** Modern */
49
53
  KnownUsageDetailsKind["Modern"] = "modern";
50
54
  })(exports.KnownUsageDetailsKind || (exports.KnownUsageDetailsKind = {}));
51
55
  /** Known values of {@link CategoryType} that the service accepts. */
52
56
  exports.KnownCategoryType = void 0;
53
57
  (function (KnownCategoryType) {
58
+ /** Cost */
54
59
  KnownCategoryType["Cost"] = "Cost";
55
60
  })(exports.KnownCategoryType || (exports.KnownCategoryType = {}));
56
61
  /** Known values of {@link TimeGrainType} that the service accepts. */
57
62
  exports.KnownTimeGrainType = void 0;
58
63
  (function (KnownTimeGrainType) {
64
+ /** Monthly */
59
65
  KnownTimeGrainType["Monthly"] = "Monthly";
66
+ /** Quarterly */
60
67
  KnownTimeGrainType["Quarterly"] = "Quarterly";
68
+ /** Annually */
61
69
  KnownTimeGrainType["Annually"] = "Annually";
70
+ /** BillingMonth */
62
71
  KnownTimeGrainType["BillingMonth"] = "BillingMonth";
72
+ /** BillingQuarter */
63
73
  KnownTimeGrainType["BillingQuarter"] = "BillingQuarter";
74
+ /** BillingAnnual */
64
75
  KnownTimeGrainType["BillingAnnual"] = "BillingAnnual";
65
76
  })(exports.KnownTimeGrainType || (exports.KnownTimeGrainType = {}));
66
77
  /** Known values of {@link BudgetOperatorType} that the service accepts. */
67
78
  exports.KnownBudgetOperatorType = void 0;
68
79
  (function (KnownBudgetOperatorType) {
80
+ /** In */
69
81
  KnownBudgetOperatorType["In"] = "In";
70
82
  })(exports.KnownBudgetOperatorType || (exports.KnownBudgetOperatorType = {}));
71
83
  /** Known values of {@link OperatorType} that the service accepts. */
72
84
  exports.KnownOperatorType = void 0;
73
85
  (function (KnownOperatorType) {
86
+ /** EqualTo */
74
87
  KnownOperatorType["EqualTo"] = "EqualTo";
88
+ /** GreaterThan */
75
89
  KnownOperatorType["GreaterThan"] = "GreaterThan";
90
+ /** GreaterThanOrEqualTo */
76
91
  KnownOperatorType["GreaterThanOrEqualTo"] = "GreaterThanOrEqualTo";
77
92
  })(exports.KnownOperatorType || (exports.KnownOperatorType = {}));
78
93
  /** Known values of {@link ThresholdType} that the service accepts. */
79
94
  exports.KnownThresholdType = void 0;
80
95
  (function (KnownThresholdType) {
96
+ /** Actual */
81
97
  KnownThresholdType["Actual"] = "Actual";
98
+ /** Forecasted */
82
99
  KnownThresholdType["Forecasted"] = "Forecasted";
83
100
  })(exports.KnownThresholdType || (exports.KnownThresholdType = {}));
84
101
  /** Known values of {@link CultureCode} that the service accepts. */
85
102
  exports.KnownCultureCode = void 0;
86
103
  (function (KnownCultureCode) {
104
+ /** EnUs */
87
105
  KnownCultureCode["EnUs"] = "en-us";
106
+ /** JaJp */
88
107
  KnownCultureCode["JaJp"] = "ja-jp";
108
+ /** ZhCn */
89
109
  KnownCultureCode["ZhCn"] = "zh-cn";
110
+ /** DeDe */
90
111
  KnownCultureCode["DeDe"] = "de-de";
112
+ /** EsEs */
91
113
  KnownCultureCode["EsEs"] = "es-es";
114
+ /** FrFr */
92
115
  KnownCultureCode["FrFr"] = "fr-fr";
116
+ /** ItIt */
93
117
  KnownCultureCode["ItIt"] = "it-it";
118
+ /** KoKr */
94
119
  KnownCultureCode["KoKr"] = "ko-kr";
120
+ /** PtBr */
95
121
  KnownCultureCode["PtBr"] = "pt-br";
122
+ /** RuRu */
96
123
  KnownCultureCode["RuRu"] = "ru-ru";
124
+ /** ZhTw */
97
125
  KnownCultureCode["ZhTw"] = "zh-tw";
126
+ /** CsCz */
98
127
  KnownCultureCode["CsCz"] = "cs-cz";
128
+ /** PlPl */
99
129
  KnownCultureCode["PlPl"] = "pl-pl";
130
+ /** TrTr */
100
131
  KnownCultureCode["TrTr"] = "tr-tr";
132
+ /** DaDk */
101
133
  KnownCultureCode["DaDk"] = "da-dk";
134
+ /** EnGb */
102
135
  KnownCultureCode["EnGb"] = "en-gb";
136
+ /** HuHu */
103
137
  KnownCultureCode["HuHu"] = "hu-hu";
138
+ /** NbNo */
104
139
  KnownCultureCode["NbNo"] = "nb-no";
140
+ /** NlNl */
105
141
  KnownCultureCode["NlNl"] = "nl-nl";
142
+ /** PtPt */
106
143
  KnownCultureCode["PtPt"] = "pt-pt";
144
+ /** SvSe */
107
145
  KnownCultureCode["SvSe"] = "sv-se";
108
146
  })(exports.KnownCultureCode || (exports.KnownCultureCode = {}));
109
147
  /** Known values of {@link ChargeSummaryKind} that the service accepts. */
110
148
  exports.KnownChargeSummaryKind = void 0;
111
149
  (function (KnownChargeSummaryKind) {
150
+ /** Legacy */
112
151
  KnownChargeSummaryKind["Legacy"] = "legacy";
152
+ /** Modern */
113
153
  KnownChargeSummaryKind["Modern"] = "modern";
114
154
  })(exports.KnownChargeSummaryKind || (exports.KnownChargeSummaryKind = {}));
115
155
  /** Known values of {@link BillingFrequency} that the service accepts. */
116
156
  exports.KnownBillingFrequency = void 0;
117
157
  (function (KnownBillingFrequency) {
158
+ /** Month */
118
159
  KnownBillingFrequency["Month"] = "Month";
160
+ /** Quarter */
119
161
  KnownBillingFrequency["Quarter"] = "Quarter";
162
+ /** Year */
120
163
  KnownBillingFrequency["Year"] = "Year";
121
164
  })(exports.KnownBillingFrequency || (exports.KnownBillingFrequency = {}));
122
165
  /** Known values of {@link Datagrain} that the service accepts. */
@@ -130,7 +173,9 @@ exports.KnownDatagrain = void 0;
130
173
  /** Known values of {@link ReservationRecommendationKind} that the service accepts. */
131
174
  exports.KnownReservationRecommendationKind = void 0;
132
175
  (function (KnownReservationRecommendationKind) {
176
+ /** Legacy */
133
177
  KnownReservationRecommendationKind["Legacy"] = "legacy";
178
+ /** Modern */
134
179
  KnownReservationRecommendationKind["Modern"] = "modern";
135
180
  })(exports.KnownReservationRecommendationKind || (exports.KnownReservationRecommendationKind = {}));
136
181
  /** Known values of {@link Term} that the service accepts. */
@@ -154,42 +199,63 @@ exports.KnownLookBackPeriod = void 0;
154
199
  /** Known values of {@link EventType} that the service accepts. */
155
200
  exports.KnownEventType = void 0;
156
201
  (function (KnownEventType) {
202
+ /** SettledCharges */
157
203
  KnownEventType["SettledCharges"] = "SettledCharges";
204
+ /** PendingCharges */
158
205
  KnownEventType["PendingCharges"] = "PendingCharges";
206
+ /** PendingAdjustments */
159
207
  KnownEventType["PendingAdjustments"] = "PendingAdjustments";
208
+ /** PendingNewCredit */
160
209
  KnownEventType["PendingNewCredit"] = "PendingNewCredit";
210
+ /** PendingExpiredCredit */
161
211
  KnownEventType["PendingExpiredCredit"] = "PendingExpiredCredit";
212
+ /** UnKnown */
162
213
  KnownEventType["UnKnown"] = "UnKnown";
214
+ /** NewCredit */
163
215
  KnownEventType["NewCredit"] = "NewCredit";
164
216
  })(exports.KnownEventType || (exports.KnownEventType = {}));
165
217
  /** Known values of {@link LotSource} that the service accepts. */
166
218
  exports.KnownLotSource = void 0;
167
219
  (function (KnownLotSource) {
220
+ /** PurchasedCredit */
168
221
  KnownLotSource["PurchasedCredit"] = "PurchasedCredit";
222
+ /** PromotionalCredit */
169
223
  KnownLotSource["PromotionalCredit"] = "PromotionalCredit";
224
+ /** ConsumptionCommitment */
170
225
  KnownLotSource["ConsumptionCommitment"] = "ConsumptionCommitment";
171
226
  })(exports.KnownLotSource || (exports.KnownLotSource = {}));
172
227
  /** Known values of {@link Status} that the service accepts. */
173
228
  exports.KnownStatus = void 0;
174
229
  (function (KnownStatus) {
230
+ /** None */
175
231
  KnownStatus["None"] = "None";
232
+ /** Active */
176
233
  KnownStatus["Active"] = "Active";
234
+ /** Inactive */
177
235
  KnownStatus["Inactive"] = "Inactive";
236
+ /** Expired */
178
237
  KnownStatus["Expired"] = "Expired";
238
+ /** Complete */
179
239
  KnownStatus["Complete"] = "Complete";
240
+ /** Canceled */
180
241
  KnownStatus["Canceled"] = "Canceled";
181
242
  })(exports.KnownStatus || (exports.KnownStatus = {}));
182
243
  /** Known values of {@link PricingModelType} that the service accepts. */
183
244
  exports.KnownPricingModelType = void 0;
184
245
  (function (KnownPricingModelType) {
246
+ /** OnDemand */
185
247
  KnownPricingModelType["OnDemand"] = "On Demand";
248
+ /** Reservation */
186
249
  KnownPricingModelType["Reservation"] = "Reservation";
250
+ /** Spot */
187
251
  KnownPricingModelType["Spot"] = "Spot";
188
252
  })(exports.KnownPricingModelType || (exports.KnownPricingModelType = {}));
189
253
  /** Known values of {@link Scope} that the service accepts. */
190
254
  exports.KnownScope = void 0;
191
255
  (function (KnownScope) {
256
+ /** Single */
192
257
  KnownScope["Single"] = "Single";
258
+ /** Shared */
193
259
  KnownScope["Shared"] = "Shared";
194
260
  })(exports.KnownScope || (exports.KnownScope = {}));
195
261
 
@@ -3127,8 +3193,8 @@ const LegacyUsageDetail = {
3127
3193
  type: {
3128
3194
  name: "Composite",
3129
3195
  className: "LegacyUsageDetail",
3130
- uberParent: "Resource",
3131
- polymorphicDiscriminator: Resource.type.polymorphicDiscriminator,
3196
+ uberParent: "UsageDetail",
3197
+ polymorphicDiscriminator: UsageDetail.type.polymorphicDiscriminator,
3132
3198
  modelProperties: Object.assign(Object.assign({}, UsageDetail.type.modelProperties), { billingAccountId: {
3133
3199
  serializedName: "properties.billingAccountId",
3134
3200
  readOnly: true,
@@ -3401,8 +3467,8 @@ const ModernUsageDetail = {
3401
3467
  type: {
3402
3468
  name: "Composite",
3403
3469
  className: "ModernUsageDetail",
3404
- uberParent: "Resource",
3405
- polymorphicDiscriminator: Resource.type.polymorphicDiscriminator,
3470
+ uberParent: "UsageDetail",
3471
+ polymorphicDiscriminator: UsageDetail.type.polymorphicDiscriminator,
3406
3472
  modelProperties: Object.assign(Object.assign({}, UsageDetail.type.modelProperties), { billingAccountId: {
3407
3473
  serializedName: "properties.billingAccountId",
3408
3474
  readOnly: true,
@@ -3843,8 +3909,8 @@ const LegacyReservationRecommendation = {
3843
3909
  type: {
3844
3910
  name: "Composite",
3845
3911
  className: "LegacyReservationRecommendation",
3846
- uberParent: "Resource",
3847
- polymorphicDiscriminator: Resource.type.polymorphicDiscriminator,
3912
+ uberParent: "ReservationRecommendation",
3913
+ polymorphicDiscriminator: ReservationRecommendation.type.polymorphicDiscriminator,
3848
3914
  modelProperties: Object.assign(Object.assign({}, ReservationRecommendation.type.modelProperties), { lookBackPeriod: {
3849
3915
  serializedName: "properties.lookBackPeriod",
3850
3916
  readOnly: true,
@@ -3949,8 +4015,8 @@ const ModernReservationRecommendation = {
3949
4015
  type: {
3950
4016
  name: "Composite",
3951
4017
  className: "ModernReservationRecommendation",
3952
- uberParent: "Resource",
3953
- polymorphicDiscriminator: Resource.type.polymorphicDiscriminator,
4018
+ uberParent: "ReservationRecommendation",
4019
+ polymorphicDiscriminator: ReservationRecommendation.type.polymorphicDiscriminator,
3954
4020
  modelProperties: Object.assign(Object.assign({}, ReservationRecommendation.type.modelProperties), { locationPropertiesLocation: {
3955
4021
  serializedName: "properties.location",
3956
4022
  readOnly: true,
@@ -4061,8 +4127,8 @@ const LegacyChargeSummary = {
4061
4127
  type: {
4062
4128
  name: "Composite",
4063
4129
  className: "LegacyChargeSummary",
4064
- uberParent: "ProxyResource",
4065
- polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator,
4130
+ uberParent: "ChargeSummary",
4131
+ polymorphicDiscriminator: ChargeSummary.type.polymorphicDiscriminator,
4066
4132
  modelProperties: Object.assign(Object.assign({}, ChargeSummary.type.modelProperties), { billingPeriodId: {
4067
4133
  serializedName: "properties.billingPeriodId",
4068
4134
  readOnly: true,
@@ -4113,8 +4179,8 @@ const ModernChargeSummary = {
4113
4179
  type: {
4114
4180
  name: "Composite",
4115
4181
  className: "ModernChargeSummary",
4116
- uberParent: "ProxyResource",
4117
- polymorphicDiscriminator: ProxyResource.type.polymorphicDiscriminator,
4182
+ uberParent: "ChargeSummary",
4183
+ polymorphicDiscriminator: ChargeSummary.type.polymorphicDiscriminator,
4118
4184
  modelProperties: Object.assign(Object.assign({}, ChargeSummary.type.modelProperties), { billingPeriodId: {
4119
4185
  serializedName: "properties.billingPeriodId",
4120
4186
  readOnly: true,
@@ -4198,10 +4264,12 @@ let discriminators = {
4198
4264
  "ProxyResource.ChargeSummary": ChargeSummary,
4199
4265
  "LegacyReservationRecommendationProperties.Single": LegacySingleScopeReservationRecommendationProperties,
4200
4266
  "LegacyReservationRecommendationProperties.Shared": LegacySharedScopeReservationRecommendationProperties,
4201
- "Resource.legacy": LegacyReservationRecommendation,
4202
- "Resource.modern": ModernReservationRecommendation,
4203
- "ProxyResource.legacy": LegacyChargeSummary,
4204
- "ProxyResource.modern": ModernChargeSummary
4267
+ "UsageDetail.legacy": LegacyUsageDetail,
4268
+ "UsageDetail.modern": ModernUsageDetail,
4269
+ "ReservationRecommendation.legacy": LegacyReservationRecommendation,
4270
+ "ReservationRecommendation.modern": ModernReservationRecommendation,
4271
+ "ChargeSummary.legacy": LegacyChargeSummary,
4272
+ "ChargeSummary.modern": ModernChargeSummary
4205
4273
  };
4206
4274
 
4207
4275
  var Mappers = /*#__PURE__*/Object.freeze({
@@ -7450,7 +7518,7 @@ class ConsumptionManagementClient extends coreClient__namespace.ServiceClient {
7450
7518
  requestContentType: "application/json; charset=utf-8",
7451
7519
  credential: credentials
7452
7520
  };
7453
- const packageDetails = `azsdk-js-arm-consumption/9.0.1`;
7521
+ const packageDetails = `azsdk-js-arm-consumption/9.1.0`;
7454
7522
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
7455
7523
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
7456
7524
  : `${packageDetails}`;
@@ -7461,6 +7529,27 @@ class ConsumptionManagementClient extends coreClient__namespace.ServiceClient {
7461
7529
  userAgentPrefix
7462
7530
  }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
7463
7531
  super(optionsWithDefaults);
7532
+ let bearerTokenAuthenticationPolicyFound = false;
7533
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
7534
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
7535
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
7536
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
7537
+ }
7538
+ if (!options ||
7539
+ !options.pipeline ||
7540
+ options.pipeline.getOrderedPolicies().length == 0 ||
7541
+ !bearerTokenAuthenticationPolicyFound) {
7542
+ this.pipeline.removePolicy({
7543
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
7544
+ });
7545
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
7546
+ credential: credentials,
7547
+ scopes: `${optionsWithDefaults.credentialScopes}`,
7548
+ challengeCallbacks: {
7549
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
7550
+ }
7551
+ }));
7552
+ }
7464
7553
  // Parameter assignments
7465
7554
  this.subscriptionId = subscriptionId;
7466
7555
  // Assigning values to Constant parameters
@@ -7483,6 +7572,34 @@ class ConsumptionManagementClient extends coreClient__namespace.ServiceClient {
7483
7572
  this.eventsOperations = new EventsOperationsImpl(this);
7484
7573
  this.lotsOperations = new LotsOperationsImpl(this);
7485
7574
  this.credits = new CreditsImpl(this);
7575
+ this.addCustomApiVersionPolicy(options.apiVersion);
7576
+ }
7577
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
7578
+ addCustomApiVersionPolicy(apiVersion) {
7579
+ if (!apiVersion) {
7580
+ return;
7581
+ }
7582
+ const apiVersionPolicy = {
7583
+ name: "CustomApiVersionPolicy",
7584
+ sendRequest(request, next) {
7585
+ return tslib.__awaiter(this, void 0, void 0, function* () {
7586
+ const param = request.url.split("?");
7587
+ if (param.length > 1) {
7588
+ const newParams = param[1].split("&").map((item) => {
7589
+ if (item.indexOf("api-version") > -1) {
7590
+ return "api-version=" + apiVersion;
7591
+ }
7592
+ else {
7593
+ return item;
7594
+ }
7595
+ });
7596
+ request.url = param[0] + "?" + newParams.join("&");
7597
+ }
7598
+ return next(request);
7599
+ });
7600
+ }
7601
+ };
7602
+ this.pipeline.addPolicy(apiVersionPolicy);
7486
7603
  }
7487
7604
  }
7488
7605