Skip to content

Commit

Permalink
CodeGen from PR 30459 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge cdaf2b35f18797c10ebdad76a13e01c275b2703d into a9980ec5181a161dd26c5277f7651722b60503ea
  • Loading branch information
SDKAuto committed Sep 10, 2024
1 parent 882ea89 commit 6cb7f77
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 86 deletions.
18 changes: 11 additions & 7 deletions sdk/billing/arm-billing/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Release History

## 5.0.1 (Unreleased)

## 6.0.0 (2024-09-10)
### Features Added

### Breaking Changes
- Interface ReservationPurchaseRequest has a new optional parameter instanceFlexibility

### Bugs Fixed

### Other Changes
### Breaking Changes

- Interface ReservationPurchaseRequest no longer has parameter instanceFlexibilityPropertiesInstanceFlexibility
- Interface ReservationPurchaseRequest no longer has parameter instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility
- Type of parameter rebillDetails of interface InvoiceProperties is changed from InvoicePropertiesRebillDetails to RebillDetails
- Type of parameter billingProfileDisplayName of interface TransactionProperties is changed from any to string


## 5.0.0 (2024-09-04)

### Features Added
Expand Down
8 changes: 4 additions & 4 deletions sdk/billing/arm-billing/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "f958cceb74699d24953a6ea04536ed65767fbeb6",
"commit": "5857ab4cce2a69f03cd719be6ef6501981c87d76",
"readme": "specification/billing/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.7 --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\\billing\\resource-manager\\readme.md --use=@autorest/[email protected].26 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --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/billing/resource-manager/readme.md --use=@autorest/typescript@^6.0.12",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "[email protected].21-beta",
"use": "@autorest/[email protected].26"
"release_tool": "@azure-tools/[email protected].12",
"use": "@autorest/typescript@^6.0.12"
}
16 changes: 4 additions & 12 deletions sdk/billing/arm-billing/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 BillingManagementClient.",
"version": "5.0.1",
"version": "6.0.0",
"engines": {
"node": ">=18.0.0"
},
Expand Down Expand Up @@ -32,7 +32,7 @@
"mkdirp": "^3.0.1",
"typescript": "~5.5.3",
"uglify-js": "^3.4.9",
"rimraf": "^5.0.5",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.2.1",
Expand Down Expand Up @@ -106,13 +106,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing"
}
11 changes: 3 additions & 8 deletions sdk/billing/arm-billing/review/arm-billing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,7 @@ export interface InvoiceProperties {
readonly isMonthlyInvoice?: boolean;
readonly payments?: Payment[];
readonly purchaseOrderNumber?: string;
rebillDetails?: InvoicePropertiesRebillDetails;
readonly rebillDetails?: RebillDetails;
refundDetails?: InvoicePropertiesRefundDetails;
readonly specialTaxationType?: SpecialTaxationType;
readonly status?: InvoiceStatus;
Expand Down Expand Up @@ -2940,10 +2940,6 @@ export interface InvoicePropertiesCreditAmount extends Amount {
export interface InvoicePropertiesFreeAzureCreditApplied extends Amount {
}

// @public
export interface InvoicePropertiesRebillDetails extends RebillDetails {
}

// @public
export interface InvoicePropertiesRefundDetails extends RefundDetailsSummary {
}
Expand Down Expand Up @@ -5242,8 +5238,7 @@ export interface ReservationPurchaseRequest {
billingPlan?: ReservationBillingPlan;
readonly billingScopeId?: string;
displayName?: string;
instanceFlexibilityPropertiesInstanceFlexibility?: InstanceFlexibility;
instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility?: InstanceFlexibility;
instanceFlexibility?: InstanceFlexibility;
location?: string;
quantity?: number;
renew?: boolean;
Expand Down Expand Up @@ -5760,7 +5755,7 @@ export interface TransactionProperties {
azureCreditApplied?: TransactionPropertiesAzureCreditApplied;
azurePlan?: string;
billingCurrency?: string;
billingProfileDisplayName?: any;
billingProfileDisplayName?: string;
billingProfileId?: string;
consumptionCommitmentDecremented?: TransactionPropertiesConsumptionCommitmentDecremented;
creditType?: CreditType;
Expand Down
2 changes: 1 addition & 1 deletion sdk/billing/arm-billing/src/billingManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class BillingManagementClient extends coreClient.ServiceClient {
credential: credentials,
};

const packageDetails = `azsdk-js-arm-billing/5.0.1`;
const packageDetails = `azsdk-js-arm-billing/6.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down
2 changes: 1 addition & 1 deletion sdk/billing/arm-billing/src/lroImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
// Licensed under the MIT License.

import { AbortSignalLike } from "@azure/abort-controller";
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
Expand Down
16 changes: 7 additions & 9 deletions sdk/billing/arm-billing/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2236,8 +2236,11 @@ export interface InvoiceProperties {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly purchaseOrderNumber?: string;
/** Rebill details for an invoice. */
rebillDetails?: InvoicePropertiesRebillDetails;
/**
* Rebill details for an invoice.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly rebillDetails?: RebillDetails;
/**
* The current status of the invoice.
* NOTE: This property will not be serialized. It can only be populated by the server.
Expand Down Expand Up @@ -3030,12 +3033,10 @@ export interface ReservationPurchaseRequest {
appliedScopeProperties?: ReservationAppliedScopeProperties;
/** Setting this to true will automatically purchase a new benefit on the expiration date time. */
renew?: boolean;
/** Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. */
instanceFlexibilityPropertiesInstanceFlexibility?: InstanceFlexibility;
/** This is the date-time when the Azure hybrid benefit needs to be reviewed. */
reviewDateTime?: Date;
/** Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. */
instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility?: InstanceFlexibility;
instanceFlexibility?: InstanceFlexibility;
}

/** The name of sku */
Expand Down Expand Up @@ -3164,7 +3165,7 @@ export interface TransactionProperties {
/** The ISO 4217 code for the currency in which this transaction is billed. */
billingCurrency?: string;
/** The name of the billing profile. */
billingProfileDisplayName?: any;
billingProfileDisplayName?: string;
/** The fully qualified ID that uniquely identifies a billing profile. */
billingProfileId?: string;
/** The amount of Microsoft Azure Consumption Commitment(MACC) decrement through the transaction. */
Expand Down Expand Up @@ -3605,9 +3606,6 @@ export interface BillingSubscriptionAliasProperties
/** Reseller for this product. The fields is not available for Microsoft Partner Agreement products. */
export interface ProductPropertiesReseller extends Reseller {}

/** Rebill details for an invoice. */
export interface InvoicePropertiesRebillDetails extends RebillDetails {}

/** The details of a refund request. */
export interface InvoicePropertiesRefundDetails extends RefundDetailsSummary {}

Expand Down
33 changes: 8 additions & 25 deletions sdk/billing/arm-billing/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4514,7 +4514,7 @@ export const InvoiceProperties: coreClient.CompositeMapper = {
serializedName: "rebillDetails",
type: {
name: "Composite",
className: "InvoicePropertiesRebillDetails",
className: "RebillDetails",
},
},
status: {
Expand Down Expand Up @@ -6131,26 +6131,19 @@ export const ReservationPurchaseRequest: coreClient.CompositeMapper = {
name: "Boolean",
},
},
instanceFlexibilityPropertiesInstanceFlexibility: {
serializedName: "properties.instanceFlexibility",
type: {
name: "String",
},
},
reviewDateTime: {
serializedName: "properties.reviewDateTime",
type: {
name: "DateTime",
},
},
instanceFlexibilityPropertiesReservedResourcePropertiesInstanceFlexibility:
{
serializedName:
"properties.reservedResourceProperties.instanceFlexibility",
type: {
name: "String",
},
instanceFlexibility: {
serializedName:
"properties.reservedResourceProperties.instanceFlexibility",
type: {
name: "String",
},
},
},
},
};
Expand Down Expand Up @@ -6496,7 +6489,7 @@ export const TransactionProperties: coreClient.CompositeMapper = {
billingProfileDisplayName: {
serializedName: "billingProfileDisplayName",
type: {
name: "any",
name: "String",
},
},
billingProfileId: {
Expand Down Expand Up @@ -7613,16 +7606,6 @@ export const ProductPropertiesReseller: coreClient.CompositeMapper = {
},
};

export const InvoicePropertiesRebillDetails: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "InvoicePropertiesRebillDetails",
modelProperties: {
...RebillDetails.type.modelProperties,
},
},
};

export const InvoicePropertiesRefundDetails: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down
10 changes: 5 additions & 5 deletions sdk/billing/arm-billing/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const billingProfileName: OperationURLParameter = {
parameterPath: "billingProfileName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"),
Pattern: new RegExp("^[a-zA-Z0-9-_]{1,128}$"),
},
serializedName: "billingProfileName",
required: true,
Expand Down Expand Up @@ -369,7 +369,7 @@ export const customerName: OperationURLParameter = {
parameterPath: "customerName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"),
Pattern: new RegExp("^[a-zA-Z0-9-_]{1,128}$"),
},
serializedName: "customerName",
required: true,
Expand All @@ -383,7 +383,7 @@ export const invoiceSectionName: OperationURLParameter = {
parameterPath: "invoiceSectionName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"),
Pattern: new RegExp("^[a-zA-Z0-9-_]{1,128}$"),
},
serializedName: "invoiceSectionName",
required: true,
Expand All @@ -397,7 +397,7 @@ export const departmentName: OperationURLParameter = {
parameterPath: "departmentName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"),
Pattern: new RegExp("^[a-zA-Z0-9-_]{1,128}$"),
},
serializedName: "departmentName",
required: true,
Expand All @@ -411,7 +411,7 @@ export const enrollmentAccountName: OperationURLParameter = {
parameterPath: "enrollmentAccountName",
mapper: {
constraints: {
Pattern: new RegExp("^[a-zA-Z\\d-_]{1,128}$"),
Pattern: new RegExp("^[a-zA-Z0-9-_]{1,128}$"),
},
serializedName: "enrollmentAccountName",
required: true,
Expand Down
8 changes: 2 additions & 6 deletions sdk/billing/arm-billing/test/sampleTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import {
Recorder,
RecorderStartOptions,
env
env,
} from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
Expand All @@ -18,15 +18,11 @@ const replaceableVariables: Record<string, string> = {
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"
SUBSCRIPTION_ID: "azure_subscription_id",
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
"AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section
],
};

describe("My test", () => {
Expand Down
10 changes: 2 additions & 8 deletions sdk/billing/arm-billing/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-billing": [
"./src/index"
]
}
"importHelpers": true
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
"./test/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit 6cb7f77

Please sign in to comment.