@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
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
* license information.
|
|
5
|
-
*
|
|
6
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as msRest from "@azure/ms-rest-js";
|
|
12
|
-
import * as Models from "../models";
|
|
13
|
-
import * as Mappers from "../models/rateCardMappers";
|
|
14
|
-
import * as Parameters from "../models/parameters";
|
|
15
|
-
import { UsageManagementClientContext } from "../usageManagementClientContext";
|
|
16
|
-
|
|
17
|
-
/** Class representing a RateCard. */
|
|
18
|
-
export class RateCard {
|
|
19
|
-
private readonly client: UsageManagementClientContext;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create a RateCard.
|
|
23
|
-
* @param {UsageManagementClientContext} client Reference to the service client.
|
|
24
|
-
*/
|
|
25
|
-
constructor(client: UsageManagementClientContext) {
|
|
26
|
-
this.client = client;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Enables you to query for the resource/meter metadata and related prices used in a given
|
|
31
|
-
* subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing
|
|
32
|
-
* meters, including but not limited to service names, types, resources, units of measure, and
|
|
33
|
-
* regions, is subject to change at any time and without notice. If you intend to use this billing
|
|
34
|
-
* data in an automated fashion, please use the billing meter GUID to uniquely identify each
|
|
35
|
-
* billable item. If the billing meter GUID is scheduled to change due to a new billing model, you
|
|
36
|
-
* will be notified in advance of the change.
|
|
37
|
-
* @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical
|
|
38
|
-
* operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale',
|
|
39
|
-
* 'Region' are required to be a part of the $filter.
|
|
40
|
-
* @param [options] The optional parameters
|
|
41
|
-
* @returns Promise<Models.RateCardGetResponse>
|
|
42
|
-
*/
|
|
43
|
-
get(filter: string, options?: msRest.RequestOptionsBase): Promise<Models.RateCardGetResponse>;
|
|
44
|
-
/**
|
|
45
|
-
* @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical
|
|
46
|
-
* operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale',
|
|
47
|
-
* 'Region' are required to be a part of the $filter.
|
|
48
|
-
* @param callback The callback
|
|
49
|
-
*/
|
|
50
|
-
get(filter: string, callback: msRest.ServiceCallback<Models.ResourceRateCardInfo>): void;
|
|
51
|
-
/**
|
|
52
|
-
* @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical
|
|
53
|
-
* operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale',
|
|
54
|
-
* 'Region' are required to be a part of the $filter.
|
|
55
|
-
* @param options The optional parameters
|
|
56
|
-
* @param callback The callback
|
|
57
|
-
*/
|
|
58
|
-
get(filter: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ResourceRateCardInfo>): void;
|
|
59
|
-
get(filter: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ResourceRateCardInfo>, callback?: msRest.ServiceCallback<Models.ResourceRateCardInfo>): Promise<Models.RateCardGetResponse> {
|
|
60
|
-
return this.client.sendOperationRequest(
|
|
61
|
-
{
|
|
62
|
-
filter,
|
|
63
|
-
options
|
|
64
|
-
},
|
|
65
|
-
getOperationSpec,
|
|
66
|
-
callback) as Promise<Models.RateCardGetResponse>;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Operation Specifications
|
|
71
|
-
const serializer = new msRest.Serializer(Mappers);
|
|
72
|
-
const getOperationSpec: msRest.OperationSpec = {
|
|
73
|
-
httpMethod: "GET",
|
|
74
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.Commerce/RateCard",
|
|
75
|
-
urlParameters: [
|
|
76
|
-
Parameters.subscriptionId
|
|
77
|
-
],
|
|
78
|
-
queryParameters: [
|
|
79
|
-
Parameters.filter,
|
|
80
|
-
Parameters.apiVersion
|
|
81
|
-
],
|
|
82
|
-
headerParameters: [
|
|
83
|
-
Parameters.acceptLanguage
|
|
84
|
-
],
|
|
85
|
-
responses: {
|
|
86
|
-
200: {
|
|
87
|
-
bodyMapper: Mappers.ResourceRateCardInfo
|
|
88
|
-
},
|
|
89
|
-
default: {
|
|
90
|
-
bodyMapper: Mappers.ErrorResponse
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
serializer
|
|
94
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
* license information.
|
|
5
|
-
*
|
|
6
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as msRest from "@azure/ms-rest-js";
|
|
12
|
-
import * as Models from "../models";
|
|
13
|
-
import * as Mappers from "../models/usageAggregatesMappers";
|
|
14
|
-
import * as Parameters from "../models/parameters";
|
|
15
|
-
import { UsageManagementClientContext } from "../usageManagementClientContext";
|
|
16
|
-
|
|
17
|
-
/** Class representing a UsageAggregates. */
|
|
18
|
-
export class UsageAggregates {
|
|
19
|
-
private readonly client: UsageManagementClientContext;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create a UsageAggregates.
|
|
23
|
-
* @param {UsageManagementClientContext} client Reference to the service client.
|
|
24
|
-
*/
|
|
25
|
-
constructor(client: UsageManagementClientContext) {
|
|
26
|
-
this.client = client;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Query aggregated Azure subscription consumption data for a date range.
|
|
31
|
-
* @param reportedStartTime The start of the time range to retrieve data for.
|
|
32
|
-
* @param reportedEndTime The end of the time range to retrieve data for.
|
|
33
|
-
* @param [options] The optional parameters
|
|
34
|
-
* @returns Promise<Models.UsageAggregatesListResponse>
|
|
35
|
-
*/
|
|
36
|
-
list(reportedStartTime: Date | string, reportedEndTime: Date | string, options?: Models.UsageAggregatesListOptionalParams): Promise<Models.UsageAggregatesListResponse>;
|
|
37
|
-
/**
|
|
38
|
-
* @param reportedStartTime The start of the time range to retrieve data for.
|
|
39
|
-
* @param reportedEndTime The end of the time range to retrieve data for.
|
|
40
|
-
* @param callback The callback
|
|
41
|
-
*/
|
|
42
|
-
list(reportedStartTime: Date | string, reportedEndTime: Date | string, callback: msRest.ServiceCallback<Models.UsageAggregationListResult>): void;
|
|
43
|
-
/**
|
|
44
|
-
* @param reportedStartTime The start of the time range to retrieve data for.
|
|
45
|
-
* @param reportedEndTime The end of the time range to retrieve data for.
|
|
46
|
-
* @param options The optional parameters
|
|
47
|
-
* @param callback The callback
|
|
48
|
-
*/
|
|
49
|
-
list(reportedStartTime: Date | string, reportedEndTime: Date | string, options: Models.UsageAggregatesListOptionalParams, callback: msRest.ServiceCallback<Models.UsageAggregationListResult>): void;
|
|
50
|
-
list(reportedStartTime: Date | string, reportedEndTime: Date | string, options?: Models.UsageAggregatesListOptionalParams | msRest.ServiceCallback<Models.UsageAggregationListResult>, callback?: msRest.ServiceCallback<Models.UsageAggregationListResult>): Promise<Models.UsageAggregatesListResponse> {
|
|
51
|
-
return this.client.sendOperationRequest(
|
|
52
|
-
{
|
|
53
|
-
reportedStartTime,
|
|
54
|
-
reportedEndTime,
|
|
55
|
-
options
|
|
56
|
-
},
|
|
57
|
-
listOperationSpec,
|
|
58
|
-
callback) as Promise<Models.UsageAggregatesListResponse>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Query aggregated Azure subscription consumption data for a date range.
|
|
63
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
64
|
-
* @param [options] The optional parameters
|
|
65
|
-
* @returns Promise<Models.UsageAggregatesListNextResponse>
|
|
66
|
-
*/
|
|
67
|
-
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.UsageAggregatesListNextResponse>;
|
|
68
|
-
/**
|
|
69
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
70
|
-
* @param callback The callback
|
|
71
|
-
*/
|
|
72
|
-
listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.UsageAggregationListResult>): void;
|
|
73
|
-
/**
|
|
74
|
-
* @param nextPageLink The NextLink from the previous successful call to List operation.
|
|
75
|
-
* @param options The optional parameters
|
|
76
|
-
* @param callback The callback
|
|
77
|
-
*/
|
|
78
|
-
listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.UsageAggregationListResult>): void;
|
|
79
|
-
listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.UsageAggregationListResult>, callback?: msRest.ServiceCallback<Models.UsageAggregationListResult>): Promise<Models.UsageAggregatesListNextResponse> {
|
|
80
|
-
return this.client.sendOperationRequest(
|
|
81
|
-
{
|
|
82
|
-
nextPageLink,
|
|
83
|
-
options
|
|
84
|
-
},
|
|
85
|
-
listNextOperationSpec,
|
|
86
|
-
callback) as Promise<Models.UsageAggregatesListNextResponse>;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Operation Specifications
|
|
91
|
-
const serializer = new msRest.Serializer(Mappers);
|
|
92
|
-
const listOperationSpec: msRest.OperationSpec = {
|
|
93
|
-
httpMethod: "GET",
|
|
94
|
-
path: "subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates",
|
|
95
|
-
urlParameters: [
|
|
96
|
-
Parameters.subscriptionId
|
|
97
|
-
],
|
|
98
|
-
queryParameters: [
|
|
99
|
-
Parameters.reportedStartTime,
|
|
100
|
-
Parameters.reportedEndTime,
|
|
101
|
-
Parameters.showDetails,
|
|
102
|
-
Parameters.aggregationGranularity,
|
|
103
|
-
Parameters.continuationToken,
|
|
104
|
-
Parameters.apiVersion
|
|
105
|
-
],
|
|
106
|
-
headerParameters: [
|
|
107
|
-
Parameters.acceptLanguage
|
|
108
|
-
],
|
|
109
|
-
responses: {
|
|
110
|
-
200: {
|
|
111
|
-
bodyMapper: Mappers.UsageAggregationListResult
|
|
112
|
-
},
|
|
113
|
-
default: {
|
|
114
|
-
bodyMapper: Mappers.ErrorResponse
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
serializer
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const listNextOperationSpec: msRest.OperationSpec = {
|
|
121
|
-
httpMethod: "GET",
|
|
122
|
-
baseUrl: "https://management.azure.com",
|
|
123
|
-
path: "{nextLink}",
|
|
124
|
-
urlParameters: [
|
|
125
|
-
Parameters.nextPageLink
|
|
126
|
-
],
|
|
127
|
-
headerParameters: [
|
|
128
|
-
Parameters.acceptLanguage
|
|
129
|
-
],
|
|
130
|
-
responses: {
|
|
131
|
-
200: {
|
|
132
|
-
bodyMapper: Mappers.UsageAggregationListResult
|
|
133
|
-
},
|
|
134
|
-
default: {
|
|
135
|
-
bodyMapper: Mappers.ErrorResponse
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
serializer
|
|
139
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
* license information.
|
|
5
|
-
*
|
|
6
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as msRest from "@azure/ms-rest-js";
|
|
12
|
-
import * as Models from "./models";
|
|
13
|
-
import * as Mappers from "./models/mappers";
|
|
14
|
-
import * as operations from "./operations";
|
|
15
|
-
import { UsageManagementClientContext } from "./usageManagementClientContext";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class UsageManagementClient extends UsageManagementClientContext {
|
|
19
|
-
// Operation groups
|
|
20
|
-
usageAggregates: operations.UsageAggregates;
|
|
21
|
-
rateCard: operations.RateCard;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Initializes a new instance of the UsageManagementClient class.
|
|
25
|
-
* @param credentials Credentials needed for the client to connect to Azure.
|
|
26
|
-
* @param subscriptionId It uniquely identifies Microsoft Azure subscription. The subscription ID
|
|
27
|
-
* forms part of the URI for every service call.
|
|
28
|
-
* @param [options] The parameter options
|
|
29
|
-
*/
|
|
30
|
-
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.UsageManagementClientOptions) {
|
|
31
|
-
super(credentials, subscriptionId, options);
|
|
32
|
-
this.usageAggregates = new operations.UsageAggregates(this);
|
|
33
|
-
this.rateCard = new operations.RateCard(this);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Operation Specifications
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
UsageManagementClient,
|
|
41
|
-
UsageManagementClientContext,
|
|
42
|
-
Models as UsageManagementModels,
|
|
43
|
-
Mappers as UsageManagementMappers
|
|
44
|
-
};
|
|
45
|
-
export * from "./operations";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
-
* license information.
|
|
5
|
-
*
|
|
6
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
7
|
-
* Changes may cause incorrect behavior and will be lost if the code is
|
|
8
|
-
* regenerated.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as Models from "./models";
|
|
12
|
-
import * as msRest from "@azure/ms-rest-js";
|
|
13
|
-
import * as msRestAzure from "@azure/ms-rest-azure-js";
|
|
14
|
-
|
|
15
|
-
const packageName = "@azure/arm-commerce";
|
|
16
|
-
const packageVersion = "2.1.1";
|
|
17
|
-
|
|
18
|
-
export class UsageManagementClientContext extends msRestAzure.AzureServiceClient {
|
|
19
|
-
credentials: msRest.ServiceClientCredentials;
|
|
20
|
-
subscriptionId: string;
|
|
21
|
-
apiVersion?: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Initializes a new instance of the UsageManagementClient class.
|
|
25
|
-
* @param credentials Credentials needed for the client to connect to Azure.
|
|
26
|
-
* @param subscriptionId It uniquely identifies Microsoft Azure subscription. The subscription ID
|
|
27
|
-
* forms part of the URI for every service call.
|
|
28
|
-
* @param [options] The parameter options
|
|
29
|
-
*/
|
|
30
|
-
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.UsageManagementClientOptions) {
|
|
31
|
-
if (credentials == undefined) {
|
|
32
|
-
throw new Error('\'credentials\' cannot be null.');
|
|
33
|
-
}
|
|
34
|
-
if (subscriptionId == undefined) {
|
|
35
|
-
throw new Error('\'subscriptionId\' cannot be null.');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!options) {
|
|
39
|
-
options = {};
|
|
40
|
-
}
|
|
41
|
-
if(!options.userAgent) {
|
|
42
|
-
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
|
|
43
|
-
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
super(credentials, options);
|
|
47
|
-
|
|
48
|
-
this.apiVersion = '2015-06-01-preview';
|
|
49
|
-
this.acceptLanguage = 'en-US';
|
|
50
|
-
this.longRunningOperationRetryTimeout = 30;
|
|
51
|
-
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
|
|
52
|
-
this.requestContentType = "application/json; charset=utf-8";
|
|
53
|
-
this.credentials = credentials;
|
|
54
|
-
this.subscriptionId = subscriptionId;
|
|
55
|
-
|
|
56
|
-
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
|
|
57
|
-
this.acceptLanguage = options.acceptLanguage;
|
|
58
|
-
}
|
|
59
|
-
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
|
|
60
|
-
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|