diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f10690b25978..e8590353f465 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -9917,23 +9917,23 @@ packages: dev: false file:projects/arm-consumption.tgz: - resolution: {integrity: sha512-Vg/7FmVsWRD2V1klJF7ehy5JwXPoGFBJamObRIjt7uzysiu15V48HW4AH4Yaop6/6L++9Om2ibGO+lzr7CbODg==, tarball: file:projects/arm-consumption.tgz} + resolution: {integrity: sha512-tdApnqzpk08PxZN4N99ntXSkGs1acCC4Rm5wnONfrpDsm00Df5Wh40TjYsOOHajivuzWMkq8S6rks0hjC+idBQ==, tarball: file:projects/arm-consumption.tgz} name: '@rush-temp/arm-consumption' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.2_rollup@2.70.0 - '@rollup/plugin-json': 4.1.0_rollup@2.70.0 - '@rollup/plugin-multi-entry': 3.0.1_rollup@2.70.0 - '@rollup/plugin-node-resolve': 8.4.0_rollup@2.70.0 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.70.0 - rollup-plugin-sourcemaps: 0.4.2_rollup@2.70.0 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.2 @@ -16529,7 +16529,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-ADG9wO8rIljoktGdVnP+v8jdrxc43TL0hQgHi7cSXkrJxFGGB6M8XqcDhuT8hYCLfLkRzCwpwH7VSnsjBDVdpg==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-9TumFphoGCJiaHQVfz2Z9AsSbhal4ZtZWx7L9fG19JdfEZKJT5uUykYq81plFNWAReFMs83oFPUO//K+BhRuLQ==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: @@ -17674,7 +17674,7 @@ packages: dev: false file:projects/web-pubsub.tgz: - resolution: {integrity: sha512-7qvVc3+mTZX3L5BoserPH04Nwu7kDUUNR5KCtK+ugSa+uTQ5jM0uPXJ3sxgajKuLX+a63eftQtMg2Zcf9K3HZw==, tarball: file:projects/web-pubsub.tgz} + resolution: {integrity: sha512-vAYE6Sk0Olihti+uB+3ac0P3Y+d/XtBXwF2rq0PblaciuLhY/J/3+Y9dpOYDpgTiTyZuAmm+7DDRAq8AYkSETQ==, tarball: file:projects/web-pubsub.tgz} name: '@rush-temp/web-pubsub' version: 0.0.0 dependencies: diff --git a/sdk/consumption/arm-consumption/CHANGELOG.md b/sdk/consumption/arm-consumption/CHANGELOG.md index 99cc8ce33f22..ebf7260be0dd 100644 --- a/sdk/consumption/arm-consumption/CHANGELOG.md +++ b/sdk/consumption/arm-consumption/CHANGELOG.md @@ -1,15 +1,22 @@ # Release History - -## 9.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 10.0.0 (2022-04-08) + +**Features** + + - Added operation LotsOperations.listByCustomer + - Added Interface LotsListByCustomerNextOptionalParams + - Added Interface LotsListByCustomerOptionalParams + - Added Type Alias LotsListByCustomerNextResponse + - Added Type Alias LotsListByCustomerResponse + - Type Alias LegacyUsageDetail has a new parameter benefitId + - Type Alias LegacyUsageDetail has a new parameter benefitName + +**Breaking Changes** + + - Interface BudgetFilter no longer has parameter not + + ## 9.0.0 (2021-12-16) The package of @azure/arm-consumption is using our next generation design principles since version 9.0.0, which contains breaking changes. diff --git a/sdk/consumption/arm-consumption/LICENSE b/sdk/consumption/arm-consumption/LICENSE index ccb63b166732..5d1d36e0af80 100644 --- a/sdk/consumption/arm-consumption/LICENSE +++ b/sdk/consumption/arm-consumption/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/consumption/arm-consumption/_meta.json b/sdk/consumption/arm-consumption/_meta.json index 1e25c71e9fde..953b68963d43 100644 --- a/sdk/consumption/arm-consumption/_meta.json +++ b/sdk/consumption/arm-consumption/_meta.json @@ -1,7 +1,8 @@ { - "commit": "d600759c3516b61a7c353bc8682bccbab85a6f65", + "commit": "270216612a7426cce8408d2b690d864248d69759", "readme": "specification/consumption/resource-manager/readme.md", - "autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211207.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/consumption/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20211207.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/api-extractor.json b/sdk/consumption/arm-consumption/api-extractor.json index 64cf6e492117..905b4c2997f0 100644 --- a/sdk/consumption/arm-consumption/api-extractor.json +++ b/sdk/consumption/arm-consumption/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/arm-consumption.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/consumption/arm-consumption/package.json b/sdk/consumption/arm-consumption/package.json index 0cfa8b17e1a9..c1c409064ac6 100644 --- a/sdk/consumption/arm-consumption/package.json +++ b/sdk/consumption/arm-consumption/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ConsumptionManagementClient.", - "version": "9.0.1", + "version": "10.0.0", "engines": { "node": ">=12.0.0" }, @@ -27,12 +27,12 @@ "types": "./types/arm-consumption.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-json": "^4.0.0", "@rollup/plugin-multi-entry": "^3.0.0", "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.0.0", + "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", @@ -97,4 +97,4 @@ }, "sideEffects": false, "autoPublish": true -} +} \ 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 ff700c3e0aac..d1ab26dba7b7 100644 --- a/sdk/consumption/arm-consumption/review/arm-consumption.api.md +++ b/sdk/consumption/arm-consumption/review/arm-consumption.api.md @@ -120,7 +120,6 @@ export interface BudgetComparisonExpression { export interface BudgetFilter { and?: BudgetFilterProperties[]; dimensions?: BudgetComparisonExpression; - not?: BudgetFilterProperties; tags?: BudgetComparisonExpression; } @@ -746,6 +745,8 @@ export type LegacyUsageDetail = UsageDetail & { readonly chargeType?: string; readonly frequency?: string; readonly payGPrice?: number; + readonly benefitId?: string; + readonly benefitName?: string; readonly pricingModel?: PricingModelType; }; @@ -788,10 +789,27 @@ export interface LotsListByBillingProfileOptionalParams extends coreClient.Opera // @public export type LotsListByBillingProfileResponse = Lots; +// @public +export interface LotsListByCustomerNextOptionalParams extends coreClient.OperationOptions { + filter?: string; +} + +// @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 diff --git a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts index b7c9fa70b3c1..7b16f0d9b493 100644 --- a/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts +++ b/sdk/consumption/arm-consumption/src/consumptionManagementClient.ts @@ -80,7 +80,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-consumption/9.0.0`; + const packageDetails = `azsdk-js-arm-consumption/10.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/consumption/arm-consumption/src/models/index.ts b/sdk/consumption/arm-consumption/src/models/index.ts index c37726a97d85..ce764396111e 100644 --- a/sdk/consumption/arm-consumption/src/models/index.ts +++ b/sdk/consumption/arm-consumption/src/models/index.ts @@ -136,8 +136,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 */ @@ -2121,6 +2119,16 @@ export type LegacyUsageDetail = UsageDetail & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly payGPrice?: number; + /** + * Unique identifier for the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitId?: string; + /** + * Name of the applicable benefit. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly benefitName?: string; /** * Identifier that indicates how the meter is priced. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3586,6 +3594,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 {} @@ -3603,6 +3621,16 @@ export interface LotsListByBillingAccountNextOptionalParams /** Contains response data for the listByBillingAccountNext operation. */ export type LotsListByBillingAccountNextResponse = Lots; +/** Optional parameters. */ +export interface LotsListByCustomerNextOptionalParams + 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 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 2433e367e222..b6c08c54b470 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: { @@ -3023,7 +3016,6 @@ export const ReservationTransaction: coreClient.CompositeMapper = { }; export const ModernReservationTransaction: coreClient.CompositeMapper = { - serializedName: "Modern", type: { name: "Composite", className: "ModernReservationTransaction", @@ -3542,6 +3534,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, diff --git a/sdk/consumption/arm-consumption/src/models/parameters.ts b/sdk/consumption/arm-consumption/src/models/parameters.ts index d3cccb1067c2..b21b5789e64e 100644 --- a/sdk/consumption/arm-consumption/src/models/parameters.ts +++ b/sdk/consumption/arm-consumption/src/models/parameters.ts @@ -369,3 +369,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/lotsOperations.ts b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts index cedd214243ff..1da8f7c3ddd6 100644 --- a/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts +++ b/sdk/consumption/arm-consumption/src/operations/lotsOperations.ts @@ -18,10 +18,14 @@ import { LotsListByBillingProfileOptionalParams, LotsListByBillingAccountNextOptionalParams, LotsListByBillingAccountOptionalParams, + LotsListByCustomerNextOptionalParams, + LotsListByCustomerOptionalParams, LotsListByBillingProfileResponse, LotsListByBillingAccountResponse, + LotsListByCustomerResponse, LotsListByBillingProfileNextResponse, - LotsListByBillingAccountNextResponse + LotsListByBillingAccountNextResponse, + LotsListByCustomerNextResponse } from "../models"; /// @@ -38,9 +42,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. @@ -111,9 +114,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. */ @@ -166,9 +168,80 @@ 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: () => { + return this.listByCustomerPagingPage( + billingAccountId, + customerId, + options + ); + } + }; + } + + private async *listByCustomerPagingPage( + billingAccountId: string, + customerId: string, + options?: LotsListByCustomerOptionalParams + ): AsyncIterableIterator { + let result = await this._listByCustomer( + billingAccountId, + customerId, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByCustomerNext( + billingAccountId, + customerId, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + 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. @@ -185,9 +258,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. */ @@ -201,6 +273,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 @@ -236,6 +326,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); @@ -278,6 +387,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", @@ -319,3 +449,24 @@ 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 + } + }, + queryParameters: [Parameters.filter, Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.billingAccountId, + Parameters.customerId + ], + 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 dcde2c7c829d..2836e80fc7a3 100644 --- a/sdk/consumption/arm-consumption/src/operations/usageDetails.ts +++ b/sdk/consumption/arm-consumption/src/operations/usageDetails.ts @@ -177,6 +177,7 @@ const listOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -200,6 +201,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.UsageDetailsListResult }, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/consumption/arm-consumption/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/test/sampleTest.ts b/sdk/consumption/arm-consumption/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/consumption/arm-consumption/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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 6e3251194117..3e6ae96443f3 100644 --- a/sdk/consumption/arm-consumption/tsconfig.json +++ b/sdk/consumption/arm-consumption/tsconfig.json @@ -9,11 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/consumption/ci.mgmt.yml b/sdk/consumption/ci.mgmt.yml index 0b30b5c1c584..138194eb7201 100644 --- a/sdk/consumption/ci.mgmt.yml +++ b/sdk/consumption/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/consumption/ci.mgmt.yml - sdk/consumption/arm-consumption/ + - sdk/consumption/arm-consumption pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/consumption/ci.mgmt.yml - sdk/consumption/arm-consumption/ - + - sdk/consumption/arm-consumption extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: consumption Artifacts: - name: azure-arm-consumption - safeName: azurearmconsumption \ No newline at end of file + safeName: azurearmconsumption