Skip to content

[AutoPR @azure/arm-consumption] update RI transactions description #949

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions sdk/consumption/arm-consumption/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Release History

## 9.0.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes


## 10.0.0 (2022-06-24)

**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
- Enum KnownEventType has a new value CreditExpired

**Breaking Changes**

- Operation ReservationRecommendationDetails.get has a new signature
- Interface BudgetFilter no longer has parameter not

## 9.0.1 (2022-04-11)

**features**
Expand Down
12 changes: 6 additions & 6 deletions sdk/consumption/arm-consumption/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "82fdf284eea880a8e027c354911a814999a77178",
"readme": "specification\\consumption\\resource-manager\\readme.md",
"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=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\readme.md --use=@autorest/[email protected].18.20220329.1 --generate-sample=true",
"commit": "c321d5c2a3dc31c4f943979b5d587b0208dab01c",
"readme": "specification/consumption/resource-manager/readme.md",
"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/[email protected].19.20220425.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.1",
"use": "@autorest/[email protected].18.20220329.1"
}
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
"use": "@autorest/[email protected].19.20220425.1"
}
26 changes: 10 additions & 16 deletions sdk/consumption/arm-consumption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ConsumptionManagementClient.",
"version": "9.0.2",
"version": "10.0.0",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.0.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -38,9 +38,11 @@
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"cross-env": "^7.0.2"
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/consumption/arm-consumption",
"repository": {
Expand Down Expand Up @@ -91,7 +93,7 @@
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
Expand All @@ -104,13 +106,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
}
30 changes: 25 additions & 5 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 @@ -505,6 +504,8 @@ export enum KnownDatagrain {

// @public
export enum KnownEventType {
// (undocumented)
CreditExpired = "CreditExpired",
// (undocumented)
NewCredit = "NewCredit",
// (undocumented)
Expand Down Expand Up @@ -746,6 +747,8 @@ export type LegacyUsageDetail = UsageDetail & {
readonly chargeType?: string;
readonly frequency?: string;
readonly payGPrice?: number;
readonly benefitId?: string;
readonly benefitName?: string;
readonly pricingModel?: PricingModelType;
};

Expand Down Expand Up @@ -788,10 +791,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 @@ -1203,7 +1223,7 @@ export type ReservationRecommendation = 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 @@ -1270,7 +1290,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 @@ -1301,7 +1321,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 @@ -1360,7 +1380,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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
*/

import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import {
UsageDetailsImpl,
Expand Down Expand Up @@ -80,7 +86,7 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-consumption/9.0.2`;
const packageDetails = `azsdk-js-arm-consumption/10.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -99,6 +105,29 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient {
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);

if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
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 All @@ -124,6 +153,35 @@ export class ConsumptionManagementClient extends coreClient.ServiceClient {
this.eventsOperations = new EventsOperationsImpl(this);
this.lotsOperations = new LotsOperationsImpl(this);
this.credits = new CreditsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}

/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return item.replace(/(?<==).*$/, apiVersion);
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}

usageDetails: UsageDetails;
Expand Down
Loading