@azure/arm-commerce 2.1.1 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +73 -81
- package/dist/index.js +822 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/getRateCard.d.ts +2 -0
- package/dist-esm/samples-dev/getRateCard.d.ts.map +1 -0
- package/dist-esm/samples-dev/getRateCard.js +30 -0
- package/dist-esm/samples-dev/getRateCard.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +178 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +9 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +19 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +132 -149
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +13 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +62 -63
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +10 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/rateCard.d.ts +27 -0
- package/dist-esm/src/operations/rateCard.d.ts.map +1 -0
- package/dist-esm/src/operations/rateCard.js +55 -0
- package/dist-esm/src/operations/rateCard.js.map +1 -0
- package/dist-esm/src/operations/usageAggregates.d.ts +38 -0
- package/dist-esm/src/operations/usageAggregates.d.ts.map +1 -0
- package/dist-esm/src/operations/usageAggregates.js +144 -0
- package/dist-esm/src/operations/usageAggregates.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +10 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts +19 -0
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/rateCard.js +9 -0
- package/dist-esm/src/operationsInterfaces/rateCard.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts +13 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.js +9 -0
- package/dist-esm/src/operationsInterfaces/usageAggregates.js.map +1 -0
- package/dist-esm/src/usageManagementClient.d.ts +20 -0
- package/dist-esm/src/usageManagementClient.d.ts.map +1 -0
- package/dist-esm/src/usageManagementClient.js +53 -0
- package/dist-esm/src/usageManagementClient.js.map +1 -0
- package/dist-esm/test/commerce_examples.d.ts +4 -0
- package/dist-esm/test/commerce_examples.d.ts.map +1 -0
- package/dist-esm/test/commerce_examples.js +58 -0
- package/dist-esm/test/commerce_examples.js.map +1 -0
- package/package.json +77 -34
- package/review/arm-commerce.api.md +178 -0
- package/rollup.config.js +181 -30
- package/src/index.ts +12 -0
- package/src/models/index.ts +210 -0
- package/{lib → src}/models/mappers.ts +138 -152
- package/src/models/parameters.ts +137 -0
- package/{lib → src}/operations/index.ts +3 -5
- package/src/operations/rateCard.ts +69 -0
- package/src/operations/usageAggregates.ts +188 -0
- package/src/operationsInterfaces/index.ts +10 -0
- package/src/operationsInterfaces/rateCard.ts +30 -0
- package/src/operationsInterfaces/usageAggregates.ts +26 -0
- package/src/usageManagementClient.ts +78 -0
- package/tsconfig.json +6 -5
- package/types/arm-commerce.d.ts +247 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-commerce.js +0 -930
- package/dist/arm-commerce.js.map +0 -1
- package/dist/arm-commerce.min.js +0 -1
- package/dist/arm-commerce.min.js.map +0 -1
- package/esm/models/index.d.ts +0 -453
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -10
- package/esm/models/index.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -21
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -12
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/rateCardMappers.d.ts +0 -2
- package/esm/models/rateCardMappers.d.ts.map +0 -1
- package/esm/models/rateCardMappers.js +0 -11
- package/esm/models/rateCardMappers.js.map +0 -1
- package/esm/models/usageAggregatesMappers.d.ts +0 -2
- package/esm/models/usageAggregatesMappers.d.ts.map +0 -1
- package/esm/models/usageAggregatesMappers.js +0 -11
- package/esm/models/usageAggregatesMappers.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js +0 -12
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/rateCard.d.ts +0 -43
- package/esm/operations/rateCard.d.ts.map +0 -1
- package/esm/operations/rateCard.js +0 -56
- package/esm/operations/rateCard.js.map +0 -1
- package/esm/operations/usageAggregates.d.ts +0 -52
- package/esm/operations/usageAggregates.d.ts.map +0 -1
- package/esm/operations/usageAggregates.js +0 -87
- package/esm/operations/usageAggregates.js.map +0 -1
- package/esm/usageManagementClient.d.ts +0 -20
- package/esm/usageManagementClient.d.ts.map +0 -1
- package/esm/usageManagementClient.js +0 -35
- package/esm/usageManagementClient.js.map +0 -1
- package/esm/usageManagementClientContext.d.ts +0 -17
- package/esm/usageManagementClientContext.d.ts.map +0 -1
- package/esm/usageManagementClientContext.js +0 -57
- package/esm/usageManagementClientContext.js.map +0 -1
- package/lib/models/index.ts +0 -479
- package/lib/models/parameters.ts +0 -124
- package/lib/models/rateCardMappers.ts +0 -21
- package/lib/models/usageAggregatesMappers.ts +0 -18
- package/lib/operations/rateCard.ts +0 -94
- package/lib/operations/usageAggregates.ts +0 -139
- package/lib/usageManagementClient.ts +0 -45
- package/lib/usageManagementClientContext.ts +0 -63
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as coreAuth from '@azure/core-auth';
|
|
2
|
+
import * as coreClient from '@azure/core-client';
|
|
3
|
+
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
4
|
+
|
|
5
|
+
/** Defines values for AggregationGranularity. */
|
|
6
|
+
export declare type AggregationGranularity = "Daily" | "Hourly";
|
|
7
|
+
|
|
8
|
+
/** Describes the format of Error response. */
|
|
9
|
+
export declare interface ErrorResponse {
|
|
10
|
+
/** Error code */
|
|
11
|
+
code?: string;
|
|
12
|
+
/** Error message indicating why the operation failed. */
|
|
13
|
+
message?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Key-value pairs of instance details in the legacy format. */
|
|
17
|
+
export declare interface InfoField {
|
|
18
|
+
/** Identifies the name of the instance provisioned by the user. */
|
|
19
|
+
project?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Detailed information about the meter. */
|
|
23
|
+
export declare interface MeterInfo {
|
|
24
|
+
/** The unique identifier of the resource. */
|
|
25
|
+
meterId?: string;
|
|
26
|
+
/** The name of the meter, within the given meter category */
|
|
27
|
+
meterName?: string;
|
|
28
|
+
/** The category of the meter, e.g., 'Cloud services', 'Networking', etc.. */
|
|
29
|
+
meterCategory?: string;
|
|
30
|
+
/** The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */
|
|
31
|
+
meterSubCategory?: string;
|
|
32
|
+
/** The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. */
|
|
33
|
+
unit?: string;
|
|
34
|
+
/** Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. */
|
|
35
|
+
meterTags?: string[];
|
|
36
|
+
/** The region in which the Azure service is available. */
|
|
37
|
+
meterRegion?: string;
|
|
38
|
+
/** 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 */
|
|
39
|
+
meterRates?: {
|
|
40
|
+
[propertyName: string]: number;
|
|
41
|
+
};
|
|
42
|
+
/** Indicates the date from which the meter rate is effective. */
|
|
43
|
+
effectiveDate?: Date;
|
|
44
|
+
/** The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. */
|
|
45
|
+
includedQuantity?: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Indicates that a monetary commitment is required for this offer */
|
|
49
|
+
export declare type MonetaryCommitment = OfferTermInfoAutoGenerated & {
|
|
50
|
+
/** Polymorphic discriminator, which specifies the different types this object can be */
|
|
51
|
+
name: "Monetary Commitment";
|
|
52
|
+
/** 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'. */
|
|
53
|
+
tieredDiscount?: {
|
|
54
|
+
[propertyName: string]: number;
|
|
55
|
+
};
|
|
56
|
+
/** An array of meter ids that are excluded from the given offer terms. */
|
|
57
|
+
excludedMeterIds?: string[];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** Indicates that this is a monetary credit offer. */
|
|
61
|
+
export declare type MonetaryCredit = OfferTermInfoAutoGenerated & {
|
|
62
|
+
/** Polymorphic discriminator, which specifies the different types this object can be */
|
|
63
|
+
name: "Monetary Credit";
|
|
64
|
+
/** The amount of credit provided under the terms of the given offer level. */
|
|
65
|
+
credit?: number;
|
|
66
|
+
/** An array of meter ids that are excluded from the given offer terms. */
|
|
67
|
+
excludedMeterIds?: string[];
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** Defines values for OfferTermInfo. */
|
|
71
|
+
export declare type OfferTermInfo = "Recurring Charge" | "Monetary Commitment" | "Monetary Credit";
|
|
72
|
+
|
|
73
|
+
/** Describes the offer term. */
|
|
74
|
+
export declare interface OfferTermInfoAutoGenerated {
|
|
75
|
+
/** Polymorphic discriminator, which specifies the different types this object can be */
|
|
76
|
+
name: "Monetary Credit" | "Monetary Commitment" | "Recurring Charge";
|
|
77
|
+
/** Indicates the date from which the offer term is effective. */
|
|
78
|
+
effectiveDate?: Date;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export declare type OfferTermInfoAutoGeneratedUnion = OfferTermInfoAutoGenerated | MonetaryCredit | MonetaryCommitment | RecurringCharge;
|
|
82
|
+
|
|
83
|
+
/** Interface representing a RateCard. */
|
|
84
|
+
export declare interface RateCard {
|
|
85
|
+
/**
|
|
86
|
+
* Enables you to query for the resource/meter metadata and related prices used in a given subscription
|
|
87
|
+
* by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including
|
|
88
|
+
* but not limited to service names, types, resources, units of measure, and regions, is subject to
|
|
89
|
+
* change at any time and without notice. If you intend to use this billing data in an automated
|
|
90
|
+
* fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing
|
|
91
|
+
* meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the
|
|
92
|
+
* change.
|
|
93
|
+
* @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical
|
|
94
|
+
* operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region'
|
|
95
|
+
* are required to be a part of the $filter.
|
|
96
|
+
* @param options The options parameters.
|
|
97
|
+
*/
|
|
98
|
+
get(filter: string, options?: RateCardGetOptionalParams): Promise<RateCardGetResponse>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Optional parameters. */
|
|
102
|
+
export declare interface RateCardGetOptionalParams extends coreClient.OperationOptions {
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Contains response data for the get operation. */
|
|
106
|
+
export declare type RateCardGetResponse = ResourceRateCardInfo;
|
|
107
|
+
|
|
108
|
+
/** Parameters that are used in the odata $filter query parameter for providing RateCard information. */
|
|
109
|
+
export declare interface RateCardQueryParameters {
|
|
110
|
+
/** 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. */
|
|
111
|
+
offerDurableId: string;
|
|
112
|
+
/** The currency in which the rates need to be provided. */
|
|
113
|
+
currency: string;
|
|
114
|
+
/** The culture in which the resource metadata needs to be localized. */
|
|
115
|
+
locale: string;
|
|
116
|
+
/** 2 letter ISO code where the offer was purchased. */
|
|
117
|
+
regionInfo: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Indicates a recurring charge is present for this offer. */
|
|
121
|
+
export declare type RecurringCharge = OfferTermInfoAutoGenerated & {
|
|
122
|
+
/** Polymorphic discriminator, which specifies the different types this object can be */
|
|
123
|
+
name: "Recurring Charge";
|
|
124
|
+
/** The amount of recurring charge as per the offer term. */
|
|
125
|
+
recurringCharge?: number;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** Price and Metadata information for resources */
|
|
129
|
+
export declare interface ResourceRateCardInfo {
|
|
130
|
+
/** The currency in which the rates are provided. */
|
|
131
|
+
currency?: string;
|
|
132
|
+
/** The culture in which the resource information is localized. */
|
|
133
|
+
locale?: string;
|
|
134
|
+
/** All rates are pretax, so this will always be returned as 'false'. */
|
|
135
|
+
isTaxIncluded?: boolean;
|
|
136
|
+
/** A list of offer terms. */
|
|
137
|
+
offerTerms?: OfferTermInfoAutoGeneratedUnion[];
|
|
138
|
+
/** A list of meters. */
|
|
139
|
+
meters?: MeterInfo[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Interface representing a UsageAggregates. */
|
|
143
|
+
export declare interface UsageAggregates {
|
|
144
|
+
/**
|
|
145
|
+
* Query aggregated Azure subscription consumption data for a date range.
|
|
146
|
+
* @param reportedStartTime The start of the time range to retrieve data for.
|
|
147
|
+
* @param reportedEndTime The end of the time range to retrieve data for.
|
|
148
|
+
* @param options The options parameters.
|
|
149
|
+
*/
|
|
150
|
+
list(reportedStartTime: Date, reportedEndTime: Date, options?: UsageAggregatesListOptionalParams): PagedAsyncIterableIterator<UsageAggregation>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Optional parameters. */
|
|
154
|
+
export declare interface UsageAggregatesListNextOptionalParams extends coreClient.OperationOptions {
|
|
155
|
+
/** `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). */
|
|
156
|
+
showDetails?: boolean;
|
|
157
|
+
/** `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. */
|
|
158
|
+
aggregationGranularity?: AggregationGranularity;
|
|
159
|
+
/** 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. */
|
|
160
|
+
continuationToken?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Contains response data for the listNext operation. */
|
|
164
|
+
export declare type UsageAggregatesListNextResponse = UsageAggregationListResult;
|
|
165
|
+
|
|
166
|
+
/** Optional parameters. */
|
|
167
|
+
export declare interface UsageAggregatesListOptionalParams extends coreClient.OperationOptions {
|
|
168
|
+
/** `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). */
|
|
169
|
+
showDetails?: boolean;
|
|
170
|
+
/** `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. */
|
|
171
|
+
aggregationGranularity?: AggregationGranularity;
|
|
172
|
+
/** 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. */
|
|
173
|
+
continuationToken?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Contains response data for the list operation. */
|
|
177
|
+
export declare type UsageAggregatesListResponse = UsageAggregationListResult;
|
|
178
|
+
|
|
179
|
+
/** Describes the usageAggregation. */
|
|
180
|
+
export declare interface UsageAggregation {
|
|
181
|
+
/** Unique Id for the usage aggregate. */
|
|
182
|
+
id?: string;
|
|
183
|
+
/** Name of the usage aggregate. */
|
|
184
|
+
name?: string;
|
|
185
|
+
/** Type of the resource being returned. */
|
|
186
|
+
type?: string;
|
|
187
|
+
/** The subscription identifier for the Azure user. */
|
|
188
|
+
subscriptionId?: string;
|
|
189
|
+
/** Unique ID for the resource that was consumed (aka ResourceID). */
|
|
190
|
+
meterId?: string;
|
|
191
|
+
/** UTC start time for the usage bucket to which this usage aggregate belongs. */
|
|
192
|
+
usageStartTime?: Date;
|
|
193
|
+
/** UTC end time for the usage bucket to which this usage aggregate belongs. */
|
|
194
|
+
usageEndTime?: Date;
|
|
195
|
+
/** The amount of the resource consumption that occurred in this time frame. */
|
|
196
|
+
quantity?: number;
|
|
197
|
+
/** The unit in which the usage for this resource is being counted, e.g. Hours, GB. */
|
|
198
|
+
unit?: string;
|
|
199
|
+
/** Friendly name of the resource being consumed. */
|
|
200
|
+
meterName?: string;
|
|
201
|
+
/** Category of the consumed resource. */
|
|
202
|
+
meterCategory?: string;
|
|
203
|
+
/** Sub-category of the consumed resource. */
|
|
204
|
+
meterSubCategory?: string;
|
|
205
|
+
/** Region of the meterId used for billing purposes */
|
|
206
|
+
meterRegion?: string;
|
|
207
|
+
/** Key-value pairs of instance details (legacy format). */
|
|
208
|
+
infoFields?: InfoField;
|
|
209
|
+
/** Key-value pairs of instance details represented as a string. */
|
|
210
|
+
instanceData?: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** The Get UsageAggregates operation response. */
|
|
214
|
+
export declare interface UsageAggregationListResult {
|
|
215
|
+
/** Gets or sets details for the requested aggregation. */
|
|
216
|
+
value?: UsageAggregation[];
|
|
217
|
+
/** Gets or sets the link to the next set of results. */
|
|
218
|
+
nextLink?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export declare class UsageManagementClient extends coreClient.ServiceClient {
|
|
222
|
+
$host: string;
|
|
223
|
+
apiVersion: string;
|
|
224
|
+
subscriptionId: string;
|
|
225
|
+
/**
|
|
226
|
+
* Initializes a new instance of the UsageManagementClient class.
|
|
227
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
228
|
+
* @param subscriptionId It uniquely identifies Microsoft Azure subscription. The subscription ID forms
|
|
229
|
+
* part of the URI for every service call.
|
|
230
|
+
* @param options The parameter options
|
|
231
|
+
*/
|
|
232
|
+
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: UsageManagementClientOptionalParams);
|
|
233
|
+
usageAggregates: UsageAggregates;
|
|
234
|
+
rateCard: RateCard;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** Optional parameters. */
|
|
238
|
+
export declare interface UsageManagementClientOptionalParams extends coreClient.ServiceClientOptions {
|
|
239
|
+
/** server parameter */
|
|
240
|
+
$host?: string;
|
|
241
|
+
/** Api Version */
|
|
242
|
+
apiVersion?: string;
|
|
243
|
+
/** Overrides client endpoint. */
|
|
244
|
+
endpoint?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.19.4"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|