diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 36a43816ffc5..142c29d887ff 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10736,17 +10736,19 @@ packages: dev: false file:projects/arm-billing.tgz: - resolution: {integrity: sha512-pixcGqnKIclwdcGnvbl4+3HBNPEF1ahE7owiJIVuQJxnlp5ISJfrSg8PIMA1xzkW1HTe2x1GSVGFhd1V72SviA==, tarball: file:projects/arm-billing.tgz} + resolution: {integrity: sha512-OUPI478sslOQmDGXUpL0iNr+8GjiuX6bsHLle3MtP5Aqk0k8huIRxk8mbJdjUjW/LiTOMMWf+hbV1S2E4L2Mrg==, tarball: file:projects/arm-billing.tgz} name: '@rush-temp/arm-billing' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.1.0 - '@microsoft/api-extractor': 7.32.0 + '@microsoft/api-extractor': 7.18.11 '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 '@rollup/plugin-json': 4.1.0_rollup@2.79.1 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -10758,7 +10760,6 @@ packages: uglify-js: 3.17.2 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false @@ -18680,7 +18681,7 @@ packages: dev: false file:projects/service-bus.tgz: - resolution: {integrity: sha512-3tvMIhTyvuOTgKK9O8L0ohZnspDLQ9sJZZxk8pbqqf+2qGbEvN2CT/VdM/Lh2d4HuFhxSkeVbJgnk9KAr99PpQ==, tarball: file:projects/service-bus.tgz} + resolution: {integrity: sha512-FlPn+HxK47mnvSCUz513u4gm5jfgfRmy1dRwKkdWCGiRIZ4VjCYC2JxCTEd6FAA/OhEgMBcY1xm0LAYqoTiFgg==, tarball: file:projects/service-bus.tgz} name: '@rush-temp/service-bus' version: 0.0.0 dependencies: diff --git a/sdk/billing/arm-billing/CHANGELOG.md b/sdk/billing/arm-billing/CHANGELOG.md index 1a6a37e9717e..b93c6d8c26d4 100644 --- a/sdk/billing/arm-billing/CHANGELOG.md +++ b/sdk/billing/arm-billing/CHANGELOG.md @@ -1,15 +1,34 @@ # Release History - -## 4.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 4.1.0-beta.1 (2022-10-12) + +**Features** + + - Added Interface Agreement + - Added Interface AvailableBalance + - Added Interface BillingAccount + - Added Interface BillingPeriod + - Added Interface BillingProfile + - Added Interface BillingProfileInfo + - Added Interface BillingProperty + - Added Interface BillingRoleAssignment + - Added Interface BillingRoleDefinition + - Added Interface BillingSubscription + - Added Interface Customer + - Added Interface CustomerPolicy + - Added Interface Department + - Added Interface EnrollmentAccount + - Added Interface EnrollmentAccountSummary + - Added Interface Instruction + - Added Interface Invoice + - Added Interface InvoiceSection + - Added Interface OperationsErrorDetails + - Added Interface OperationsErrorResponse + - Added Interface Policy + - Added Interface Product + - Added Interface Transaction + - Interface BillingProfileListResult has a new optional parameter totalCount + ## 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 55e805859e00..874fa42678a4 100644 --- a/sdk/billing/arm-billing/README.md +++ b/sdk/billing/arm-billing/README.md @@ -6,14 +6,14 @@ 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 ### 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. diff --git a/sdk/billing/arm-billing/_meta.json b/sdk/billing/arm-billing/_meta.json index 48efeb238799..55703cdd84a8 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": "82a5d57725ad9f852b8d3a9dc3c558c803ac9321", + "readme": "specification/billing/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/billing/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.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.4.3", + "use": "@autorest/typescript@6.0.0-rc.1" +} \ No newline at end of file diff --git a/sdk/billing/arm-billing/package.json b/sdk/billing/arm-billing/package.json index ac6f27235b9b..4ed99caba719 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": [ @@ -28,7 +28,7 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-billing.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", @@ -40,9 +40,13 @@ "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" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "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,9 +97,8 @@ "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:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -107,4 +110,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..9249755973b2 100644 --- a/sdk/billing/arm-billing/review/arm-billing.api.md +++ b/sdk/billing/arm-billing/review/arm-billing.api.md @@ -53,15 +53,16 @@ export type AddressValidateResponse = ValidateAddressResponse; export type AddressValidationStatus = string; // @public -export type Agreement = Resource & { +export interface Agreement extends Resource { + readonly acceptanceMode?: AcceptanceMode; readonly agreementLink?: string; + readonly billingProfileInfo?: BillingProfileInfo; readonly category?: Category; - readonly acceptanceMode?: AcceptanceMode; readonly effectiveDate?: Date; readonly expirationDate?: Date; participants?: Participants[]; readonly status?: string; -}; +} // @public export interface AgreementListResult { @@ -112,9 +113,9 @@ export interface Amount { export type AutoRenew = string; // @public -export type AvailableBalance = Resource & { +export interface AvailableBalance extends Resource { readonly amount?: Amount; -}; +} // @public export interface AvailableBalances { @@ -135,19 +136,19 @@ export interface AzurePlan { } // @public -export type BillingAccount = Resource & { - displayName?: string; - soldTo?: AddressDetails; - readonly agreementType?: AgreementType; - readonly accountType?: AccountType; +export interface BillingAccount extends Resource { readonly accountStatus?: AccountStatus; + readonly accountType?: AccountType; + readonly agreementType?: AgreementType; billingProfiles?: BillingProfilesOnExpand; - readonly enrollmentDetails?: Enrollment; departments?: Department[]; + displayName?: string; enrollmentAccounts?: EnrollmentAccount[]; + readonly enrollmentDetails?: Enrollment; readonly hasReadAccess?: boolean; notificationEmailAddress?: string; -}; + soldTo?: AddressDetails; +} // @public export interface BillingAccountListResult { @@ -287,11 +288,11 @@ export interface BillingManagementClientOptionalParams extends coreClient.Servic } // @public -export type BillingPeriod = Resource & { - readonly billingPeriodStartDate?: Date; +export interface BillingPeriod extends Resource { readonly billingPeriodEndDate?: Date; + readonly billingPeriodStartDate?: Date; readonly invoiceIds?: string[]; -}; +} // @public export interface BillingPeriods { @@ -409,27 +410,27 @@ export interface BillingPermissionsProperties { } // @public -export type BillingProfile = Resource & { - displayName?: string; - poNumber?: string; +export interface BillingProfile extends Resource { readonly billingRelationshipType?: BillingRelationshipType; billTo?: AddressDetails; - readonly indirectRelationshipInfo?: IndirectRelationshipInfo; - invoiceEmailOptIn?: boolean; - readonly invoiceDay?: number; readonly currency?: string; + displayName?: string; enabledAzurePlans?: AzurePlan[]; - invoiceSections?: InvoiceSectionsOnExpand; readonly hasReadAccess?: boolean; - readonly systemId?: string; + readonly indirectRelationshipInfo?: IndirectRelationshipInfo; + readonly invoiceDay?: number; + invoiceEmailOptIn?: boolean; + invoiceSections?: InvoiceSectionsOnExpand; + poNumber?: string; + readonly spendingLimit?: SpendingLimit; readonly status?: BillingProfileStatus; readonly statusReasonCode?: StatusReasonCode; - readonly spendingLimit?: SpendingLimit; - readonly targetClouds?: TargetCloud[]; + readonly systemId?: string; tags?: { [propertyName: string]: string; }; -}; + readonly targetClouds?: TargetCloud[]; +} // @public export interface BillingProfileCreationRequest { @@ -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[]; } @@ -509,25 +518,25 @@ export type BillingProfileStatus = string; export type BillingProfileStatusReasonCode = string; // @public -export type BillingProperty = Resource & { +export interface BillingProperty extends Resource { readonly accountAdminNotificationEmailAddress?: string; - readonly billingTenantId?: string; - readonly billingAccountId?: string; readonly billingAccountDisplayName?: string; - readonly billingProfileId?: string; + readonly billingAccountId?: string; readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly billingProfileSpendingLimit?: BillingProfileSpendingLimit; readonly billingProfileStatus?: BillingProfileStatus; readonly billingProfileStatusReasonCode?: BillingProfileStatusReasonCode; - readonly billingProfileSpendingLimit?: BillingProfileSpendingLimit; + readonly billingTenantId?: string; costCenter?: string; - readonly invoiceSectionId?: string; readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; readonly isAccountAdmin?: boolean; readonly productId?: string; readonly productName?: string; - readonly skuId?: string; readonly skuDescription?: string; -}; + readonly skuId?: string; +} // @public export interface BillingPropertyGetOptionalParams extends coreClient.OperationOptions { @@ -553,18 +562,18 @@ export type BillingPropertyUpdateResponse = BillingProperty; export type BillingRelationshipType = string; // @public -export type BillingRoleAssignment = Resource & { - readonly createdOn?: string; - readonly createdByPrincipalTenantId?: string; +export interface BillingRoleAssignment extends Resource { readonly createdByPrincipalId?: string; + readonly createdByPrincipalTenantId?: string; readonly createdByUserEmailAddress?: string; + readonly createdOn?: string; principalId?: string; principalTenantId?: string; roleDefinitionId?: string; readonly scope?: string; userAuthenticationType?: string; userEmailAddress?: string; -}; +} // @public export interface BillingRoleAssignmentListResult { @@ -670,11 +679,11 @@ export interface BillingRoleAssignmentsListByInvoiceSectionOptionalParams extend export type BillingRoleAssignmentsListByInvoiceSectionResponse = BillingRoleAssignmentListResult; // @public -export type BillingRoleDefinition = Resource & { +export interface BillingRoleDefinition extends Resource { readonly description?: string; permissions?: BillingPermissionsProperties[]; readonly roleName?: string; -}; +} // @public export interface BillingRoleDefinitionListResult { @@ -756,24 +765,24 @@ export interface BillingRoleDefinitionsListByInvoiceSectionOptionalParams extend export type BillingRoleDefinitionsListByInvoiceSectionResponse = BillingRoleDefinitionListResult; // @public -export type BillingSubscription = Resource & { - readonly displayName?: string; - readonly subscriptionId?: string; - subscriptionBillingStatus?: BillingSubscriptionStatusType; - readonly lastMonthCharges?: Amount; - readonly monthToDateCharges?: Amount; - readonly billingProfileId?: string; +export interface BillingSubscription extends Resource { readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; costCenter?: string; - readonly customerId?: string; readonly customerDisplayName?: string; - readonly invoiceSectionId?: string; + readonly customerId?: string; + readonly displayName?: string; readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + readonly lastMonthCharges?: Amount; + readonly monthToDateCharges?: Amount; readonly reseller?: Reseller; - skuId?: string; readonly skuDescription?: string; + skuId?: string; + subscriptionBillingStatus?: BillingSubscriptionStatusType; + readonly subscriptionId?: string; readonly suspensionReasons?: string[]; -}; +} // @public export interface BillingSubscriptions { @@ -894,13 +903,13 @@ export type BillingSubscriptionsValidateMoveResponse = ValidateSubscriptionTrans export type Category = string; // @public -export type Customer = Resource & { - readonly billingProfileId?: string; +export interface Customer extends Resource { readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; displayName?: string; enabledAzurePlans?: AzurePlan[]; resellers?: Reseller[]; -}; +} // @public export interface CustomerListResult { @@ -910,9 +919,9 @@ export interface CustomerListResult { } // @public -export type CustomerPolicy = Resource & { +export interface CustomerPolicy extends Resource { viewCharges?: ViewCharges; -}; +} // @public export interface Customers { @@ -966,12 +975,12 @@ export interface CustomersListByBillingProfileOptionalParams extends coreClient. export type CustomersListByBillingProfileResponse = CustomerListResult; // @public -export type Department = Resource & { - departmentName?: string; +export interface Department extends Resource { costCenter?: string; - status?: string; + departmentName?: string; enrollmentAccounts?: EnrollmentAccount[]; -}; + status?: string; +} // @public interface Document_2 { @@ -1008,16 +1017,16 @@ export interface Enrollment { } // @public -export type EnrollmentAccount = Resource & { +export interface EnrollmentAccount extends Resource { accountName?: string; - costCenter?: string; accountOwner?: string; accountOwnerEmail?: string; - status?: string; - startDate?: Date; - endDate?: Date; + costCenter?: string; department?: Department; -}; + endDate?: Date; + startDate?: Date; + status?: string; +} // @public export interface EnrollmentAccountContext { @@ -1061,9 +1070,9 @@ export interface EnrollmentAccountsListOptionalParams extends coreClient.Operati export type EnrollmentAccountsListResponse = EnrollmentAccountListResult; // @public -export type EnrollmentAccountSummary = Resource & { +export interface EnrollmentAccountSummary extends Resource { readonly principalName?: string; -}; +} // @public export interface EnrollmentPolicies { @@ -1101,12 +1110,12 @@ export interface IndirectRelationshipInfo { } // @public -export type Instruction = Resource & { +export interface Instruction extends Resource { amount?: number; - startDate?: Date; - endDate?: Date; creationDate?: Date; -}; + endDate?: Date; + startDate?: Date; +} // @public export interface InstructionListResult { @@ -1150,35 +1159,35 @@ export interface InstructionsPutOptionalParams extends coreClient.OperationOptio export type InstructionsPutResponse = Instruction; // @public -export type Invoice = Resource & { - readonly dueDate?: Date; - readonly invoiceDate?: Date; - readonly status?: InvoiceStatus; +export interface Invoice extends Resource { readonly amountDue?: Amount; readonly azurePrepaymentApplied?: Amount; readonly billedAmount?: Amount; + readonly billedDocumentId?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; readonly creditAmount?: Amount; + readonly creditForDocumentId?: string; + readonly documents?: Document_2[]; + readonly documentType?: InvoiceDocumentType; + readonly dueDate?: Date; readonly freeAzureCreditApplied?: Amount; - readonly subTotal?: Amount; - readonly taxAmount?: Amount; - readonly totalAmount?: Amount; - readonly invoicePeriodStartDate?: Date; + readonly invoiceDate?: Date; readonly invoicePeriodEndDate?: Date; + readonly invoicePeriodStartDate?: Date; readonly invoiceType?: InvoiceType; readonly isMonthlyInvoice?: boolean; - readonly billingProfileId?: string; - readonly billingProfileDisplayName?: string; - readonly purchaseOrderNumber?: string; - readonly documents?: Document_2[]; readonly payments?: PaymentProperties[]; + readonly purchaseOrderNumber?: string; readonly rebillDetails?: { [propertyName: string]: RebillDetails; }; - readonly documentType?: InvoiceDocumentType; - readonly billedDocumentId?: string; - readonly creditForDocumentId?: string; + readonly status?: InvoiceStatus; readonly subscriptionId?: string; -}; + readonly subTotal?: Amount; + readonly taxAmount?: Amount; + readonly totalAmount?: Amount; +} // @public export type InvoiceDocumentType = string; @@ -1269,7 +1278,7 @@ export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesOptionalPara export type InvoicesDownloadMultipleBillingSubscriptionInvoicesResponse = DownloadUrl; // @public -export type InvoiceSection = Resource & { +export interface InvoiceSection extends Resource { displayName?: string; labels?: { [propertyName: string]: string; @@ -1280,7 +1289,7 @@ export type InvoiceSection = Resource & { [propertyName: string]: string; }; readonly targetCloud?: TargetCloud; -}; +} // @public export interface InvoiceSectionCreationRequest { @@ -1438,393 +1447,265 @@ export type InvoiceType = string; // @public export enum KnownAcceptanceMode { - // (undocumented) ClickToAccept = "ClickToAccept", - // (undocumented) ESignEmbedded = "ESignEmbedded", - // (undocumented) ESignOffline = "ESignOffline" } // @public export enum KnownAccountStatus { - // (undocumented) Active = "Active", - // (undocumented) Deleted = "Deleted", - // (undocumented) Disabled = "Disabled", - // (undocumented) Expired = "Expired", - // (undocumented) Extended = "Extended", - // (undocumented) Terminated = "Terminated", - // (undocumented) Transferred = "Transferred" } // @public export enum KnownAccountType { - // (undocumented) Enterprise = "Enterprise", - // (undocumented) Individual = "Individual", - // (undocumented) Partner = "Partner" } // @public export enum KnownAddressValidationStatus { - // (undocumented) Invalid = "Invalid", - // (undocumented) Valid = "Valid" } // @public export enum KnownAgreementType { - // (undocumented) EnterpriseAgreement = "EnterpriseAgreement", - // (undocumented) MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - // (undocumented) MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", - // (undocumented) MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement" } // @public export enum KnownAutoRenew { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownBillingFrequency { - // (undocumented) Monthly = "Monthly", - // (undocumented) OneTime = "OneTime", - // (undocumented) UsageBased = "UsageBased" } // @public export enum KnownBillingProfileSpendingLimit { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownBillingProfileStatus { - // (undocumented) Active = "Active", - // (undocumented) Disabled = "Disabled", - // (undocumented) Warned = "Warned" } // @public export enum KnownBillingProfileStatusReasonCode { - // (undocumented) PastDue = "PastDue", - // (undocumented) SpendingLimitExpired = "SpendingLimitExpired", - // (undocumented) SpendingLimitReached = "SpendingLimitReached" } // @public export enum KnownBillingRelationshipType { - // (undocumented) CSPPartner = "CSPPartner", - // (undocumented) Direct = "Direct", - // (undocumented) IndirectCustomer = "IndirectCustomer", - // (undocumented) IndirectPartner = "IndirectPartner" } // @public export enum KnownBillingSubscriptionStatusType { - // (undocumented) Abandoned = "Abandoned", - // (undocumented) Active = "Active", - // (undocumented) Deleted = "Deleted", - // (undocumented) Inactive = "Inactive", - // (undocumented) Warning = "Warning" } // @public export enum KnownCategory { - // (undocumented) AffiliatePurchaseTerms = "AffiliatePurchaseTerms", - // (undocumented) MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", - // (undocumented) Other = "Other" } // @public export enum KnownDocumentSource { - // (undocumented) DRS = "DRS", - // (undocumented) ENF = "ENF" } // @public export enum KnownDocumentType { - // (undocumented) CreditNote = "CreditNote", - // (undocumented) Invoice = "Invoice", - // (undocumented) TaxReceipt = "TaxReceipt", - // (undocumented) VoidNote = "VoidNote" } // @public export enum KnownInvoiceDocumentType { - // (undocumented) CreditNote = "CreditNote", - // (undocumented) Invoice = "Invoice" } // @public export enum KnownInvoiceSectionState { - // (undocumented) Active = "Active", - // (undocumented) Restricted = "Restricted" } // @public export enum KnownInvoiceStatus { - // (undocumented) Due = "Due", - // (undocumented) OverDue = "OverDue", - // (undocumented) Paid = "Paid", - // (undocumented) Void = "Void" } // @public export enum KnownInvoiceType { - // (undocumented) AzureMarketplace = "AzureMarketplace", - // (undocumented) AzureService = "AzureService", - // (undocumented) AzureSupport = "AzureSupport" } // @public export enum KnownMarketplacePurchasesPolicy { - // (undocumented) AllAllowed = "AllAllowed", - // (undocumented) NotAllowed = "NotAllowed", - // (undocumented) OnlyFreeAllowed = "OnlyFreeAllowed" } // @public export enum KnownPaymentMethodFamily { - // (undocumented) CheckWire = "CheckWire", - // (undocumented) CreditCard = "CreditCard", - // (undocumented) Credits = "Credits", - // (undocumented) None = "None" } // @public export enum KnownProductStatusType { - // (undocumented) Active = "Active", - // (undocumented) AutoRenew = "AutoRenew", - // (undocumented) Cancelled = "Cancelled", - // (undocumented) Disabled = "Disabled", - // (undocumented) Expired = "Expired", - // (undocumented) Expiring = "Expiring", - // (undocumented) Inactive = "Inactive", - // (undocumented) PastDue = "PastDue" } // @public export enum KnownProductTransferValidationErrorCode { - // (undocumented) CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", - // (undocumented) DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", - // (undocumented) InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", - // (undocumented) InsufficientPermissionOnSource = "InsufficientPermissionOnSource", - // (undocumented) InvalidSource = "InvalidSource", - // (undocumented) NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", - // (undocumented) OneTimePurchaseProductTransferNotAllowed = "OneTimePurchaseProductTransferNotAllowed", - // (undocumented) ProductNotActive = "ProductNotActive", - // (undocumented) ProductTypeNotSupported = "ProductTypeNotSupported" } // @public export enum KnownReservationPurchasesPolicy { - // (undocumented) Allowed = "Allowed", - // (undocumented) NotAllowed = "NotAllowed" } // @public export enum KnownReservationType { - // (undocumented) Purchase = "Purchase", - // (undocumented) UsageCharge = "Usage Charge" } // @public export enum KnownSpendingLimit { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownSpendingLimitForBillingProfile { - // (undocumented) Off = "Off", - // (undocumented) On = "On" } // @public export enum KnownStatusReasonCode { - // (undocumented) PastDue = "PastDue", - // (undocumented) SpendingLimitExpired = "SpendingLimitExpired", - // (undocumented) SpendingLimitReached = "SpendingLimitReached" } // @public export enum KnownStatusReasonCodeForBillingProfile { - // (undocumented) PastDue = "PastDue", - // (undocumented) SpendingLimitExpired = "SpendingLimitExpired", - // (undocumented) SpendingLimitReached = "SpendingLimitReached" } // @public export enum KnownSubscriptionTransferValidationErrorCode { - // (undocumented) BillingAccountInactive = "BillingAccountInactive", - // (undocumented) CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", - // (undocumented) DestinationBillingProfileInactive = "DestinationBillingProfileInactive", - // (undocumented) DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound", - // (undocumented) DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", - // (undocumented) DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive", - // (undocumented) DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound", - // (undocumented) InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", - // (undocumented) InsufficientPermissionOnSource = "InsufficientPermissionOnSource", - // (undocumented) InvalidDestination = "InvalidDestination", - // (undocumented) InvalidSource = "InvalidSource", - // (undocumented) MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination", - // (undocumented) NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", - // (undocumented) ProductInactive = "ProductInactive", - // (undocumented) ProductNotFound = "ProductNotFound", - // (undocumented) ProductTypeNotSupported = "ProductTypeNotSupported", - // (undocumented) SourceBillingProfilePastDue = "SourceBillingProfilePastDue", - // (undocumented) SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", - // (undocumented) SubscriptionNotActive = "SubscriptionNotActive", - // (undocumented) SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported" } // @public export enum KnownTargetCloud { - // (undocumented) USGov = "USGov", - // (undocumented) USNat = "USNat", - // (undocumented) USSec = "USSec" } // @public export enum KnownTransactionTypeKind { - // (undocumented) All = "all", - // (undocumented) Reservation = "reservation" } // @public export enum KnownViewCharges { - // (undocumented) Allowed = "Allowed", - // (undocumented) NotAllowed = "NotAllowed" } // @public export enum KnownViewChargesPolicy { - // (undocumented) Allowed = "Allowed", - // (undocumented) NotAllowed = "NotAllowed" } @@ -1857,6 +1738,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 { } @@ -1927,37 +1820,37 @@ export interface PoliciesUpdateOptionalParams extends coreClient.OperationOption export type PoliciesUpdateResponse = Policy; // @public -export type Policy = Resource & { +export interface Policy extends Resource { marketplacePurchases?: MarketplacePurchasesPolicy; reservationPurchases?: ReservationPurchasesPolicy; viewCharges?: ViewChargesPolicy; -}; +} // @public -export type Product = Resource & { +export interface Product extends Resource { autoRenew?: AutoRenew; + readonly availabilityId?: string; + billingFrequency?: BillingFrequency; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly customerDisplayName?: string; + readonly customerId?: string; readonly displayName?: string; - readonly purchaseDate?: Date; - readonly productTypeId?: string; - readonly productType?: string; - status?: ProductStatusType; readonly endDate?: Date; - billingFrequency?: BillingFrequency; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; readonly lastCharge?: Amount; readonly lastChargeDate?: Date; + readonly productType?: string; + readonly productTypeId?: string; + readonly purchaseDate?: Date; readonly quantity?: number; - readonly skuId?: string; + readonly reseller?: Reseller; readonly skuDescription?: string; + readonly skuId?: string; + status?: ProductStatusType; readonly tenantId?: string; - readonly availabilityId?: string; - readonly invoiceSectionId?: string; - readonly invoiceSectionDisplayName?: string; - readonly billingProfileId?: string; - readonly billingProfileDisplayName?: string; - readonly customerId?: string; - readonly customerDisplayName?: string; - readonly reseller?: Reseller; -}; +} // @public export interface Products { @@ -2239,44 +2132,44 @@ export type SubscriptionTransferValidationErrorCode = string; export type TargetCloud = string; // @public -export type Transaction = Resource & { - kind?: TransactionTypeKind; +export interface Transaction extends Resource { + readonly azureCreditApplied?: Amount; + readonly azurePlan?: string; + readonly billingCurrency?: string; + readonly billingProfileDisplayName?: string; + readonly billingProfileId?: string; + readonly customerDisplayName?: string; + readonly customerId?: string; readonly date?: Date; + readonly discount?: number; + readonly effectivePrice?: Amount; + readonly exchangeRate?: number; readonly invoice?: string; readonly invoiceId?: string; + readonly invoiceSectionDisplayName?: string; + readonly invoiceSectionId?: string; + kind?: TransactionTypeKind; + readonly marketPrice?: Amount; readonly orderId?: string; readonly orderName?: string; + readonly pricingCurrency?: string; + readonly productDescription?: string; readonly productFamily?: string; - readonly productTypeId?: string; readonly productType?: string; - readonly productDescription?: string; - transactionType?: ReservationType; - readonly transactionAmount?: Amount; + readonly productTypeId?: string; readonly quantity?: number; - readonly invoiceSectionId?: string; - readonly invoiceSectionDisplayName?: string; - readonly billingProfileId?: string; - readonly billingProfileDisplayName?: string; - readonly customerId?: string; - readonly customerDisplayName?: string; + readonly servicePeriodEndDate?: Date; + readonly servicePeriodStartDate?: Date; readonly subscriptionId?: string; readonly subscriptionName?: string; - readonly azurePlan?: string; - readonly azureCreditApplied?: Amount; - readonly billingCurrency?: string; - readonly discount?: number; - readonly effectivePrice?: Amount; - readonly exchangeRate?: number; - readonly marketPrice?: Amount; - readonly pricingCurrency?: string; - readonly servicePeriodStartDate?: Date; - readonly servicePeriodEndDate?: Date; readonly subTotal?: Amount; readonly tax?: Amount; + readonly transactionAmount?: Amount; + transactionType?: ReservationType; readonly unitOfMeasure?: string; readonly units?: number; readonly unitType?: string; -}; +} // @public export interface TransactionListResult { diff --git a/sdk/billing/arm-billing/sample.env b/sdk/billing/arm-billing/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/billing/arm-billing/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file 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..7c6a213dc755 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. */ @@ -1049,7 +1089,7 @@ export interface EnrollmentAccountContext { } /** An invoice section. */ -export type InvoiceSection = Resource & { +export interface InvoiceSection extends Resource { /** The name of the invoice section. */ displayName?: string; /** Dictionary of metadata associated with the invoice section. */ @@ -1071,10 +1111,10 @@ export type InvoiceSection = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly targetCloud?: TargetCloud; -}; +} /** A billing profile. */ -export type BillingProfile = Resource & { +export interface BillingProfile extends Resource { /** The name of the billing profile. */ displayName?: string; /** The purchase order name that will appear on the invoices generated for the billing profile. */ @@ -1139,10 +1179,10 @@ export type BillingProfile = Resource & { readonly targetClouds?: TargetCloud[]; /** Tags of billing profiles. */ tags?: { [propertyName: string]: string }; -}; +} /** An enrollment account. */ -export type EnrollmentAccount = Resource & { +export interface EnrollmentAccount extends Resource { /** The name of the enrollment account. */ accountName?: string; /** The cost center associated with the enrollment account. */ @@ -1159,10 +1199,10 @@ export type EnrollmentAccount = Resource & { endDate?: Date; /** Associated department. By default this is not populated, unless it's specified in $expand. */ department?: Department; -}; +} /** A department. */ -export type Department = Resource & { +export interface Department extends Resource { /** The name of the department. */ departmentName?: string; /** The cost center associated with the department. */ @@ -1171,10 +1211,10 @@ export type Department = Resource & { status?: string; /** Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. */ enrollmentAccounts?: EnrollmentAccount[]; -}; +} /** A billing account. */ -export type BillingAccount = Resource & { +export interface BillingAccount extends Resource { /** The billing account name. */ displayName?: string; /** The address of the individual or organization that is responsible for the billing account. */ @@ -1212,19 +1252,19 @@ export type BillingAccount = Resource & { readonly hasReadAccess?: boolean; /** Notification email address, only for legacy accounts */ notificationEmailAddress?: string; -}; +} /** The latest Azure credit balance. This is the balance available for pay now. */ -export type AvailableBalance = Resource & { +export interface AvailableBalance extends Resource { /** * Balance amount. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly amount?: Amount; -}; +} /** An instruction. */ -export type Instruction = Resource & { +export interface Instruction extends Resource { /** The amount budgeted for this billing instruction. */ amount?: number; /** The date this billing instruction goes into effect. */ @@ -1233,10 +1273,10 @@ export type Instruction = Resource & { endDate?: Date; /** The date this billing instruction was created. */ creationDate?: Date; -}; +} /** A partner's customer. */ -export type Customer = Resource & { +export interface Customer extends Resource { /** * The ID of the billing profile for the invoice section. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1253,10 +1293,10 @@ export type Customer = Resource & { enabledAzurePlans?: AzurePlan[]; /** The list of resellers for which an Azure plan is enabled for the customer. */ resellers?: Reseller[]; -}; +} /** A billing subscription. */ -export type BillingSubscription = Resource & { +export interface BillingSubscription extends Resource { /** * The name of the subscription. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1328,10 +1368,10 @@ export type BillingSubscription = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly suspensionReasons?: string[]; -}; +} /** A product. */ -export type Product = Resource & { +export interface Product extends Resource { /** Indicates whether auto renewal is turned on or off for a product. */ autoRenew?: AutoRenew; /** @@ -1433,10 +1473,10 @@ export type Product = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly reseller?: Reseller; -}; +} /** An invoice. */ -export type Invoice = Resource & { +export interface Invoice extends Resource { /** * The due date for the invoice. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1562,10 +1602,10 @@ export type Invoice = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly subscriptionId?: string; -}; +} /** A transaction. */ -export type Transaction = Resource & { +export interface Transaction extends Resource { /** The kind of transaction. Options are all or reservation. */ kind?: TransactionTypeKind; /** @@ -1740,26 +1780,26 @@ export type Transaction = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly unitType?: string; -}; +} /** A policy. */ -export type Policy = Resource & { +export interface Policy extends Resource { /** The policy that controls whether Azure marketplace purchases are allowed for a billing profile. */ marketplacePurchases?: MarketplacePurchasesPolicy; /** The policy that controls whether Azure reservation purchases are allowed for a billing profile. */ reservationPurchases?: ReservationPurchasesPolicy; /** The policy that controls whether users with Azure RBAC access to a subscription can view its charges. */ viewCharges?: ViewChargesPolicy; -}; +} /** The customer's Policy. */ -export type CustomerPolicy = Resource & { +export interface CustomerPolicy extends Resource { /** The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. */ viewCharges?: ViewCharges; -}; +} /** A billing property. */ -export type BillingProperty = Resource & { +export interface BillingProperty extends Resource { /** * The email address on which the account admin gets all Azure notifications. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1842,10 +1882,10 @@ export type BillingProperty = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly skuDescription?: string; -}; +} /** The properties of a role definition. */ -export type BillingRoleDefinition = Resource & { +export interface BillingRoleDefinition extends Resource { /** * The role description * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1858,10 +1898,10 @@ export type BillingRoleDefinition = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly roleName?: string; -}; +} /** The role assignment */ -export type BillingRoleAssignment = Resource & { +export interface BillingRoleAssignment extends Resource { /** * The date the role assignment was created. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1897,10 +1937,10 @@ export type BillingRoleAssignment = Resource & { userAuthenticationType?: string; /** The email address of the user. */ userEmailAddress?: string; -}; +} /** An agreement. */ -export type Agreement = Resource & { +export interface Agreement extends Resource { /** * The URL to download the agreement. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -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. @@ -1933,19 +1978,19 @@ export type Agreement = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly status?: string; -}; +} /** An enrollment account resource. */ -export type EnrollmentAccountSummary = Resource & { +export interface EnrollmentAccountSummary extends Resource { /** * The account owner's principal name. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly principalName?: string; -}; +} /** A billing period resource. */ -export type BillingPeriod = Resource & { +export interface BillingPeriod extends Resource { /** * The start of the date range covered by the billing period. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1961,7 +2006,7 @@ export type BillingPeriod = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly invoiceIds?: string[]; -}; +} /** Defines headers for BillingProfiles_createOrUpdate operation. */ export interface BillingProfilesCreateOrUpdateHeaders { @@ -2029,9 +2074,13 @@ export interface InvoicesDownloadMultipleBillingSubscriptionInvoicesHeaders { /** Known values of {@link AgreementType} that the service accepts. */ export enum KnownAgreementType { + /** MicrosoftCustomerAgreement */ MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + /** EnterpriseAgreement */ EnterpriseAgreement = "EnterpriseAgreement", + /** MicrosoftOnlineServicesProgram */ MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram", + /** MicrosoftPartnerAgreement */ MicrosoftPartnerAgreement = "MicrosoftPartnerAgreement" } @@ -2049,8 +2098,11 @@ export type AgreementType = string; /** Known values of {@link AccountType} that the service accepts. */ export enum KnownAccountType { + /** Enterprise */ Enterprise = "Enterprise", + /** Individual */ Individual = "Individual", + /** Partner */ Partner = "Partner" } @@ -2067,12 +2119,19 @@ export type AccountType = string; /** Known values of {@link AccountStatus} that the service accepts. */ export enum KnownAccountStatus { + /** Active */ Active = "Active", + /** Deleted */ Deleted = "Deleted", + /** Disabled */ Disabled = "Disabled", + /** Expired */ Expired = "Expired", + /** Transferred */ Transferred = "Transferred", + /** Extended */ Extended = "Extended", + /** Terminated */ Terminated = "Terminated" } @@ -2093,9 +2152,13 @@ export type AccountStatus = string; /** Known values of {@link BillingRelationshipType} that the service accepts. */ export enum KnownBillingRelationshipType { + /** Direct */ Direct = "Direct", + /** IndirectCustomer */ IndirectCustomer = "IndirectCustomer", + /** IndirectPartner */ IndirectPartner = "IndirectPartner", + /** CSPPartner */ CSPPartner = "CSPPartner" } @@ -2113,7 +2176,9 @@ export type BillingRelationshipType = string; /** Known values of {@link InvoiceSectionState} that the service accepts. */ export enum KnownInvoiceSectionState { + /** Active */ Active = "Active", + /** Restricted */ Restricted = "Restricted" } @@ -2129,8 +2194,11 @@ export type InvoiceSectionState = string; /** Known values of {@link TargetCloud} that the service accepts. */ export enum KnownTargetCloud { + /** USGov */ USGov = "USGov", + /** USNat */ USNat = "USNat", + /** USSec */ USSec = "USSec" } @@ -2147,8 +2215,11 @@ export type TargetCloud = string; /** Known values of {@link BillingProfileStatus} that the service accepts. */ export enum KnownBillingProfileStatus { + /** Active */ Active = "Active", + /** Disabled */ Disabled = "Disabled", + /** Warned */ Warned = "Warned" } @@ -2165,8 +2236,11 @@ export type BillingProfileStatus = string; /** Known values of {@link StatusReasonCode} that the service accepts. */ export enum KnownStatusReasonCode { + /** PastDue */ PastDue = "PastDue", + /** SpendingLimitReached */ SpendingLimitReached = "SpendingLimitReached", + /** SpendingLimitExpired */ SpendingLimitExpired = "SpendingLimitExpired" } @@ -2183,7 +2257,9 @@ export type StatusReasonCode = string; /** Known values of {@link SpendingLimit} that the service accepts. */ export enum KnownSpendingLimit { + /** Off */ Off = "Off", + /** On */ On = "On" } @@ -2199,8 +2275,11 @@ export type SpendingLimit = string; /** Known values of {@link StatusReasonCodeForBillingProfile} that the service accepts. */ export enum KnownStatusReasonCodeForBillingProfile { + /** PastDue */ PastDue = "PastDue", + /** SpendingLimitReached */ SpendingLimitReached = "SpendingLimitReached", + /** SpendingLimitExpired */ SpendingLimitExpired = "SpendingLimitExpired" } @@ -2217,7 +2296,9 @@ export type StatusReasonCodeForBillingProfile = string; /** Known values of {@link SpendingLimitForBillingProfile} that the service accepts. */ export enum KnownSpendingLimitForBillingProfile { + /** Off */ Off = "Off", + /** On */ On = "On" } @@ -2233,7 +2314,9 @@ export type SpendingLimitForBillingProfile = string; /** Known values of {@link AddressValidationStatus} that the service accepts. */ export enum KnownAddressValidationStatus { + /** Valid */ Valid = "Valid", + /** Invalid */ Invalid = "Invalid" } @@ -2249,10 +2332,15 @@ export type AddressValidationStatus = string; /** Known values of {@link BillingSubscriptionStatusType} that the service accepts. */ export enum KnownBillingSubscriptionStatusType { + /** Active */ Active = "Active", + /** Inactive */ Inactive = "Inactive", + /** Abandoned */ Abandoned = "Abandoned", + /** Deleted */ Deleted = "Deleted", + /** Warning */ Warning = "Warning" } @@ -2271,7 +2359,9 @@ export type BillingSubscriptionStatusType = string; /** Known values of {@link AutoRenew} that the service accepts. */ export enum KnownAutoRenew { + /** Off */ Off = "Off", + /** On */ On = "On" } @@ -2287,13 +2377,21 @@ export type AutoRenew = string; /** Known values of {@link ProductStatusType} that the service accepts. */ export enum KnownProductStatusType { + /** Active */ Active = "Active", + /** Inactive */ Inactive = "Inactive", + /** PastDue */ PastDue = "PastDue", + /** Expiring */ Expiring = "Expiring", + /** Expired */ Expired = "Expired", + /** Disabled */ Disabled = "Disabled", + /** Cancelled */ Cancelled = "Cancelled", + /** AutoRenew */ AutoRenew = "AutoRenew" } @@ -2315,8 +2413,11 @@ export type ProductStatusType = string; /** Known values of {@link BillingFrequency} that the service accepts. */ export enum KnownBillingFrequency { + /** OneTime */ OneTime = "OneTime", + /** Monthly */ Monthly = "Monthly", + /** UsageBased */ UsageBased = "UsageBased" } @@ -2333,9 +2434,13 @@ export type BillingFrequency = string; /** Known values of {@link InvoiceStatus} that the service accepts. */ export enum KnownInvoiceStatus { + /** Due */ Due = "Due", + /** OverDue */ OverDue = "OverDue", + /** Paid */ Paid = "Paid", + /** Void */ Void = "Void" } @@ -2353,8 +2458,11 @@ export type InvoiceStatus = string; /** Known values of {@link InvoiceType} that the service accepts. */ export enum KnownInvoiceType { + /** AzureService */ AzureService = "AzureService", + /** AzureMarketplace */ AzureMarketplace = "AzureMarketplace", + /** AzureSupport */ AzureSupport = "AzureSupport" } @@ -2371,9 +2479,13 @@ export type InvoiceType = string; /** Known values of {@link DocumentType} that the service accepts. */ export enum KnownDocumentType { + /** Invoice */ Invoice = "Invoice", + /** VoidNote */ VoidNote = "VoidNote", + /** TaxReceipt */ TaxReceipt = "TaxReceipt", + /** CreditNote */ CreditNote = "CreditNote" } @@ -2391,7 +2503,9 @@ export type DocumentType = string; /** Known values of {@link DocumentSource} that the service accepts. */ export enum KnownDocumentSource { + /** DRS */ DRS = "DRS", + /** ENF */ ENF = "ENF" } @@ -2407,9 +2521,13 @@ export type DocumentSource = string; /** Known values of {@link PaymentMethodFamily} that the service accepts. */ export enum KnownPaymentMethodFamily { + /** Credits */ Credits = "Credits", + /** CheckWire */ CheckWire = "CheckWire", + /** CreditCard */ CreditCard = "CreditCard", + /** None */ None = "None" } @@ -2427,7 +2545,9 @@ export type PaymentMethodFamily = string; /** Known values of {@link InvoiceDocumentType} that the service accepts. */ export enum KnownInvoiceDocumentType { + /** Invoice */ Invoice = "Invoice", + /** CreditNote */ CreditNote = "CreditNote" } @@ -2443,25 +2563,45 @@ export type InvoiceDocumentType = string; /** Known values of {@link SubscriptionTransferValidationErrorCode} that the service accepts. */ export enum KnownSubscriptionTransferValidationErrorCode { + /** BillingAccountInactive */ BillingAccountInactive = "BillingAccountInactive", + /** CrossBillingAccountNotAllowed */ CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", + /** DestinationBillingProfileInactive */ DestinationBillingProfileInactive = "DestinationBillingProfileInactive", + /** DestinationBillingProfileNotFound */ DestinationBillingProfileNotFound = "DestinationBillingProfileNotFound", + /** DestinationBillingProfilePastDue */ DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", + /** DestinationInvoiceSectionInactive */ DestinationInvoiceSectionInactive = "DestinationInvoiceSectionInactive", + /** DestinationInvoiceSectionNotFound */ DestinationInvoiceSectionNotFound = "DestinationInvoiceSectionNotFound", + /** InsufficientPermissionOnDestination */ InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", + /** InsufficientPermissionOnSource */ InsufficientPermissionOnSource = "InsufficientPermissionOnSource", + /** InvalidDestination */ InvalidDestination = "InvalidDestination", + /** InvalidSource */ InvalidSource = "InvalidSource", + /** MarketplaceNotEnabledOnDestination */ MarketplaceNotEnabledOnDestination = "MarketplaceNotEnabledOnDestination", + /** NotAvailableForDestinationMarket */ NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", + /** ProductInactive */ ProductInactive = "ProductInactive", + /** ProductNotFound */ ProductNotFound = "ProductNotFound", + /** ProductTypeNotSupported */ ProductTypeNotSupported = "ProductTypeNotSupported", + /** SourceBillingProfilePastDue */ SourceBillingProfilePastDue = "SourceBillingProfilePastDue", + /** SourceInvoiceSectionInactive */ SourceInvoiceSectionInactive = "SourceInvoiceSectionInactive", + /** SubscriptionNotActive */ SubscriptionNotActive = "SubscriptionNotActive", + /** SubscriptionTypeNotSupported */ SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported" } @@ -2495,14 +2635,23 @@ export type SubscriptionTransferValidationErrorCode = string; /** Known values of {@link ProductTransferValidationErrorCode} that the service accepts. */ export enum KnownProductTransferValidationErrorCode { + /** InvalidSource */ InvalidSource = "InvalidSource", + /** ProductNotActive */ ProductNotActive = "ProductNotActive", + /** InsufficientPermissionOnSource */ InsufficientPermissionOnSource = "InsufficientPermissionOnSource", + /** InsufficientPermissionOnDestination */ InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination", + /** DestinationBillingProfilePastDue */ DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue", + /** ProductTypeNotSupported */ ProductTypeNotSupported = "ProductTypeNotSupported", + /** CrossBillingAccountNotAllowed */ CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed", + /** NotAvailableForDestinationMarket */ NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket", + /** OneTimePurchaseProductTransferNotAllowed */ OneTimePurchaseProductTransferNotAllowed = "OneTimePurchaseProductTransferNotAllowed" } @@ -2525,7 +2674,9 @@ export type ProductTransferValidationErrorCode = string; /** Known values of {@link TransactionTypeKind} that the service accepts. */ export enum KnownTransactionTypeKind { + /** All */ All = "all", + /** Reservation */ Reservation = "reservation" } @@ -2541,7 +2692,9 @@ export type TransactionTypeKind = string; /** Known values of {@link ReservationType} that the service accepts. */ export enum KnownReservationType { + /** Purchase */ Purchase = "Purchase", + /** UsageCharge */ UsageCharge = "Usage Charge" } @@ -2557,8 +2710,11 @@ export type ReservationType = string; /** Known values of {@link MarketplacePurchasesPolicy} that the service accepts. */ export enum KnownMarketplacePurchasesPolicy { + /** AllAllowed */ AllAllowed = "AllAllowed", + /** OnlyFreeAllowed */ OnlyFreeAllowed = "OnlyFreeAllowed", + /** NotAllowed */ NotAllowed = "NotAllowed" } @@ -2575,7 +2731,9 @@ export type MarketplacePurchasesPolicy = string; /** Known values of {@link ReservationPurchasesPolicy} that the service accepts. */ export enum KnownReservationPurchasesPolicy { + /** Allowed */ Allowed = "Allowed", + /** NotAllowed */ NotAllowed = "NotAllowed" } @@ -2591,7 +2749,9 @@ export type ReservationPurchasesPolicy = string; /** Known values of {@link ViewChargesPolicy} that the service accepts. */ export enum KnownViewChargesPolicy { + /** Allowed */ Allowed = "Allowed", + /** NotAllowed */ NotAllowed = "NotAllowed" } @@ -2607,7 +2767,9 @@ export type ViewChargesPolicy = string; /** Known values of {@link ViewCharges} that the service accepts. */ export enum KnownViewCharges { + /** Allowed */ Allowed = "Allowed", + /** NotAllowed */ NotAllowed = "NotAllowed" } @@ -2623,8 +2785,11 @@ export type ViewCharges = string; /** Known values of {@link BillingProfileStatusReasonCode} that the service accepts. */ export enum KnownBillingProfileStatusReasonCode { + /** PastDue */ PastDue = "PastDue", + /** SpendingLimitReached */ SpendingLimitReached = "SpendingLimitReached", + /** SpendingLimitExpired */ SpendingLimitExpired = "SpendingLimitExpired" } @@ -2641,7 +2806,9 @@ export type BillingProfileStatusReasonCode = string; /** Known values of {@link BillingProfileSpendingLimit} that the service accepts. */ export enum KnownBillingProfileSpendingLimit { + /** Off */ Off = "Off", + /** On */ On = "On" } @@ -2657,8 +2824,11 @@ export type BillingProfileSpendingLimit = string; /** Known values of {@link Category} that the service accepts. */ export enum KnownCategory { + /** MicrosoftCustomerAgreement */ MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement", + /** AffiliatePurchaseTerms */ AffiliatePurchaseTerms = "AffiliatePurchaseTerms", + /** Other */ Other = "Other" } @@ -2675,8 +2845,11 @@ export type Category = string; /** Known values of {@link AcceptanceMode} that the service accepts. */ export enum KnownAcceptanceMode { + /** ClickToAccept */ ClickToAccept = "ClickToAccept", + /** ESignEmbedded */ ESignEmbedded = "ESignEmbedded", + /** ESignOffline */ ESignOffline = "ESignOffline" } @@ -3336,20 +3509,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 +3806,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() {