Skip to content

Commit 94228f1

Browse files
author
SDKAuto
committed
CodeGen from PR 15007 in Azure/azure-rest-api-specs
Merge e98221e59c3b1b8f6ec54a662d3c735bd2eeee00 into 3cf8aa90fbdf15379f62a1e8e0c3dcbd9c4d46af
1 parent b8da289 commit 94228f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9242
-7425
lines changed

sdk/consumption/arm-consumption/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Azure ConsumptionManagementClient SDK for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for ConsumptionManagementClient.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for ConsumptionManagementClient.
44

55
### Currently supported environments
66

77
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8-
- Latest versions of Safari, Chrome, Edge, and Firefox.
8+
- Latest versions of Safari, Chrome, Edge and Firefox.
99

1010
### Prerequisites
1111

@@ -21,7 +21,6 @@ Install both packages using the below command:
2121
```bash
2222
npm install --save @azure/arm-consumption @azure/identity
2323
```
24-
2524
> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
2625
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
2726

@@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/
3736

3837
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
3938
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
40-
4139
#### nodejs - Authentication, client creation, and list usageDetails as an example written in JavaScript.
4240

4341
##### Sample code
@@ -51,12 +49,13 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
5149
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
5250
const creds = new DefaultAzureCredential();
5351
const client = new ConsumptionManagementClient(creds, subscriptionId);
52+
const scope = "testscope";
5453
const expand = "testexpand";
5554
const filter = "testfilter";
5655
const skiptoken = "testskiptoken";
5756
const top = 1;
58-
const apply = "testapply";
59-
client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
57+
const metric = "actualcost";
58+
client.usageDetails.list(scope, expand, filter, skiptoken, top, metric).then((result) => {
6059
console.log("The result is:");
6160
console.log(result);
6261
}).catch((err) => {
@@ -90,15 +89,16 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
9089
const credential = new InteractiveBrowserCredential(
9190
{
9291
clientId: "<client id for your Azure AD app>",
93-
tenantId: "<optional tenant for your organization>"
92+
tenant: "<optional tenant for your organization>"
9493
});
9594
const client = new Azure.ArmConsumption.ConsumptionManagementClient(creds, subscriptionId);
95+
const scope = "testscope";
9696
const expand = "testexpand";
9797
const filter = "testfilter";
9898
const skiptoken = "testskiptoken";
9999
const top = 1;
100-
const apply = "testapply";
101-
client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
100+
const metric = "actualcost";
101+
client.usageDetails.list(scope, expand, filter, skiptoken, top, metric).then((result) => {
102102
console.log("The result is:");
103103
console.log(result);
104104
}).catch((err) => {

sdk/consumption/arm-consumption/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"rollup-plugin-sourcemaps": "^0.4.2",
2828
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/consumption/arm-consumption",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/consumption/arm-consumption/rollup.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps";
77
*/
88
const config = {
99
input: "./esm/consumptionManagementClient.js",
10-
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
10+
external: [
11+
"@azure/ms-rest-js",
12+
"@azure/ms-rest-azure-js"
13+
],
1114
output: {
1215
file: "./dist/arm-consumption.js",
1316
format: "umd",
@@ -25,7 +28,10 @@ const config = {
2528
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
2629
*/`
2730
},
28-
plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
31+
plugins: [
32+
nodeResolve({ mainFields: ['module', 'main'] }),
33+
sourcemaps()
34+
]
2935
};
3036

3137
export default config;

sdk/consumption/arm-consumption/src/consumptionManagementClient.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,27 @@ import * as Mappers from "./models/mappers";
1414
import * as operations from "./operations";
1515
import { ConsumptionManagementClientContext } from "./consumptionManagementClientContext";
1616

17+
1718
class ConsumptionManagementClient extends ConsumptionManagementClientContext {
1819
// Operation groups
1920
usageDetails: operations.UsageDetails;
2021
marketplaces: operations.Marketplaces;
22+
budgets: operations.Budgets;
23+
tags: operations.Tags;
24+
charges: operations.Charges;
2125
balances: operations.Balances;
2226
reservationsSummaries: operations.ReservationsSummaries;
2327
reservationsDetails: operations.ReservationsDetails;
2428
reservationRecommendations: operations.ReservationRecommendations;
25-
budgets: operations.Budgets;
29+
reservationRecommendationDetails: operations.ReservationRecommendationDetails;
30+
reservationTransactions: operations.ReservationTransactions;
2631
priceSheet: operations.PriceSheet;
27-
tags: operations.Tags;
2832
forecasts: operations.Forecasts;
2933
operations: operations.Operations;
3034
aggregatedCost: operations.AggregatedCost;
31-
charges: operations.Charges;
32-
tenants: operations.Tenants;
35+
events: operations.EventsOperations;
36+
lots: operations.LotsOperations;
37+
credits: operations.Credits;
3338

3439
/**
3540
* Initializes a new instance of the ConsumptionManagementClient class.
@@ -42,26 +47,26 @@ class ConsumptionManagementClient extends ConsumptionManagementClientContext {
4247
* @param subscriptionId Azure Subscription ID.
4348
* @param [options] The parameter options
4449
*/
45-
constructor(
46-
credentials: msRest.ServiceClientCredentials | TokenCredential,
47-
subscriptionId: string,
48-
options?: Models.ConsumptionManagementClientOptions
49-
) {
50+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ConsumptionManagementClientOptions) {
5051
super(credentials, subscriptionId, options);
5152
this.usageDetails = new operations.UsageDetails(this);
5253
this.marketplaces = new operations.Marketplaces(this);
54+
this.budgets = new operations.Budgets(this);
55+
this.tags = new operations.Tags(this);
56+
this.charges = new operations.Charges(this);
5357
this.balances = new operations.Balances(this);
5458
this.reservationsSummaries = new operations.ReservationsSummaries(this);
5559
this.reservationsDetails = new operations.ReservationsDetails(this);
5660
this.reservationRecommendations = new operations.ReservationRecommendations(this);
57-
this.budgets = new operations.Budgets(this);
61+
this.reservationRecommendationDetails = new operations.ReservationRecommendationDetails(this);
62+
this.reservationTransactions = new operations.ReservationTransactions(this);
5863
this.priceSheet = new operations.PriceSheet(this);
59-
this.tags = new operations.Tags(this);
6064
this.forecasts = new operations.Forecasts(this);
6165
this.operations = new operations.Operations(this);
6266
this.aggregatedCost = new operations.AggregatedCost(this);
63-
this.charges = new operations.Charges(this);
64-
this.tenants = new operations.Tenants(this);
67+
this.events = new operations.EventsOperations(this);
68+
this.lots = new operations.LotsOperations(this);
69+
this.credits = new operations.Credits(this);
6570
}
6671
}
6772

sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import * as Models from "./models";
1111
import * as msRest from "@azure/ms-rest-js";
12-
import { TokenCredential } from "@azure/core-auth";
1312
import * as msRestAzure from "@azure/ms-rest-azure-js";
13+
import { TokenCredential } from "@azure/core-auth";
1414

1515
const packageName = "@azure/arm-consumption";
1616
const packageVersion = "7.1.0";
@@ -31,16 +31,12 @@ export class ConsumptionManagementClientContext extends msRestAzure.AzureService
3131
* @param subscriptionId Azure Subscription ID.
3232
* @param [options] The parameter options
3333
*/
34-
constructor(
35-
credentials: msRest.ServiceClientCredentials | TokenCredential,
36-
subscriptionId: string,
37-
options?: Models.ConsumptionManagementClientOptions
38-
) {
34+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ConsumptionManagementClientOptions) {
3935
if (credentials == undefined) {
40-
throw new Error("'credentials' cannot be null.");
36+
throw new Error('\'credentials\' cannot be null.');
4137
}
4238
if (subscriptionId == undefined) {
43-
throw new Error("'subscriptionId' cannot be null.");
39+
throw new Error('\'subscriptionId\' cannot be null.');
4440
}
4541

4642
if (!options) {
@@ -53,8 +49,8 @@ export class ConsumptionManagementClientContext extends msRestAzure.AzureService
5349

5450
super(credentials, options);
5551

56-
this.apiVersion = "2018-10-01";
57-
this.acceptLanguage = "en-US";
52+
this.apiVersion = '2021-05-01';
53+
this.acceptLanguage = 'en-US';
5854
this.longRunningOperationRetryTimeout = 30;
5955
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
6056
this.requestContentType = "application/json; charset=utf-8";
@@ -64,10 +60,7 @@ export class ConsumptionManagementClientContext extends msRestAzure.AzureService
6460
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
6561
this.acceptLanguage = options.acceptLanguage;
6662
}
67-
if (
68-
options.longRunningOperationRetryTimeout !== null &&
69-
options.longRunningOperationRetryTimeout !== undefined
70-
) {
63+
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
7164
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
7265
}
7366
}

sdk/consumption/arm-consumption/src/models/aggregatedCostMappers.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,55 @@
77
*/
88

99
export {
10+
discriminators,
11+
Amount,
12+
AmountWithExchangeRate,
1013
Balance,
1114
BalancePropertiesAdjustmentDetailsItem,
1215
BalancePropertiesNewPurchasesDetailsItem,
1316
BaseResource,
1417
Budget,
18+
BudgetComparisonExpression,
19+
BudgetFilter,
20+
BudgetFilterProperties,
1521
BudgetTimePeriod,
1622
ChargeSummary,
23+
CreditBalanceSummary,
24+
CreditSummary,
1725
CurrentSpend,
1826
ErrorDetails,
1927
ErrorResponse,
20-
Filters,
28+
EventSummary,
2129
Forecast,
2230
ForecastPropertiesConfidenceLevelsItem,
31+
ForecastSpend,
32+
LegacyChargeSummary,
33+
LegacyReservationTransaction,
34+
LegacyUsageDetail,
35+
LotSummary,
2336
ManagementGroupAggregatedCostResult,
2437
Marketplace,
2538
MeterDetails,
39+
MeterDetailsResponse,
40+
ModernChargeSummary,
41+
ModernReservationTransaction,
42+
ModernUsageDetail,
2643
Notification,
2744
PriceSheetProperties,
2845
PriceSheetResult,
2946
ProxyResource,
47+
Reseller,
3048
ReservationDetail,
49+
ReservationRecommendationDetailsCalculatedSavingsProperties,
50+
ReservationRecommendationDetailsModel,
51+
ReservationRecommendationDetailsResourceProperties,
52+
ReservationRecommendationDetailsSavingsProperties,
53+
ReservationRecommendationDetailsUsageProperties,
3154
ReservationSummary,
55+
ReservationTransaction,
56+
ReservationTransactionResource,
3257
Resource,
3358
Tag,
3459
TagsResult,
35-
Tenant,
3660
UsageDetail
3761
} from "../models/mappers";

sdk/consumption/arm-consumption/src/models/balancesMappers.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,55 @@
77
*/
88

99
export {
10+
discriminators,
11+
Amount,
12+
AmountWithExchangeRate,
1013
Balance,
1114
BalancePropertiesAdjustmentDetailsItem,
1215
BalancePropertiesNewPurchasesDetailsItem,
1316
BaseResource,
1417
Budget,
18+
BudgetComparisonExpression,
19+
BudgetFilter,
20+
BudgetFilterProperties,
1521
BudgetTimePeriod,
1622
ChargeSummary,
23+
CreditBalanceSummary,
24+
CreditSummary,
1725
CurrentSpend,
1826
ErrorDetails,
1927
ErrorResponse,
20-
Filters,
28+
EventSummary,
2129
Forecast,
2230
ForecastPropertiesConfidenceLevelsItem,
31+
ForecastSpend,
32+
LegacyChargeSummary,
33+
LegacyReservationTransaction,
34+
LegacyUsageDetail,
35+
LotSummary,
2336
ManagementGroupAggregatedCostResult,
2437
Marketplace,
2538
MeterDetails,
39+
MeterDetailsResponse,
40+
ModernChargeSummary,
41+
ModernReservationTransaction,
42+
ModernUsageDetail,
2643
Notification,
2744
PriceSheetProperties,
2845
PriceSheetResult,
2946
ProxyResource,
47+
Reseller,
3048
ReservationDetail,
49+
ReservationRecommendationDetailsCalculatedSavingsProperties,
50+
ReservationRecommendationDetailsModel,
51+
ReservationRecommendationDetailsResourceProperties,
52+
ReservationRecommendationDetailsSavingsProperties,
53+
ReservationRecommendationDetailsUsageProperties,
3154
ReservationSummary,
55+
ReservationTransaction,
56+
ReservationTransactionResource,
3257
Resource,
3358
Tag,
3459
TagsResult,
35-
Tenant,
3660
UsageDetail
3761
} from "../models/mappers";

sdk/consumption/arm-consumption/src/models/budgetsMappers.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,56 @@
77
*/
88

99
export {
10+
discriminators,
11+
Amount,
12+
AmountWithExchangeRate,
1013
Balance,
1114
BalancePropertiesAdjustmentDetailsItem,
1215
BalancePropertiesNewPurchasesDetailsItem,
1316
BaseResource,
1417
Budget,
18+
BudgetComparisonExpression,
19+
BudgetFilter,
20+
BudgetFilterProperties,
1521
BudgetsListResult,
1622
BudgetTimePeriod,
1723
ChargeSummary,
24+
CreditBalanceSummary,
25+
CreditSummary,
1826
CurrentSpend,
1927
ErrorDetails,
2028
ErrorResponse,
21-
Filters,
29+
EventSummary,
2230
Forecast,
2331
ForecastPropertiesConfidenceLevelsItem,
32+
ForecastSpend,
33+
LegacyChargeSummary,
34+
LegacyReservationTransaction,
35+
LegacyUsageDetail,
36+
LotSummary,
2437
ManagementGroupAggregatedCostResult,
2538
Marketplace,
2639
MeterDetails,
40+
MeterDetailsResponse,
41+
ModernChargeSummary,
42+
ModernReservationTransaction,
43+
ModernUsageDetail,
2744
Notification,
2845
PriceSheetProperties,
2946
PriceSheetResult,
3047
ProxyResource,
48+
Reseller,
3149
ReservationDetail,
50+
ReservationRecommendationDetailsCalculatedSavingsProperties,
51+
ReservationRecommendationDetailsModel,
52+
ReservationRecommendationDetailsResourceProperties,
53+
ReservationRecommendationDetailsSavingsProperties,
54+
ReservationRecommendationDetailsUsageProperties,
3255
ReservationSummary,
56+
ReservationTransaction,
57+
ReservationTransactionResource,
3358
Resource,
3459
Tag,
3560
TagsResult,
36-
Tenant,
3761
UsageDetail
3862
} from "../models/mappers";

0 commit comments

Comments
 (0)