Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_@azure/arm-consumption] [consumption]Update readme.python.md(Do not merge) #1033

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 14 additions & 21 deletions sdk/consumption/arm-consumption/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
## Release History
# Release History

## 9.1.0 (2022-01-14)

**Features**

### 9.0.0-beta.2 (Unreleased)
- Type Alias LegacyUsageDetail has a new parameter benefitId
- Type Alias LegacyUsageDetail has a new parameter benefitName


## 9.0.0 (2021-12-16)

#### Features Added
The package of @azure/arm-consumption is using our next generation design principles since version 9.0.0, which contains breaking changes.

#### Breaking Changes
To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).

#### Bugs Fixed
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).

#### Other Changes

### 9.0.0-beta.1 (2021-11-16)

This is the first preview for the new version of the `@azure/arm-consumption` package that follows the new [guidelines for TypeScript SDKs](https://azure.github.io/azure-sdk/typescript_introduction.html) for Azure services.

While this package remains auto generated, the SDK generator itself has undergone changes to comply with the above guidelines in order to generate packages that are idiomatic to the JavaScript/TypeScript ecosystem and consistent with other packages for Azure services. For more on this, please see [State of the Azure SDK 2021](https://devblogs.microsoft.com/azure-sdk/state-of-the-azure-sdk-2021/).

Please note that this version has breaking changes, all of which were made after careful consideration during the authoring of the guidelines and user studies.

**Noteworthy changes and features**
- Authentication: The packages `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` are no longer supported. Use package [@azure/identity](https://www.npmjs.com/package/@azure/identity) instead. Select a credential from Azure Identity examples based on the authentication method of your choice.
- Callbacks: Method overloads that used callbacks have been removed and the use of promises is encouraged instead.
- List operations now return an iterable result that follows the `PagedAsyncIterableIterator` interface as opposed to the previous model where you had to make a new request using the link to the next page.
- Long running operations i.e. the Lro related object returned by methods whose names started with `begin`, now uses `pollUntilDone` to check whether the request is finished, instead of `pollUntilFinished`. To get the final result, use the corresponding method that will have the suffix `AndWait`.
- The SDK only supports ECMAScript 2015 (ES6) and beyond, all projects that referenced this SDK should be upgraded to use ES6.
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/consumption/arm-consumption/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Microsoft
Copyright (c) 2022 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions sdk/consumption/arm-consumption/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ConsumptionManagementClient(new DefaultAzureCredential(), subscriptionId);
```


### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).

## Key concepts

### ConsumptionManagementClient
Expand Down
8 changes: 4 additions & 4 deletions sdk/consumption/arm-consumption/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "48e3687f073bee2cdc03b1bab8b2cbbee07dcf49",
"commit": "39758b3496c8096ab9fe067f9dd434b4a88dc9ce",
"readme": "specification/consumption/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.14",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-beta.14"
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1",
"repository_url": "https://github.com/openapi-env-test/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20211130.1"
}
23 changes: 7 additions & 16 deletions sdk/consumption/arm-consumption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ConsumptionManagementClient.",
"version": "9.0.0-beta.2",
"engines": {
"node": ">=12.0.0"
},
"version": "9.1.0",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand All @@ -36,6 +28,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"mocha": "^7.1.1",
Expand All @@ -46,9 +39,7 @@
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
Expand All @@ -75,7 +66,7 @@
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
Expand All @@ -90,7 +81,7 @@
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
Expand Down
56 changes: 43 additions & 13 deletions sdk/consumption/arm-consumption/review/arm-consumption.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,15 @@ export type ChargeSummaryKind = string;
export type ChargeSummaryUnion = ChargeSummary | LegacyChargeSummary | ModernChargeSummary;

// @public (undocumented)
export class ConsumptionManagementClient extends ConsumptionManagementClientContext {
export class ConsumptionManagementClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams);
// (undocumented)
aggregatedCost: AggregatedCost;
// (undocumented)
apiVersion: string;
// (undocumented)
balances: Balances;
// (undocumented)
budgets: Budgets;
Expand Down Expand Up @@ -254,22 +258,13 @@ export class ConsumptionManagementClient extends ConsumptionManagementClientCont
// (undocumented)
reservationTransactions: ReservationTransactions;
// (undocumented)
subscriptionId: string;
// (undocumented)
tags: Tags;
// (undocumented)
usageDetails: UsageDetails;
}

// @public (undocumented)
export class ConsumptionManagementClientContext extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
subscriptionId: string;
}

// @public
export interface ConsumptionManagementClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
Expand Down Expand Up @@ -666,13 +661,46 @@ export type LegacyReservationRecommendation = ReservationRecommendation & {
readonly totalCostWithReservedInstances?: number;
readonly netSavings?: number;
readonly firstUsageDate?: Date;
readonly scope?: string;
scope: string;
readonly skuProperties?: SkuProperty[];
};

// @public
export interface LegacyReservationRecommendationProperties {
readonly costWithNoReservedInstances?: number;
readonly firstUsageDate?: Date;
readonly instanceFlexibilityGroup?: string;
readonly instanceFlexibilityRatio?: number;
readonly lookBackPeriod?: string;
readonly meterId?: string;
readonly netSavings?: number;
readonly normalizedSize?: string;
readonly recommendedQuantity?: number;
readonly recommendedQuantityNormalized?: number;
readonly resourceType?: string;
scope: "Single" | "Shared";
readonly skuProperties?: SkuProperty[];
readonly term?: string;
readonly totalCostWithReservedInstances?: number;
}

// @public (undocumented)
export type LegacyReservationRecommendationPropertiesUnion = LegacyReservationRecommendationProperties | LegacySingleScopeReservationRecommendationProperties | LegacySharedScopeReservationRecommendationProperties;

// @public
export type LegacyReservationTransaction = ReservationTransaction & {};

// @public
export type LegacySharedScopeReservationRecommendationProperties = LegacyReservationRecommendationProperties & {
scope: "Shared";
};

// @public
export type LegacySingleScopeReservationRecommendationProperties = LegacyReservationRecommendationProperties & {
scope: "Single";
readonly subscriptionId?: string;
};

// @public
export type LegacyUsageDetail = UsageDetail & {
readonly billingAccountId?: string;
Expand Down Expand Up @@ -718,6 +746,8 @@ export type LegacyUsageDetail = UsageDetail & {
readonly chargeType?: string;
readonly frequency?: string;
readonly payGPrice?: number;
readonly benefitId?: string;
readonly benefitName?: string;
readonly pricingModel?: PricingModelType;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreClient from "@azure/core-client";
import * as coreAuth from "@azure/core-auth";
import {
UsageDetailsImpl,
Expand Down Expand Up @@ -45,10 +46,13 @@ import {
LotsOperations,
Credits
} from "./operationsInterfaces";
import { ConsumptionManagementClientContext } from "./consumptionManagementClientContext";
import { ConsumptionManagementClientOptionalParams } from "./models";

export class ConsumptionManagementClient extends ConsumptionManagementClientContext {
export class ConsumptionManagementClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;

/**
* Initializes a new instance of the ConsumptionManagementClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
Expand All @@ -60,7 +64,46 @@ export class ConsumptionManagementClient extends ConsumptionManagementClientCont
subscriptionId: string,
options?: ConsumptionManagementClientOptionalParams
) {
super(credentials, subscriptionId, options);
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
if (subscriptionId === undefined) {
throw new Error("'subscriptionId' cannot be null");
}

// Initializing default values for options
if (!options) {
options = {};
}
const defaults: ConsumptionManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};

const packageDetails = `azsdk-js-arm-consumption/9.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;

if (!options.credentialScopes) {
options.credentialScopes = ["https://management.azure.com/.default"];
}
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri: options.endpoint || "https://management.azure.com"
};
super(optionsWithDefaults);
// Parameter assignments
this.subscriptionId = subscriptionId;

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-10-01";
this.usageDetails = new UsageDetailsImpl(this);
this.marketplaces = new MarketplacesImpl(this);
this.budgets = new BudgetsImpl(this);
Expand Down
Loading