diff --git a/sdk/billing/arm-billing/CHANGELOG.md b/sdk/billing/arm-billing/CHANGELOG.md index 1a6a37e9717e..8af3a5830c8f 100644 --- a/sdk/billing/arm-billing/CHANGELOG.md +++ b/sdk/billing/arm-billing/CHANGELOG.md @@ -1,15 +1,15 @@ # Release History - -## 4.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 4.1.0-beta.1 (2022-06-16) + +**Features** + + - Added Interface BillingProfileInfo + - Added Interface OperationsErrorDetails + - Added Interface OperationsErrorResponse + - Interface BillingProfileListResult has a new optional parameter totalCount + - Type Alias Agreement has a new parameter billingProfileInfo + ## 4.0.1 (2022-04-11) - Bug fix diff --git a/sdk/billing/arm-billing/README.md b/sdk/billing/arm-billing/README.md index d2a99b1f034f..874fa42678a4 100644 --- a/sdk/billing/arm-billing/README.md +++ b/sdk/billing/arm-billing/README.md @@ -6,7 +6,7 @@ Billing client provides access to billing resources for Azure subscriptions. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billing/arm-billing) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-billing) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-billing) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-billing?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/billing/arm-billing/_meta.json b/sdk/billing/arm-billing/_meta.json index 48efeb238799..f08d42fe4868 100644 --- a/sdk/billing/arm-billing/_meta.json +++ b/sdk/billing/arm-billing/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d29e6eb4894005c52e67cb4b5ac3faf031113e7d", - "readme": "specification\\billing\\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\\commerce\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.18.20220329.1 --generate-sample=true", + "commit": "bf10d887eb00e0cd9b1e108d036c4092db07b4bb", + "readme": "specification/billing/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/billing/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.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/typescript@6.0.0-alpha.18.20220329.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" +} \ No newline at end of file diff --git a/sdk/billing/arm-billing/package.json b/sdk/billing/arm-billing/package.json index 7b99ae5e5cef..06e9c175f7ac 100644 --- a/sdk/billing/arm-billing/package.json +++ b/sdk/billing/arm-billing/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for BillingManagementClient.", - "version": "4.0.2", + "version": "4.1.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@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": [ @@ -40,9 +40,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/billing/arm-billing", "repository": { @@ -93,7 +95,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" }, @@ -107,4 +109,4 @@ ] }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/billing/arm-billing/review/arm-billing.api.md b/sdk/billing/arm-billing/review/arm-billing.api.md index 17009cbc42d6..988b9b04f266 100644 --- a/sdk/billing/arm-billing/review/arm-billing.api.md +++ b/sdk/billing/arm-billing/review/arm-billing.api.md @@ -57,6 +57,7 @@ export type Agreement = Resource & { readonly agreementLink?: string; readonly category?: Category; readonly acceptanceMode?: AcceptanceMode; + readonly billingProfileInfo?: BillingProfileInfo; readonly effectiveDate?: Date; readonly expirationDate?: Date; participants?: Participants[]; @@ -440,9 +441,17 @@ export interface BillingProfileCreationRequest { poNumber?: string; } +// @public +export interface BillingProfileInfo { + billingProfileDisplayName?: string; + billingProfileId?: string; + indirectRelationshipOrganizationName?: string; +} + // @public export interface BillingProfileListResult { readonly nextLink?: string; + readonly totalCount?: number; readonly value?: BillingProfile[]; } @@ -1857,6 +1866,18 @@ export interface Operations { list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface OperationsErrorDetails { + readonly code?: string; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface OperationsErrorResponse { + error?: OperationsErrorDetails; +} + // @public export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { } diff --git a/sdk/billing/arm-billing/src/billingManagementClient.ts b/sdk/billing/arm-billing/src/billingManagementClient.ts index ee773f0c8cc8..e7881916df5e 100644 --- a/sdk/billing/arm-billing/src/billingManagementClient.ts +++ b/sdk/billing/arm-billing/src/billingManagementClient.ts @@ -7,6 +7,7 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { BillingAccountsImpl, @@ -23,13 +24,13 @@ import { TransactionsImpl, PoliciesImpl, BillingPropertyOperationsImpl, - OperationsImpl, BillingRoleDefinitionsImpl, BillingRoleAssignmentsImpl, AgreementsImpl, ReservationsImpl, EnrollmentAccountsImpl, - BillingPeriodsImpl + BillingPeriodsImpl, + OperationsImpl } from "./operations"; import { BillingAccounts, @@ -46,13 +47,13 @@ import { Transactions, Policies, BillingPropertyOperations, - Operations, BillingRoleDefinitions, BillingRoleAssignments, Agreements, Reservations, EnrollmentAccounts, - BillingPeriods + BillingPeriods, + Operations } from "./operationsInterfaces"; import { BillingManagementClientOptionalParams } from "./models"; @@ -87,7 +88,7 @@ export class BillingManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-billing/4.0.2`; + const packageDetails = `azsdk-js-arm-billing/4.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -106,6 +107,29 @@ export class BillingManagementClient 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; @@ -125,13 +149,13 @@ export class BillingManagementClient extends coreClient.ServiceClient { this.transactions = new TransactionsImpl(this); this.policies = new PoliciesImpl(this); this.billingPropertyOperations = new BillingPropertyOperationsImpl(this); - this.operations = new OperationsImpl(this); this.billingRoleDefinitions = new BillingRoleDefinitionsImpl(this); this.billingRoleAssignments = new BillingRoleAssignmentsImpl(this); this.agreements = new AgreementsImpl(this); this.reservations = new ReservationsImpl(this); this.enrollmentAccounts = new EnrollmentAccountsImpl(this); this.billingPeriods = new BillingPeriodsImpl(this); + this.operations = new OperationsImpl(this); } billingAccounts: BillingAccounts; @@ -148,11 +172,11 @@ export class BillingManagementClient extends coreClient.ServiceClient { transactions: Transactions; policies: Policies; billingPropertyOperations: BillingPropertyOperations; - operations: Operations; billingRoleDefinitions: BillingRoleDefinitions; billingRoleAssignments: BillingRoleAssignments; agreements: Agreements; reservations: Reservations; enrollmentAccounts: EnrollmentAccounts; billingPeriods: BillingPeriods; + operations: Operations; } diff --git a/sdk/billing/arm-billing/src/models/index.ts b/sdk/billing/arm-billing/src/models/index.ts index 81635b09b200..022f7eb73023 100644 --- a/sdk/billing/arm-billing/src/models/index.ts +++ b/sdk/billing/arm-billing/src/models/index.ts @@ -376,6 +376,11 @@ export interface BillingProfileListResult { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly value?: BillingProfile[]; + /** + * Total number of records. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalCount?: number; /** * The link (url) to the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -671,60 +676,6 @@ export interface TransactionListResult { readonly nextLink?: string; } -/** The list of billing operations and a URL link to get the next set of results. */ -export interface OperationListResult { - /** - * The list of billing operations supported by the Microsoft.Billing resource provider. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Operation[]; - /** - * URL to get the next set of operation list results if there are any. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** A Billing REST API operation. */ -export interface Operation { - /** - * Operation name: {provider}/{resource}/{operation}. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Identifies if the operation is a data operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isDataAction?: boolean; - /** The object that represents the operation. */ - display?: OperationDisplay; -} - -/** The object that represents the operation. */ -export interface OperationDisplay { - /** - * Service provider: Microsoft.Billing. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provider?: string; - /** - * Resource on which the operation is performed such as invoice and billing subscription. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resource?: string; - /** - * Operation type such as read, write and delete. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly operation?: string; - /** - * Description of operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; -} - /** The list of role definitions. */ export interface BillingRoleDefinitionListResult { /** @@ -767,6 +718,16 @@ export interface AgreementListResult { readonly nextLink?: string; } +/** Details about billing profile associated with agreement and available only for specific agreements. */ +export interface BillingProfileInfo { + /** The unique identifier for the billing profile. */ + billingProfileId?: string; + /** The name of the billing profile */ + billingProfileDisplayName?: string; + /** Billing account name. This property is available for a specific type of agreement. */ + indirectRelationshipOrganizationName?: string; +} + /** The details about a participant. */ export interface Participants { /** @@ -1016,6 +977,85 @@ export interface BillingPeriodsListResult { readonly nextLink?: string; } +/** The list of billing operations and a URL link to get the next set of results. */ +export interface OperationListResult { + /** + * The list of billing operations supported by the Microsoft.Billing resource provider. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A Billing REST API operation. */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Identifies if the operation is a data operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** The object that represents the operation. */ + display?: OperationDisplay; +} + +/** The object that represents the operation. */ +export interface OperationDisplay { + /** + * Service provider: Microsoft.Billing. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * Resource on which the operation is performed such as invoice and billing subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * Operation type such as read, write and delete. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * Description of operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. */ +export interface OperationsErrorResponse { + /** The details of the error. */ + error?: OperationsErrorDetails; +} + +/** The details of the error. */ +export interface OperationsErrorDetails { + /** + * Error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * Error message indicating why the operation failed. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The target of the particular error. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; +} + /** The request parameters for creating a new billing profile. */ export interface BillingProfileCreationRequest { /** The name of the billing profile. */ @@ -1916,6 +1956,11 @@ export type Agreement = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly acceptanceMode?: AcceptanceMode; + /** + * The list of billing profiles associated with agreement and present only for specific agreements. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly billingProfileInfo?: BillingProfileInfo; /** * The date from which the agreement is effective. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3336,20 +3381,6 @@ export interface BillingPropertyUpdateOptionalParams /** Contains response data for the update operation. */ export type BillingPropertyUpdateResponse = BillingProperty; -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - /** Optional parameters. */ export interface BillingRoleDefinitionsGetByBillingAccountOptionalParams extends coreClient.OperationOptions {} @@ -3647,6 +3678,20 @@ export interface BillingPeriodsListNextOptionalParams /** Contains response data for the listNext operation. */ export type BillingPeriodsListNextResponse = BillingPeriodsListResult; +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + /** Optional parameters. */ export interface BillingManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/billing/arm-billing/src/models/mappers.ts b/sdk/billing/arm-billing/src/models/mappers.ts index cab4b62c81e0..dea3bf046a0a 100644 --- a/sdk/billing/arm-billing/src/models/mappers.ts +++ b/sdk/billing/arm-billing/src/models/mappers.ts @@ -771,6 +771,13 @@ export const BillingProfileListResult: coreClient.CompositeMapper = { } } }, + totalCount: { + serializedName: "totalCount", + readOnly: true, + type: { + name: "Number" + } + }, nextLink: { serializedName: "nextLink", readOnly: true, @@ -1341,10 +1348,10 @@ export const TransactionListResult: coreClient.CompositeMapper = { } }; -export const OperationListResult: coreClient.CompositeMapper = { +export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OperationListResult", + className: "BillingRoleDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -1354,7 +1361,7 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" + className: "BillingRoleDefinition" } } } @@ -1370,77 +1377,10 @@ export const OperationListResult: coreClient.CompositeMapper = { } }; -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - isDataAction: { - serializedName: "isDataAction", - readOnly: true, - type: { - name: "Boolean" - } - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - readOnly: true, - type: { - name: "String" - } - }, - resource: { - serializedName: "resource", - readOnly: true, - type: { - name: "String" - } - }, - operation: { - serializedName: "operation", - readOnly: true, - type: { - name: "String" - } - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { +export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingRoleDefinitionListResult", + className: "BillingRoleAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -1450,7 +1390,7 @@ export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "BillingRoleDefinition" + className: "BillingRoleAssignment" } } } @@ -1466,10 +1406,10 @@ export const BillingRoleDefinitionListResult: coreClient.CompositeMapper = { } }; -export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { +export const AgreementListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingRoleAssignmentListResult", + className: "AgreementListResult", modelProperties: { value: { serializedName: "value", @@ -1479,7 +1419,7 @@ export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "BillingRoleAssignment" + className: "Agreement" } } } @@ -1495,27 +1435,25 @@ export const BillingRoleAssignmentListResult: coreClient.CompositeMapper = { } }; -export const AgreementListResult: coreClient.CompositeMapper = { +export const BillingProfileInfo: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AgreementListResult", + className: "BillingProfileInfo", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + billingProfileId: { + serializedName: "billingProfileId", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Agreement" - } - } + name: "String" } }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + billingProfileDisplayName: { + serializedName: "billingProfileDisplayName", + type: { + name: "String" + } + }, + indirectRelationshipOrganizationName: { + serializedName: "indirectRelationshipOrganizationName", type: { name: "String" } @@ -1947,6 +1885,148 @@ export const BillingPeriodsListResult: coreClient.CompositeMapper = { } }; +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const OperationsErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "OperationsErrorDetails" + } + } + } + } +}; + +export const OperationsErrorDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationsErrorDetails", + 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" + } + } + } + } +}; + export const BillingProfileCreationRequest: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3580,6 +3660,13 @@ export const Agreement: coreClient.CompositeMapper = { name: "String" } }, + billingProfileInfo: { + serializedName: "properties.billingProfileInfo", + type: { + name: "Composite", + className: "BillingProfileInfo" + } + }, effectiveDate: { serializedName: "properties.effectiveDate", readOnly: true, diff --git a/sdk/billing/arm-billing/src/operations/index.ts b/sdk/billing/arm-billing/src/operations/index.ts index 44525347c3ce..4783a6a428be 100644 --- a/sdk/billing/arm-billing/src/operations/index.ts +++ b/sdk/billing/arm-billing/src/operations/index.ts @@ -20,10 +20,10 @@ export * from "./invoices"; export * from "./transactions"; export * from "./policies"; export * from "./billingPropertyOperations"; -export * from "./operations"; export * from "./billingRoleDefinitions"; export * from "./billingRoleAssignments"; export * from "./agreements"; export * from "./reservations"; export * from "./enrollmentAccounts"; export * from "./billingPeriods"; +export * from "./operations"; diff --git a/sdk/billing/arm-billing/src/operations/operations.ts b/sdk/billing/arm-billing/src/operations/operations.ts index bef525a131ac..a0bc578c2a81 100644 --- a/sdk/billing/arm-billing/src/operations/operations.ts +++ b/sdk/billing/arm-billing/src/operations/operations.ts @@ -111,7 +111,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.OperationsErrorResponse } }, queryParameters: [Parameters.apiVersion], @@ -127,7 +127,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.ErrorResponse + bodyMapper: Mappers.OperationsErrorResponse } }, queryParameters: [Parameters.apiVersion], diff --git a/sdk/billing/arm-billing/src/operationsInterfaces/index.ts b/sdk/billing/arm-billing/src/operationsInterfaces/index.ts index 44525347c3ce..4783a6a428be 100644 --- a/sdk/billing/arm-billing/src/operationsInterfaces/index.ts +++ b/sdk/billing/arm-billing/src/operationsInterfaces/index.ts @@ -20,10 +20,10 @@ export * from "./invoices"; export * from "./transactions"; export * from "./policies"; export * from "./billingPropertyOperations"; -export * from "./operations"; export * from "./billingRoleDefinitions"; export * from "./billingRoleAssignments"; export * from "./agreements"; export * from "./reservations"; export * from "./enrollmentAccounts"; export * from "./billingPeriods"; +export * from "./operations"; diff --git a/sdk/billing/arm-billing/test/sampleTest.ts b/sdk/billing/arm-billing/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/billing/arm-billing/test/sampleTest.ts +++ b/sdk/billing/arm-billing/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -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: [] +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() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() {