Skip to content

Commit

Permalink
CodeGen from PR 20855 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 784952d6aa577abca026925fed9c2a9483923d30 into 3e839d05a41f1dc59680852eb519db8269e9d843
  • Loading branch information
SDKAuto committed Oct 12, 2022
1 parent 99819d3 commit f7418ac
Show file tree
Hide file tree
Showing 26 changed files with 767 additions and 429 deletions.
12 changes: 6 additions & 6 deletions common/config/rush/pnpm-lock.yaml

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

33 changes: 25 additions & 8 deletions sdk/consumption/arm-consumption/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
# Release History

## 10.0.0 (2022-10-12)

**Features**

## 9.1.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed
- Added operation LotsOperations.listByCustomer
- Added Interface LotsListByCustomerNextOptionalParams
- Added Interface LotsListByCustomerOptionalParams
- Added Type Alias LotsListByCustomerNextResponse
- Added Type Alias LotsListByCustomerResponse
- Interface CreditSummary has a new optional parameter eTagPropertiesETag
- Interface LegacyUsageDetail has a new optional parameter benefitId
- Interface LegacyUsageDetail has a new optional parameter benefitName
- Enum KnownEventType has a new value CreditExpired

### Other Changes
**Breaking Changes**

- Operation ReservationRecommendationDetails.get has a new signature
- Interface BudgetFilter no longer has parameter not
- Interface CreditSummary no longer has parameter eTag
- Interface LegacyChargeSummary no longer has parameter kind
- Interface LegacyReservationRecommendation no longer has parameter kind
- Interface LegacyUsageDetail no longer has parameter kind
- Interface ModernChargeSummary no longer has parameter kind
- Interface ModernReservationRecommendation no longer has parameter kind
- Interface ModernUsageDetail no longer has parameter kind


## 9.1.0 (2022-09-05)

**Features**
Expand Down
2 changes: 1 addition & 1 deletion sdk/consumption/arm-consumption/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Consumption management client provides access to consumption resources for Azure

### Currently supported environments

- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.

See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
Expand Down
10 changes: 5 additions & 5 deletions sdk/consumption/arm-consumption/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "d600759c3516b61a7c353bc8682bccbab85a6f65",
"readme": "specification\\consumption\\resource-manager\\readme.md",
"autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\consumption\\resource-manager\\readme.md --use=@autorest/[email protected].20220727.1 --generate-sample=true",
"commit": "ed79a1bc47e1ec40b19f624428cb5139ea6f85b5",
"readme": "specification/consumption/resource-manager/readme.md",
"autorest_command": "autorest --version=3.8.4 --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/[email protected]",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected].2",
"use": "@autorest/[email protected].20220727.1"
"release_tool": "@azure-tools/[email protected].3",
"use": "@autorest/[email protected]"
}
18 changes: 5 additions & 13 deletions sdk/consumption/arm-consumption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ConsumptionManagementClient.",
"version": "9.1.1",
"version": "10.0.0",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -26,15 +26,15 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-consumption.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@microsoft/api-extractor": "7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.6.0",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
Expand Down Expand Up @@ -107,13 +107,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-consumption?view=azure-node-preview"
}
}
"autoPublish": true
}
39 changes: 26 additions & 13 deletions sdk/consumption/arm-consumption/review/arm-consumption.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export interface BudgetComparisonExpression {
export interface BudgetFilter {
and?: BudgetFilterProperties[];
dimensions?: BudgetComparisonExpression;
not?: BudgetFilterProperties;
tags?: BudgetComparisonExpression;
}

Expand Down Expand Up @@ -292,11 +291,11 @@ 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 pendingCreditAdjustments?: Amount;
readonly pendingEligibleCharges?: Amount;
Expand Down Expand Up @@ -477,6 +476,7 @@ export enum KnownDatagrain {

// @public
export enum KnownEventType {
CreditExpired = "CreditExpired",
NewCredit = "NewCredit",
PendingAdjustments = "PendingAdjustments",
PendingCharges = "PendingCharges",
Expand Down Expand Up @@ -577,7 +577,6 @@ export interface LegacyChargeSummary extends ChargeSummary {
readonly billingPeriodId?: string;
readonly chargesBilledSeparately?: number;
readonly currency?: string;
kind: "legacy";
readonly marketplaceCharges?: number;
readonly usageEnd?: string;
readonly usageStart?: string;
Expand All @@ -589,7 +588,6 @@ export interface LegacyReservationRecommendation extends ReservationRecommendati
readonly firstUsageDate?: Date;
readonly instanceFlexibilityGroup?: string;
readonly instanceFlexibilityRatio?: number;
kind: "legacy";
readonly lookBackPeriod?: string;
readonly meterId?: string;
readonly netSavings?: number;
Expand Down Expand Up @@ -645,6 +643,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;
Expand All @@ -661,7 +661,6 @@ export interface LegacyUsageDetail extends UsageDetail {
readonly frequency?: string;
readonly invoiceSection?: string;
readonly isAzureCreditEligible?: boolean;
kind: "legacy";
readonly meterDetails?: MeterDetailsResponse;
readonly meterId?: string;
readonly offerId?: string;
Expand Down Expand Up @@ -728,10 +727,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<LotSummary>;
listByBillingProfile(billingAccountId: string, billingProfileId: string, options?: LotsListByBillingProfileOptionalParams): PagedAsyncIterableIterator<LotSummary>;
listByCustomer(billingAccountId: string, customerId: string, options?: LotsListByCustomerOptionalParams): PagedAsyncIterableIterator<LotSummary>;
}

// @public
Expand Down Expand Up @@ -865,7 +881,6 @@ export interface ModernChargeSummary extends ChargeSummary {
readonly customerId?: string;
readonly invoiceSectionId?: string;
readonly isInvoiced?: boolean;
kind: "modern";
readonly marketplaceCharges?: Amount;
readonly usageEnd?: string;
readonly usageStart?: string;
Expand All @@ -877,7 +892,6 @@ export interface ModernReservationRecommendation extends ReservationRecommendati
readonly firstUsageDate?: Date;
readonly instanceFlexibilityGroup?: string;
readonly instanceFlexibilityRatio?: number;
kind: "modern";
readonly locationPropertiesLocation?: string;
readonly lookBackPeriod?: number;
readonly meterId?: string;
Expand Down Expand Up @@ -954,7 +968,6 @@ export interface ModernUsageDetail extends UsageDetail {
readonly invoiceSectionId?: string;
readonly invoiceSectionName?: string;
readonly isAzureCreditEligible?: boolean;
kind: "modern";
readonly marketPrice?: number;
readonly meterCategory?: string;
readonly meterId?: string;
Expand Down Expand Up @@ -1146,7 +1159,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<ReservationRecommendationDetailsGetResponse>;
get(resourceScope: string, scope: Scope, region: string, term: Term, lookBackPeriod: LookBackPeriod, product: string, options?: ReservationRecommendationDetailsGetOptionalParams): Promise<ReservationRecommendationDetailsGetResponse>;
}

// @public
Expand Down Expand Up @@ -1213,7 +1226,7 @@ export type ReservationRecommendationKind = string;

// @public
export interface ReservationRecommendations {
list(scope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator<ReservationRecommendationUnion>;
list(resourceScope: string, options?: ReservationRecommendationsListOptionalParams): PagedAsyncIterableIterator<ReservationRecommendationUnion>;
}

// @public
Expand Down Expand Up @@ -1244,7 +1257,7 @@ export type ReservationRecommendationUnion = ReservationRecommendation | LegacyR

// @public
export interface ReservationsDetails {
list(scope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator<ReservationDetail>;
list(resourceScope: string, options?: ReservationsDetailsListOptionalParams): PagedAsyncIterableIterator<ReservationDetail>;
listByReservationOrder(reservationOrderId: string, filter: string, options?: ReservationsDetailsListByReservationOrderOptionalParams): PagedAsyncIterableIterator<ReservationDetail>;
listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, filter: string, options?: ReservationsDetailsListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator<ReservationDetail>;
}
Expand Down Expand Up @@ -1303,7 +1316,7 @@ export type ReservationsDetailsListResponse = ReservationDetailsListResult;

// @public
export interface ReservationsSummaries {
list(scope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator<ReservationSummary>;
list(resourceScope: string, grain: Datagrain, options?: ReservationsSummariesListOptionalParams): PagedAsyncIterableIterator<ReservationSummary>;
listByReservationOrder(reservationOrderId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderOptionalParams): PagedAsyncIterableIterator<ReservationSummary>;
listByReservationOrderAndReservation(reservationOrderId: string, reservationId: string, grain: Datagrain, options?: ReservationsSummariesListByReservationOrderAndReservationOptionalParams): PagedAsyncIterableIterator<ReservationSummary>;
}
Expand Down
39 changes: 16 additions & 23 deletions sdk/consumption/arm-consumption/src/consumptionManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-consumption/9.1.1`;
const packageDetails = `azsdk-js-arm-consumption/10.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -106,34 +106,27 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient {
};
super(optionsWithDefaults);

let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes: `${optionsWithDefaults.credentialScopes}`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
}
// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Loading

0 comments on commit f7418ac

Please sign in to comment.