Skip to content

Commit e3a1276

Browse files
author
SDKAuto
committed
CodeGen from PR 12581 in Azure/azure-rest-api-specs
Merge c144fa083bb797fedc378618b5908e25d567005c into dfedab416d1c4fe521f6f3c58cdcb0da37107b84
1 parent 65c755b commit e3a1276

Some content is hidden

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

47 files changed

+8430
-6246
lines changed

sdk/consumption/arm-consumption/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 Microsoft
3+
Copyright (c) 2021 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/consumption/arm-consumption/README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,38 @@ This package contains an isomorphic SDK for ConsumptionManagementClient.
99

1010
### How to Install
1111

12-
```
12+
```bash
1313
npm install @azure/arm-consumption
1414
```
1515

1616
### How to use
1717

18-
#### nodejs - Authentication, client creation and list usageDetails as an example written in TypeScript.
18+
#### nodejs - client creation and list usageDetails as an example written in TypeScript.
1919

2020
##### Install @azure/ms-rest-nodeauth
2121

22-
```
23-
npm install @azure/ms-rest-nodeauth
22+
- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
23+
```bash
24+
npm install @azure/ms-rest-nodeauth@"^3.0.0"
2425
```
2526

2627
##### Sample code
2728

28-
```ts
29-
import * as msRest from "@azure/ms-rest-js";
30-
import * as msRestAzure from "@azure/ms-rest-azure-js";
31-
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
32-
import { ConsumptionManagementClient, ConsumptionManagementModels, ConsumptionManagementMappers } from "@azure/arm-consumption";
29+
While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
30+
```typescript
31+
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
32+
const { ConsumptionManagementClient } = require("@azure/arm-consumption");
3333
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3434

3535
msRestNodeAuth.interactiveLogin().then((creds) => {
3636
const client = new ConsumptionManagementClient(creds, subscriptionId);
37+
const scope = "testscope";
3738
const expand = "testexpand";
3839
const filter = "testfilter";
3940
const skiptoken = "testskiptoken";
4041
const top = 1;
41-
const apply = "testapply";
42-
client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
42+
const metric = "actualcost";
43+
client.usageDetails.list(scope, expand, filter, skiptoken, top, metric).then((result) => {
4344
console.log("The result is:");
4445
console.log(result);
4546
});
@@ -52,7 +53,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
5253

5354
##### Install @azure/ms-rest-browserauth
5455

55-
```
56+
```bash
5657
npm install @azure/ms-rest-browserauth
5758
```
5859

@@ -82,12 +83,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
8283
authManager.login();
8384
}
8485
const client = new Azure.ArmConsumption.ConsumptionManagementClient(res.creds, subscriptionId);
86+
const scope = "testscope";
8587
const expand = "testexpand";
8688
const filter = "testfilter";
8789
const skiptoken = "testskiptoken";
8890
const top = 1;
89-
const apply = "testapply";
90-
client.usageDetails.list(expand, filter, skiptoken, top, apply).then((result) => {
91+
const metric = "actualcost";
92+
client.usageDetails.list(scope, expand, filter, skiptoken, top, metric).then((result) => {
9193
console.log("The result is:");
9294
console.log(result);
9395
}).catch((err) => {
@@ -105,5 +107,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
105107

106108
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
107109

108-
109-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fconsumption%2Farm-consumption%2FREADME.png)
110+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/consumption/arm-consumption/README.png)

sdk/consumption/arm-consumption/package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "ConsumptionManagementClient Library with typescript type definitions for node.js and browser.",
55
"version": "6.3.0",
66
"dependencies": {
7-
"@azure/ms-rest-azure-js": "^1.1.0",
8-
"@azure/ms-rest-js": "^1.1.0",
9-
"tslib": "^1.9.3"
7+
"@azure/ms-rest-azure-js": "^2.0.1",
8+
"@azure/ms-rest-js": "^2.0.4",
9+
"tslib": "^1.10.0"
1010
},
1111
"keywords": [
1212
"node",
@@ -20,18 +20,19 @@
2020
"module": "./esm/consumptionManagementClient.js",
2121
"types": "./esm/consumptionManagementClient.d.ts",
2222
"devDependencies": {
23-
"typescript": "^3.1.1",
24-
"rollup": "^0.66.2",
25-
"rollup-plugin-node-resolve": "^3.4.0",
26-
"uglify-js": "^3.4.9"
23+
"typescript": "^3.5.3",
24+
"rollup": "^1.18.0",
25+
"rollup-plugin-node-resolve": "^5.2.0",
26+
"rollup-plugin-sourcemaps": "^0.4.2",
27+
"uglify-js": "^3.6.0"
2728
},
28-
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/consumption/arm-consumption",
29+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/consumption/arm-consumption",
2930
"repository": {
3031
"type": "git",
31-
"url": "https://github.com/azure/azure-sdk-for-js.git"
32+
"url": "https://github.com/Azure/azure-sdk-for-js.git"
3233
},
3334
"bugs": {
34-
"url": "https://github.com/azure/azure-sdk-for-js/issues"
35+
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
3536
},
3637
"files": [
3738
"dist/**/*.js",
@@ -43,6 +44,7 @@
4344
"esm/**/*.d.ts",
4445
"esm/**/*.d.ts.map",
4546
"src/**/*.ts",
47+
"README.md",
4648
"rollup.config.js",
4749
"tsconfig.json"
4850
],
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
import rollup from "rollup";
12
import nodeResolve from "rollup-plugin-node-resolve";
3+
import sourcemaps from "rollup-plugin-sourcemaps";
4+
25
/**
3-
* @type {import('rollup').RollupFileOptions}
6+
* @type {rollup.RollupFileOptions}
47
*/
58
const config = {
6-
input: './esm/consumptionManagementClient.js',
7-
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
9+
input: "./esm/consumptionManagementClient.js",
10+
external: [
11+
"@azure/ms-rest-js",
12+
"@azure/ms-rest-azure-js"
13+
],
814
output: {
915
file: "./dist/arm-consumption.js",
1016
format: "umd",
@@ -15,17 +21,17 @@ const config = {
1521
"@azure/ms-rest-azure-js": "msRestAzure"
1622
},
1723
banner: `/*
18-
* Copyright (c) Microsoft Corporation. All rights reserved.
19-
* Licensed under the MIT License. See License.txt in the project root for
20-
* license information.
24+
* Copyright (c) Microsoft Corporation.
25+
* Licensed under the MIT License.
2126
*
2227
* Code generated by Microsoft (R) AutoRest Code Generator.
23-
* Changes may cause incorrect behavior and will be lost if the code is
24-
* regenerated.
28+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
2529
*/`
2630
},
2731
plugins: [
28-
nodeResolve({ module: true })
32+
nodeResolve({ mainFields: ['module', 'main'] }),
33+
sourcemaps()
2934
]
3035
};
36+
3137
export default config;

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
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.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -19,17 +18,22 @@ class ConsumptionManagementClient extends ConsumptionManagementClientContext {
1918
// Operation groups
2019
usageDetails: operations.UsageDetails;
2120
marketplaces: operations.Marketplaces;
21+
budgets: operations.Budgets;
22+
tags: operations.Tags;
23+
charges: operations.Charges;
2224
balances: operations.Balances;
2325
reservationsSummaries: operations.ReservationsSummaries;
2426
reservationsDetails: operations.ReservationsDetails;
2527
reservationRecommendations: operations.ReservationRecommendations;
26-
budgets: operations.Budgets;
28+
reservationRecommendationDetails: operations.ReservationRecommendationDetails;
29+
reservationTransactions: operations.ReservationTransactions;
2730
priceSheet: operations.PriceSheet;
28-
tags: operations.Tags;
2931
forecasts: operations.Forecasts;
3032
operations: operations.Operations;
3133
aggregatedCost: operations.AggregatedCost;
32-
charges: operations.Charges;
34+
events: operations.EventsOperations;
35+
lots: operations.LotsOperations;
36+
credits: operations.Credits;
3337

3438
/**
3539
* Initializes a new instance of the ConsumptionManagementClient class.
@@ -41,17 +45,22 @@ class ConsumptionManagementClient extends ConsumptionManagementClientContext {
4145
super(credentials, subscriptionId, options);
4246
this.usageDetails = new operations.UsageDetails(this);
4347
this.marketplaces = new operations.Marketplaces(this);
48+
this.budgets = new operations.Budgets(this);
49+
this.tags = new operations.Tags(this);
50+
this.charges = new operations.Charges(this);
4451
this.balances = new operations.Balances(this);
4552
this.reservationsSummaries = new operations.ReservationsSummaries(this);
4653
this.reservationsDetails = new operations.ReservationsDetails(this);
4754
this.reservationRecommendations = new operations.ReservationRecommendations(this);
48-
this.budgets = new operations.Budgets(this);
55+
this.reservationRecommendationDetails = new operations.ReservationRecommendationDetails(this);
56+
this.reservationTransactions = new operations.ReservationTransactions(this);
4957
this.priceSheet = new operations.PriceSheet(this);
50-
this.tags = new operations.Tags(this);
5158
this.forecasts = new operations.Forecasts(this);
5259
this.operations = new operations.Operations(this);
5360
this.aggregatedCost = new operations.AggregatedCost(this);
54-
this.charges = new operations.Charges(this);
61+
this.events = new operations.EventsOperations(this);
62+
this.lots = new operations.LotsOperations(this);
63+
this.credits = new operations.Credits(this);
5564
}
5665
}
5766

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
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.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -13,7 +12,7 @@ import * as msRest from "@azure/ms-rest-js";
1312
import * as msRestAzure from "@azure/ms-rest-azure-js";
1413

1514
const packageName = "@azure/arm-consumption";
16-
const packageVersion = "0.1.0";
15+
const packageVersion = "6.3.0";
1716

1817
export class ConsumptionManagementClientContext extends msRestAzure.AzureServiceClient {
1918
credentials: msRest.ServiceClientCredentials;
@@ -44,7 +43,7 @@ export class ConsumptionManagementClientContext extends msRestAzure.AzureService
4443

4544
super(credentials, options);
4645

47-
this.apiVersion = '2018-10-01';
46+
this.apiVersion = '2019-10-01';
4847
this.acceptLanguage = 'en-US';
4948
this.longRunningOperationRetryTimeout = 30;
5049
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";

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

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,58 @@
11
/*
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.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
7-
* Changes may cause incorrect behavior and will be lost if the code is
8-
* regenerated.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
97
*/
108

119
export {
12-
ManagementGroupAggregatedCostResult,
13-
Resource,
14-
BaseResource,
15-
ErrorResponse,
16-
ErrorDetails,
17-
UsageDetail,
18-
MeterDetails,
19-
Marketplace,
10+
discriminators,
11+
Amount,
2012
Balance,
21-
BalancePropertiesNewPurchasesDetailsItem,
2213
BalancePropertiesAdjustmentDetailsItem,
23-
ReservationSummary,
24-
ReservationDetail,
25-
PriceSheetResult,
26-
PriceSheetProperties,
14+
BalancePropertiesNewPurchasesDetailsItem,
15+
BaseResource,
16+
Budget,
17+
BudgetComparisonExpression,
18+
BudgetFilter,
19+
BudgetFilterProperties,
20+
BudgetTimePeriod,
21+
ChargeSummary,
22+
CreditBalanceSummary,
23+
CreditSummary,
24+
CurrentSpend,
25+
ErrorDetails,
26+
ErrorResponse,
27+
EventSummary,
2728
Forecast,
2829
ForecastPropertiesConfidenceLevelsItem,
29-
ChargeSummary,
30+
LegacyChargeSummary,
31+
LegacyReservationTransaction,
32+
LegacyUsageDetail,
33+
LotSummary,
34+
ManagementGroupAggregatedCostResult,
35+
Marketplace,
36+
MeterDetails,
37+
MeterDetailsResponse,
38+
ModernChargeSummary,
39+
ModernReservationTransaction,
40+
ModernUsageDetail,
41+
Notification,
42+
PriceSheetProperties,
43+
PriceSheetResult,
3044
ProxyResource,
31-
TagsResult,
45+
ReservationDetail,
46+
ReservationRecommendationDetailsCalculatedSavingsProperties,
47+
ReservationRecommendationDetailsModel,
48+
ReservationRecommendationDetailsResourceProperties,
49+
ReservationRecommendationDetailsSavingsProperties,
50+
ReservationRecommendationDetailsUsageProperties,
51+
ReservationSummary,
52+
ReservationTransaction,
53+
ReservationTransactionResource,
54+
Resource,
3255
Tag,
33-
Budget,
34-
BudgetTimePeriod,
35-
Filters,
36-
CurrentSpend,
37-
Notification
56+
TagsResult,
57+
UsageDetail
3858
} from "../models/mappers";
39-

0 commit comments

Comments
 (0)