diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0a554e9578c8..f18419e38834 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1661,6 +1661,7 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} + deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -3157,7 +3158,7 @@ packages: /core-js/2.6.12: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. + deprecated: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. requiresBuild: true dev: false @@ -7215,6 +7216,7 @@ packages: /source-map-resolve/0.5.3: resolution: {integrity: sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==} + deprecated: See https://github.com/lydell/source-map-resolve#deprecated dependencies: atob: 2.1.2 decode-uri-component: 0.2.0 @@ -7232,6 +7234,7 @@ packages: /source-map-url/0.4.1: resolution: {integrity: sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==} + deprecated: See https://github.com/lydell/source-map-url#deprecated dev: false /source-map/0.5.7: @@ -8912,7 +8915,7 @@ packages: dev: false file:projects/arm-consumption.tgz: - resolution: {integrity: sha512-+QO3p+4CRPfQWWvafo/pWxWoe8GKmhggUHMBLgJtRy7Lkgd/0Z96EqDBhtPyQWUhrLah6ZQLyLMmBRKl8/UNdg==, tarball: file:projects/arm-consumption.tgz} + resolution: {integrity: sha512-m+tcI8203C8X1l/+HsD9meTIpK7WFovm3PIq8aPtplYANgJya1BCr/a8aFHJGlLx5SRquHceWeAZeP0Iqn6jTQ==, tarball: file:projects/arm-consumption.tgz} name: '@rush-temp/arm-consumption' version: 0.0.0 dependencies: @@ -8924,6 +8927,7 @@ packages: cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 + rimraf: 3.0.2 rollup: 1.32.1 rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 diff --git a/sdk/consumption/arm-consumption/CHANGELOG.md b/sdk/consumption/arm-consumption/CHANGELOG.md index 149522f751db..888bccbfed97 100644 --- a/sdk/consumption/arm-consumption/CHANGELOG.md +++ b/sdk/consumption/arm-consumption/CHANGELOG.md @@ -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). diff --git a/sdk/consumption/arm-consumption/LICENSE b/sdk/consumption/arm-consumption/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/consumption/arm-consumption/LICENSE +++ b/sdk/consumption/arm-consumption/LICENSE @@ -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 diff --git a/sdk/consumption/arm-consumption/README.md b/sdk/consumption/arm-consumption/README.md index 28c2ebe0ee72..0deee092228b 100644 --- a/sdk/consumption/arm-consumption/README.md +++ b/sdk/consumption/arm-consumption/README.md @@ -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 diff --git a/sdk/consumption/arm-consumption/_meta.json b/sdk/consumption/arm-consumption/_meta.json index d0e59c705456..6b62e183ebe0 100644 --- a/sdk/consumption/arm-consumption/_meta.json +++ b/sdk/consumption/arm-consumption/_meta.json @@ -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" } \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index a37de4da4ecd..6a0d0f0dc14c 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -3,10 +3,8 @@ "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", @@ -14,13 +12,7 @@ "@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", @@ -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", @@ -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", @@ -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", @@ -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" }, diff --git a/sdk/consumption/arm-consumption/review/arm-consumption.api.md b/sdk/consumption/arm-consumption/review/arm-consumption.api.md index c8c1e970bcc2..f220b8458c23 100644 --- a/sdk/consumption/arm-consumption/review/arm-consumption.api.md +++ b/sdk/consumption/arm-consumption/review/arm-consumption.api.md @@ -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; @@ -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; @@ -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; @@ -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; }; diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts index 10eb7bfa3ec8..59b0fb91ac6c 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts @@ -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, @@ -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. @@ -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); diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts deleted file mode 100644 index 2bdc0c9c9dc3..000000000000 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClientContext.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * 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 { ConsumptionManagementClientOptionalParams } from "./models"; - -export class ConsumptionManagementClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the ConsumptionManagementClientContext class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId Azure Subscription ID. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: ConsumptionManagementClientOptionalParams - ) { - 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.0.0-beta.1`; - 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"; - } -} diff --git a/sdk/consumption/arm-consumption/src/index.ts b/sdk/consumption/arm-consumption/src/index.ts index 85be07789c30..6b9c66458886 100644 --- a/sdk/consumption/arm-consumption/src/index.ts +++ b/sdk/consumption/arm-consumption/src/index.ts @@ -9,5 +9,4 @@ /// export * from "./models"; export { ConsumptionManagementClient } from "./consumptionManagementClient"; -export { ConsumptionManagementClientContext } from "./consumptionManagementClientContext"; export * from "./operationsInterfaces"; diff --git a/sdk/consumption/arm-consumption/src/models/index.ts b/sdk/consumption/arm-consumption/src/models/index.ts index 3a01d3d767f3..2409862e5340 100644 --- a/sdk/consumption/arm-consumption/src/models/index.ts +++ b/sdk/consumption/arm-consumption/src/models/index.ts @@ -8,6 +8,10 @@ import * as coreClient from "@azure/core-client"; +export type LegacyReservationRecommendationPropertiesUnion = + | LegacyReservationRecommendationProperties + | LegacySingleScopeReservationRecommendationProperties + | LegacySharedScopeReservationRecommendationProperties; export type UsageDetailUnion = | UsageDetail | LegacyUsageDetail @@ -120,27 +124,6 @@ export interface BudgetsListResult { readonly nextLink?: string; } -/** The Resource model definition. */ -export interface ProxyResource { - /** - * Resource Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * Resource name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Resource type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. */ - eTag?: string; -} - /** The start and end date for a budget. */ export interface BudgetTimePeriod { /** The start date for the budget. */ @@ -227,6 +210,27 @@ export interface ForecastSpend { readonly unit?: string; } +/** The Resource model definition. */ +export interface ProxyResource { + /** + * Resource Id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * Resource name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not. */ + eTag?: string; +} + /** The tag resource. */ export interface Tag { /** Tag key. */ @@ -797,6 +801,82 @@ export interface MeterDetailsResponse { readonly serviceFamily?: string; } +/** The properties of the reservation recommendation. */ +export interface LegacyReservationRecommendationProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + scope: "Single" | "Shared"; + /** + * The number of days of usage to look back for recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lookBackPeriod?: string; + /** + * The instance Flexibility Ratio. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceFlexibilityRatio?: number; + /** + * The instance Flexibility Group. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly instanceFlexibilityGroup?: string; + /** + * The normalized Size. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly normalizedSize?: string; + /** + * The recommended Quantity Normalized. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantityNormalized?: number; + /** + * The meter id (GUID) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly meterId?: string; + /** + * The azure resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; + /** + * RI recommendations in one or three year terms. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * The total amount of cost without reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly costWithNoReservedInstances?: number; + /** + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantity?: number; + /** + * The total amount of cost with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalCostWithReservedInstances?: number; + /** + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly netSavings?: number; + /** + * The usage date for looking back. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly firstUsageDate?: Date; + /** + * List of sku properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuProperties?: SkuProperty[]; +} + /** The Sku property */ export interface SkuProperty { /** @@ -1807,6 +1887,23 @@ export type AmountWithExchangeRate = Amount & { readonly exchangeRateMonth?: number; }; +/** The properties of the legacy reservation recommendation for single scope. */ +export type LegacySingleScopeReservationRecommendationProperties = LegacyReservationRecommendationProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + scope: "Single"; + /** + * Subscription id associated with single scoped recommendation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; +}; + +/** The properties of the legacy reservation recommendation for shared scope. */ +export type LegacySharedScopeReservationRecommendationProperties = LegacyReservationRecommendationProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + scope: "Shared"; +}; + /** Legacy usage detail. */ export type LegacyUsageDetail = UsageDetail & { /** @@ -2024,6 +2121,16 @@ export type LegacyUsageDetail = UsageDetail & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly payGPrice?: number; + /** + * Unique identifier for the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitId?: string; + /** + * Name of the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitName?: string; /** * Identifier that indicates how the meter is priced. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2462,11 +2569,8 @@ export type LegacyReservationRecommendation = ReservationRecommendation & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly firstUsageDate?: Date; - /** - * Shared or single recommendation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly scope?: string; + /** Shared or single recommendation. */ + scope: string; /** * List of sku properties * NOTE: This property will not be serialized. It can only be populated by the server. diff --git a/sdk/consumption/arm-consumption/src/models/mappers.ts b/sdk/consumption/arm-consumption/src/models/mappers.ts index 206c50f3893a..ddeffd645b64 100644 --- a/sdk/consumption/arm-consumption/src/models/mappers.ts +++ b/sdk/consumption/arm-consumption/src/models/mappers.ts @@ -179,42 +179,6 @@ export const BudgetsListResult: coreClient.CompositeMapper = { } }; -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - eTag: { - serializedName: "eTag", - type: { - name: "String" - } - } - } - } -}; - export const BudgetTimePeriod: coreClient.CompositeMapper = { type: { name: "Composite", @@ -466,6 +430,42 @@ export const ForecastSpend: coreClient.CompositeMapper = { } }; +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + eTag: { + serializedName: "eTag", + type: { + name: "String" + } + } + } + } +}; + export const Tag: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1453,6 +1453,131 @@ export const MeterDetailsResponse: coreClient.CompositeMapper = { } }; +export const LegacyReservationRecommendationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LegacyReservationRecommendationProperties", + uberParent: "LegacyReservationRecommendationProperties", + polymorphicDiscriminator: { + serializedName: "scope", + clientName: "scope" + }, + modelProperties: { + lookBackPeriod: { + serializedName: "lookBackPeriod", + readOnly: true, + type: { + name: "String" + } + }, + instanceFlexibilityRatio: { + serializedName: "instanceFlexibilityRatio", + readOnly: true, + type: { + name: "Number" + } + }, + instanceFlexibilityGroup: { + serializedName: "instanceFlexibilityGroup", + readOnly: true, + type: { + name: "String" + } + }, + normalizedSize: { + serializedName: "normalizedSize", + readOnly: true, + type: { + name: "String" + } + }, + recommendedQuantityNormalized: { + serializedName: "recommendedQuantityNormalized", + readOnly: true, + type: { + name: "Number" + } + }, + meterId: { + serializedName: "meterId", + readOnly: true, + type: { + name: "Uuid" + } + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + }, + term: { + serializedName: "term", + readOnly: true, + type: { + name: "String" + } + }, + costWithNoReservedInstances: { + serializedName: "costWithNoReservedInstances", + readOnly: true, + type: { + name: "Number" + } + }, + recommendedQuantity: { + serializedName: "recommendedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + totalCostWithReservedInstances: { + serializedName: "totalCostWithReservedInstances", + readOnly: true, + type: { + name: "Number" + } + }, + netSavings: { + serializedName: "netSavings", + readOnly: true, + type: { + name: "Number" + } + }, + firstUsageDate: { + serializedName: "firstUsageDate", + readOnly: true, + type: { + name: "DateTime" + } + }, + scope: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + }, + skuProperties: { + serializedName: "skuProperties", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuProperty" + } + } + } + } + } + } +}; + export const SkuProperty: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3072,6 +3197,41 @@ export const AmountWithExchangeRate: coreClient.CompositeMapper = { } }; +export const LegacySingleScopeReservationRecommendationProperties: coreClient.CompositeMapper = { + serializedName: "Single", + type: { + name: "Composite", + className: "LegacySingleScopeReservationRecommendationProperties", + uberParent: "LegacyReservationRecommendationProperties", + polymorphicDiscriminator: + LegacyReservationRecommendationProperties.type.polymorphicDiscriminator, + modelProperties: { + ...LegacyReservationRecommendationProperties.type.modelProperties, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +export const LegacySharedScopeReservationRecommendationProperties: coreClient.CompositeMapper = { + serializedName: "Shared", + type: { + name: "Composite", + className: "LegacySharedScopeReservationRecommendationProperties", + uberParent: "LegacyReservationRecommendationProperties", + polymorphicDiscriminator: + LegacyReservationRecommendationProperties.type.polymorphicDiscriminator, + modelProperties: { + ...LegacyReservationRecommendationProperties.type.modelProperties + } + } +}; + export const LegacyUsageDetail: coreClient.CompositeMapper = { serializedName: "legacy", type: { @@ -3382,6 +3542,20 @@ export const LegacyUsageDetail: coreClient.CompositeMapper = { name: "Number" } }, + benefitId: { + serializedName: "properties.benefitId", + readOnly: true, + type: { + name: "String" + } + }, + benefitName: { + serializedName: "properties.benefitName", + readOnly: true, + type: { + name: "String" + } + }, pricingModel: { serializedName: "properties.pricingModel", readOnly: true, @@ -4012,7 +4186,7 @@ export const LegacyReservationRecommendation: coreClient.CompositeMapper = { }, scope: { serializedName: "properties.scope", - readOnly: true, + required: true, type: { name: "String" } @@ -4328,9 +4502,12 @@ export const LegacyReservationTransaction: coreClient.CompositeMapper = { }; export let discriminators = { + LegacyReservationRecommendationProperties: LegacyReservationRecommendationProperties, "Resource.UsageDetail": UsageDetail, "Resource.ReservationRecommendation": ReservationRecommendation, "ProxyResource.ChargeSummary": ChargeSummary, + "LegacyReservationRecommendationProperties.Single": LegacySingleScopeReservationRecommendationProperties, + "LegacyReservationRecommendationProperties.Shared": LegacySharedScopeReservationRecommendationProperties, "Resource.legacy": LegacyReservationRecommendation, "Resource.modern": ModernReservationRecommendation, "ProxyResource.legacy": LegacyChargeSummary, diff --git a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts index 3c7e7b24ad40..6860727b8e7f 100644 --- a/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts +++ b/sdk/consumption/arm-consumption/src/operations/aggregatedCost.ts @@ -10,7 +10,7 @@ import { AggregatedCost } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { AggregatedCostGetByManagementGroupOptionalParams, AggregatedCostGetByManagementGroupResponse, @@ -20,13 +20,13 @@ import { /** Class containing AggregatedCost operations. */ export class AggregatedCostImpl implements AggregatedCost { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class AggregatedCost class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/balances.ts b/sdk/consumption/arm-consumption/src/operations/balances.ts index f14871fbfe93..ec5c3fcf9868 100644 --- a/sdk/consumption/arm-consumption/src/operations/balances.ts +++ b/sdk/consumption/arm-consumption/src/operations/balances.ts @@ -10,7 +10,7 @@ import { Balances } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { BalancesGetByBillingAccountOptionalParams, BalancesGetByBillingAccountResponse, @@ -20,13 +20,13 @@ import { /** Class containing Balances operations. */ export class BalancesImpl implements Balances { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Balances class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } @@ -86,7 +86,7 @@ const getByBillingAccountOperationSpec: coreClient.OperationSpec = { }; const getForBillingPeriodByBillingAccountOperationSpec: coreClient.OperationSpec = { path: - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances", httpMethod: "GET", responses: { 200: { diff --git a/sdk/consumption/arm-consumption/src/operations/budgets.ts b/sdk/consumption/arm-consumption/src/operations/budgets.ts index 14d5d108ec9d..3144474a981c 100644 --- a/sdk/consumption/arm-consumption/src/operations/budgets.ts +++ b/sdk/consumption/arm-consumption/src/operations/budgets.ts @@ -11,7 +11,7 @@ import { Budgets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { Budget, BudgetsListNextOptionalParams, @@ -28,13 +28,13 @@ import { /// /** Class containing Budgets operations. */ export class BudgetsImpl implements Budgets { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Budgets class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/charges.ts b/sdk/consumption/arm-consumption/src/operations/charges.ts index 84cf290ccf3e..2f817da55bcd 100644 --- a/sdk/consumption/arm-consumption/src/operations/charges.ts +++ b/sdk/consumption/arm-consumption/src/operations/charges.ts @@ -10,18 +10,18 @@ import { Charges } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { ChargesListOptionalParams, ChargesListResponse } from "../models"; /** Class containing Charges operations. */ export class ChargesImpl implements Charges { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Charges class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/credits.ts b/sdk/consumption/arm-consumption/src/operations/credits.ts index ba7de30ac696..921fe9fcfa95 100644 --- a/sdk/consumption/arm-consumption/src/operations/credits.ts +++ b/sdk/consumption/arm-consumption/src/operations/credits.ts @@ -10,18 +10,18 @@ import { Credits } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { CreditsGetOptionalParams, CreditsGetResponse } from "../models"; /** Class containing Credits operations. */ export class CreditsImpl implements Credits { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Credits class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts index 27b8dfbcc29c..06a65db0db31 100644 --- a/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts +++ b/sdk/consumption/arm-consumption/src/operations/eventsOperations.ts @@ -11,7 +11,7 @@ import { EventsOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { EventSummary, EventsListByBillingProfileNextOptionalParams, @@ -27,13 +27,13 @@ import { /// /** Class containing EventsOperations operations. */ export class EventsOperationsImpl implements EventsOperations { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class EventsOperations class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts index 29761c54ad5b..cedd214243ff 100644 --- a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts +++ b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts @@ -11,7 +11,7 @@ import { LotsOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { LotSummary, LotsListByBillingProfileNextOptionalParams, @@ -27,13 +27,13 @@ import { /// /** Class containing LotsOperations operations. */ export class LotsOperationsImpl implements LotsOperations { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class LotsOperations class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts index 91d834f18a26..45219696eb9b 100644 --- a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts +++ b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts @@ -11,7 +11,7 @@ import { Marketplaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { Marketplace, MarketplacesListNextOptionalParams, @@ -23,13 +23,13 @@ import { /// /** Class containing Marketplaces operations. */ export class MarketplacesImpl implements Marketplaces { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Marketplaces class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/operations.ts b/sdk/consumption/arm-consumption/src/operations/operations.ts index e06f354b8e36..3ff353670fbf 100644 --- a/sdk/consumption/arm-consumption/src/operations/operations.ts +++ b/sdk/consumption/arm-consumption/src/operations/operations.ts @@ -11,7 +11,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { Operation, OperationsListNextOptionalParams, @@ -23,13 +23,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts index 7f1f87b93f3a..baf8229c556b 100644 --- a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts +++ b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts @@ -10,7 +10,7 @@ import { PriceSheet } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { PriceSheetGetOptionalParams, PriceSheetGetResponse, @@ -20,13 +20,13 @@ import { /** Class containing PriceSheet operations. */ export class PriceSheetImpl implements PriceSheet { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class PriceSheet class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts index b8aaa6b5a949..c3bf7a979b7b 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts @@ -10,7 +10,7 @@ import { ReservationRecommendationDetails } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { Term, LookBackPeriod, @@ -21,13 +21,13 @@ import { /** Class containing ReservationRecommendationDetails operations. */ export class ReservationRecommendationDetailsImpl implements ReservationRecommendationDetails { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationRecommendationDetails class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts index c4592c3fe5bb..91e81411e61b 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts @@ -11,7 +11,7 @@ import { ReservationRecommendations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { ReservationRecommendationUnion, ReservationRecommendationsListNextOptionalParams, @@ -24,13 +24,13 @@ import { /** Class containing ReservationRecommendations operations. */ export class ReservationRecommendationsImpl implements ReservationRecommendations { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationRecommendations class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts index 33b2fec8e592..1331e4507515 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts @@ -11,7 +11,7 @@ import { ReservationTransactions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { ReservationTransaction, ReservationTransactionsListNextOptionalParams, @@ -28,13 +28,13 @@ import { /// /** Class containing ReservationTransactions operations. */ export class ReservationTransactionsImpl implements ReservationTransactions { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationTransactions class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts index ed32d2487a8f..559f5c455263 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts @@ -11,7 +11,7 @@ import { ReservationsDetails } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { ReservationDetail, ReservationsDetailsListByReservationOrderNextOptionalParams, @@ -31,13 +31,13 @@ import { /// /** Class containing ReservationsDetails operations. */ export class ReservationsDetailsImpl implements ReservationsDetails { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationsDetails class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts index c4a5b4a96256..8fc6c0110bb8 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts @@ -11,7 +11,7 @@ import { ReservationsSummaries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { ReservationSummary, Datagrain, @@ -32,13 +32,13 @@ import { /// /** Class containing ReservationsSummaries operations. */ export class ReservationsSummariesImpl implements ReservationsSummaries { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class ReservationsSummaries class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/tags.ts b/sdk/consumption/arm-consumption/src/operations/tags.ts index 2e3b656eae7f..51406a682b0d 100644 --- a/sdk/consumption/arm-consumption/src/operations/tags.ts +++ b/sdk/consumption/arm-consumption/src/operations/tags.ts @@ -10,18 +10,18 @@ import { Tags } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { TagsGetOptionalParams, TagsGetResponse } from "../models"; /** Class containing Tags operations. */ export class TagsImpl implements Tags { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class Tags class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } diff --git a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts index 8f1ebaf6a65c..2836e80fc7a3 100644 --- a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts @@ -11,7 +11,7 @@ import { UsageDetails } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ConsumptionManagementClientContext } from "../consumptionManagementClientContext"; +import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { UsageDetailUnion, UsageDetailsListNextOptionalParams, @@ -23,13 +23,13 @@ import { /// /** Class containing UsageDetails operations. */ export class UsageDetailsImpl implements UsageDetails { - private readonly client: ConsumptionManagementClientContext; + private readonly client: ConsumptionManagementClient; /** * Initialize a new instance of the class UsageDetails class. * @param client Reference to the service client */ - constructor(client: ConsumptionManagementClientContext) { + constructor(client: ConsumptionManagementClient) { this.client = client; } @@ -177,6 +177,7 @@ const listOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -200,6 +201,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts index 8368199ab4d3..7ed89b043e1b 100644 --- a/sdk/consumption/arm-consumption/test/sampleTest.ts +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -10,13 +10,9 @@ import { env, record, RecorderEnvironmentSetup, - Recorder, - delay, - isPlaybackMode + Recorder } from "@azure-tools/test-recorder"; import * as assert from "assert"; -import { ClientSecretCredential } from "@azure/identity"; -import { ConsumptionManagementClient } from "../src/consumptionManagementClient"; const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { @@ -35,99 +31,18 @@ const recorderEnvSetup: RecorderEnvironmentSetup = { queryParametersToSkip: [] }; -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - describe("My test", () => { let recorder: Recorder; - let subscriptionId: string; - let client: ConsumptionManagementClient; - let location: string; - let resourceGroup: string; - let budgetName: string; - let vmName: string; - let scope: string; beforeEach(async function() { recorder = record(this, recorderEnvSetup); - subscriptionId = env.SUBSCRIPTION_ID; - // This is an example of how the environment variables are used - const credential = new ClientSecretCredential( - env.AZURE_TENANT_ID, - env.AZURE_CLIENT_ID, - env.AZURE_CLIENT_SECRET - ); - client = new ConsumptionManagementClient(credential, subscriptionId); - location = "eastus"; - resourceGroup = "myjstest"; - budgetName = "mybudgetxxxy"; - vmName = "myvmxxx"; - scope = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroup; }); afterEach(async function() { await recorder.stop(); }); - it("budgets create test", async function() { - const res = await client.budgets.createOrUpdate(scope,budgetName,{ - category: "Cost", - amount: 100, - timeGrain: "Monthly", - timePeriod: { - startDate: new Date("2021-11-01T00:00:00Z"), - endDate: new Date("2021-11-31T00:00:00Z") - }, - filter: { - and: [ - { - dimensions: { - name: "ResourceId", - operator: "In", - values: [ - "/subscriptions/"+subscriptionId+"/resourceGroups/"+resourceGroup+"/providers/Microsoft.Compute/virtualMachines/"+vmName - ] - } - }, - { - tags: { - name: "category", - operator: "In", - values: [ - "Dev", - "Prod" - ] - } - } - ] - }, - notifications: { - Actual_GreaterThan_80_Percent: { - enabled: true, - operator: "GreaterThan", - threshold: 80, - contactEmails: [ - "johndoe@contoso.com", - "janesmith@contoso.com" - ], - contactRoles: [ - "Contributor", - "Reader" - ], - thresholdType: "Actual" - } - } - }); - assert.equal(res.name,budgetName); - }); - - it("budgets get test", async function() { - const res = await client.budgets.get(scope,budgetName); - assert.equal(res.name,budgetName); - }); - - it("budgets delete test", async function() { - const res = await client.budgets.delete(scope,budgetName); + it("sample test", async function() { + console.log("Hi, I'm a test!"); }); });