diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 551b759f3099..a1620e454dbc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4818,7 +4818,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230803 + typescript: 5.2.0-dev.20230804 dev: false /duplexer3/0.1.5: @@ -10335,8 +10335,8 @@ packages: hasBin: true dev: false - /typescript/5.2.0-dev.20230803: - resolution: {integrity: sha512-DwCyutWHyT7Il7xpJCxtx4/S5F4qjAo2SE6QDRSLhEUtBFGwGHTHCvuyfm9KNrdwn67jGitdlw4gpbSTVVjoww==} + /typescript/5.2.0-dev.20230804: + resolution: {integrity: sha512-4g7zcF85Th+zpaMgR7CHzM1MqjJ0Fv3+2PUxzCUMW8tc7aRYGPtQBfnAyN0+yXChZaV6lVejmrh7hle1DMAEcw==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -12734,7 +12734,7 @@ packages: dev: false file:projects/arm-consumption.tgz: - resolution: {integrity: sha512-c+hU20o2kCuEaXsaztEJVTNYXrdFRvXeJcJSP3MTcazD70wLaTuj8zsZVQjQOhMtz84m+3KvE1nppEA6tavVGA==, tarball: file:projects/arm-consumption.tgz} + resolution: {integrity: sha512-KBF8j8ziZ3SXXvzYxiI7G7VcCOX2O9SWASU305e6RagXbaprfJmENf/OKuyTQb5RP6SFfwtVZ/RP2OuIdm/sfQ==, tarball: file:projects/arm-consumption.tgz} name: '@rush-temp/arm-consumption' version: 0.0.0 dependencies: @@ -12749,7 +12749,7 @@ packages: chai: 4.3.7 cross-env: 7.0.3 dotenv: 16.3.1 - mkdirp: 1.0.4 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -20263,7 +20263,7 @@ packages: dev: false file:projects/notification-hubs.tgz: - resolution: {integrity: sha512-9MFu1tfnxzzD0yi+/vt2r/ZCUZ79/cMut8DlmlKrYaA4vJo/CicjvfUAWMHz6lkhbJLpYuHy73X0IPIbve11fg==, tarball: file:projects/notification-hubs.tgz} + resolution: {integrity: sha512-DGgM6ZJxfKnVK8axRpJQXEKY+mhOliJQc1QU5q/cyzia188SP9xzz4UX73KmCYNchJuY8AhUoRMShUy+p4ztlg==, tarball: file:projects/notification-hubs.tgz} name: '@rush-temp/notification-hubs' version: 0.0.0 dependencies: diff --git a/sdk/consumption/arm-consumption/CHANGELOG.md b/sdk/consumption/arm-consumption/CHANGELOG.md index f76f06327d23..35017732bc69 100644 --- a/sdk/consumption/arm-consumption/CHANGELOG.md +++ b/sdk/consumption/arm-consumption/CHANGELOG.md @@ -1,15 +1,59 @@ # Release History + +## 10.0.0 (2023-08-04) + +**Features** -## 9.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation LotsOperations.listByCustomer + - Added operation PriceSheet.beginDownloadByBillingAccountPeriod + - Added operation PriceSheet.beginDownloadByBillingAccountPeriodAndWait + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorResponseAutoGenerated + - Added Interface LotsListByCustomerNextOptionalParams + - Added Interface LotsListByCustomerOptionalParams + - Added Interface ModernReservationRecommendationProperties + - Added Interface ModernSharedScopeReservationRecommendationProperties + - Added Interface ModernSingleScopeReservationRecommendationProperties + - Added Interface OperationStatus + - Added Interface PriceSheetDownloadByBillingAccountPeriodHeaders + - Added Interface PriceSheetDownloadByBillingAccountPeriodOptionalParams + - Added Interface SavingsPlan + - Added Type Alias LotsListByCustomerNextResponse + - Added Type Alias LotsListByCustomerResponse + - Added Type Alias ModernReservationRecommendationPropertiesUnion + - Added Type Alias OperationStatusType + - Added Type Alias OrgType + - Added Type Alias PriceSheetDownloadByBillingAccountPeriodResponse + - Interface Balance has a new optional parameter overageRefund + - Interface CreditSummary has a new optional parameter eTagPropertiesETag + - Interface CreditSummary has a new optional parameter isEstimatedBalance + - Interface EventSummary has a new optional parameter isEstimatedBalance + - Interface LegacyChargeSummary has a new optional parameter azureMarketplaceCharges + - Interface LegacyUsageDetail has a new optional parameter benefitId + - Interface LegacyUsageDetail has a new optional parameter benefitName + - Interface LotSummary has a new optional parameter isEstimatedBalance + - Interface LotSummary has a new optional parameter orgType + - Interface LotSummary has a new optional parameter usedAmount + - Interface ModernChargeSummary has a new optional parameter subscriptionId + - Interface ModernReservationRecommendation has a new optional parameter resourceType + - Interface PriceSheetProperties has a new optional parameter savingsPlan + - Interface ReservationRecommendationDetailsGetOptionalParams has a new optional parameter filter + - Interface ReservationTransactionsListOptionalParams has a new optional parameter previewMarkupPercentage + - Interface ReservationTransactionsListOptionalParams has a new optional parameter useMarkupIfPartner + - Added Enum KnownOperationStatusType + - Added Enum KnownOrgType + - Enum KnownEventType has a new value CreditExpired -### Other Changes +**Breaking Changes** + - Operation ReservationRecommendationDetails.get has a new signature + - Class ConsumptionManagementClient has a new signature + - Interface BudgetFilter no longer has parameter not + - Interface LegacyChargeSummary no longer has parameter marketplaceCharges + - Parameter scope of interface ModernReservationRecommendation is now required + + ## 9.2.0 (2023-01-03) **Features** diff --git a/sdk/consumption/arm-consumption/_meta.json b/sdk/consumption/arm-consumption/_meta.json index 53b7e4beed2c..a887f0312a06 100644 --- a/sdk/consumption/arm-consumption/_meta.json +++ b/sdk/consumption/arm-consumption/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d600759c3516b61a7c353bc8682bccbab85a6f65", - "readme": "specification\\consumption\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\consumption\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true", + "commit": "221a805c98af200a318be0432800604f725f0b98", + "readme": "specification/consumption/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.5.20221215.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index f19e6052c306..68d502f213cd 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -3,13 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ConsumptionManagementClient.", - "version": "9.2.1", + "version": "10.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -31,7 +33,7 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", @@ -109,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-consumption?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption" +} \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/review/arm-consumption.api.md b/sdk/consumption/arm-consumption/review/arm-consumption.api.md index e949327f5510..73fd40bed349 100644 --- a/sdk/consumption/arm-consumption/review/arm-consumption.api.md +++ b/sdk/consumption/arm-consumption/review/arm-consumption.api.md @@ -6,7 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export interface AggregatedCost { @@ -53,6 +55,7 @@ export interface Balance extends Resource { readonly endingBalance?: number; readonly newPurchases?: number; readonly newPurchasesDetails?: BalancePropertiesNewPurchasesDetailsItem[]; + readonly overageRefund?: number; readonly priceHidden?: boolean; readonly serviceOverage?: number; readonly totalOverage?: number; @@ -120,7 +123,6 @@ export interface BudgetComparisonExpression { export interface BudgetFilter { and?: BudgetFilterProperties[]; dimensions?: BudgetComparisonExpression; - not?: BudgetFilterProperties; tags?: BudgetComparisonExpression; } @@ -225,6 +227,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { // (undocumented) $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams); + constructor(credentials: coreAuth.TokenCredential, options?: ConsumptionManagementClientOptionalParams); // (undocumented) aggregatedCost: AggregatedCost; // (undocumented) @@ -258,7 +261,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { // (undocumented) reservationTransactions: ReservationTransactions; // (undocumented) - subscriptionId: string; + subscriptionId?: string; // (undocumented) tags: Tags; // (undocumented) @@ -292,12 +295,13 @@ export interface CreditsGetOptionalParams extends coreClient.OperationOptions { export type CreditsGetResponse = CreditSummary; // @public -export interface CreditSummary extends Resource { +export interface CreditSummary extends ProxyResource { readonly balanceSummary?: CreditBalanceSummary; readonly billingCurrency?: string; readonly creditCurrency?: string; - readonly eTag?: string; + readonly eTagPropertiesETag?: string; readonly expiredCredit?: Amount; + readonly isEstimatedBalance?: boolean; readonly pendingCreditAdjustments?: Amount; readonly pendingEligibleCharges?: Amount; readonly reseller?: Reseller; @@ -321,6 +325,21 @@ export interface DownloadProperties { readonly validTill?: string; } +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface ErrorDetails { readonly code?: string; @@ -332,6 +351,11 @@ export interface ErrorResponse { error?: ErrorDetails; } +// @public +export interface ErrorResponseAutoGenerated { + error?: ErrorDetail; +} + // @public export interface Events { readonly nextLink?: string; @@ -392,6 +416,7 @@ export interface EventSummary extends ProxyResource { readonly eTagPropertiesETag?: string; eventType?: EventType; readonly invoiceNumber?: string; + readonly isEstimatedBalance?: boolean; readonly lotId?: string; readonly lotSource?: string; readonly newCredit?: Amount; @@ -479,6 +504,7 @@ export enum KnownDatagrain { // @public export enum KnownEventType { + CreditExpired = "CreditExpired", NewCredit = "NewCredit", PendingAdjustments = "PendingAdjustments", PendingCharges = "PendingCharges", @@ -509,6 +535,13 @@ export enum KnownMetrictype { UsageMetricType = "usage" } +// @public +export enum KnownOperationStatusType { + Completed = "Completed", + Failed = "Failed", + Running = "Running" +} + // @public export enum KnownOperatorType { EqualTo = "EqualTo", @@ -516,6 +549,12 @@ export enum KnownOperatorType { GreaterThanOrEqualTo = "GreaterThanOrEqualTo" } +// @public +export enum KnownOrgType { + ContributorOrgType = "Contributor", + PrimaryOrgType = "Primary" +} + // @public export enum KnownPricingModelType { OnDemand = "On Demand", @@ -576,11 +615,11 @@ export enum KnownUsageDetailsKind { // @public export interface LegacyChargeSummary extends ChargeSummary { readonly azureCharges?: number; + readonly azureMarketplaceCharges?: number; readonly billingPeriodId?: string; readonly chargesBilledSeparately?: number; readonly currency?: string; kind: "legacy"; - readonly marketplaceCharges?: number; readonly usageEnd?: string; readonly usageStart?: string; } @@ -647,6 +686,8 @@ export interface LegacyUsageDetail extends UsageDetail { readonly accountName?: string; readonly accountOwnerId?: string; readonly additionalInfo?: string; + readonly benefitId?: string; + readonly benefitName?: string; readonly billingAccountId?: string; readonly billingAccountName?: string; readonly billingCurrency?: string; @@ -729,10 +770,26 @@ export interface LotsListByBillingProfileOptionalParams extends coreClient.Opera // @public export type LotsListByBillingProfileResponse = Lots; +// @public +export interface LotsListByCustomerNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type LotsListByCustomerNextResponse = Lots; + +// @public +export interface LotsListByCustomerOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @public +export type LotsListByCustomerResponse = Lots; + // @public export interface LotsOperations { listByBillingAccount(billingAccountId: string, options?: LotsListByBillingAccountOptionalParams): PagedAsyncIterableIterator; listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: LotsListByBillingProfileOptionalParams): PagedAsyncIterableIterator; + listByCustomer(billingAccountId: string, customerId: string, options?: LotsListByCustomerOptionalParams): PagedAsyncIterableIterator; } // @public @@ -746,6 +803,8 @@ export interface LotSummary extends ProxyResource { readonly creditCurrency?: string; readonly eTagPropertiesETag?: string; readonly expirationDate?: Date; + readonly isEstimatedBalance?: boolean; + readonly orgType?: OrgType; readonly originalAmount?: Amount; readonly originalAmountInBillingCurrency?: AmountWithExchangeRate; readonly poNumber?: string; @@ -754,6 +813,7 @@ export interface LotSummary extends ProxyResource { readonly source?: LotSource; readonly startDate?: Date; readonly status?: Status; + readonly usedAmount?: Amount; } // @public @@ -865,6 +925,7 @@ export interface ModernChargeSummary extends ChargeSummary { readonly isInvoiced?: boolean; kind: "modern"; readonly marketplaceCharges?: Amount; + readonly subscriptionId?: string; readonly usageEnd?: string; readonly usageStart?: string; } @@ -883,13 +944,38 @@ export interface ModernReservationRecommendation extends ReservationRecommendati readonly normalizedSize?: string; readonly recommendedQuantity?: number; readonly recommendedQuantityNormalized?: number; - readonly scope?: string; + readonly resourceType?: string; + scope: string; + readonly skuName?: string; + readonly skuProperties?: SkuProperty[]; + readonly term?: string; + readonly totalCostWithReservedInstances?: Amount; +} + +// @public +export interface ModernReservationRecommendationProperties { + readonly costWithNoReservedInstances?: Amount; + readonly firstUsageDate?: Date; + readonly instanceFlexibilityGroup?: string; + readonly instanceFlexibilityRatio?: number; + readonly location?: string; + readonly lookBackPeriod?: number; + readonly meterId?: string; + readonly netSavings?: Amount; + readonly normalizedSize?: string; + readonly recommendedQuantity?: number; + readonly recommendedQuantityNormalized?: number; + readonly resourceType?: string; + scope: "Single" | "Shared"; readonly skuName?: string; readonly skuProperties?: SkuProperty[]; readonly term?: string; readonly totalCostWithReservedInstances?: Amount; } +// @public (undocumented) +export type ModernReservationRecommendationPropertiesUnion = ModernReservationRecommendationProperties | ModernSingleScopeReservationRecommendationProperties | ModernSharedScopeReservationRecommendationProperties; + // @public export interface ModernReservationTransaction extends ReservationTransactionResource { readonly amount?: number; @@ -920,6 +1006,17 @@ export interface ModernReservationTransactionsListResult { readonly value?: ModernReservationTransaction[]; } +// @public +export interface ModernSharedScopeReservationRecommendationProperties extends ModernReservationRecommendationProperties { + scope: "Shared"; +} + +// @public +export interface ModernSingleScopeReservationRecommendationProperties extends ModernReservationRecommendationProperties { + scope: "Single"; + readonly subscriptionId?: string; +} + // @public export interface ModernUsageDetail extends UsageDetail { readonly additionalInfo?: string; @@ -1050,15 +1147,47 @@ export interface OperationsListOptionalParams extends coreClient.OperationOption // @public export type OperationsListResponse = OperationListResult; +// @public +export interface OperationStatus { + readonly downloadUrl?: string; + status?: OperationStatusType; + readonly validTill?: Date; +} + +// @public +export type OperationStatusType = string; + // @public export type OperatorType = string; +// @public +export type OrgType = string; + // @public export interface PriceSheet { + beginDownloadByBillingAccountPeriod(billingAccountId: string, billingPeriodName: string, options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams): Promise, PriceSheetDownloadByBillingAccountPeriodResponse>>; + beginDownloadByBillingAccountPeriodAndWait(billingAccountId: string, billingPeriodName: string, options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams): Promise; get(options?: PriceSheetGetOptionalParams): Promise; getByBillingPeriod(billingPeriodName: string, options?: PriceSheetGetByBillingPeriodOptionalParams): Promise; } +// @public +export interface PriceSheetDownloadByBillingAccountPeriodHeaders { + // (undocumented) + location?: string; + // (undocumented) + retryAfter?: number; +} + +// @public +export interface PriceSheetDownloadByBillingAccountPeriodOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PriceSheetDownloadByBillingAccountPeriodResponse = OperationStatus; + // @public export interface PriceSheetGetByBillingPeriodOptionalParams extends coreClient.OperationOptions { expand?: string; @@ -1088,6 +1217,7 @@ export interface PriceSheetProperties { readonly meterId?: string; readonly offerId?: string; readonly partNumber?: string; + readonly savingsPlan?: SavingsPlan; readonly unitOfMeasure?: string; readonly unitPrice?: number; } @@ -1144,7 +1274,7 @@ export interface ReservationRecommendation extends Resource, ResourceAttributes // @public export interface ReservationRecommendationDetails { - get(scope: string, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams): Promise; + get(resourceScope: string, scope: Scope, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams): Promise; } // @public @@ -1160,6 +1290,7 @@ export interface ReservationRecommendationDetailsCalculatedSavingsProperties { // @public export interface ReservationRecommendationDetailsGetOptionalParams extends coreClient.OperationOptions { + filter?: string; } // @public @@ -1211,7 +1342,7 @@ export type ReservationRecommendationKind = string; // @public export interface ReservationRecommendations { - list(scope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator; + list(resourceScope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator; } // @public @@ -1241,7 +1372,7 @@ export type ReservationRecommendationUnion = ReservationRecommendation | LegacyR // @public export interface ReservationsDetails { - list(scope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator; + list(resourceScope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator; listByReservationOrder(reservationOrderId: string, filter: string, options?: ReservationsDetailsListByReservationOrderOptionalParams): PagedAsyncIterableIterator; listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; } @@ -1295,7 +1426,7 @@ export type ReservationsDetailsListResponse = ReservationDetailsListResult; // @public export interface ReservationsSummaries { - list(scope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator; + list(resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator; listByReservationOrder(reservationOrderId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderOptionalParams): PagedAsyncIterableIterator; listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator; } @@ -1440,6 +1571,8 @@ export type ReservationTransactionsListNextResponse = ReservationTransactionsLis // @public export interface ReservationTransactionsListOptionalParams extends coreClient.OperationOptions { filter?: string; + previewMarkupPercentage?: number; + useMarkupIfPartner?: boolean; } // @public @@ -1468,6 +1601,13 @@ export interface ResourceAttributes { readonly sku?: string; } +// @public +export interface SavingsPlan { + readonly effectivePrice?: number; + readonly marketPrice?: number; + readonly term?: string; +} + // @public export type Scope = string; diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts index 451072395676..7ee21ee888ac 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts @@ -57,7 +57,7 @@ import { ConsumptionManagementClientOptionalParams } from "./models"; export class ConsumptionManagementClient extends coreClient.ServiceClient { $host: string; apiVersion: string; - subscriptionId: string; + subscriptionId?: string; /** * Initializes a new instance of the ConsumptionManagementClient class. @@ -69,12 +69,28 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ConsumptionManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + options?: ConsumptionManagementClientOptionalParams + ); + constructor( + credentials: coreAuth.TokenCredential, + subscriptionIdOrOptions?: + | ConsumptionManagementClientOptionalParams + | string, + options?: ConsumptionManagementClientOptionalParams ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); + + let subscriptionId: string | undefined; + + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } // Initializing default values for options @@ -86,7 +102,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-consumption/9.2.1`; + const packageDetails = `azsdk-js-arm-consumption/10.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -139,7 +155,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-10-01"; + this.apiVersion = options.apiVersion || "2023-11-01"; this.usageDetails = new UsageDetailsImpl(this); this.marketplaces = new MarketplacesImpl(this); this.budgets = new BudgetsImpl(this); diff --git a/sdk/consumption/arm-consumption/src/lroImpl.ts b/sdk/consumption/arm-consumption/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/consumption/arm-consumption/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; +} diff --git a/sdk/consumption/arm-consumption/src/models/index.ts b/sdk/consumption/arm-consumption/src/models/index.ts index 50fb293eb139..090a157e5b96 100644 --- a/sdk/consumption/arm-consumption/src/models/index.ts +++ b/sdk/consumption/arm-consumption/src/models/index.ts @@ -12,6 +12,10 @@ export type LegacyReservationRecommendationPropertiesUnion = | LegacyReservationRecommendationProperties | LegacySingleScopeReservationRecommendationProperties | LegacySharedScopeReservationRecommendationProperties; +export type ModernReservationRecommendationPropertiesUnion = + | ModernReservationRecommendationProperties + | ModernSingleScopeReservationRecommendationProperties + | ModernSharedScopeReservationRecommendationProperties; export type UsageDetailUnion = | UsageDetail | LegacyUsageDetail @@ -136,8 +140,6 @@ export interface BudgetTimePeriod { export interface BudgetFilter { /** The logical "AND" expression. Must have at least 2 items. */ and?: BudgetFilterProperties[]; - /** The logical "NOT" expression. */ - not?: BudgetFilterProperties; /** Has comparison expression for a dimension */ dimensions?: BudgetComparisonExpression; /** Has comparison expression for a tag */ @@ -343,7 +345,7 @@ export interface ReservationRecommendationDetailsResourceProperties { */ readonly appliedScopes?: string[]; /** - * On demand rate of the resource. + * Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly onDemandRate?: number; @@ -358,7 +360,7 @@ export interface ReservationRecommendationDetailsResourceProperties { */ readonly region?: string; /** - * Reservation rate of the resource. + * Hourly reservation rate of the resource. Varies based on the term. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reservationRate?: number; @@ -400,15 +402,15 @@ export interface ReservationRecommendationDetailsSavingsProperties { readonly unitOfMeasure?: string; } -/** Details of estimated savings. */ +/** Details of estimated savings. The costs and savings are estimated for the term. */ export interface ReservationRecommendationDetailsCalculatedSavingsProperties { /** - * The cost without reservation. + * The cost without reservation. Includes hardware and software cost. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly onDemandCost?: number; /** - * The difference between total reservation cost and reservation cost. + * Hardware and software cost of the resources not covered by the reservation. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly overageCost?: number; @@ -418,19 +420,19 @@ export interface ReservationRecommendationDetailsCalculatedSavingsProperties { */ readonly quantity?: number; /** - * The exact cost of the estimated usage using reservation. + * Hardware cost of the resources covered by the reservation. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reservationCost?: number; /** - * The cost of the suggested quantity. + * Reservation cost + software cost of the resources covered by the reservation + overage cost. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly totalReservationCost?: number; /** The number of reserved units used to calculate savings. Always 1 for virtual machines. */ reservedUnitCount?: number; /** - * The amount saved by purchasing the recommended quantity of reservation. + * The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - totalReservationCost. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly savings?: number; @@ -592,6 +594,11 @@ export interface PriceSheetProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly offerId?: string; + /** + * SavingsPlan Details + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly savingsPlan?: SavingsPlan; } /** The properties of the meter detail. */ @@ -643,6 +650,25 @@ export interface MeterDetails { readonly serviceTier?: string; } +/** The properties of the SavingsPlan. */ +export interface SavingsPlan { + /** + * SavingsPlan term + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly term?: string; + /** + * SavingsPlan Market Price + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly marketPrice?: number; + /** + * SavingsPlan Effective Price + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectivePrice?: number; +} + /** Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results. */ export interface OperationListResult { /** @@ -772,6 +798,71 @@ export interface CreditBalanceSummary { readonly estimatedBalanceInBillingCurrency?: AmountWithExchangeRate; } +/** The status of the long running operation. */ +export interface OperationStatus { + /** The status of the long running operation. */ + status?: OperationStatusType; + /** + * The link (url) to download the pricesheet. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly downloadUrl?: string; + /** + * Download link validity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly validTill?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponseAutoGenerated { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + /** The properties of the meter detail. */ export interface MeterDetailsResponse { /** @@ -891,6 +982,92 @@ export interface SkuProperty { readonly value?: string; } +/** The properties of the reservation recommendation. */ +export interface ModernReservationRecommendationProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + scope: "Single" | "Shared"; + /** + * Resource Location. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly location?: string; + /** + * 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?: number; + /** + * 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; + /** + * 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?: Amount; + /** + * Recommended quality for reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly recommendedQuantity?: number; + /** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; + /** + * 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?: Amount; + /** + * Total estimated savings with reserved instances. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly netSavings?: Amount; + /** + * 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[]; + /** + * This is the ARM Sku name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly skuName?: string; +} + /** The properties of the price sheet download. */ export interface DownloadProperties { /** @@ -1109,6 +1286,11 @@ export interface Balance extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly priceHidden?: boolean; + /** + * Overage Refunds + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly overageRefund?: number; /** * List of new purchases. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1369,50 +1551,6 @@ export interface ManagementGroupAggregatedCostResult extends Resource { excludedSubscriptions?: string[]; } -/** A credit summary resource. */ -export interface CreditSummary extends Resource { - /** - * Summary of balances associated with this credit summary. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly balanceSummary?: CreditBalanceSummary; - /** - * Pending credit adjustments. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly pendingCreditAdjustments?: Amount; - /** - * Expired credit. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly expiredCredit?: Amount; - /** - * Pending eligible charges. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly pendingEligibleCharges?: Amount; - /** - * The credit currency. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly creditCurrency?: string; - /** - * The billing currency. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly billingCurrency?: string; - /** - * Credit's reseller. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reseller?: Reseller; - /** - * The eTag for the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly eTag?: string; -} - /** A budget resource. */ export interface Budget extends ProxyResource { /** The category of the budget, whether the budget tracks cost or usage. */ @@ -1494,7 +1632,7 @@ export interface EventSummary extends ProxyResource { */ readonly charges?: Amount; /** - * The balance after the event. + * The balance after the event, Note: This will not be returned for Contributor Organization Type in Multi-MACC. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly closedBalance?: Amount; @@ -1570,6 +1708,11 @@ export interface EventSummary extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly closedBalanceInBillingCurrency?: AmountWithExchangeRate; + /** + * If true, the listed details are based on an estimation and it will be subjected to change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEstimatedBalance?: boolean; /** * The eTag for the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1644,6 +1787,70 @@ export interface LotSummary extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reseller?: Reseller; + /** + * If true, the listed details are based on an estimation and it will be subjected to change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEstimatedBalance?: boolean; + /** + * The eTag for the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTagPropertiesETag?: string; + /** + * The organization type of the lot. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly orgType?: OrgType; + /** + * Amount consumed from the commitment. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly usedAmount?: Amount; +} + +/** A credit summary resource. */ +export interface CreditSummary extends ProxyResource { + /** + * Summary of balances associated with this credit summary. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly balanceSummary?: CreditBalanceSummary; + /** + * Pending credit adjustments. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pendingCreditAdjustments?: Amount; + /** + * Expired credit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly expiredCredit?: Amount; + /** + * Pending eligible charges. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly pendingEligibleCharges?: Amount; + /** + * The credit currency. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly creditCurrency?: string; + /** + * The billing currency. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingCurrency?: string; + /** + * Credit's reseller. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reseller?: Reseller; + /** + * If true, the listed details are based on an estimation and it will be subjected to change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEstimatedBalance?: boolean; /** * The eTag for the resource. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1669,7 +1876,7 @@ export interface ReservationTransaction extends ReservationTransactionResource { */ readonly description?: string; /** - * The type of the transaction (Purchase, Cancel, etc.) + * The type of the transaction (Purchase, Cancel or Refund). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly eventType?: string; @@ -1814,7 +2021,7 @@ export interface ModernReservationTransaction */ readonly eventDate?: Date; /** - * The type of the transaction (Purchase, Cancel, etc.) + * The type of the transaction (Purchase, Cancel or Refund). * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly eventType?: string; @@ -1908,6 +2115,25 @@ export interface LegacySharedScopeReservationRecommendationProperties scope: "Shared"; } +/** The properties of the modern reservation recommendation for single scope. */ +export interface ModernSingleScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /** 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 modern reservation recommendation for shared scope. */ +export interface ModernSharedScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /** Polymorphic discriminator, which specifies the different types this object can be */ + scope: "Shared"; +} + /** Legacy usage detail. */ export interface LegacyUsageDetail extends UsageDetail { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2127,6 +2353,16 @@ export interface LegacyUsageDetail extends 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. @@ -2634,6 +2870,11 @@ export interface ModernReservationRecommendation * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly recommendedQuantity?: number; + /** + * Resource type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resourceType?: string; /** * The total amount of cost with reserved instances. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2649,11 +2890,8 @@ export interface ModernReservationRecommendation * 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. @@ -2699,7 +2937,7 @@ export interface LegacyChargeSummary extends ChargeSummary { * Marketplace Charges. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly marketplaceCharges?: number; + readonly azureMarketplaceCharges?: number; /** * Currency Code * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2766,11 +3004,22 @@ export interface ModernChargeSummary extends ChargeSummary { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly isInvoiced?: boolean; + /** + * Subscription guid. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly subscriptionId?: string; } /** Legacy Reservation transaction resource. */ export interface LegacyReservationTransaction extends ReservationTransaction {} +/** Defines headers for PriceSheet_downloadByBillingAccountPeriod operation. */ +export interface PriceSheetDownloadByBillingAccountPeriodHeaders { + location?: string; + retryAfter?: number; +} + /** Known values of {@link Metrictype} that the service accepts. */ export enum KnownMetrictype { /** Actual cost data. */ @@ -2872,11 +3121,11 @@ export type BudgetOperatorType = string; /** Known values of {@link OperatorType} that the service accepts. */ export enum KnownOperatorType { - /** EqualTo */ + /** Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. */ EqualTo = "EqualTo", - /** GreaterThan */ + /** Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert. */ GreaterThan = "GreaterThan", - /** GreaterThanOrEqualTo */ + /** Alert will be triggered if the evaluated cost is greater than or equal to the threshold value. */ GreaterThanOrEqualTo = "GreaterThanOrEqualTo" } @@ -2885,17 +3134,17 @@ export enum KnownOperatorType { * {@link KnownOperatorType} can be used interchangeably with OperatorType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **EqualTo** \ - * **GreaterThan** \ - * **GreaterThanOrEqualTo** + * **EqualTo**: Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. \ + * **GreaterThan**: Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert. \ + * **GreaterThanOrEqualTo**: Alert will be triggered if the evaluated cost is greater than or equal to the threshold value. */ export type OperatorType = string; /** Known values of {@link ThresholdType} that the service accepts. */ export enum KnownThresholdType { - /** Actual */ + /** Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget . */ Actual = "Actual", - /** Forecasted */ + /** Forecasted costs budget alerts provide advanced notification that your spending trends are likely to exceed your allocated budget, as it relies on forecasted cost predictions. */ Forecasted = "Forecasted" } @@ -2904,8 +3153,8 @@ export enum KnownThresholdType { * {@link KnownThresholdType} can be used interchangeably with ThresholdType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Actual** \ - * **Forecasted** + * **Actual**: Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget . \ + * **Forecasted**: Forecasted costs budget alerts provide advanced notification that your spending trends are likely to exceed your allocated budget, as it relies on forecasted cost predictions. */ export type ThresholdType = string; @@ -3059,6 +3308,24 @@ export enum KnownReservationRecommendationKind { */ export type ReservationRecommendationKind = string; +/** Known values of {@link Scope} that the service accepts. */ +export enum KnownScope { + /** Single */ + Single = "Single", + /** Shared */ + Shared = "Shared" +} + +/** + * Defines values for Scope. \ + * {@link KnownScope} can be used interchangeably with Scope, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Single** \ + * **Shared** + */ +export type Scope = string; + /** Known values of {@link Term} that the service accepts. */ export enum KnownTerm { /** 1 year reservation term */ @@ -3113,7 +3380,9 @@ export enum KnownEventType { /** UnKnown */ UnKnown = "UnKnown", /** NewCredit */ - NewCredit = "NewCredit" + NewCredit = "NewCredit", + /** CreditExpired */ + CreditExpired = "CreditExpired" } /** @@ -3127,7 +3396,8 @@ export enum KnownEventType { * **PendingNewCredit** \ * **PendingExpiredCredit** \ * **UnKnown** \ - * **NewCredit** + * **NewCredit** \ + * **CreditExpired** */ export type EventType = string; @@ -3182,6 +3452,45 @@ export enum KnownStatus { */ export type Status = string; +/** Known values of {@link OrgType} that the service accepts. */ +export enum KnownOrgType { + /** Primary organization type for MACC */ + PrimaryOrgType = "Primary", + /** Contributor organization type for MACC */ + ContributorOrgType = "Contributor" +} + +/** + * Defines values for OrgType. \ + * {@link KnownOrgType} can be used interchangeably with OrgType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Primary**: Primary organization type for MACC \ + * **Contributor**: Contributor organization type for MACC + */ +export type OrgType = string; + +/** Known values of {@link OperationStatusType} that the service accepts. */ +export enum KnownOperationStatusType { + /** Running */ + Running = "Running", + /** Completed */ + Completed = "Completed", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for OperationStatusType. \ + * {@link KnownOperationStatusType} can be used interchangeably with OperationStatusType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Running** \ + * **Completed** \ + * **Failed** + */ +export type OperationStatusType = string; + /** Known values of {@link PricingModelType} that the service accepts. */ export enum KnownPricingModelType { /** OnDemand */ @@ -3203,24 +3512,6 @@ export enum KnownPricingModelType { */ export type PricingModelType = string; -/** Known values of {@link Scope} that the service accepts. */ -export enum KnownScope { - /** Single */ - Single = "Single", - /** Shared */ - Shared = "Shared" -} - -/** - * Defines values for Scope. \ - * {@link KnownScope} can be used interchangeably with Scope, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Single** \ - * **Shared** - */ -export type Scope = string; - /** Optional parameters. */ export interface UsageDetailsListOptionalParams extends coreClient.OperationOptions { @@ -3464,7 +3755,10 @@ export type ReservationRecommendationsListNextResponse = ReservationRecommendati /** Optional parameters. */ export interface ReservationRecommendationDetailsGetOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Used to filter reservation recommendation details by: properties/subscriptionId can be specified for billing account and billing profile paths. */ + filter?: string; +} /** Contains response data for the get operation. */ export type ReservationRecommendationDetailsGetResponse = ReservationRecommendationDetailsModel; @@ -3472,8 +3766,12 @@ export type ReservationRecommendationDetailsGetResponse = ReservationRecommendat /** Optional parameters. */ export interface ReservationTransactionsListOptionalParams extends coreClient.OperationOptions { - /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and 31) */ filter?: string; + /** Applies mark up to the transactions if the caller is a partner. */ + useMarkupIfPartner?: boolean; + /** Preview markup percentage to be applied. */ + previewMarkupPercentage?: number; } /** Contains response data for the list operation. */ @@ -3482,7 +3780,7 @@ export type ReservationTransactionsListResponse = ReservationTransactionsListRes /** Optional parameters. */ export interface ReservationTransactionsListByBillingProfileOptionalParams extends coreClient.OperationOptions { - /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge' */ + /** Filter reservation transactions by date range. The properties/EventDate for start date and end date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31) */ filter?: string; } @@ -3531,6 +3829,18 @@ export interface PriceSheetGetByBillingPeriodOptionalParams /** Contains response data for the getByBillingPeriod operation. */ export type PriceSheetGetByBillingPeriodResponse = PriceSheetResult; +/** Optional parameters. */ +export interface PriceSheetDownloadByBillingAccountPeriodOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the downloadByBillingAccountPeriod operation. */ +export type PriceSheetDownloadByBillingAccountPeriodResponse = OperationStatus; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -3610,6 +3920,16 @@ export interface LotsListByBillingAccountOptionalParams /** Contains response data for the listByBillingAccount operation. */ export type LotsListByBillingAccountResponse = Lots; +/** Optional parameters. */ +export interface LotsListByCustomerOptionalParams + extends coreClient.OperationOptions { + /** May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:). */ + filter?: string; +} + +/** Contains response data for the listByCustomer operation. */ +export type LotsListByCustomerResponse = Lots; + /** Optional parameters. */ export interface LotsListByBillingProfileNextOptionalParams extends coreClient.OperationOptions {} @@ -3624,6 +3944,13 @@ export interface LotsListByBillingAccountNextOptionalParams /** Contains response data for the listByBillingAccountNext operation. */ export type LotsListByBillingAccountNextResponse = Lots; +/** Optional parameters. */ +export interface LotsListByCustomerNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCustomerNext operation. */ +export type LotsListByCustomerNextResponse = Lots; + /** Optional parameters. */ export interface CreditsGetOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/consumption/arm-consumption/src/models/mappers.ts b/sdk/consumption/arm-consumption/src/models/mappers.ts index bd98dc2dad1b..6230ad9f067f 100644 --- a/sdk/consumption/arm-consumption/src/models/mappers.ts +++ b/sdk/consumption/arm-consumption/src/models/mappers.ts @@ -218,13 +218,6 @@ export const BudgetFilter: coreClient.CompositeMapper = { } } }, - not: { - serializedName: "not", - type: { - name: "Composite", - className: "BudgetFilterProperties" - } - }, dimensions: { serializedName: "dimensions", type: { @@ -1102,6 +1095,13 @@ export const PriceSheetProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + savingsPlan: { + serializedName: "savingsPlan", + type: { + name: "Composite", + className: "SavingsPlan" + } } } } @@ -1179,6 +1179,36 @@ export const MeterDetails: coreClient.CompositeMapper = { } }; +export const SavingsPlan: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SavingsPlan", + modelProperties: { + term: { + serializedName: "term", + readOnly: true, + type: { + name: "String" + } + }, + marketPrice: { + serializedName: "marketPrice", + readOnly: true, + type: { + name: "Number" + } + }, + effectivePrice: { + serializedName: "effectivePrice", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1409,6 +1439,131 @@ export const CreditBalanceSummary: coreClient.CompositeMapper = { } }; +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + downloadUrl: { + serializedName: "properties.downloadUrl", + readOnly: true, + type: { + name: "String" + } + }, + validTill: { + serializedName: "properties.validTill", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + +export const ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + export const MeterDetailsResponse: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1601,6 +1756,145 @@ export const SkuProperty: coreClient.CompositeMapper = { } }; +export const ModernReservationRecommendationProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ModernReservationRecommendationProperties", + uberParent: "ModernReservationRecommendationProperties", + polymorphicDiscriminator: { + serializedName: "scope", + clientName: "scope" + }, + modelProperties: { + location: { + serializedName: "location", + readOnly: true, + type: { + name: "String" + } + }, + lookBackPeriod: { + serializedName: "lookBackPeriod", + readOnly: true, + type: { + name: "Number" + } + }, + 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" + } + }, + term: { + serializedName: "term", + readOnly: true, + type: { + name: "String" + } + }, + costWithNoReservedInstances: { + serializedName: "costWithNoReservedInstances", + type: { + name: "Composite", + className: "Amount" + } + }, + recommendedQuantity: { + serializedName: "recommendedQuantity", + readOnly: true, + type: { + name: "Number" + } + }, + resourceType: { + serializedName: "resourceType", + readOnly: true, + type: { + name: "String" + } + }, + totalCostWithReservedInstances: { + serializedName: "totalCostWithReservedInstances", + type: { + name: "Composite", + className: "Amount" + } + }, + netSavings: { + serializedName: "netSavings", + type: { + name: "Composite", + className: "Amount" + } + }, + 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" + } + } + } + }, + skuName: { + serializedName: "skuName", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const DownloadProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1935,6 +2229,13 @@ export const Balance: coreClient.CompositeMapper = { name: "Boolean" } }, + overageRefund: { + serializedName: "properties.overageRefund", + readOnly: true, + type: { + name: "Number" + } + }, newPurchasesDetails: { serializedName: "properties.newPurchasesDetails", readOnly: true, @@ -2385,72 +2686,6 @@ export const ManagementGroupAggregatedCostResult: coreClient.CompositeMapper = { } }; -export const CreditSummary: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreditSummary", - modelProperties: { - ...Resource.type.modelProperties, - balanceSummary: { - serializedName: "properties.balanceSummary", - type: { - name: "Composite", - className: "CreditBalanceSummary" - } - }, - pendingCreditAdjustments: { - serializedName: "properties.pendingCreditAdjustments", - type: { - name: "Composite", - className: "Amount" - } - }, - expiredCredit: { - serializedName: "properties.expiredCredit", - type: { - name: "Composite", - className: "Amount" - } - }, - pendingEligibleCharges: { - serializedName: "properties.pendingEligibleCharges", - type: { - name: "Composite", - className: "Amount" - } - }, - creditCurrency: { - serializedName: "properties.creditCurrency", - readOnly: true, - type: { - name: "String" - } - }, - billingCurrency: { - serializedName: "properties.billingCurrency", - readOnly: true, - type: { - name: "String" - } - }, - reseller: { - serializedName: "properties.reseller", - type: { - name: "Composite", - className: "Reseller" - } - }, - eTag: { - serializedName: "properties.eTag", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const Budget: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2732,6 +2967,13 @@ export const EventSummary: coreClient.CompositeMapper = { className: "AmountWithExchangeRate" } }, + isEstimatedBalance: { + serializedName: "properties.isEstimatedBalance", + readOnly: true, + type: { + name: "Boolean" + } + }, eTagPropertiesETag: { serializedName: "properties.eTag", readOnly: true, @@ -2840,6 +3082,100 @@ export const LotSummary: coreClient.CompositeMapper = { className: "Reseller" } }, + isEstimatedBalance: { + serializedName: "properties.isEstimatedBalance", + readOnly: true, + type: { + name: "Boolean" + } + }, + eTagPropertiesETag: { + serializedName: "properties.eTag", + readOnly: true, + type: { + name: "String" + } + }, + orgType: { + serializedName: "properties.OrgType", + readOnly: true, + type: { + name: "String" + } + }, + usedAmount: { + serializedName: "properties.UsedAmount", + type: { + name: "Composite", + className: "Amount" + } + } + } + } +}; + +export const CreditSummary: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreditSummary", + modelProperties: { + ...ProxyResource.type.modelProperties, + balanceSummary: { + serializedName: "properties.balanceSummary", + type: { + name: "Composite", + className: "CreditBalanceSummary" + } + }, + pendingCreditAdjustments: { + serializedName: "properties.pendingCreditAdjustments", + type: { + name: "Composite", + className: "Amount" + } + }, + expiredCredit: { + serializedName: "properties.expiredCredit", + type: { + name: "Composite", + className: "Amount" + } + }, + pendingEligibleCharges: { + serializedName: "properties.pendingEligibleCharges", + type: { + name: "Composite", + className: "Amount" + } + }, + creditCurrency: { + serializedName: "properties.creditCurrency", + readOnly: true, + type: { + name: "String" + } + }, + billingCurrency: { + serializedName: "properties.billingCurrency", + readOnly: true, + type: { + name: "String" + } + }, + reseller: { + serializedName: "properties.reseller", + type: { + name: "Composite", + className: "Reseller" + } + }, + isEstimatedBalance: { + serializedName: "properties.isEstimatedBalance", + readOnly: true, + type: { + name: "Boolean" + } + }, eTagPropertiesETag: { serializedName: "properties.eTag", readOnly: true, @@ -3023,7 +3359,6 @@ export const ReservationTransaction: coreClient.CompositeMapper = { }; export const ModernReservationTransaction: coreClient.CompositeMapper = { - serializedName: "Modern", type: { name: "Composite", className: "ModernReservationTransaction", @@ -3232,6 +3567,41 @@ export const LegacySharedScopeReservationRecommendationProperties: coreClient.Co } }; +export const ModernSingleScopeReservationRecommendationProperties: coreClient.CompositeMapper = { + serializedName: "Single", + type: { + name: "Composite", + className: "ModernSingleScopeReservationRecommendationProperties", + uberParent: "ModernReservationRecommendationProperties", + polymorphicDiscriminator: + ModernReservationRecommendationProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ModernReservationRecommendationProperties.type.modelProperties, + subscriptionId: { + serializedName: "subscriptionId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +export const ModernSharedScopeReservationRecommendationProperties: coreClient.CompositeMapper = { + serializedName: "Shared", + type: { + name: "Composite", + className: "ModernSharedScopeReservationRecommendationProperties", + uberParent: "ModernReservationRecommendationProperties", + polymorphicDiscriminator: + ModernReservationRecommendationProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ModernReservationRecommendationProperties.type.modelProperties + } + } +}; + export const LegacyUsageDetail: coreClient.CompositeMapper = { serializedName: "legacy", type: { @@ -3542,6 +3912,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, @@ -4275,6 +4659,13 @@ export const ModernReservationRecommendation: coreClient.CompositeMapper = { name: "Number" } }, + resourceType: { + serializedName: "properties.resourceType", + readOnly: true, + type: { + name: "String" + } + }, totalCostWithReservedInstances: { serializedName: "properties.totalCostWithReservedInstances", type: { @@ -4298,7 +4689,7 @@ export const ModernReservationRecommendation: coreClient.CompositeMapper = { }, scope: { serializedName: "properties.scope", - readOnly: true, + required: true, type: { name: "String" } @@ -4371,8 +4762,8 @@ export const LegacyChargeSummary: coreClient.CompositeMapper = { name: "Number" } }, - marketplaceCharges: { - serializedName: "properties.marketplaceCharges", + azureMarketplaceCharges: { + serializedName: "properties.azureMarketplaceCharges", readOnly: true, type: { name: "Number" @@ -4474,6 +4865,13 @@ export const ModernChargeSummary: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + subscriptionId: { + serializedName: "properties.subscriptionId", + readOnly: true, + type: { + name: "String" + } } } } @@ -4489,13 +4887,37 @@ export const LegacyReservationTransaction: coreClient.CompositeMapper = { } }; +export const PriceSheetDownloadByBillingAccountPeriodHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PriceSheetDownloadByBillingAccountPeriodHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + export let discriminators = { LegacyReservationRecommendationProperties: LegacyReservationRecommendationProperties, + ModernReservationRecommendationProperties: ModernReservationRecommendationProperties, "Resource.UsageDetail": UsageDetail, "Resource.ReservationRecommendation": ReservationRecommendation, "ProxyResource.ChargeSummary": ChargeSummary, "LegacyReservationRecommendationProperties.Single": LegacySingleScopeReservationRecommendationProperties, "LegacyReservationRecommendationProperties.Shared": LegacySharedScopeReservationRecommendationProperties, + "ModernReservationRecommendationProperties.Single": ModernSingleScopeReservationRecommendationProperties, + "ModernReservationRecommendationProperties.Shared": ModernSharedScopeReservationRecommendationProperties, "UsageDetail.legacy": LegacyUsageDetail, "UsageDetail.modern": ModernUsageDetail, "ReservationRecommendation.legacy": LegacyReservationRecommendation, diff --git a/sdk/consumption/arm-consumption/src/models/parameters.ts b/sdk/consumption/arm-consumption/src/models/parameters.ts index d3cccb1067c2..4c13c537bd1b 100644 --- a/sdk/consumption/arm-consumption/src/models/parameters.ts +++ b/sdk/consumption/arm-consumption/src/models/parameters.ts @@ -96,7 +96,7 @@ export const top: OperationQueryParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-10-01", + defaultValue: "2023-11-01", isConstant: true, serializedName: "api-version", type: { @@ -240,6 +240,18 @@ export const reservationId: OperationURLParameter = { } }; +export const resourceScope: OperationURLParameter = { + parameterPath: "resourceScope", + mapper: { + serializedName: "resourceScope", + required: true, + type: { + name: "String" + } + }, + skipEncoding: true +}; + export const reservationId1: OperationQueryParameter = { parameterPath: ["options", "reservationId"], mapper: { @@ -271,6 +283,17 @@ export const filter1: OperationQueryParameter = { } }; +export const scope1: OperationQueryParameter = { + parameterPath: "scope", + mapper: { + serializedName: "scope", + required: true, + type: { + name: "String" + } + } +}; + export const region: OperationQueryParameter = { parameterPath: "region", mapper: { @@ -315,6 +338,26 @@ export const product: OperationQueryParameter = { } }; +export const useMarkupIfPartner: OperationQueryParameter = { + parameterPath: ["options", "useMarkupIfPartner"], + mapper: { + serializedName: "useMarkupIfPartner", + type: { + name: "Boolean" + } + } +}; + +export const previewMarkupPercentage: OperationQueryParameter = { + parameterPath: ["options", "previewMarkupPercentage"], + mapper: { + serializedName: "previewMarkupPercentage", + type: { + name: "Number" + } + } +}; + export const billingProfileId: OperationURLParameter = { parameterPath: "billingProfileId", mapper: { @@ -337,6 +380,20 @@ export const subscriptionId: OperationURLParameter = { } }; +export const billingPeriodName1: OperationURLParameter = { + parameterPath: "billingPeriodName", + mapper: { + constraints: { + Pattern: new RegExp("^[0-9]*$") + }, + serializedName: "billingPeriodName", + required: true, + type: { + name: "String" + } + } +}; + export const managementGroupId: OperationURLParameter = { parameterPath: "managementGroupId", mapper: { @@ -369,3 +426,14 @@ export const endDate1: OperationQueryParameter = { } } }; + +export const customerId: OperationURLParameter = { + parameterPath: "customerId", + mapper: { + serializedName: "customerId", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/consumption/arm-consumption/src/operations/budgets.ts b/sdk/consumption/arm-consumption/src/operations/budgets.ts index 5a6472e9f187..b41f760a8028 100644 --- a/sdk/consumption/arm-consumption/src/operations/budgets.ts +++ b/sdk/consumption/arm-consumption/src/operations/budgets.ts @@ -52,7 +52,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param options The options parameters. */ @@ -122,7 +122,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param options The options parameters. */ @@ -149,7 +149,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param options The options parameters. @@ -180,7 +180,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. @@ -211,7 +211,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param options The options parameters. @@ -240,7 +240,7 @@ export class BudgetsImpl implements Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. diff --git a/sdk/consumption/arm-consumption/src/operations/charges.ts b/sdk/consumption/arm-consumption/src/operations/charges.ts index 2f817da55bcd..a78015f4172d 100644 --- a/sdk/consumption/arm-consumption/src/operations/charges.ts +++ b/sdk/consumption/arm-consumption/src/operations/charges.ts @@ -39,10 +39,10 @@ export class ChargesImpl implements Charges { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param options The options parameters. */ list( diff --git a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts index c26514278ceb..90e5064714ed 100644 --- a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts +++ b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts @@ -21,8 +21,12 @@ import { LotsListByBillingAccountNextOptionalParams, LotsListByBillingAccountOptionalParams, LotsListByBillingAccountResponse, + LotsListByCustomerNextOptionalParams, + LotsListByCustomerOptionalParams, + LotsListByCustomerResponse, LotsListByBillingProfileNextResponse, - LotsListByBillingAccountNextResponse + LotsListByBillingAccountNextResponse, + LotsListByCustomerNextResponse } from "../models"; /// @@ -39,9 +43,8 @@ export class LotsOperationsImpl implements LotsOperations { } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for + * Microsoft Customer Agreements (MCA) billing accounts. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. @@ -125,9 +128,8 @@ export class LotsOperationsImpl implements LotsOperations { } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported + * for Microsoft Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -196,9 +198,93 @@ export class LotsOperationsImpl implements LotsOperations { } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements + * (MPA) billing accounts. + * @param billingAccountId BillingAccount ID + * @param customerId Customer ID + * @param options The options parameters. + */ + public listByCustomer( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByCustomerPagingAll( + billingAccountId, + customerId, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCustomerPagingPage( + billingAccountId, + customerId, + options, + settings + ); + } + }; + } + + private async *listByCustomerPagingPage( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: LotsListByCustomerResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCustomer( + billingAccountId, + customerId, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountId, + customerId, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCustomerPagingAll( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByCustomerPagingPage( + billingAccountId, + customerId, + options + )) { + yield* page; + } + } + + /** + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for + * Microsoft Customer Agreements (MCA) billing accounts. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. @@ -215,9 +301,8 @@ export class LotsOperationsImpl implements LotsOperations { } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported + * for Microsoft Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -231,6 +316,24 @@ export class LotsOperationsImpl implements LotsOperations { ); } + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements + * (MPA) billing accounts. + * @param billingAccountId BillingAccount ID + * @param customerId Customer ID + * @param options The options parameters. + */ + private _listByCustomer( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, customerId, options }, + listByCustomerOperationSpec + ); + } + /** * ListByBillingProfileNext * @param billingAccountId BillingAccount ID @@ -266,6 +369,25 @@ export class LotsOperationsImpl implements LotsOperations { listByBillingAccountNextOperationSpec ); } + + /** + * ListByCustomerNext + * @param billingAccountId BillingAccount ID + * @param customerId Customer ID + * @param nextLink The nextLink from the previous successful call to the ListByCustomer method. + * @param options The options parameters. + */ + private _listByCustomerNext( + billingAccountId: string, + customerId: string, + nextLink: string, + options?: LotsListByCustomerNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { billingAccountId, customerId, nextLink, options }, + listByCustomerNextOperationSpec + ); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -308,6 +430,27 @@ const listByBillingAccountOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listByCustomerOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}/providers/Microsoft.Consumption/lots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.customerId + ], + headerParameters: [Parameters.accept], + serializer +}; const listByBillingProfileNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", @@ -347,3 +490,23 @@ const listByBillingAccountNextOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listByCustomerNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Lots + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.customerId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts index 6f7daa62be12..6708321baa60 100644 --- a/sdk/consumption/arm-consumption/src/operations/marketplaces.ts +++ b/sdk/consumption/arm-consumption/src/operations/marketplaces.ts @@ -166,6 +166,7 @@ const listOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.MarketplacesListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -187,6 +188,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.MarketplacesListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts index baf8229c556b..19ec4d4e1a60 100644 --- a/sdk/consumption/arm-consumption/src/operations/priceSheet.ts +++ b/sdk/consumption/arm-consumption/src/operations/priceSheet.ts @@ -11,11 +11,19 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClient } from "../consumptionManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { PriceSheetGetOptionalParams, PriceSheetGetResponse, PriceSheetGetByBillingPeriodOptionalParams, - PriceSheetGetByBillingPeriodResponse + PriceSheetGetByBillingPeriodResponse, + PriceSheetDownloadByBillingAccountPeriodOptionalParams, + PriceSheetDownloadByBillingAccountPeriodResponse } from "../models"; /** Class containing PriceSheet operations. */ @@ -54,6 +62,97 @@ export class PriceSheetImpl implements PriceSheet { getByBillingPeriodOperationSpec ); } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id + * @param billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + async beginDownloadByBillingAccountPeriod( + billingAccountId: string, + billingPeriodName: string, + options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PriceSheetDownloadByBillingAccountPeriodResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { billingAccountId, billingPeriodName, options }, + spec: downloadByBillingAccountPeriodOperationSpec + }); + const poller = await createHttpPoller< + PriceSheetDownloadByBillingAccountPeriodResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id + * @param billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + async beginDownloadByBillingAccountPeriodAndWait( + billingAccountId: string, + billingPeriodName: string, + options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams + ): Promise { + const poller = await this.beginDownloadByBillingAccountPeriod( + billingAccountId, + billingPeriodName, + options + ); + return poller.pollUntilDone(); + } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); @@ -106,3 +205,33 @@ const getByBillingPeriodOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const downloadByBillingAccountPeriodOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.OperationStatus + }, + 201: { + bodyMapper: Mappers.OperationStatus + }, + 202: { + bodyMapper: Mappers.OperationStatus + }, + 204: { + bodyMapper: Mappers.OperationStatus + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.billingAccountId, + Parameters.billingPeriodName1 + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts index c3bf7a979b7b..3705a589fae2 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendationDetails.ts @@ -12,6 +12,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ConsumptionManagementClient } from "../consumptionManagementClient"; import { + Scope, Term, LookBackPeriod, ReservationRecommendationDetailsGetOptionalParams, @@ -33,12 +34,13 @@ export class ReservationRecommendationDetailsImpl /** * Details of a reservation recommendation for what-if analysis of reserved instances. - * @param scope The scope associated with reservation recommendation details operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendation details operations. This + * includes '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -47,7 +49,8 @@ export class ReservationRecommendationDetailsImpl * @param options The options parameters. */ get( - scope: string, + resourceScope: string, + scope: Scope, region: string, term: Term, lookBackPeriod: LookBackPeriod, @@ -55,7 +58,7 @@ export class ReservationRecommendationDetailsImpl options?: ReservationRecommendationDetailsGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, region, term, lookBackPeriod, product, options }, + { resourceScope, scope, region, term, lookBackPeriod, product, options }, getOperationSpec ); } @@ -65,7 +68,7 @@ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const getOperationSpec: coreClient.OperationSpec = { path: - "/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails", + "/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails", httpMethod: "GET", responses: { 200: { @@ -77,13 +80,15 @@ const getOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [ + Parameters.filter, Parameters.apiVersion, + Parameters.scope1, Parameters.region, Parameters.term, Parameters.lookBackPeriod, Parameters.product ], - urlParameters: [Parameters.$host, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceScope], headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts index c037c1e9b67d..ec7abf3ce7ee 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationRecommendations.ts @@ -37,19 +37,19 @@ export class ReservationRecommendationsImpl /** * List of recommendations for purchasing reserved instances. - * @param scope The scope associated with reservation recommendations operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope * @param options The options parameters. */ public list( - scope: string, + resourceScope: string, options?: ReservationRecommendationsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scope, options); + const iter = this.listPagingAll(resourceScope, options); return { next() { return iter.next(); @@ -61,27 +61,27 @@ export class ReservationRecommendationsImpl if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(scope, options, settings); + return this.listPagingPage(resourceScope, options, settings); } }; } private async *listPagingPage( - scope: string, + resourceScope: string, options?: ReservationRecommendationsListOptionalParams, settings?: PageSettings ): AsyncIterableIterator { let result: ReservationRecommendationsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(scope, options); + result = await this._list(resourceScope, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext(scope, continuationToken, options); + result = await this._listNext(resourceScope, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -90,52 +90,52 @@ export class ReservationRecommendationsImpl } private async *listPagingAll( - scope: string, + resourceScope: string, options?: ReservationRecommendationsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(scope, options)) { + for await (const page of this.listPagingPage(resourceScope, options)) { yield* page; } } /** * List of recommendations for purchasing reserved instances. - * @param scope The scope associated with reservation recommendations operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope * @param options The options parameters. */ private _list( - scope: string, + resourceScope: string, options?: ReservationRecommendationsListOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, options }, + { resourceScope, options }, listOperationSpec ); } /** * ListNext - * @param scope The scope associated with reservation recommendations operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( - scope: string, + resourceScope: string, nextLink: string, options?: ReservationRecommendationsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, nextLink, options }, + { resourceScope, nextLink, options }, listNextOperationSpec ); } @@ -144,7 +144,8 @@ export class ReservationRecommendationsImpl const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Consumption/reservationRecommendations", + path: + "/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations", httpMethod: "GET", responses: { 200: { @@ -156,7 +157,7 @@ const listOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [Parameters.filter, Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceScope], headerParameters: [Parameters.accept], serializer }; @@ -172,7 +173,11 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.resourceScope + ], headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts index 4eaf6125af4d..9e3edfd57fd4 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationTransactions.ts @@ -40,7 +40,12 @@ export class ReservationTransactionsImpl implements ReservationTransactions { } /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing account scope. Note: The refund transactions + * are posted along with its purchase transaction (i.e. in the purchase billing month). For example, + * The refund is requested in May 2021. This refund transaction will have event date as May 2021 but + * the billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -102,7 +107,12 @@ export class ReservationTransactionsImpl implements ReservationTransactions { } /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing profile scope. The refund transactions are + * posted along with its purchase transaction (i.e. in the purchase billing month). For example, The + * refund is requested in May 2021. This refund transaction will have event date as May 2021 but the + * billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. @@ -186,7 +196,12 @@ export class ReservationTransactionsImpl implements ReservationTransactions { } /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing account scope. Note: The refund transactions + * are posted along with its purchase transaction (i.e. in the purchase billing month). For example, + * The refund is requested in May 2021. This refund transaction will have event date as May 2021 but + * the billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -201,7 +216,12 @@ export class ReservationTransactionsImpl implements ReservationTransactions { } /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing profile scope. The refund transactions are + * posted along with its purchase transaction (i.e. in the purchase billing month). For example, The + * refund is requested in May 2021. This refund transaction will have event date as May 2021 but the + * billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. @@ -268,7 +288,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.filter, Parameters.apiVersion], + queryParameters: [ + Parameters.filter, + Parameters.apiVersion, + Parameters.useMarkupIfPartner, + Parameters.previewMarkupPercentage + ], urlParameters: [Parameters.$host, Parameters.billingAccountId], headerParameters: [Parameters.accept], serializer diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts index 60a5ff3c0114..18a2ca351ea2 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsDetails.ts @@ -43,7 +43,11 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and * end date. The filter supports 'le' and 'ge' @@ -127,7 +131,11 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and @@ -220,19 +228,23 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } /** - * Lists the reservations details for the defined scope and provided date range. - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. + * @param resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param options The options parameters. */ public list( - scope: string, + resourceScope: string, options?: ReservationsDetailsListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scope, options); + const iter = this.listPagingAll(resourceScope, options); return { next() { return iter.next(); @@ -244,27 +256,27 @@ export class ReservationsDetailsImpl implements ReservationsDetails { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(scope, options, settings); + return this.listPagingPage(resourceScope, options, settings); } }; } private async *listPagingPage( - scope: string, + resourceScope: string, options?: ReservationsDetailsListOptionalParams, settings?: PageSettings ): AsyncIterableIterator { let result: ReservationsDetailsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(scope, options); + result = await this._list(resourceScope, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext(scope, continuationToken, options); + result = await this._listNext(resourceScope, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -273,16 +285,20 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } private async *listPagingAll( - scope: string, + resourceScope: string, options?: ReservationsDetailsListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(scope, options)) { + for await (const page of this.listPagingPage(resourceScope, options)) { yield* page; } } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and * end date. The filter supports 'le' and 'ge' @@ -300,7 +316,11 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and @@ -320,20 +340,24 @@ export class ReservationsDetailsImpl implements ReservationsDetails { } /** - * Lists the reservations details for the defined scope and provided date range. - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. + * @param resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param options The options parameters. */ private _list( - scope: string, + resourceScope: string, options?: ReservationsDetailsListOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, options }, + { resourceScope, options }, listOperationSpec ); } @@ -379,21 +403,21 @@ export class ReservationsDetailsImpl implements ReservationsDetails { /** * ListNext - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * @param resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( - scope: string, + resourceScope: string, nextLink: string, options?: ReservationsDetailsListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, nextLink, options }, + { resourceScope, nextLink, options }, listNextOperationSpec ); } @@ -440,7 +464,7 @@ const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpe serializer }; const listOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Consumption/reservationDetails", + path: "/{resourceScope}/providers/Microsoft.Consumption/reservationDetails", httpMethod: "GET", responses: { 200: { @@ -458,7 +482,7 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.reservationId1, Parameters.reservationOrderId1 ], - urlParameters: [Parameters.$host, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceScope], headerParameters: [Parameters.accept], serializer }; @@ -512,7 +536,11 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.resourceScope + ], headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts index 3b492dbfd1d7..37ca2111ab3c 100644 --- a/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts +++ b/sdk/consumption/arm-consumption/src/operations/reservationsSummaries.ts @@ -44,7 +44,9 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param grain Can be daily or monthly * @param options The options parameters. @@ -127,7 +129,9 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param grain Can be daily or monthly @@ -219,21 +223,23 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a + * payload size limit of 12MB, so currently callers get 400 when the response size exceeds the ARM + * limit. In such cases, API call should be made with smaller date ranges. + * @param resourceScope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param grain Can be daily or monthly * @param options The options parameters. */ public list( - scope: string, + resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(scope, grain, options); + const iter = this.listPagingAll(resourceScope, grain, options); return { next() { return iter.next(); @@ -245,13 +251,13 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(scope, grain, options, settings); + return this.listPagingPage(resourceScope, grain, options, settings); } }; } private async *listPagingPage( - scope: string, + resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams, settings?: PageSettings @@ -259,14 +265,14 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { let result: ReservationsSummariesListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(scope, grain, options); + result = await this._list(resourceScope, grain, options); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); yield page; } while (continuationToken) { - result = await this._listNext(scope, continuationToken, options); + result = await this._listNext(resourceScope, continuationToken, options); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -275,17 +281,23 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } private async *listPagingAll( - scope: string, + resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams ): AsyncIterableIterator { - for await (const page of this.listPagingPage(scope, grain, options)) { + for await (const page of this.listPagingPage( + resourceScope, + grain, + options + )) { yield* page; } } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param grain Can be daily or monthly * @param options The options parameters. @@ -302,7 +314,9 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param grain Can be daily or monthly @@ -323,22 +337,24 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a + * payload size limit of 12MB, so currently callers get 400 when the response size exceeds the ARM + * limit. In such cases, API call should be made with smaller date ranges. + * @param resourceScope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param grain Can be daily or monthly * @param options The options parameters. */ private _list( - scope: string, + resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, grain, options }, + { resourceScope, grain, options }, listOperationSpec ); } @@ -384,21 +400,21 @@ export class ReservationsSummariesImpl implements ReservationsSummaries { /** * ListNext - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * @param resourceScope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ private _listNext( - scope: string, + resourceScope: string, nextLink: string, options?: ReservationsSummariesListNextOptionalParams ): Promise { return this.client.sendOperationRequest( - { scope, nextLink, options }, + { resourceScope, nextLink, options }, listNextOperationSpec ); } @@ -445,7 +461,7 @@ const listByReservationOrderAndReservationOperationSpec: coreClient.OperationSpe serializer }; const listOperationSpec: coreClient.OperationSpec = { - path: "/{scope}/providers/Microsoft.Consumption/reservationSummaries", + path: "/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries", httpMethod: "GET", responses: { 200: { @@ -464,7 +480,7 @@ const listOperationSpec: coreClient.OperationSpec = { Parameters.reservationId1, Parameters.reservationOrderId1 ], - urlParameters: [Parameters.$host, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceScope], headerParameters: [Parameters.accept], serializer }; @@ -518,7 +534,11 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - urlParameters: [Parameters.$host, Parameters.scope, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.resourceScope + ], headerParameters: [Parameters.accept], serializer }; diff --git a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts index 3c118200ad97..b3f9234b6972 100644 --- a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts @@ -37,6 +37,12 @@ export class UsageDetailsImpl implements UsageDetails { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May * 1, 2014 or later. + * + * **Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We + * do not recommend that you take a new dependency on this API. Please use the Cost Details API + * instead. We will notify customers once a date for retirement has been determined.For Learn more,see + * [Generate Cost Details Report - Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)** * @param scope The scope associated with usage details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, @@ -52,10 +58,10 @@ export class UsageDetailsImpl implements UsageDetails { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param options The options parameters. */ public list( @@ -114,6 +120,12 @@ export class UsageDetailsImpl implements UsageDetails { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May * 1, 2014 or later. + * + * **Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We + * do not recommend that you take a new dependency on this API. Please use the Cost Details API + * instead. We will notify customers once a date for retirement has been determined.For Learn more,see + * [Generate Cost Details Report - Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)** * @param scope The scope associated with usage details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, @@ -129,10 +141,10 @@ export class UsageDetailsImpl implements UsageDetails { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param options The options parameters. */ private _list( @@ -162,10 +174,10 @@ export class UsageDetailsImpl implements UsageDetails { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param nextLink The nextLink from the previous successful call to the List method. * @param options The options parameters. */ @@ -190,6 +202,7 @@ const listOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -213,6 +226,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts index ef12d70ae33e..48209eff739f 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/budgets.ts @@ -33,7 +33,7 @@ export interface Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param options The options parameters. */ @@ -54,7 +54,7 @@ export interface Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param options The options parameters. @@ -79,7 +79,7 @@ export interface Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. @@ -104,7 +104,7 @@ export interface Budgets { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @param budgetName Budget Name. * @param options The options parameters. diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts index 074f8c6d24ee..2de802039286 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/charges.ts @@ -24,10 +24,10 @@ export interface Charges { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param options The options parameters. */ list( diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts index cee7524cb172..3be08764527e 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/lotsOperations.ts @@ -10,16 +10,16 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { LotSummary, LotsListByBillingProfileOptionalParams, - LotsListByBillingAccountOptionalParams + LotsListByBillingAccountOptionalParams, + LotsListByCustomerOptionalParams } from "../models"; /// /** Interface representing a LotsOperations. */ export interface LotsOperations { /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for + * Microsoft Customer Agreements (MCA) billing accounts. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. @@ -30,9 +30,8 @@ export interface LotsOperations { options?: LotsListByBillingProfileOptionalParams ): PagedAsyncIterableIterator; /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a - * billing profile. Microsoft Azure consumption commitments are only supported for the billing account - * scope. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported + * for Microsoft Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -40,4 +39,16 @@ export interface LotsOperations { billingAccountId: string, options?: LotsListByBillingAccountOptionalParams ): PagedAsyncIterableIterator; + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements + * (MPA) billing accounts. + * @param billingAccountId BillingAccount ID + * @param customerId Customer ID + * @param options The options parameters. + */ + listByCustomer( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams + ): PagedAsyncIterableIterator; } diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts index b9ce965b0936..4cbd670e1984 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/priceSheet.ts @@ -6,11 +6,14 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PriceSheetGetOptionalParams, PriceSheetGetResponse, PriceSheetGetByBillingPeriodOptionalParams, - PriceSheetGetByBillingPeriodResponse + PriceSheetGetByBillingPeriodResponse, + PriceSheetDownloadByBillingAccountPeriodOptionalParams, + PriceSheetDownloadByBillingAccountPeriodResponse } from "../models"; /** Interface representing a PriceSheet. */ @@ -31,4 +34,31 @@ export interface PriceSheet { billingPeriodName: string, options?: PriceSheetGetByBillingPeriodOptionalParams ): Promise; + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id + * @param billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + beginDownloadByBillingAccountPeriod( + billingAccountId: string, + billingPeriodName: string, + options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PriceSheetDownloadByBillingAccountPeriodResponse + > + >; + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id + * @param billingAccountId BillingAccount ID + * @param billingPeriodName Billing Period Name. + * @param options The options parameters. + */ + beginDownloadByBillingAccountPeriodAndWait( + billingAccountId: string, + billingPeriodName: string, + options?: PriceSheetDownloadByBillingAccountPeriodOptionalParams + ): Promise; } diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts index 563830545ff9..5733c252df79 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendationDetails.ts @@ -7,6 +7,7 @@ */ import { + Scope, Term, LookBackPeriod, ReservationRecommendationDetailsGetOptionalParams, @@ -17,12 +18,13 @@ import { export interface ReservationRecommendationDetails { /** * Details of a reservation recommendation for what-if analysis of reserved instances. - * @param scope The scope associated with reservation recommendation details operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendation details operations. This + * includes '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -31,7 +33,8 @@ export interface ReservationRecommendationDetails { * @param options The options parameters. */ get( - scope: string, + resourceScope: string, + scope: Scope, region: string, term: Term, lookBackPeriod: LookBackPeriod, diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts index e4df3b2a4d35..826ea6fcc729 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationRecommendations.ts @@ -17,16 +17,16 @@ import { export interface ReservationRecommendations { /** * List of recommendations for purchasing reserved instances. - * @param scope The scope associated with reservation recommendations operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope + * @param resourceScope The scope associated with reservation recommendations operations. This includes + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for billingProfile scope * @param options The options parameters. */ list( - scope: string, + resourceScope: string, options?: ReservationRecommendationsListOptionalParams ): PagedAsyncIterableIterator; } diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts index bc3dd77c5727..9c62317804f1 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationTransactions.ts @@ -18,7 +18,12 @@ import { /** Interface representing a ReservationTransactions. */ export interface ReservationTransactions { /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing account scope. Note: The refund transactions + * are posted along with its purchase transaction (i.e. in the purchase billing month). For example, + * The refund is requested in May 2021. This refund transaction will have event date as May 2021 but + * the billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param options The options parameters. */ @@ -27,7 +32,12 @@ export interface ReservationTransactions { options?: ReservationTransactionsListOptionalParams ): PagedAsyncIterableIterator; /** - * List of transactions for reserved instances on billing account scope + * List of transactions for reserved instances on billing profile scope. The refund transactions are + * posted along with its purchase transaction (i.e. in the purchase billing month). For example, The + * refund is requested in May 2021. This refund transaction will have event date as May 2021 but the + * billing month as April 2020 when the reservation purchase was made. Note: ARM has a payload size + * limit of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such + * cases, API call should be made with smaller date ranges. * @param billingAccountId BillingAccount ID * @param billingProfileId Azure Billing Profile ID. * @param options The options parameters. diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts index 771aedbfc513..ae98ce1db0b6 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsDetails.ts @@ -18,7 +18,11 @@ import { /** Interface representing a ReservationsDetails. */ export interface ReservationsDetails { /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and * end date. The filter supports 'le' and 'ge' @@ -30,7 +34,11 @@ export interface ReservationsDetails { options?: ReservationsDetailsListByReservationOrderOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param filter Filter reservation details by date range. The properties/UsageDate for start date and @@ -44,16 +52,20 @@ export interface ReservationsDetails { options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the reservations details for the defined scope and provided date range. - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, + * so currently callers get 400 when the response size exceeds the ARM limit. If the data size is too + * large, customers may also get 504 as the API timed out preparing the data. In such cases, API call + * should be made with smaller date ranges or a call to Generate Reservation Details Report API should + * be made as it is asynchronous and will not run into response size time outs. + * @param resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param options The options parameters. */ list( - scope: string, + resourceScope: string, options?: ReservationsDetailsListOptionalParams ): PagedAsyncIterableIterator; } diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts index 935d9eeaef13..ec431720300c 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/reservationsSummaries.ts @@ -19,7 +19,9 @@ import { /** Interface representing a ReservationsSummaries. */ export interface ReservationsSummaries { /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param grain Can be daily or monthly * @param options The options parameters. @@ -30,7 +32,9 @@ export interface ReservationsSummaries { options?: ReservationsSummariesListByReservationOrderOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of + * 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API + * call should be made with smaller date ranges. * @param reservationOrderId Order Id of the reservation * @param reservationId Id of the reservation * @param grain Can be daily or monthly @@ -43,17 +47,19 @@ export interface ReservationsSummaries { options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams ): PagedAsyncIterableIterator; /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), - * and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for BillingProfile scope (modern). + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a + * payload size limit of 12MB, so currently callers get 400 when the response size exceeds the ARM + * limit. In such cases, API call should be made with smaller date ranges. + * @param resourceScope The scope associated with reservations summaries operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), + * and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' + * for BillingProfile scope (modern). * @param grain Can be daily or monthly * @param options The options parameters. */ list( - scope: string, + resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams ): PagedAsyncIterableIterator; diff --git a/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts index b705a0dfe826..b8f2f64db9ad 100644 --- a/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operationsInterfaces/usageDetails.ts @@ -15,6 +15,12 @@ export interface UsageDetails { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May * 1, 2014 or later. + * + * **Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We + * do not recommend that you take a new dependency on this API. Please use the Cost Details API + * instead. We will notify customers once a date for retirement has been determined.For Learn more,see + * [Generate Cost Details Report - Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)** * @param scope The scope associated with usage details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, @@ -30,10 +36,10 @@ export interface UsageDetails { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific + * for partners. * @param options The options parameters. */ list( diff --git a/sdk/consumption/arm-consumption/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/consumption/arm-consumption/tsconfig.json b/sdk/consumption/arm-consumption/tsconfig.json index 6e8ad365181f..3e6ae96443f3 100644 --- a/sdk/consumption/arm-consumption/tsconfig.json +++ b/sdk/consumption/arm-consumption/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-consumption": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"