/
index.ts
479 lines (457 loc) · 12.6 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js";
import * as msRest from "@azure/ms-rest-js";
export { BaseResource, CloudError };
/**
* @interface
* An interface representing InfoField.
* Key-value pairs of instance details in the legacy format.
*
*/
export interface InfoField {
/**
* @member {string} [project] Identifies the name of the instance provisioned
* by the user.
*/
project?: string;
}
/**
* @interface
* An interface representing UsageAggregation.
* Describes the usageAggregation.
*
*/
export interface UsageAggregation {
/**
* @member {string} [id] Unique Id for the usage aggregate.
*/
id?: string;
/**
* @member {string} [name] Name of the usage aggregate.
*/
name?: string;
/**
* @member {string} [type] Type of the resource being returned.
*/
type?: string;
/**
* @member {string} [subscriptionId] The subscription identifier for the
* Azure user.
*/
subscriptionId?: string;
/**
* @member {string} [meterId] Unique ID for the resource that was consumed
* (aka ResourceID).
*/
meterId?: string;
/**
* @member {Date} [usageStartTime] UTC start time for the usage bucket to
* which this usage aggregate belongs.
*/
usageStartTime?: Date;
/**
* @member {Date} [usageEndTime] UTC end time for the usage bucket to which
* this usage aggregate belongs.
*/
usageEndTime?: Date;
/**
* @member {number} [quantity] The amount of the resource consumption that
* occurred in this time frame.
*/
quantity?: number;
/**
* @member {string} [unit] The unit in which the usage for this resource is
* being counted, e.g. Hours, GB.
*/
unit?: string;
/**
* @member {string} [meterName] Friendly name of the resource being consumed.
*/
meterName?: string;
/**
* @member {string} [meterCategory] Category of the consumed resource.
*/
meterCategory?: string;
/**
* @member {string} [meterSubCategory] Sub-category of the consumed resource.
*/
meterSubCategory?: string;
/**
* @member {string} [meterRegion] Region of the meterId used for billing
* purposes
*/
meterRegion?: string;
/**
* @member {InfoField} [infoFields] Key-value pairs of instance details
* (legacy format).
*/
infoFields?: InfoField;
/**
* @member {string} [instanceData] Key-value pairs of instance details
* represented as a string.
*/
instanceData?: string;
}
/**
* @interface
* An interface representing RateCardQueryParameters.
* Parameters that are used in the odata $filter query parameter for providing
* RateCard information.
*
*/
export interface RateCardQueryParameters {
/**
* @member {string} offerDurableId The Offer ID parameter consists of the
* 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See
* https://azure.microsoft.com/en-us/support/legal/offer-details/ for more
* information on the list of available Offer IDs, country/region
* availability, and billing currency.
*/
offerDurableId: string;
/**
* @member {string} currency The currency in which the rates need to be
* provided.
*/
currency: string;
/**
* @member {string} locale The culture in which the resource metadata needs
* to be localized.
*/
locale: string;
/**
* @member {string} regionInfo 2 letter ISO code where the offer was
* purchased.
*/
regionInfo: string;
}
/**
* Contains the possible cases for OfferTermInfo.
*/
export type OfferTermInfoUnion = OfferTermInfo | MonetaryCredit | MonetaryCommitment | RecurringCharge;
/**
* @interface
* An interface representing OfferTermInfo.
* Describes the offer term.
*
*/
export interface OfferTermInfo {
/**
* @member {string} name Polymorphic Discriminator
*/
name: "OfferTermInfo";
/**
* @member {Date} [effectiveDate] Indicates the date from which the offer
* term is effective.
*/
effectiveDate?: Date;
}
/**
* @interface
* An interface representing MeterInfo.
* Detailed information about the meter.
*
*/
export interface MeterInfo {
/**
* @member {string} [meterId] The unique identifier of the resource.
*/
meterId?: string;
/**
* @member {string} [meterName] The name of the meter, within the given meter
* category
*/
meterName?: string;
/**
* @member {string} [meterCategory] The category of the meter, e.g., 'Cloud
* services', 'Networking', etc..
*/
meterCategory?: string;
/**
* @member {string} [meterSubCategory] The subcategory of the meter, e.g.,
* 'A6 Cloud services', 'ExpressRoute (IXP)', etc..
*/
meterSubCategory?: string;
/**
* @member {string} [unit] The unit in which the meter consumption is
* charged, e.g., 'Hours', 'GB', etc.
*/
unit?: string;
/**
* @member {string[]} [meterTags] Provides additional meter data. 'Third
* Party' indicates a meter with no discount. Blanks indicate First Party.
*/
meterTags?: string[];
/**
* @member {string} [meterRegion] The region in which the Azure service is
* available.
*/
meterRegion?: string;
/**
* @member {{ [propertyName: string]: number }} [meterRates] The list of
* key/value pairs for the meter rates, in the format 'key':'value' where key
* = the meter quantity, and value = the corresponding price
*/
meterRates?: { [propertyName: string]: number };
/**
* @member {Date} [effectiveDate] Indicates the date from which the meter
* rate is effective.
*/
effectiveDate?: Date;
/**
* @member {number} [includedQuantity] The resource quantity that is included
* in the offer at no cost. Consumption beyond this quantity will be charged.
*/
includedQuantity?: number;
}
/**
* @interface
* An interface representing ResourceRateCardInfo.
* Price and Metadata information for resources
*
*/
export interface ResourceRateCardInfo {
/**
* @member {string} [currency] The currency in which the rates are provided.
*/
currency?: string;
/**
* @member {string} [locale] The culture in which the resource information is
* localized.
*/
locale?: string;
/**
* @member {boolean} [isTaxIncluded] All rates are pretax, so this will
* always be returned as 'false'.
*/
isTaxIncluded?: boolean;
/**
* @member {OfferTermInfoUnion[]} [offerTerms] A list of offer terms.
*/
offerTerms?: OfferTermInfoUnion[];
/**
* @member {MeterInfo[]} [meters] A list of meters.
*/
meters?: MeterInfo[];
}
/**
* @interface
* An interface representing MonetaryCredit.
* Indicates that this is a monetary credit offer.
*
*/
export interface MonetaryCredit {
/**
* @member {string} name Polymorphic Discriminator
*/
name: "Monetary Credit";
/**
* @member {Date} [effectiveDate] Indicates the date from which the offer
* term is effective.
*/
effectiveDate?: Date;
/**
* @member {number} [credit] The amount of credit provided under the terms of
* the given offer level.
*/
credit?: number;
/**
* @member {string[]} [excludedMeterIds] An array of meter ids that are
* excluded from the given offer terms.
*/
excludedMeterIds?: string[];
}
/**
* @interface
* An interface representing MonetaryCommitment.
* Indicates that a monetary commitment is required for this offer
*
*/
export interface MonetaryCommitment {
/**
* @member {string} name Polymorphic Discriminator
*/
name: "Monetary Commitment";
/**
* @member {Date} [effectiveDate] Indicates the date from which the offer
* term is effective.
*/
effectiveDate?: Date;
/**
* @member {{ [propertyName: string]: number }} [tieredDiscount] The list of
* key/value pairs for the tiered meter rates, in the format 'key':'value'
* where key = price, and value = the corresponding discount percentage. This
* field is used only by offer terms of type 'Monetary Commitment'.
*/
tieredDiscount?: { [propertyName: string]: number };
/**
* @member {string[]} [excludedMeterIds] An array of meter ids that are
* excluded from the given offer terms.
*/
excludedMeterIds?: string[];
}
/**
* @interface
* An interface representing RecurringCharge.
* Indicates a recurring charge is present for this offer.
*
*/
export interface RecurringCharge {
/**
* @member {string} name Polymorphic Discriminator
*/
name: "Recurring Charge";
/**
* @member {Date} [effectiveDate] Indicates the date from which the offer
* term is effective.
*/
effectiveDate?: Date;
/**
* @member {number} [recurringCharge] The amount of recurring charge as per
* the offer term.
*/
recurringCharge?: number;
}
/**
* @interface
* An interface representing ErrorResponse.
* Describes the format of Error response.
*
*/
export interface ErrorResponse {
/**
* @member {string} [code] Error code
*/
code?: string;
/**
* @member {string} [message] Error message indicating why the operation
* failed.
*/
message?: string;
}
/**
* @interface
* An interface representing UsageAggregatesListOptionalParams.
* Optional Parameters.
*
* @extends RequestOptionsBase
*/
export interface UsageAggregatesListOptionalParams extends msRest.RequestOptionsBase {
/**
* @member {boolean} [showDetails] `True` returns usage data in
* instance-level detail, `false` causes server-side aggregation with fewer
* details. For example, if you have 3 website instances, by default you will
* get 3 line items for website consumption. If you specify showDetails =
* false, the data will be aggregated as a single line item for website
* consumption within the time period (for the given subscriptionId, meterId,
* usageStartTime and usageEndTime).
*/
showDetails?: boolean;
/**
* @member {AggregationGranularity} [aggregationGranularity] `Daily`
* (default) returns the data in daily granularity, `Hourly` returns the data
* in hourly granularity. Possible values include: 'Daily', 'Hourly'. Default
* value: 'Daily' .
*/
aggregationGranularity?: AggregationGranularity;
/**
* @member {string} [continuationToken] Used when a continuation token string
* is provided in the response body of the previous call, enabling paging
* through a large result set. If not present, the data is retrieved from the
* beginning of the day/hour (based on the granularity) passed in.
*/
continuationToken?: string;
}
/**
* @interface
* An interface representing UsageManagementClientOptions.
* @extends AzureServiceClientOptions
*/
export interface UsageManagementClientOptions extends AzureServiceClientOptions {
/**
* @member {string} [baseUri]
*/
baseUri?: string;
}
/**
* @interface
* An interface representing the UsageAggregationListResult.
* The Get UsageAggregates operation response.
*
* @extends Array<UsageAggregation>
*/
export interface UsageAggregationListResult extends Array<UsageAggregation> {
/**
* @member {string} [nextLink] Gets or sets the link to the next set of
* results.
*/
nextLink?: string;
}
/**
* Defines values for AggregationGranularity.
* Possible values include: 'Daily', 'Hourly'
* @readonly
* @enum {string}
*/
export type AggregationGranularity = 'Daily' | 'Hourly';
/**
* Contains response data for the list operation.
*/
export type UsageAggregatesListResponse = UsageAggregationListResult & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: UsageAggregationListResult;
};
};
/**
* Contains response data for the listNext operation.
*/
export type UsageAggregatesListNextResponse = UsageAggregationListResult & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: UsageAggregationListResult;
};
};
/**
* Contains response data for the get operation.
*/
export type RateCardGetResponse = ResourceRateCardInfo & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ResourceRateCardInfo;
};
};